Package com.ibm.di.api.jmx.mbeans
Class Notifier
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- com.ibm.di.api.jmx.mbeans.Notifier
-
- All Implemented Interfaces:
BaseMBean,NotifierMBean,javax.management.NotificationBroadcaster,javax.management.NotificationEmitter
public class Notifier extends javax.management.NotificationBroadcasterSupport implements NotifierMBean
This class provides methods for sending JMX notifications.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEVT_AL_STARTFinal variable used for distinguishing the type of the notification.static java.lang.StringEVT_AL_STOPFinal variable used for distinguishing the type of the notification.static java.lang.StringEVT_CI_STARTFinal variable used for distinguishing the type of the notification.static java.lang.StringEVT_CI_STOPFinal variable used for distinguishing the type of the notification.static java.lang.StringEVT_CI_UPDATEDFinal variable used for distinguishing the type of the notification.static java.lang.StringEVT_SRV_STOPFinal variable used for distinguishing the type of the notification.static java.lang.StringMBEAN_IDID of the MBean.static java.lang.StringMBEAN_TYPEType of the MBean.static java.lang.StringTYPE_ALLFinal variable used for distinguishing the type of the notification groups.static java.lang.StringTYPE_ASSEMBLY_LINEFinal variable used for distinguishing the type of the notification groups.static java.lang.StringTYPE_CONFIG_INSTANCEFinal variable used for distinguishing the type of the notification groups.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassemblyLineFinished(java.lang.String aAssemblyLineId)Sends notification for assembly line stopping.voidassemblyLineStarted(java.lang.String aAssemblyLineId)Sends notification for assembly line starting.voidconfigInstanceStarted(java.lang.String aConfigId)Sends notification for config instance starting.voidconfigInstanceStopped(java.lang.String aConfigId)Sends notification for config instance stopping.voidconfigInstanceUpdated(java.lang.String aConfigId)Sends notification for updating the config instance file.voiddisable()Disables the Notifier.voidenable()Enables the Notifier.java.lang.StringgetId()Reads attribute "Id".java.lang.StringgetKeyPropertyList()Returns the MBean key property list.static NotifiergetNotifier()Returns the Notifier.javax.management.ObjectNamegetObjectName()Gets the object name of the Notifier.java.lang.StringgetType()Reads attribute "Type".static Notifierinit()Initializes the Notifier.booleanisEnabled()Checks if the notification is enabled.voidsendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData)Sends custom notification.voidsendNotification(javax.management.Notification aNotification)Sends a notification.voidserverStopped(java.util.Date aBootTime)Sends notification for server stopping.
-
-
-
Field Detail
-
MBEAN_TYPE
public static final java.lang.String MBEAN_TYPE
Type of the MBean.- See Also:
- Constant Field Values
-
MBEAN_ID
public static final java.lang.String MBEAN_ID
ID of the MBean.- See Also:
- Constant Field Values
-
EVT_CI_START
public static final java.lang.String EVT_CI_START
Final variable used for distinguishing the type of the notification. Indicates notification for config instance starting.- See Also:
- Constant Field Values
-
EVT_CI_STOP
public static final java.lang.String EVT_CI_STOP
Final variable used for distinguishing the type of the notification. Indicates notification for config instance stopping.- See Also:
- Constant Field Values
-
EVT_CI_UPDATED
public static final java.lang.String EVT_CI_UPDATED
Final variable used for distinguishing the type of the notification. Indicates notification for updating of the config instance file.- See Also:
- Constant Field Values
-
EVT_AL_START
public static final java.lang.String EVT_AL_START
Final variable used for distinguishing the type of the notification. Indicates notification for assembly line starting.- See Also:
- Constant Field Values
-
EVT_AL_STOP
public static final java.lang.String EVT_AL_STOP
Final variable used for distinguishing the type of the notification. Indicates notification for assembly line stopping.- See Also:
- Constant Field Values
-
EVT_SRV_STOP
public static final java.lang.String EVT_SRV_STOP
Final variable used for distinguishing the type of the notification. Indicates notification for server stopping.- See Also:
- Constant Field Values
-
TYPE_ALL
public static final java.lang.String TYPE_ALL
Final variable used for distinguishing the type of the notification groups. Indicates notification group containing all notifications.- See Also:
- Constant Field Values
-
TYPE_CONFIG_INSTANCE
public static final java.lang.String TYPE_CONFIG_INSTANCE
Final variable used for distinguishing the type of the notification groups. Indicates notification group containing all notifications for config instances.- See Also:
- Constant Field Values
-
TYPE_ASSEMBLY_LINE
public static final java.lang.String TYPE_ASSEMBLY_LINE
Final variable used for distinguishing the type of the notification groups. Indicates notification group containing all notifications for assembly lines.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static Notifier init() throws DIException
Initializes the Notifier.- Returns:
- the initialized Notifier.
- Throws:
DIException- if the JMX notification service is already initialized.
-
getNotifier
public static Notifier getNotifier() throws DIException
Returns the Notifier.- Returns:
- the Notifier object.
- Throws:
DIException- if the JMX notification service is not initialized.
-
getObjectName
public javax.management.ObjectName getObjectName()
Gets the object name of the Notifier.- Returns:
- the object name
-
isEnabled
public boolean isEnabled()
Checks if the notification is enabled.- Returns:
- true if the notification is enabled, false otherwise.
-
enable
public void enable()
Enables the Notifier.
-
disable
public void disable()
Disables the Notifier.
-
assemblyLineStarted
public void assemblyLineStarted(java.lang.String aAssemblyLineId)
Sends notification for assembly line starting.- Parameters:
aAssemblyLineId- the assembly line id.
-
assemblyLineFinished
public void assemblyLineFinished(java.lang.String aAssemblyLineId)
Sends notification for assembly line stopping.- Parameters:
aAssemblyLineId- the assembly line id.
-
configInstanceStarted
public void configInstanceStarted(java.lang.String aConfigId)
Sends notification for config instance starting.- Parameters:
aConfigId- the config instance id.
-
configInstanceStopped
public void configInstanceStopped(java.lang.String aConfigId)
Sends notification for config instance stopping.- Parameters:
aConfigId- the config instance id.
-
configInstanceUpdated
public void configInstanceUpdated(java.lang.String aConfigId)
Sends notification for updating the config instance file.- Parameters:
aConfigId- the config instance id.
-
serverStopped
public void serverStopped(java.util.Date aBootTime)
Sends notification for server stopping.- Parameters:
aBootTime- the boot time.
-
sendCustomNotification
public void sendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData)Sends custom notification.- Parameters:
aType- the type of the notification.aId- the id of the notification. Used for building the message of the notification.aData- The user data object. It is used for whatever data the notification source wishes to communicate to its consumers.
-
getType
public java.lang.String getType()
Reads attribute "Type".getType()andgetId()are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".
-
getId
public java.lang.String getId()
Reads attribute "Id". The "Id" value should be different for different MBeans of the same type.getType()andgetId()are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".
-
getKeyPropertyList
public java.lang.String getKeyPropertyList()
Returns the MBean key property list. If the MBean type isNotifierand the id isNotifier, the result of this method would be"type=Notifier,id=Notifier"- Returns:
- string representing the MBean attributes.
-
sendNotification
public void sendNotification(javax.management.Notification aNotification)
Sends a notification.- Overrides:
sendNotificationin classjavax.management.NotificationBroadcasterSupport- Parameters:
aNotification- The notification to send.
-
-