27package org.jau.util.parallel;
29import java.io.PrintStream;
31import org.jau.sys.Debug;
32import org.jau.sys.PropertyAccess;
38public abstract class TaskBase implements Runnable {
40 private static final boolean TRACE_SOURCE;
72 this.sourceStack = TRACE_SOURCE ?
new Throwable(
"Creation @") :
null;
73 this.tCreated = System.currentTimeMillis();
76 this.isExecuted =
false;
77 this.isFlushed =
false;
78 this.execThread =
null;
123 public abstract void run();
135 public final void flush(
final Throwable t) {
185 eth =
"0x"+Integer.toHexString(
execThread.hashCode());
Helper routines for logging and debugging.
static final void initSingleton()
Ensures static init block has been issues, i.e.
Helper routines for accessing properties.
static final boolean isPropertyDefined(final String property, final boolean jnlpAlias)
Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after ...
final void setAttachment(final Object o)
Attach a custom object to this task.
final Throwable getThrowable()
volatile boolean isFlushed
final Thread getExecutionThread()
Returns the execution thread or null if not yet run().
final long getTimestampBeforeExec()
final String getExceptionOutIntro()
final boolean isExecuted()
TaskBase(final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut)
volatile Thread execThread
final void flush(final Throwable t)
Simply flush this task and notify a waiting executor.
final boolean catchExceptions
final Object getAttachment()
Return the attachment object if any.
final long getTimestampCreate()
final long getTimestampAfterExec()
final long getDurationTotal()
volatile boolean isExecuted
final Throwable sourceStack
final void printSourceTrace()
Throwable runnableException
final Object getSyncObject()
Return the synchronization object if any.
final boolean isFlushed()
final boolean isInQueue()
final long getDurationInQueue()
final boolean hasWaiter()
final long getDurationInExec()
final PrintStream exceptionOut