public class EventNotifier extends NotificationBroadcasterSupport implements EventNotifierBase, EventNotifierMBean, NotificationListener
start() method
is called to determine what instances in the domain are currently active and
register with each of them as a notification listener. This is accomplished
by invoking the addNotificationListener operation on the
instance Event Notifier MBeans. Second, when a new instance Event Notifier
MBean is registered after this MBean is already active, the new instance
MBean invokes the instanceStarted operation on this MBean to
inform it to register as a notification listener with the instance MBean.
The instanceStarted operation in turn invokes the
addNotificationListener operation on the instance MBean to
complete the registration.
For both cases, an entry is added to a table of instance names and MBean
object names for every instance Event Notifier MBean with which this MBean
is registered as a notification listener.
When an instance is terminating, its Event Notifier MBean invokes the
instanceStopped operation on this MBean to inform it to
unregister as a notification listener with the instance MBean. The
instanceStopped operation in turn invokes the
removeNotificationListener operation on the instance MBean to
complete the unregistration. Likewise, when the Management Runtime Service
is stopping, this MBean unregisters as a notification listener from each
instance Event Notifier MBean still found in the table of instance names.
The entry for an instance is removed as soon as the unregistration has
completed.EventNotifierBase.EventType, EventNotifierBase.SourceTypeCOMPONENT_NAME_KEY, EVENT_TYPE_KEY, JBI_PREFIX, NOTIFICATION_CLASS_NAME, NOTIFICATION_DESCRIPTION, NOTIFICATION_TYPES, SERVICE_ASSEMBLY_NAME_KEY, SERVICE_UNIT_NAME_KEY, SOURCE_NAME_KEY, SOURCE_TYPE_KEY, TARGET_NAME_KEY| Modifier and Type | Method and Description |
|---|---|
boolean |
disableNotifications()
This method is called to disable event notifications.
|
boolean |
enableNotifications()
This method is called to enable event notifications.
|
MBeanNotificationInfo[] |
getNotificationInfo()
Returns an array indicating, for each notification this MBean may send,
the notification type, the name of the Java class of the notification,
and a description of the notification.
|
void |
handleNotification(Notification notification,
Object handback)
This is invoked when a JMX notification is received from an instance
Event Notifier MBean with which this MBean has registered as a
notification listener.
|
boolean |
instanceStarted(String instanceName,
ObjectName objectName)
Inform this MBean that an instance has started and this MBean needs to
register itself as a notification listener for the instance Event
Notifier MBean on that instance.
|
boolean |
instanceStopped(String instanceName,
ObjectName objectName)
Inform this MBean that an instance has stopped and this MBean needs to
unregister itself as a notification listener for the instance Event
Notifier MBean on that instance.
|
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveNotificationListeneraddNotificationListener, removeNotificationListenerpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class NotificationBroadcasterSupportjavax.managagement.MBeanNotificationInfo
objects which describe the notifications.public boolean disableNotifications()
disableNotifications in interface EventNotifierMBeanpublic boolean enableNotifications()
enableNotifications in interface EventNotifierMBeanpublic boolean instanceStarted(String instanceName, ObjectName objectName)
addNotificationListener operation on the Event Notifier
MBean for the specified instance using the specified JMX object name.instanceStarted in interface EventNotifierMBeaninstanceName - the name of the instance that has started.objectName - the JMX object name of the Event Notifier MBean for
the instance.public boolean instanceStopped(String instanceName, ObjectName objectName)
removeNotificationListener operation on the Event Notifier
MBean for the specified instance using the specified JMX object name.instanceStopped in interface EventNotifierMBeaninstanceName - the name of the instance that has stopped.objectName - the JMX object name of the Event Notifier MBean for
the instance.public void handleNotification(Notification notification, Object handback)
handleNotification in interface NotificationListenernotification - The notification object.handback - An object reference that was used when this MBean
registered as a listener with the instance Event Notifier MBean. In
this case, it is the instance name.Copyright © 2011-2016 OpenESB Community. All Rights Reserved.