com.ibm.di.api.jmx.mbeans
Class Notifier

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by com.ibm.di.api.jmx.mbeans.Notifier
All Implemented Interfaces:
BaseMBean, NotifierMBean, NotificationBroadcaster, NotificationEmitter

public class Notifier
extends NotificationBroadcasterSupport
implements NotifierMBean

This class provides methods for sending JMX notifications.


Field Summary
static String EVT_AL_START
          Final variable used for distinguishing the type of the notification.
static String EVT_AL_STOP
          Final variable used for distinguishing the type of the notification.
static String EVT_CI_START
          Final variable used for distinguishing the type of the notification.
static String EVT_CI_STOP
          Final variable used for distinguishing the type of the notification.
static String EVT_CI_UPDATED
          Final variable used for distinguishing the type of the notification.
static String EVT_SRV_STOP
          Final variable used for distinguishing the type of the notification.
static String MBEAN_ID
          ID of the MBean.
static String MBEAN_TYPE
          Type of the MBean.
static String TYPE_ALL
          Final variable used for distinguishing the type of the notification groups.
static String TYPE_ASSEMBLY_LINE
          Final variable used for distinguishing the type of the notification groups.
static String TYPE_CONFIG_INSTANCE
          Final variable used for distinguishing the type of the notification groups.
 
Method Summary
 void assemblyLineFinished(String aAssemblyLineId)
          Sends notification for assembly line stopping.
 void assemblyLineStarted(String aAssemblyLineId)
          Sends notification for assembly line starting.
 void configInstanceStarted(String aConfigId)
          Sends notification for config instance starting.
 void configInstanceStopped(String aConfigId)
          Sends notification for config instance stopping.
 void configInstanceUpdated(String aConfigId)
          Sends notification for updating the config instance file.
 void disable()
          Disables the Notifier.
 void enable()
          Enables the Notifier.
 String getId()
          Reads attribute "Id".
 String getKeyPropertyList()
          Returns the MBean key property list.
static Notifier getNotifier()
          Returns the Notifier.
 ObjectName getObjectName()
          Gets the object name of the Notifier.
 String getType()
          Reads attribute "Type".
static Notifier init()
          Initializes the Notifier.
 boolean isEnabled()
          Checks if the notification is enabled.
 void sendCustomNotification(String aType, String aId, Object aData)
          Sends custom notification.
 void sendNotification(Notification aNotification)
          Sends a notification.
 void serverStopped(Date aBootTime)
          Sends notification for server stopping.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MBEAN_TYPE

public static final String MBEAN_TYPE
Type of the MBean.

See Also:
Constant Field Values

MBEAN_ID

public static final String MBEAN_ID
ID of the MBean.

See Also:
Constant Field Values

EVT_CI_START

public static final 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 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 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 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 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 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 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 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 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 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(String aAssemblyLineId)
Sends notification for assembly line starting.

Parameters:
aAssemblyLineId - the assembly line id.

assemblyLineFinished

public void assemblyLineFinished(String aAssemblyLineId)
Sends notification for assembly line stopping.

Parameters:
aAssemblyLineId - the assembly line id.

configInstanceStarted

public void configInstanceStarted(String aConfigId)
Sends notification for config instance starting.

Parameters:
aConfigId - the config instance id.

configInstanceStopped

public void configInstanceStopped(String aConfigId)
Sends notification for config instance stopping.

Parameters:
aConfigId - the config instance id.

configInstanceUpdated

public void configInstanceUpdated(String aConfigId)
Sends notification for updating the config instance file.

Parameters:
aConfigId - the config instance id.

serverStopped

public void serverStopped(Date aBootTime)
Sends notification for server stopping.

Parameters:
aBootTime - the boot time.

sendCustomNotification

public void sendCustomNotification(String aType,
                                   String aId,
                                   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 String getType()
Reads attribute "Type".

getType() and getId() 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".

Specified by:
getType in interface BaseMBean
Returns:
the type of this MBean.

getId

public String getId()
Reads attribute "Id". The "Id" value should be different for different MBeans of the same type.

getType() and getId() 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".

Specified by:
getId in interface BaseMBean
Returns:
the Id of this MBean.

getKeyPropertyList

public String getKeyPropertyList()
Returns the MBean key property list. If the MBean type is Notifier and the id is Notifier, the result of this method would be "type=Notifier,id=Notifier"

Returns:
string representing the MBean attributes.

sendNotification

public void sendNotification(Notification aNotification)
Sends a notification.

Overrides:
sendNotification in class NotificationBroadcasterSupport
Parameters:
aNotification - The notification to send.