Package jadex.bridge

Class ComponentResultListener<E>

  • All Implemented Interfaces:
    jadex.commons.future.IFutureCommandResultListener<E>, jadex.commons.future.IResultListener<E>, jadex.commons.future.IUndoneResultListener<E>
    Direct Known Subclasses:
    IntermediateComponentResultListener

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void commandAvailable​(java.lang.Object command)
      Called when a command is available.
      void exceptionOccurred​(java.lang.Exception exception)
      Called when an exception occurred.
      void exceptionOccurredIfUndone​(java.lang.Exception exception)
      Called when an exception occurred.
      void resultAvailable​(E result)
      Called when the result is available.
      void resultAvailableIfUndone​(E result)
      Called when the result is available.
      static void scheduleForward​(IExternalAccess access, IInternalAccess component, java.lang.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​(java.lang.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 Detail

      • listener

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

        protected boolean undone
        The undone flag.
    • Constructor Detail

      • ComponentResultListener

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

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

      • resultAvailable

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

        public void exceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurred in interface jadex.commons.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.commons.future.IUndoneResultListener<E>
        Parameters:
        result - The result.
      • exceptionOccurredIfUndone

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

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

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

        public static void scheduleForward​(IExternalAccess access,
                                           IInternalAccess component,
                                           java.lang.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.