Class ComponentResultListener<E>

java.lang.Object
jadex.execution.future.ComponentResultListener<E>
All Implemented Interfaces:
jadex.future.IFutureCommandResultListener<E>, jadex.future.IResultListener<E>, jadex.future.IUndoneResultListener<E>
Direct Known Subclasses:
IntermediateComponentResultListener

public class ComponentResultListener<E> extends Object implements jadex.future.IResultListener<E>, jadex.future.IFutureCommandResultListener<E>, jadex.future.IUndoneResultListener<E>
The result listener for executing listener invocations as a component step.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected jadex.core.IExternalAccess
    The external access.
    protected jadex.core.IComponent
    The component.
    protected jadex.future.IResultListener<E>
    The result listener.
    protected boolean
    The undone flag.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComponentResultListener(jadex.future.IResultListener<E> listener, jadex.core.IComponent component)
    Create a new component result listener.
    ComponentResultListener(jadex.future.IResultListener<E> listener, jadex.core.IExternalAccess access)
    Create a new component result listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when a command is available.
    void
    Called when an exception occurred.
    void
    Called when an exception occurred.
    void
    Called when the result is available.
    void
    Called when the result is available.
    static jadex.future.IFuture<Void>
    scheduleForward(jadex.core.IExternalAccess access, jadex.core.IComponent component, Runnable notification)
    Execute a listener notification on the component using either an external access or the internal one and robustly use the rescue thread for the notification, when the component is terminated.
    protected void
    scheduleForward(Runnable notification)
    Execute a listener notification on the component.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • listener

      protected jadex.future.IResultListener<E> listener
      The result listener.
    • component

      protected jadex.core.IComponent component
      The component.
    • access

      protected jadex.core.IExternalAccess access
      The external access.
    • undone

      protected boolean undone
      The undone flag.
  • Constructor Details

    • ComponentResultListener

      public ComponentResultListener(jadex.future.IResultListener<E> listener, jadex.core.IComponent component)
      Create a new component result listener.
      Parameters:
      listener - The listener.
      adapter - The adapter.
    • ComponentResultListener

      public ComponentResultListener(jadex.future.IResultListener<E> listener, jadex.core.IExternalAccess access)
      Create a new component result listener.
      Parameters:
      listener - The listener.
      adapter - The adapter.
  • Method Details

    • resultAvailable

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

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

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

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

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

      protected void scheduleForward(Runnable notification)
      Execute a listener notification on the component.
    • scheduleForward

      public static jadex.future.IFuture<Void> scheduleForward(jadex.core.IExternalAccess access, jadex.core.IComponent component, Runnable notification)
      Execute a listener notification on the component using either an external access or the internal one and robustly use the rescue thread for the notification, when the component is terminated.