Package jadex.future

Class TerminableDelegationFutureHandler<E>

java.lang.Object
jadex.future.TerminableDelegationFutureHandler<E>

public class TerminableDelegationFutureHandler<E> extends Object
Handler for common code of (non) intermediate terminable delegation future. Workaround for missing multiple inheritance.
  • Field Details

    • src

      protected ITerminableFuture<E> src
      The termination source.
    • terminate

      protected boolean terminate
      Flag if source has to be terminated.
    • terminated

      protected boolean terminated
      Flag if source has been terminated.
    • reason

      protected Exception reason
      Exception used for termination.
    • storedcmds

      protected List<Object> storedcmds
      The list of stored backward commands, to be sent when src is connected.
    • pullcnt

      protected int pullcnt
      The number of intermediate pulls to be performed, when the source is connected.
  • Constructor Details

    • TerminableDelegationFutureHandler

      public TerminableDelegationFutureHandler()
      Create a new future.
  • Method Details

    • setTerminationSource

      public void setTerminationSource(ITerminableFuture<E> src)
      Set the termination source.
    • terminate

      public void terminate()
      Terminate the future. The exception will be set to FutureTerminatedException.
    • terminate

      public void terminate(Exception reason)
      Terminate the future and supply a custom reason.
    • pullIntermediateResult

      public void pullIntermediateResult()
      Pull an intermediate result.
    • sendBackwardCommand

      public void sendBackwardCommand(Object info)
      Send a backward command in direction of the source.
      Parameters:
      info - The command info.