public class ManagedFutureTask<V> extends FutureTask<V> implements Future<V>
Modifier and Type | Field and Description |
---|---|
protected ContextHandle |
contextHandleForReset |
protected ContextHandle |
contextHandleForSetup |
protected AbstractManagedExecutorService |
executor |
protected Object |
task |
protected TaskDoneCallback |
taskDoneCallback |
protected javax.enterprise.concurrent.ManagedTaskListener |
taskListener |
protected Throwable |
taskRunThrowable |
Constructor and Description |
---|
ManagedFutureTask(AbstractManagedExecutorService executor,
Callable callable) |
ManagedFutureTask(AbstractManagedExecutorService executor,
Runnable runnable,
V result) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected void |
captureContext(AbstractManagedExecutorService executor) |
protected void |
done() |
void |
done(Throwable t)
Call by ThreadPoolExecutor after a task is done execution.
|
String |
getTaskIdentityName() |
void |
resetContext() |
void |
run() |
protected void |
setException(Throwable t) |
void |
setTaskDoneCallback(TaskDoneCallback taskDoneCallback) |
void |
setupContext() |
void |
starting(Thread t) |
void |
submitted() |
get, get, isCancelled, isDone, runAndReset, set
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, isCancelled, isDone
protected final AbstractManagedExecutorService executor
protected final javax.enterprise.concurrent.ManagedTaskListener taskListener
protected ContextHandle contextHandleForSetup
protected ContextHandle contextHandleForReset
protected Object task
protected Throwable taskRunThrowable
protected TaskDoneCallback taskDoneCallback
public ManagedFutureTask(AbstractManagedExecutorService executor, Runnable runnable, V result)
public ManagedFutureTask(AbstractManagedExecutorService executor, Callable callable)
protected final void captureContext(AbstractManagedExecutorService executor)
public void setupContext()
public void resetContext()
public void run()
run
in interface Runnable
run
in interface RunnableFuture<V>
run
in class FutureTask<V>
public boolean cancel(boolean mayInterruptIfRunning)
public void submitted()
protected void done()
done
in class FutureTask<V>
protected void setException(Throwable t)
setException
in class FutureTask<V>
public void starting(Thread t)
public void done(Throwable t)
t
- any runtime exception encountered during executing the task. But
any Throwable thrown during executing of running the task would have
been caught by FutureTask and would have been set by setException(). So
t is ignored here.public void setTaskDoneCallback(TaskDoneCallback taskDoneCallback)
public String getTaskIdentityName()
Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.