public abstract class AbstractTask extends AbstractPoolable implements java.lang.Runnable, Schedulable
logger_
Constructor and Description |
---|
AbstractTask() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInterrupt() |
abstract void |
doWork()
Override this Method in Subclasses to do the "real work".
|
protected TaskExecutor |
getTaskExecutor() |
protected boolean |
isRunnable() |
void |
run()
run method invoked by TaskExecutor.
|
protected void |
schedule(boolean directRunAllowed)
schedule this Task for execution.
|
protected void |
schedule(TaskExecutor executor,
boolean directRunAllowed)
schedule this Task for execution.
|
protected void |
setTaskExecutor(TaskExecutor taskExecutor) |
dispose, reset, setObjectPool
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
schedule
protected TaskExecutor getTaskExecutor()
protected void setTaskExecutor(TaskExecutor taskExecutor)
public abstract void doWork() throws java.lang.Exception
java.lang.Exception
protected boolean isRunnable()
public void run()
run
in interface java.lang.Runnable
protected void checkInterrupt() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void schedule(boolean directRunAllowed)
directRunAllowed
- true, if the task may be run in the calling thread. false, if the TaskExecutor
should be used.protected void schedule(TaskExecutor executor, boolean directRunAllowed)
executor
- TaskExecutor that should execute this TaskdirectRunAllowed
- true, if the task may be run in the calling thread. false, if the TaskExecutor
should be used.