Modifier and Type | Field and Description |
---|---|
protected Runnable |
runnable |
attachment, catchExceptions, exceptionOut, isFlushed, runnableException, sourceStack, syncObject, tCreated, tExecuted, tStarted
Constructor and Description |
---|
RunnableTask(Runnable runnable,
Object syncObject,
boolean catchExceptions,
PrintStream exceptionOut)
Create a RunnableTask object w/ synchronization,
ie.
|
Modifier and Type | Method and Description |
---|---|
Runnable |
getRunnable()
Return the user action
|
static void |
invoke(boolean waitUntilDone,
Runnable runnable)
Invoks
runnable . |
void |
run() |
flush, flush, getAttachment, getDurationInExec, getDurationInQueue, getDurationTotal, getExceptionOutIntro, getSyncObject, getThrowable, getTimestampAfterExec, getTimestampBeforeExec, getTimestampCreate, hasWaiter, isExecuted, isFlushed, isInQueue, printSourceTrace, setAttachment, toString
protected final Runnable runnable
public RunnableTask(Runnable runnable, Object syncObject, boolean catchExceptions, PrintStream exceptionOut)
invokeAndWait()
, i.e. invoke(true, runnable)
.runnable
- The user actionsyncObject
- The synchronization object if caller wait until runnable
execution is completed,
or null
if waiting is not desired.catchExceptions
- Influence an occurring exception during runnable
execution.
If true
, the exception is silenced and can be retrieved via TaskBase.getThrowable()
,
otherwise the exception is thrown.exceptionOut
- If not null
, exceptions are written to this PrintStream
.public static void invoke(boolean waitUntilDone, Runnable runnable)
runnable
.waitUntilDone
- if true
, waits until runnable
execution is completed, otherwise returns immediately.runnable
- the Runnable
to execute.public final Runnable getRunnable()