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.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Throwableprotected Rbooleancancel(boolean interrupt) protected abstract Rcompute()protected voidget()protected final voidprotected final voidprotected final voidbooleanisActive()booleanbooleanisDone()booleanisFailed()voidreset()final voidrun()voidrunAsync()protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidtoString()protected voidundo()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
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:
getin interfaceFuture<R>- Throws:
InterruptedExceptionExecutionException
-
get
public R get(long pMillisecTimeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<R>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
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:
isCancelledin 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()
-