public abstract class TaskBase extends Object implements Runnable
invokeAndWait()
semantics.Modifier and Type | Field and Description |
---|---|
protected Object |
attachment |
protected boolean |
catchExceptions |
protected PrintStream |
exceptionOut |
protected boolean |
isFlushed |
protected Throwable |
runnableException |
protected Throwable |
sourceStack |
protected Object |
syncObject |
protected long |
tCreated |
protected long |
tExecuted |
protected long |
tStarted |
Modifier | Constructor and Description |
---|---|
protected |
TaskBase(Object syncObject,
boolean catchExceptions,
PrintStream exceptionOut) |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Deprecated.
Use
flush(Throwable) . |
void |
flush(Throwable t)
Simply flush this task and notify a waiting executor.
|
Object |
getAttachment()
Return the attachment object if any.
|
long |
getDurationInExec() |
long |
getDurationInQueue() |
long |
getDurationTotal() |
protected String |
getExceptionOutIntro() |
Object |
getSyncObject()
Return the synchronization object if any.
|
Throwable |
getThrowable() |
long |
getTimestampAfterExec() |
long |
getTimestampBeforeExec() |
long |
getTimestampCreate() |
boolean |
hasWaiter() |
boolean |
isExecuted() |
boolean |
isFlushed() |
boolean |
isInQueue() |
protected void |
printSourceTrace() |
abstract void |
run() |
void |
setAttachment(Object o)
Attach a custom object to this task.
|
String |
toString() |
protected final Object syncObject
protected final boolean catchExceptions
protected final PrintStream exceptionOut
protected final Throwable sourceStack
protected Object attachment
protected Throwable runnableException
protected long tCreated
protected long tStarted
protected volatile long tExecuted
protected volatile boolean isFlushed
protected TaskBase(Object syncObject, boolean catchExceptions, PrintStream exceptionOut)
protected final String getExceptionOutIntro()
protected final void printSourceTrace()
public final Object getSyncObject()
#RunnableTask(Runnable, Object, boolean)
public final void setAttachment(Object o)
public final Object getAttachment()
setAttachment(Object)
public final void flush(Throwable t)
t
- optional Throwable to be assigned for later getThrowable()
query in case of an error.isFlushed()
,
isInQueue()
public final void flush()
flush(Throwable)
.public final boolean isInQueue()
isExecuted()
&& !isFlushed()
public final boolean isExecuted()
public final boolean isFlushed()
public final boolean hasWaiter()
notifyObject
was passed, otherwise false;public final Throwable getThrowable()
#RunnableTask(Runnable, Object, boolean)
public final long getTimestampCreate()
public final long getTimestampBeforeExec()
public final long getTimestampAfterExec()
public final long getDurationInQueue()
public final long getDurationInExec()
public final long getDurationTotal()