Package de.intarsys.tools.concurrent
Class AbstractFutureTask<R>
java.lang.Object
de.intarsys.tools.concurrent.AbstractFutureTask<R>
- Type Parameters:
R
-
- Direct Known Subclasses:
CallbackFutureTask
,TaskSequence
,TaskStep
This is an alternate implementation for
FutureTask
, which is in some
cases not flexible enough.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Throwable
protected R
boolean
cancel
(boolean interrupt) protected abstract R
compute()
protected void
get()
protected final void
protected final void
protected final void
boolean
isActive()
boolean
boolean
isDone()
boolean
isFailed()
void
reset()
final void
run()
void
runAsync()
protected void
protected void
protected void
protected void
protected void
protected void
protected void
toString()
protected void
undo()
-
Field Details
-
Log
-
-
Constructor Details
-
AbstractFutureTask
protected AbstractFutureTask()
-
-
Method Details
-
basicGetException
-
basicGetResult
-
cancel
public boolean cancel(boolean interrupt) -
compute
- Throws:
Exception
-
computeAsync
protected void computeAsync() -
get
- Specified by:
get
in interfaceFuture<R>
- Throws:
InterruptedException
ExecutionException
-
get
public R get(long pMillisecTimeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<R>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
getException
-
handleException
protected final void handleException() -
handleFinally
protected final void handleFinally() -
handleResult
protected final void handleResult() -
isActive
public boolean isActive() -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<R>
-
isDone
public boolean isDone() -
isFailed
public boolean isFailed() -
reset
public void reset() -
run
public final void run() -
runAsync
public void runAsync() -
setException
-
setResult
-
taskCancelled
protected void taskCancelled() -
taskFailed
protected void taskFailed() -
taskFinally
protected void taskFinally() -
taskFinished
protected void taskFinished() -
taskStarted
protected void taskStarted() -
toString
-
undo
protected void undo()
-