Package jadex.execution.future
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 -
Constructor Summary
ConstructorsConstructorDescriptionComponentResultListener
(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 TypeMethodDescriptionvoid
commandAvailable
(Object command) Called when a command is available.void
exceptionOccurred
(Exception exception) Called when an exception occurred.void
exceptionOccurredIfUndone
(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 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.
-
Field Details
-
listener
The result listener. -
component
protected jadex.core.IComponent componentThe component. -
access
protected jadex.core.IExternalAccess accessThe external access. -
undone
protected boolean undoneThe 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
Called when the result is available.- Specified by:
resultAvailable
in interfacejadex.future.IResultListener<E>
- Parameters:
result
- The result.
-
exceptionOccurred
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfacejadex.future.IResultListener<E>
- Parameters:
exception
- The exception.
-
resultAvailableIfUndone
Called when the result is available.- Specified by:
resultAvailableIfUndone
in interfacejadex.future.IUndoneResultListener<E>
- Parameters:
result
- The result.
-
exceptionOccurredIfUndone
Called when an exception occurred.- Specified by:
exceptionOccurredIfUndone
in interfacejadex.future.IUndoneResultListener<E>
- Parameters:
exception
- The exception.
-
commandAvailable
Called when a command is available.- Specified by:
commandAvailable
in interfacejadex.future.IFutureCommandResultListener<E>
-
scheduleForward
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.
-