Package jadex.future

Class ExceptionDelegationResultListener<E,T>

java.lang.Object
jadex.future.ExceptionDelegationResultListener<E,T>
All Implemented Interfaces:
IFutureCommandResultListener<E>, IResultListener<E>, IUndoneResultListener<E>

public abstract class ExceptionDelegationResultListener<E,T> extends Object implements IResultListener<E>, IFutureCommandResultListener<E>, IUndoneResultListener<E>
Result listener that delegates calls to a future.
  • Field Details

    • future

      protected Future<T> future
      The future to which calls are delegated.
    • undone

      protected boolean undone
      Flag if undone methods should be used.
  • Constructor Details

    • ExceptionDelegationResultListener

      public ExceptionDelegationResultListener(Future<T> future)
      Create a new listener.
      Parameters:
      future - The delegation target.
    • ExceptionDelegationResultListener

      public ExceptionDelegationResultListener(Future<T> future, boolean undone)
      Create a new listener.
      Parameters:
      future - The delegation target.
      undone - use undone methods.
  • Method Details

    • resultAvailable

      public final void resultAvailable(E result)
      Called when the result is available.
      Specified by:
      resultAvailable in interface IResultListener<E>
      Parameters:
      result - The result.
    • customResultAvailable

      public abstract void customResultAvailable(E result) throws Exception
      Called when the result is available.
      Parameters:
      result - The result.
      Throws:
      Exception
    • exceptionOccurred

      public void exceptionOccurred(Exception exception)
      Called when an exception occurred.
      Specified by:
      exceptionOccurred in interface IResultListener<E>
      Parameters:
      exception - The exception.
    • resultAvailableIfUndone

      public void resultAvailableIfUndone(E result)
      Called when the result is available.
      Specified by:
      resultAvailableIfUndone in interface IUndoneResultListener<E>
      Parameters:
      result - The result.
    • exceptionOccurredIfUndone

      public void exceptionOccurredIfUndone(Exception exception)
      Called when an exception occurred.
      Specified by:
      exceptionOccurredIfUndone in interface IUndoneResultListener<E>
      Parameters:
      exception - The exception.
    • isUndone

      public boolean isUndone()
      Get the undone.
      Returns:
      The undone.
    • commandAvailable

      public void commandAvailable(Object command)
      Called when a command is available.
      Specified by:
      commandAvailable in interface IFutureCommandResultListener<E>