| java.lang.Object javax.management.NotificationBroadcasterSupport com.sun.jbi.framework.EventNotifier
EventNotifier | public class EventNotifier extends NotificationBroadcasterSupport implements EventNotifierCommon,EventNotifierMBean(Code) | | This is the instance Event Notifier MBean that generates notifications for
the entire JBI runtime. There is one of these MBeans per runtime instance,
and it is called to emit notifications for all applicable events in the
runtime. This MBean is registered with ServiceName=Framework,
ControlType=Notification, and ComponentType=System.
Notifications that are currently supported by this implementation include:
- JBI Runtime:
- Component (Binding Component / Service Engine):
- Installed
- Started
- Stopped
- Shut down
- Uninstalled
- Shared Library:
- Service Assembly:
- Deployed
- Started
- Stopped
- Shut down
- Undeployed
- Service Unit:
- Deployed
- Started
- Stopped
- Shut down
- Undeployed
All notifications emitted by this MBean are instances of the
javax.management.Notification class, and include following
information:
-
type - a dotted string describing the notification, such as
"com.sun.jbi.started.binding.component"
-
msg - a message resulting from the operation, such as
"Binding sun-http-binding started successfully"
-
seqNo - a sequence number which is unique for the current execution of the
runtime
-
timeStamp - a timestamp indicating the time the notification was created
-
userData - a
javax.management.openmbean.CompositeData object
which contains the following:
-
Event type: Deployed, Undeployed, Installed, Uninstalled, Started,
Stopped, or ShutDown
-
Source type: BindingComponent, ServiceEngine, SharedLibrary,
ServiceAssembly, ServiceUnit, or JBIRuntime
-
Source name: component name, shared library name, service assembly name,
or service unit name
-
Target name: instance name or cluster name + instance name, such as
"server", "instance1", or "cluster1-instance1"
-
Component name: this is present only for Service Unit notifications
-
Service Assembly name: this is present only for Service Unit notifications
-
Note that this class extends the NotificationBroadcasterSupport class
provided by the JDK, and there is no guarantee that the calls to send
notifications are asynchronous. Therefore, all sending of notifications
is done on separate threads to ensure that an ill-behaved client cannot
block the thread on which the call to this class was made. This is done
using the facilities provided by the java.util.concurrent package. In the
constructor for this class, a thread pool is created, and all calls to
the sendNotification() method are made using this thread pool. The Notify
class contained in this class implements the Runnable interface and is
used to make the sendNotification() calls.
author: Mark S White |
Inner Class :class Notify implements Runnable | |
Method Summary | |
public void | disableNotifications() Disable event notifications from being emitted by this MBean. | public Notification | emitComponentNotification(EventType eventType, SourceType sourceType, String componentName, String msg) Emit a notification for an event on either a binding component or a
service engine. | public Notification | emitRuntimeNotification(EventType eventType, String msg) Emit a notification for an event on the JBI runtime. | public Notification | emitServiceAssemblyNotification(EventType eventType, String serviceAssemblyName, String msg) Emit a notification for an event on a service assembly. | public Notification | emitServiceUnitNotification(EventType eventType, String serviceUnitName, String serviceAssemblyName, String componentName, String msg) Emit a notification for an event on a service unit. | public Notification | emitSharedLibraryNotification(EventType eventType, String sharedLibraryName, String msg) Emit a notification for an event on a shared library. | public void | enableNotifications() Enable event notifications to be emitted by this MBean. | public 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 | instanceStarting() Inform the DAS Event Notifier MBean that this instance is starting. | void | instanceStopping() Inform the DAS Event Notifier MBean that this instance is stopping. |
COMPONENT_NAME_KEY | final static String COMPONENT_NAME_KEY(Code) | | Item name key for component name. Package-visible for unit testing.
|
ITEM_DESCRIPTIONS_1 | final static String[] ITEM_DESCRIPTIONS_1(Code) | | List of descriptions of items for CompositeData construction for
runtime, component, shared library, and service assembly notifications.
Package-visible for unit testing.
|
ITEM_DESCRIPTIONS_2 | final static String[] ITEM_DESCRIPTIONS_2(Code) | | List of descriptions of items for CompositeData construction for service
unit notifications. Package-visible for unit testing.
|
ITEM_NAMES_1 | final static String[] ITEM_NAMES_1(Code) | | List of item names for CompositeData construction for runtime, component,
shared library, and service assembly notifications. Package-visible for
unit testing.
|
ITEM_NAMES_2 | final static String[] ITEM_NAMES_2(Code) | | List of item names for CompositeData construction for service unit
notifications. Package-visible for unit testing.
|
ITEM_TYPES_1 | final static OpenType[] ITEM_TYPES_1(Code) | | List of types of items for CompositeData construction for runtime,
component, shared library, and service assembly notifications. Package-
visible for unit testing.
|
ITEM_TYPES_2 | final static OpenType[] ITEM_TYPES_2(Code) | | List of types of items for CompositeData construction for service unit
notifications. Package-visible for unit testing.
|
JBI_FRAMEWORK | final static String JBI_FRAMEWORK(Code) | | Source name for JBI runtime notification messages. Package-visible for
unit testing.
|
SERVICE_ASSEMBLY_NAME_KEY | final static String SERVICE_ASSEMBLY_NAME_KEY(Code) | | Item name key for service assembly name. Package-visible for unit testing.
|
SERVICE_UNIT_NAME_KEY | final static String SERVICE_UNIT_NAME_KEY(Code) | | Item name key for service unit name. Package-visible for unit testing.
|
SOURCE_NAME_KEY | final static String SOURCE_NAME_KEY(Code) | | Item name key for source type. Package-visible for unit testing.
|
SOURCE_TYPE_KEY | final static String SOURCE_TYPE_KEY(Code) | | Item name key for source type. Package-visible for unit testing.
|
TARGET_NAME_KEY | final static String TARGET_NAME_KEY(Code) | | Item name key for target name. Package-visible for unit testing.
|
disableNotifications | public void disableNotifications()(Code) | | Disable event notifications from being emitted by this MBean.
|
emitComponentNotification | public Notification emitComponentNotification(EventType eventType, SourceType sourceType, String componentName, String msg)(Code) | | Emit a notification for an event on either a binding component or a
service engine. The caller provides information that determines the
content of the notification. The event type for a component notification
can be Installed, Uninstalled, Started, Stopped, or ShutDown. The source
type is either BindingComponent or ServiceEngine.
Parameters: eventType - the type of event that occurred. Parameters: sourceType - the type of component on which the event occurred. Parameters: componentName - the name of the component on which the eventoccurred. Parameters: msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting). |
emitRuntimeNotification | public Notification emitRuntimeNotification(EventType eventType, String msg)(Code) | | Emit a notification for an event on the JBI runtime. The caller provides
information that determines the content of of the notification. The
event type for a JBI runtime notification can be Ready, Started, or
Stopped. The source type is always JBIRuntime.
Parameters: eventType - the type of event that occurred. Parameters: msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting). |
emitServiceAssemblyNotification | public Notification emitServiceAssemblyNotification(EventType eventType, String serviceAssemblyName, String msg)(Code) | | Emit a notification for an event on a service assembly. The caller
provides information that determines the content of the notification.
The event type for a service assembly notification can be Deployed,
Undeployed, Started, Stopped, or ShutDown. The source type is always
ServiceAssembly.
Parameters: eventType - the type of event that occurred. Parameters: serviceAssemblyName - the name of the service assembly on which theevent occurred. Parameters: msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting). |
emitServiceUnitNotification | public Notification emitServiceUnitNotification(EventType eventType, String serviceUnitName, String serviceAssemblyName, String componentName, String msg)(Code) | | Emit a notification for an event on a service unit. The caller provides
information that determines the content of the notification. The event
type for a service unit notification can be Deployed, Undeployed,
Started, Stopped, or ShutDown. The source type is always ServiceUnit.
Parameters: eventType - the type of event that occurred. Parameters: serviceUnitName - the name of the service unit on which the eventoccurred. Parameters: serviceAssemblyName - the name of the service assembly to which theservice unit belongs. Parameters: componentName - the name of the component to which the service unitis deployed. Parameters: msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting). |
emitSharedLibraryNotification | public Notification emitSharedLibraryNotification(EventType eventType, String sharedLibraryName, String msg)(Code) | | Emit a notification for an event on a shared library. The caller provides
information that determines the content of the notification. The event
type for a shared library notification can be either Installed or
Uninstalled. The source type is always SharedLibrary.
Parameters: eventType - the type of event that occurred. Parameters: sharedLibraryName - the name of the shared library on which theevent occurred. Parameters: msg - a message associated with the event. the actual Notification sent (this is used primarily for unittesting). |
enableNotifications | public void enableNotifications()(Code) | | Enable event notifications to be emitted by this MBean.
|
getNotificationInfo | public MBeanNotificationInfo[] getNotificationInfo()(Code) | | 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.
an array of javax.managagement.MBeanNotificationInfo objects which describe the notifications. |
instanceStarting | void instanceStarting()(Code) | | Inform the DAS Event Notifier MBean that this instance is starting. This
causes the DAS MBean to invoke the addNotificationListener()
operation on this instance MBean to register itself as a notification
listener for notifications from this instance. This method is called by
the framework during startup.
|
instanceStopping | void instanceStopping()(Code) | | Inform the DAS Event Notifier MBean that this instance is stopping. This
causes the DAS MBean to invoke the removeNotificationListener
operation on this instance MBean to unregister itself as a notification
listener for notifications from this instance. This method is called by
the framework during shutdown.
|
|
|