public class FutureFunctionality
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DROP_INTERMEDIATE_RESULT
Marker for an intermediate result to be dropped.
|
protected java.util.logging.Logger |
logger
The logger used for notification failure warnings (if any).
|
protected IResultCommand<java.util.logging.Logger,java.lang.Void> |
loggerfetcher |
protected boolean |
undone |
Constructor and Description |
---|
FutureFunctionality(IResultCommand<java.util.logging.Logger,java.lang.Void> loggerfetcher) |
FutureFunctionality(java.util.logging.Logger logger) |
Modifier and Type | Method and Description |
---|---|
static void |
connectDelegationFuture(Future target,
IFuture source)
Connect a delegation future with the source.
|
static Future<?> |
getDelegationFuture(java.lang.Class<?> clazz,
FutureFunctionality func) |
static <T> Future<T> |
getDelegationFuture(IFuture<T> orig,
FutureFunctionality func) |
protected java.util.logging.Logger |
getLogger()
Get the logger.
|
void |
handleBackwardCommand(java.lang.Object info)
Optionally augment backward command behavior.
|
void |
handleException(java.lang.Exception exception)
Optionally augment exception behavior.
|
void |
handleFinished(java.util.Collection<java.lang.Object> results)
Optionally alter finished behavior.
|
java.lang.Object |
handleIntermediateResult(java.lang.Object result)
Optionally alter a result.
|
void |
handlePull()
Optionally augment pull behavior.
|
java.lang.Object |
handleResult(java.lang.Object result)
Optionally alter a result.
|
void |
handleTerminated(java.lang.Exception reason)
Optionally augment termination behavior.
|
boolean |
isUndone(boolean undone)
Optionally alter the undone flag.
|
protected void |
logException(java.lang.Exception e,
java.lang.Exception userex,
boolean terminable,
boolean undone,
boolean async)
Log an exception.
|
void |
scheduleBackward(ICommand<java.lang.Void> code)
Schedule backward in result direction,
i.e.
|
<T> void |
scheduleForward(ICommand<T> code,
T arg)
Schedule forward in result direction,
i.e.
|
public static final java.lang.String DROP_INTERMEDIATE_RESULT
protected java.util.logging.Logger logger
protected IResultCommand<java.util.logging.Logger,java.lang.Void> loggerfetcher
protected boolean undone
public FutureFunctionality(java.util.logging.Logger logger)
public FutureFunctionality(IResultCommand<java.util.logging.Logger,java.lang.Void> loggerfetcher)
protected java.util.logging.Logger getLogger()
protected void logException(java.lang.Exception e, java.lang.Exception userex, boolean terminable, boolean undone, boolean async)
public <T> void scheduleForward(ICommand<T> code, T arg)
public void scheduleBackward(ICommand<java.lang.Void> code)
public boolean isUndone(boolean undone)
public java.lang.Object handleResult(java.lang.Object result) throws java.lang.Exception
java.lang.Exception
public java.lang.Object handleIntermediateResult(java.lang.Object result) throws java.lang.Exception
java.lang.Exception
public void handleFinished(java.util.Collection<java.lang.Object> results) throws java.lang.Exception
java.lang.Exception
public void handleException(java.lang.Exception exception)
public void handleTerminated(java.lang.Exception reason)
public void handleBackwardCommand(java.lang.Object info)
public void handlePull()
public static <T> Future<T> getDelegationFuture(IFuture<T> orig, FutureFunctionality func)
public static Future<?> getDelegationFuture(java.lang.Class<?> clazz, FutureFunctionality func)