|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.common.util.RunnableTask
public class RunnableTask
Helper class to provide a Runnable queue implementation with a Runnable wrapper
which notifies after execution for the invokeAndWait()
semantics.
Constructor Summary | |
---|---|
RunnableTask(Runnable runnable)
Create a RunnableTask object w/o synchronization, ie. |
|
RunnableTask(Runnable runnable,
Object syncObject)
Create a RunnableTask object w/ synchronization, ie. |
|
RunnableTask(Runnable runnable,
Object syncObject,
boolean catchExceptions)
Create a RunnableTask object w/ synchronization, ie. |
Method Summary | |
---|---|
void |
flush()
Simply flush this task and notify a waiting executor. |
Object |
getAttachment()
Return the attachment object if any. |
long |
getDurationInExec()
|
long |
getDurationInQueue()
|
long |
getDurationTotal()
|
Runnable |
getRunnable()
Return the user action |
Object |
getSyncObject()
Return the synchronization object if any. |
Throwable |
getThrowable()
|
long |
getTimestampAfterExec()
|
long |
getTimestampBeforeExec()
|
long |
getTimestampCreate()
|
boolean |
hasWaiter()
|
boolean |
isExecuted()
|
boolean |
isFlushed()
|
boolean |
isInQueue()
|
void |
run()
|
void |
setAttachment(Object o)
Attach a custom object to this task. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RunnableTask(Runnable runnable)
invokeAndWait()
.
runnable
- the user actionpublic RunnableTask(Runnable runnable, Object syncObject)
invokeAndWait()
.
runnable
- the user actionsyncObject
- the synchronization object the caller shall wait for in case of invokeAndWait()
public RunnableTask(Runnable runnable, Object syncObject, boolean catchExceptions)
invokeAndWait()
.
runnable
- the user actionsyncObject
- the synchronization object the caller shall wait for in case of invokeAndWai()t
catchExceptions
- if true, exception during runnable
execution are catched, otherwise not.
Use getThrowable()
to determine whether an exception has been catched.Method Detail |
---|
public Runnable getRunnable()
public Object getSyncObject()
RunnableTask(Runnable, Object, boolean)
public void setAttachment(Object o)
public Object getAttachment()
setAttachment(Object)
public void run()
run
in interface Runnable
public void flush()
isFlushed()
,
isInQueue()
public boolean isInQueue()
isExecuted()
&& !isFlushed()
public boolean isExecuted()
public boolean isFlushed()
public boolean hasWaiter()
notifyObject
was passed, otherwise false;public Throwable getThrowable()
RunnableTask(Runnable, Object, boolean)
public long getTimestampCreate()
public long getTimestampBeforeExec()
public long getTimestampAfterExec()
public long getDurationInQueue()
public long getDurationInExec()
public long getDurationTotal()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |