Package jadex.future
Class TerminableDelegationFutureHandler<E>
java.lang.Object
jadex.future.TerminableDelegationFutureHandler<E>
Handler for common code of (non) intermediate terminable delegation future.
Workaround for missing multiple inheritance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe number of intermediate pulls to be performed, when the source is connected.protected ExceptionException used for termination.protected ITerminableFuture<E>The termination source.The list of stored backward commands, to be sent when src is connected.protected booleanFlag if source has to be terminated.protected booleanFlag if source has been terminated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPull an intermediate result.voidsendBackwardCommand(Object info) Send a backward command in direction of the source.voidSet the termination source.voidTerminate the future.voidTerminate the future and supply a custom reason.
-
Field Details
-
src
The termination source. -
terminate
protected boolean terminateFlag if source has to be terminated. -
terminated
protected boolean terminatedFlag if source has been terminated. -
reason
Exception used for termination. -
storedcmds
The list of stored backward commands, to be sent when src is connected. -
pullcnt
protected int pullcntThe number of intermediate pulls to be performed, when the source is connected.
-
-
Constructor Details
-
TerminableDelegationFutureHandler
public TerminableDelegationFutureHandler()Create a new future.
-
-
Method Details
-
setTerminationSource
Set the termination source. -
terminate
public void terminate()Terminate the future. The exception will be set to FutureTerminatedException. -
terminate
Terminate the future and supply a custom reason. -
pullIntermediateResult
public void pullIntermediateResult()Pull an intermediate result. -
sendBackwardCommand
Send a backward command in direction of the source.- Parameters:
info- The command info.
-