com.ibm.websphere.asynchbeans
Interface AsynchScope
All Superinterfaces:
- public interface AsynchScope
- extends AsynchScopeManager
AsynchScopes can also be configured to automatically deregister a set of NotificationListeners when they are destroyed. If the Notification methods are used to register and unregister the listeners then this can ease the burden of ensuring that listeners are unregistered when required.
Asynch Beans can also have children which are also asynch beans. These can be useful for scoping data underneath the parent. If the parent is destroyed then the children are destroyed also. Asynch Beans are named. All beans at the same 'level' of the tree must be uniquely named. Ultimately, a WorkManager owns all asynch beans.
See Also:
Field Summary
Fields inherited from interface com.ibm.websphere.asynchbeans.EventSource |
---|
APPLICATION_NOTIFICATION_EVENT_SOURCE, MAX_LISTENER_SEQUENCE_VALUE, MIN_LISTENER_SEQUENCE_VALUE |
Method Summary
Modifier and Type | Method and Description |
---|---|
|
destroy()
This destroys the bean.
|
getAlarmManager()
This returns the alarm manager owned by this bean.
|
|
|
getName()
This returns the name of the asynch bean.
|
getParent()
This returns the parent of the bean.
|
|
|
getPropertyMap()
This returns a set of properties that can be manipulated.
|
getSubsystemMonitorManager()
This returns the subsystem monitor manager owned by this bean.
|
|
|
registerListener(EventSource es,java.lang.Object listener)
This registers the listener with the EventSource.
|
|
registerListener(EventSource es,java.lang.Object listener,int priority)
This registers the listener with the EventSource.
|
|
unregisterListener(EventSource es,java.lang.Object listener)
This removes the listener from the EventSource and also updates the Scope to forget
this listener.
|
Methods inherited from interface com.ibm.websphere.asynchbeans.AsynchScopeManager |
---|
createAsynchScope, findAsynchScope, findOrCreateAsynchScope |
Methods inherited from interface com.ibm.websphere.asynchbeans.EventSource |
---|
addListener, addListener, getEventTrigger, getEventTrigger, removeListener |
Method Detail
getName
- java.lang.String getName()
This returns the name of the asynch bean.
Returns:
The name of the asynch bean.
destroy
- void destroy()
This destroys the bean. A JMX Notification is sent to registered
listeners and then the subsystem monitors and alarms are destroyed
followed by the bean it-self. After it is destroyed the application
should not reference this bean again.
getPropertyMap
- java.util.Map getPropertyMap()
This returns a set of properties that can be manipulated.
This Map is thread safe and is basically a Hashtable.
getAlarmManager
- AlarmManager getAlarmManager()
This returns the alarm manager owned by this bean. The lifecycle
of this alarm manager and any associated alarms created using it
are directly coupled to the lifecycle of the asynch bean.
Returns:
The asynch beans AlarmManager
getSubsystemMonitorManager
- SubsystemMonitorManager getSubsystemMonitorManager( )
This returns the subsystem monitor manager owned by this bean. The
lifecycle of this manager and any associated subsystem monitors
created using this manager are directly coupled to the lifecycle of the
asynch bean.
Returns:
The SubsystemMonitorManager associated with the bean.
getParent
- AsynchScopeManager getParent()
This returns the parent of the bean. The parent is always an
AsynchScopeManager. WorkManager and AsynchScope extend
AsynchScopeManager. A instanceof check or the context of the
application will allow whether the parent is an AsynchScope
or a WorkManager.
Returns:
The parent of the Scope. Either a WorkManager or an
AsynchScope. Never null.
registerListener
- void registerListener(EventSource es,
- java.lang.Object listener)
This registers the listener with the EventSource. The AsynchScope will
remember that it did this and automatically remove the listener when the AsynchScope
is destroyed. This is a convenience function. If a listener is registered on behalf of
a Scope then this frees the programmer of having to unregister it when the scope is destroyed.
Parameters:
es
- The EventSource to call addListener on. listener
- The listener it-self. registerListener
- void registerListener(EventSource es,
- java.lang.Object listener,
- int priority)
This registers the listener with the EventSource. The AsynchScope will
remember that it did this and automatically remove the listener when the AsynchScope
is destroyed. This is a convenience function. If a listener is registered on behalf of
a Scope then this frees the programmer of having to unregister it when the scope is destroyed.
Parameters:
es
- The EventSource to call addListener on. listener
- The listener it-self. priority
- The priority of the listener (0-9) unregisterListener
- void unregisterListener(EventSource es,
- java.lang.Object listener)
This removes the listener from the EventSource and also updates the Scope to forget
this listener. This should be called if the listener is to be removed from the EventSource
before the Scope will be destroyed.
Parameters:
es
- The EventSourc to remove the listener from. listener
- The listener to remove.