com.stc.connector.management.jca.system.mbeans
Class BaseMonitorMBean

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended bycom.stc.connector.management.jca.system.mbeans.BaseMonitorMBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter
Direct Known Subclasses:
STCActivationSpecMonitor, STCAdapterConfigurationMonitor, STCManagedConnectionMonitor, STCMCFMonitor, STCRAMonitor

public class BaseMonitorMBean
extends javax.management.NotificationBroadcasterSupport
implements javax.management.DynamicMBean, javax.management.MBeanRegistration

The BaseMonitorMBean class provides the basic functionalities for buffering alerts if the Event Management framework is not yet ready for receiving alerts. Each MBean (e.g CollabMonitorMBean) should inherits this base class.

Copyright: Copyright (c) 2003

Company: seebeyond

Version:
1.0
Author:
Yoke Lee

Field Summary
protected  java.util.ArrayList mAttributesInfo
          MBean attributes
protected  java.util.ArrayList mConstructorsInfo
          MBean constructors
protected  javax.management.MBeanInfo mMBeanInfo
          MBean info
protected  java.util.ArrayList mNotificationsInfo
          MBean notifications
protected  java.util.ArrayList mOperationsInfo
          MBean operations
 
Constructor Summary
BaseMonitorMBean()
          default constructor
 
Method Summary
 void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          intercepts the addNotificationListener and increment listeners counter
protected  void buildDefaultDynamicMBeanInfo()
          Build the protected MBeanInfo field, which represents the management interface exposed by the MBean; i.e., the set of attributes, constructors, operations and notifications which are available for management.
protected  void buildDynamicMBeanInfo()
           
 java.lang.Object getAttribute(java.lang.String aName)
           
 javax.management.AttributeList getAttributes(java.lang.String[] aNames)
          Retrieves the value of specified attributes of the Dynamic MBean
 javax.management.MBeanInfo getMBeanInfo()
           
 java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Invokes an operation on the Dynamic MBean.
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void removeNotificationListener(javax.management.NotificationListener listener)
          intercepts the removeNotificationListener and decrement listeners counter
 void sendNotification(javax.management.Notification n)
          send out a jmx notification.
 void setAttribute(javax.management.Attribute aAttribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList aAttributes)
          Sets the value of specified aAttributes of the Dynamic MBean.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
getNotificationInfo, handleNotification, removeNotificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mAttributesInfo

protected java.util.ArrayList mAttributesInfo
MBean attributes


mConstructorsInfo

protected java.util.ArrayList mConstructorsInfo
MBean constructors


mOperationsInfo

protected java.util.ArrayList mOperationsInfo
MBean operations


mNotificationsInfo

protected java.util.ArrayList mNotificationsInfo
MBean notifications


mMBeanInfo

protected javax.management.MBeanInfo mMBeanInfo
MBean info

Constructor Detail

BaseMonitorMBean

public BaseMonitorMBean()
default constructor

Method Detail

buildDefaultDynamicMBeanInfo

protected void buildDefaultDynamicMBeanInfo()
Build the protected MBeanInfo field, which represents the management interface exposed by the MBean; i.e., the set of attributes, constructors, operations and notifications which are available for management. A reference to the MBeanInfo object is returned by the getMBeanInfo() method of the DynamicMBean interface. Note that, once constructed, an MBeanInfo object is immutable.


getAttribute

public java.lang.Object getAttribute(java.lang.String aName)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute aAttribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] aNames)
Retrieves the value of specified attributes of the Dynamic MBean

Specified by:
getAttributes in interface javax.management.DynamicMBean
Parameters:
aNames - aNames of the attributes
Returns:
AttributeList list of attribute aNames and values

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList aAttributes)
Sets the value of specified aAttributes of the Dynamic MBean.

Specified by:
setAttributes in interface javax.management.DynamicMBean
Parameters:
aAttributes - list of attribute names and values.
Returns:
AttributeList list of attribute names and values

invoke

public java.lang.Object invoke(java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Invokes an operation on the Dynamic MBean.

Specified by:
invoke in interface javax.management.DynamicMBean
Parameters:
operationName - The name of the action to be invoked
params - An array containing the parameters to be set when the action is invoked
signature - An array containing the aSignature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which the action is invoked.
Returns:
The object returned by the action, which represents the result of invoking the action on the MBean specified
Throws:
javax.management.MBeanException - MBeanException
javax.management.ReflectionException - ReflectionException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean

buildDynamicMBeanInfo

protected void buildDynamicMBeanInfo()

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
Specified by:
preDeregister in interface javax.management.MBeanRegistration

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
Specified by:
preRegister in interface javax.management.MBeanRegistration

addNotificationListener

public void addNotificationListener(javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
intercepts the addNotificationListener and increment listeners counter

Specified by:
addNotificationListener in interface javax.management.NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener)
                                throws javax.management.ListenerNotFoundException
intercepts the removeNotificationListener and decrement listeners counter

Specified by:
removeNotificationListener in interface javax.management.NotificationBroadcaster
Throws:
javax.management.ListenerNotFoundException

sendNotification

public void sendNotification(javax.management.Notification n)
send out a jmx notification. We need to do buffering if there's currently no listeners.