Class ActivityStateNotificationWrapper
java.lang.Object
de.aristaflow.ilm.core.runtimemanager.ActivityStateNotificationWrapper
- All Implemented Interfaces:
ActivityStateNotification
This class wraps an
ActivityStateCallback and forwards calls to
ActivityStateNotification appropriately.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ActivityStateCallbackThe object to which to forward calls to.protected UUIDThe ID of the notification callback used after the current resume.protected booleanWhether this wrapper has been created when resuming.protected final EBPInstanceReferenceThe (Java) activity for unregistering incleanup().protected final LocalActivityStateNotifierThe activity state listener to unregister from incleanup().protected final ConcurrentMap<EBPInstanceReference,ActivityStateNotificationWrapper> The map to unregister from incleanup().protected URI[]The URIs with which thisActivityStateNotificationhas been registered.protected final SessionTokenThe session token for unregistering incleanup(). -
Constructor Summary
ConstructorsConstructorDescriptionActivityStateNotificationWrapper(ActivityStateCallback asc, boolean ignoreResumed, SessionToken session, EBPInstanceReference jActivity, ConcurrentMap<EBPInstanceReference, ActivityStateNotificationWrapper> listeners, LocalActivityStateNotifier lasn) Creates a new wrapper for the designatedActivityStateCallback. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivityClosed(EBPInstanceReference activity, String sessionId) Notifies that the designated activity in the designated execution session has been closed.voidactivityFailed(EBPInstanceReference activity, String sessionId, String errorMessage, String state, long errorCode) Notifies that the designated activity in the designated execution session has failed with the designated additional failure information.voidactivityReset(EBPInstanceReference activity, String sessionId) Notifies that the designated activity in the designated execution session has been reset.voidactivityResumed(EBPInstanceReference activity, String sessionId, URI[] newListener) Notifies that the designated activity has been resumed.voidactivitySignalled(EBPInstanceReference activity, String sessionId, int signal) Notifies that the designated activity in the designated execution session has terminated with the designated signal.voidactivitySuspended(EBPInstanceReference activity, String sessionId) Notifies that the designated activity in the designated execution session has been suspended normally.voidactivitySuspended(EBPInstanceReference activity, String sessionId, long timeout) Notifies that the designated activity in the designated execution session has been suspended and needs to be resumed after the designated timeout.protected voidcleanup()Removes this wrapper from the map of listeners and from the global activity state listener for a specific activity.getId()Gets the ID of the wrappedActivityStateCallback-instance.URI[]getUris()Gets the URIs with which thisActivityStateNotificationhas been registered ornull.voidSets the URIs with which thisActivityStateNotificationhas been registered.URI[]Sets the ID of the callback used after resuming.
-
Field Details
-
asc
The object to which to forward calls to. -
ignoreResumed
protected boolean ignoreResumedWhether this wrapper has been created when resuming. This skips the first resume notification. -
callbackAfterResume
The ID of the notification callback used after the current resume. -
session
The session token for unregistering incleanup(). -
jActivity
The (Java) activity for unregistering incleanup(). -
listeners
The map to unregister from incleanup(). -
lasn
The activity state listener to unregister from incleanup(). -
regUris
The URIs with which thisActivityStateNotificationhas been registered.
-
-
Constructor Details
-
ActivityStateNotificationWrapper
public ActivityStateNotificationWrapper(ActivityStateCallback asc, boolean ignoreResumed, SessionToken session, EBPInstanceReference jActivity, ConcurrentMap<EBPInstanceReference, ActivityStateNotificationWrapper> listeners, LocalActivityStateNotifier lasn) Creates a new wrapper for the designatedActivityStateCallback.- Parameters:
asc- TheActivityStateCallbackto wrap.ignoreResumed- Whether this wrapper has been created when resuming. This skips the first resume notification.session- The session token for unregistering incleanup(). This must not benulljActivity- The (Java) activity for unregistering incleanup(). This must not benulllisteners- The map to unregister from incleanup(). This must not benulllasn- The activity state listener to unregister from incleanup(). This must not benull
-
-
Method Details
-
init
Sets the URIs with which thisActivityStateNotificationhas been registered.- Parameters:
uris- The URIs with which thisActivityStateNotificationhas been registered This must not benullnor empty.
-
getUris
Gets the URIs with which thisActivityStateNotificationhas been registered ornull.- Returns:
- The URIs with which this
ActivityStateNotificationhas been registered.
-
getId
Gets the ID of the wrappedActivityStateCallback-instance.- Returns:
- The ID of the wrapped
ActivityStateCallback-instance.
-
setCallbackAfterResume
Sets the ID of the callback used after resuming. This is required to determine whether it is the same or a different notification. This is also part of the notification interface.- Parameters:
id- The ID of the notification callback used after the current resume.- Returns:
- The URIs with which this
ActivityStateNotificationhas been registered in case it is the wrapper for the designated callback ID ornull.
-
activityClosed
Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has been closed.- Specified by:
activityClosedin interfaceActivityStateNotification- Parameters:
activity- The activity that has been closed.sessionId- The ID of the execution session of the closed activity.
-
activitySuspended
Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has been suspended normally. There may be an resume and further notifications afterwards.- Specified by:
activitySuspendedin interfaceActivityStateNotification- Parameters:
activity- The activity that has been suspended normally.sessionId- The ID of the execution session of the suspended activity.
-
activitySuspended
Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has been suspended and needs to be resumed after the designated timeout. Usually this will be started by aResumingRuntimeManagerand thus there will be a resume and further notifications afterwards.- Specified by:
activitySuspendedin interfaceActivityStateNotification- Parameters:
activity- The activity that has been suspended normally.sessionId- The ID of the execution session of the suspended activity.timeout- The time period (in milliseconds) when the suspended application wants to be resumed automatically.
-
activityResumed
Description copied from interface:ActivityStateNotificationNotifies that the designated activity has been resumed. This will only be sent if the activity is resumed on the very same runtime manager.- Specified by:
activityResumedin interfaceActivityStateNotification- Parameters:
activity- The activity that has been suspended normally.sessionId- The ID of the new execution session of the resumed activity.newListener- The URIs of the listener that has been registered when resuming ornullin case no listener has been registered when resuming. If a new listener has been registered, this listener will not be notified any more.- See Also:
-
activityReset
Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has been reset.- Specified by:
activityResetin interfaceActivityStateNotification- Parameters:
activity- The activity that has been reset.sessionId- The ID of the execution session of the reset activity.
-
activitySignalled
Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has terminated with the designated signal.- Specified by:
activitySignalledin interfaceActivityStateNotification- Parameters:
activity- The activity that has been terminated.sessionId- The ID of the execution session of the signalled activity.signal- The signal that led to the termination of the activity.
-
activityFailed
public void activityFailed(EBPInstanceReference activity, String sessionId, String errorMessage, String state, long errorCode) Description copied from interface:ActivityStateNotificationNotifies that the designated activity in the designated execution session has failed with the designated additional failure information.- Specified by:
activityFailedin interfaceActivityStateNotification- Parameters:
activity- The activity that has failed.sessionId- The ID of the execution session of the failed activity.errorMessage- The error message to be interpreted by a user or by a failure handling routine.state- Arbitrary state information specific to the instance, comparable to the vendor code in.SQLExceptionerrorCode- The error code specifying the type of error.
-
cleanup
protected void cleanup()Removes this wrapper from the map of listeners and from the global activity state listener for a specific activity.
-