Class FutureFunctionality

java.lang.Object
jadex.execution.future.FutureFunctionality
Direct Known Subclasses:
ComponentFutureFunctionality

public class FutureFunctionality extends Object
Default future functionality.
  • Field Details

    • DROP_INTERMEDIATE_RESULT

      public static final String DROP_INTERMEDIATE_RESULT
      Marker for an intermediate result to be dropped.
      See Also:
    • logger

      protected Logger logger
      The logger used for notification failure warnings (if any).
    • loggerfetcher

      protected jadex.common.IResultCommand<Logger,Void> loggerfetcher
    • undone

      protected boolean undone
    • future

      protected jadex.future.Future<?> future
  • Constructor Details

    • FutureFunctionality

      public FutureFunctionality()
    • FutureFunctionality

      public FutureFunctionality(Logger logger)
    • FutureFunctionality

      public FutureFunctionality(jadex.common.IResultCommand<Logger,Void> loggerfetcher)
  • Method Details

    • getFuture

      public jadex.future.Future<?> getFuture()
    • setFuture

      public void setFuture(jadex.future.Future<?> future)
    • getLogger

      protected Logger getLogger()
      Get the logger.
    • logException

      protected void logException(Exception e, Exception userex, boolean terminable, boolean undone, boolean async)
      Log an exception.
    • scheduleForward

      public <T> void scheduleForward(jadex.common.ICommand<T> code, T arg)
      Schedule forward in result direction, i.e. from callee to caller, e.g. update timer to avoid timeouts.
    • scheduleBackward

      public void scheduleBackward(jadex.common.ICommand<Void> code)
      Schedule backward in result direction, i.e. from caller to callee, e.g. future termination.
    • isUndone

      public boolean isUndone(boolean undone)
      Optionally alter the undone flag.
    • handleResult

      public Object handleResult(Object result) throws Exception
      Optionally alter a result.
      Throws:
      Exception
    • handleIntermediateResult

      public Object handleIntermediateResult(Object result) throws Exception
      Optionally alter a result.
      Throws:
      Exception
    • handleAfterIntermediateResult

      public void handleAfterIntermediateResult(Object result) throws Exception
      Perform code after an intermediate result has been added.
      Throws:
      Exception
    • handleFinished

      public void handleFinished(Collection<Object> results) throws Exception
      Optionally alter finished behavior.
      Throws:
      Exception
    • handleException

      public void handleException(Exception exception)
      Optionally augment exception behavior.
    • handleTerminated

      public void handleTerminated(Exception reason)
      Optionally augment termination behavior.
    • handleBackwardCommand

      public void handleBackwardCommand(Object info)
      Optionally augment backward command behavior.
    • handlePull

      public void handlePull()
      Optionally augment pull behavior.
    • getDelegationFuture

      public static <T> jadex.future.Future<T> getDelegationFuture(jadex.future.IFuture<T> orig, FutureFunctionality func)
    • getDelegationFuture

      public static jadex.future.Future<?> getDelegationFuture(Class<?> clazz, FutureFunctionality func)