Interface LocalInstanceStateNotifier
-
- All Superinterfaces:
ADEPT2Service
,InstanceStateListener
public interface LocalInstanceStateNotifier extends InstanceStateListener
This interface provides the means for anInstanceStateListener
as simple service that forwards all incoming instance state notifications to the locally registeredInstanceStateNotifcation
s. This avoids the need for anInstanceStateNotifcation
to implementADEPT2Service
.The notification listeners can only be registered locally (no proxy objects allowed). They are identified via the registered instance ID (as well as their object identity).
The listeners will be unregistered implicitly, that is, as soon as an instance terminates (finishes or fails) the corresponding listeners will be unregistered (unless registered for all instances). When resuming the listeners will be unregistered in case a different listener has been registered for future events. Otherwise the listeners will remain.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URI[]
registerInstanceStateListener(SessionToken session, InstanceStateNotification listener)
Registers the designated listener for state changes of every instance.URI[]
registerInstanceStateListener(SessionToken session, UUID instanceId, InstanceStateNotification listener)
Registers the designated listener for state changes of the designated instance.void
unregisterInstanceStateListener(SessionToken session, InstanceStateNotification listener)
Unregisters the designated listener for state changes of every instance.void
unregisterInstanceStateListener(SessionToken session, UUID instanceId, InstanceStateNotification listener)
Unregisters the designated listener for state changes of the designated instance.-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, start
-
Methods inherited from interface de.aristaflow.adept2.core.executionmanager.InstanceStateListener
getInstanceStateNotification
-
-
-
-
Method Detail
-
registerInstanceStateListener
URI[] registerInstanceStateListener(SessionToken session, UUID instanceId, InstanceStateNotification listener)
Registers the designated listener for state changes of the designated instance. The designated listener has to be local with respect to this listener service. This service will forward all notifications.- Parameters:
session
- The session which is used to check for access rights on this method.instanceId
- The ID of the instance for which to listen to state changes.listener
- A listener to register for instance state changes.- Returns:
- The URIs to register at
InstanceControl
.
-
unregisterInstanceStateListener
void unregisterInstanceStateListener(SessionToken session, UUID instanceId, InstanceStateNotification listener)
Unregisters the designated listener for state changes of the designated instance. The designated listener has to be local with respect to this listener service. Unregistering is not necessary after the instance has finished or failed since unregistering will be done implicitly in these cases.- Parameters:
session
- The session which is used to check for access rights on this method.instanceId
- The ID of the instance for which to no longer listen to state changes.listener
- A listener to unregister for instance state changes.
-
registerInstanceStateListener
URI[] registerInstanceStateListener(SessionToken session, InstanceStateNotification listener)
Registers the designated listener for state changes of every instance. The designated listener has to be local with respect to this listener service. This service will forward all notifications. Unregistering is required.- Parameters:
session
- The session which is used to check for access rights on this method.listener
- A listener to register for instance state changes.- Returns:
- The URIs to register at
InstanceControl
.
-
unregisterInstanceStateListener
void unregisterInstanceStateListener(SessionToken session, InstanceStateNotification listener)
Unregisters the designated listener for state changes of every instance. The designated listener has to be local with respect to this listener service. Unregistering is required.- Parameters:
session
- The session which is used to check for access rights on this method.listener
- A listener to unregister for instance state changes.
-
-