public interface ActivityStateListener extends ADEPT2Service
ActivityStateListener provides access to an
ActivityStateNotification which is notified when the observed
activity terminates (has been closed, suspended, reset, failed or signalled).
A default implementation exists, that allows local (!)
ActivityStateListeners to register themselves for an activity
and get notifications about its state changes. Services are also free to
implement this interface. In this case only
getActivityStateNotification() is relevant. The other two methods
may be empty. However, for the callback to work with
SynchronousActivityStarting, the provided URIs need to
represent a service interface that directly implements
ActivityStateListener. It will not work, if only the service
implementation knows about ActivityStateListener but not its
service interface! URIs to SynchronousActivityStarting. The
default implementation will unregister listeners implicitly, that is, as soon
as an activity has terminated finally (not suspended), its listeners will be
unregistered.| Modifier and Type | Method and Description |
|---|---|
ActivityStateNotification |
getActivityStateNotification()
Gets the interface to send notifications to when the state of the observed
activity changes, that is it has been closed, suspended, reset, failed or
signalled.
|
java.net.URI[] |
registerActivityStateListener(SessionToken session,
EBPInstanceReference activity,
ActivityStateNotification listener)
Registers the designated listener for state changes of the designated
activity.
|
void |
unregisterActivityStateListener(SessionToken session,
EBPInstanceReference activity,
ActivityStateNotification listener)
Unregisters the designated listener for state changes of the designated
activity.
|
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, startActivityStateNotification getActivityStateNotification()
java.net.URI[] registerActivityStateListener(SessionToken session, EBPInstanceReference activity, ActivityStateNotification listener)
This method need not be implemented by a service which is directly
registered at a SynchronousActivityStarting. It cannot be
called remotely.
session - The session which is used to check for access rights on this
method.activity - The activity for which to listen to state changes.listener - A listener to register for activity state changes.SynchronousActivityStarting.void unregisterActivityStateListener(SessionToken session, EBPInstanceReference activity, ActivityStateNotification listener)
This method need not be implemented by a service which is directly
registered at a SynchronousActivityStarting. It cannot be
called remotely.
session - The session which is used to check for access rights on this
method.activity - The activity for which no longer listen to state changes.listener - A listener to unregister for activity state changes.