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

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended bycom.stc.connector.management.jca.system.mbeans.BaseMonitorMBean
          extended bycom.stc.connector.management.jca.system.mbeans.STCManagedConnectionMonitor
All Implemented Interfaces:
javax.management.DynamicMBean, java.util.EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, STCManagedConnectionMonitorBean

public class STCManagedConnectionMonitor
extends BaseMonitorMBean
implements STCManagedConnectionMonitorBean, javax.management.MBeanRegistration, javax.management.NotificationListener


Field Summary
 
Fields inherited from class com.stc.connector.management.jca.system.mbeans.BaseMonitorMBean
mAttributesInfo, mConstructorsInfo, mMBeanInfo, mNotificationsInfo, mOperationsInfo
 
Constructor Summary
STCManagedConnectionMonitor()
           
 
Method Summary
protected  void buildDynamicMBeanInfo()
          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.
 void disable()
          Disable use of managed connection
 void enable()
          Enable use of managed connection
 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
 java.lang.Integer getCurrentConnections()
          Getter for current number of connections
 java.lang.Integer getMaxConnections()
          Getter for Maximum number of connections allowed
 java.lang.Integer getMinConnections()
          Getter for Minimum number of connections allowed
 java.lang.String getName()
          Getter for this mbean's name
 void handleNotification(javax.management.Notification aNotification, java.lang.Object obj)
           
 java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Invokes an operation on the Dynamic MBean.
 java.lang.Boolean isEnabled()
          Flag indicating if managed connection is enabled or not
 void postRegister(java.lang.Boolean registrationDone)
          MBeanRegistration implementation method
 javax.management.ObjectName preRegister(javax.management.MBeanServer aServer, javax.management.ObjectName aName)
          MBeanRegistration implementation method
 void sendAlert()
           
 void sendAlert(com.stc.eventmanagement.Event event)
           
 void sendAlert(java.lang.String alertMsg, int severity)
           
 void sendAlert(java.lang.String alertMsgCode, java.lang.String[] alertMsgCodeArgs, java.lang.String alertMsg, int severity)
           
 void sendAlert(java.lang.String projectName, java.lang.String collabName, java.lang.String componentName, java.lang.String alertMsgCode, java.lang.String[] alertMsgCodeArgs, java.lang.String alertMsg, int severity)
           
 void setCurrentConnections(int curConns)
          Setter for current number of connections used
 void setMaxConnections(int maxConns)
          Setter for Maximum number of connections allowed
 void setMinConnections(int minConns)
          Setter for Minimum number of connections allowed
 void setName(java.lang.String name)
          Setter for this mbean's name
 
Methods inherited from class com.stc.connector.management.jca.system.mbeans.BaseMonitorMBean
addNotificationListener, buildDefaultDynamicMBeanInfo, getMBeanInfo, postDeregister, preDeregister, removeNotificationListener, sendNotification, setAttribute, setAttributes
 
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
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, preDeregister
 

Constructor Detail

STCManagedConnectionMonitor

public STCManagedConnectionMonitor()
Method Detail

buildDynamicMBeanInfo

protected void buildDynamicMBeanInfo()
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.

Overrides:
buildDynamicMBeanInfo in class BaseMonitorMBean

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
Description copied from class: BaseMonitorMBean
Invokes an operation on the Dynamic MBean.

Specified by:
invoke in interface javax.management.DynamicMBean
Overrides:
invoke in class BaseMonitorMBean
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.ReflectionException - ReflectionException
javax.management.MBeanException - MBeanException

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] aNames)
Description copied from class: BaseMonitorMBean
Retrieves the value of specified attributes of the Dynamic MBean

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

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
Overrides:
getAttribute in class BaseMonitorMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

handleNotification

public void handleNotification(javax.management.Notification aNotification,
                               java.lang.Object obj)
Specified by:
handleNotification in interface javax.management.NotificationListener

sendAlert

public void sendAlert(java.lang.String projectName,
                      java.lang.String collabName,
                      java.lang.String componentName,
                      java.lang.String alertMsgCode,
                      java.lang.String[] alertMsgCodeArgs,
                      java.lang.String alertMsg,
                      int severity)

sendAlert

public void sendAlert(java.lang.String alertMsgCode,
                      java.lang.String[] alertMsgCodeArgs,
                      java.lang.String alertMsg,
                      int severity)
Specified by:
sendAlert in interface STCManagedConnectionMonitorBean

sendAlert

public void sendAlert(java.lang.String alertMsg,
                      int severity)
Specified by:
sendAlert in interface STCManagedConnectionMonitorBean

sendAlert

public void sendAlert()
Specified by:
sendAlert in interface STCManagedConnectionMonitorBean

sendAlert

public void sendAlert(com.stc.eventmanagement.Event event)

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer aServer,
                                               javax.management.ObjectName aName)
MBeanRegistration implementation method

Specified by:
preRegister in interface javax.management.MBeanRegistration
Overrides:
preRegister in class BaseMonitorMBean
Parameters:
aServer - MBeanServer
aName - MBean's ObjectName
Returns:
MBean's ObjectName
Throws:
java.lang.Exception - This exception should be caught by the MBean server and re-thrown as an MBeanRegistrationException

postRegister

public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration implementation method

Specified by:
postRegister in interface javax.management.MBeanRegistration
Overrides:
postRegister in class BaseMonitorMBean
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed

enable

public void enable()
Enable use of managed connection

Specified by:
enable in interface STCManagedConnectionMonitorBean

disable

public void disable()
Disable use of managed connection

Specified by:
disable in interface STCManagedConnectionMonitorBean

isEnabled

public java.lang.Boolean isEnabled()
Flag indicating if managed connection is enabled or not

Specified by:
isEnabled in interface STCManagedConnectionMonitorBean

setMinConnections

public void setMinConnections(int minConns)
Setter for Minimum number of connections allowed

Specified by:
setMinConnections in interface STCManagedConnectionMonitorBean

getMinConnections

public java.lang.Integer getMinConnections()
Getter for Minimum number of connections allowed

Specified by:
getMinConnections in interface STCManagedConnectionMonitorBean

setMaxConnections

public void setMaxConnections(int maxConns)
Setter for Maximum number of connections allowed

Specified by:
setMaxConnections in interface STCManagedConnectionMonitorBean

getMaxConnections

public java.lang.Integer getMaxConnections()
Getter for Maximum number of connections allowed

Specified by:
getMaxConnections in interface STCManagedConnectionMonitorBean

setCurrentConnections

public void setCurrentConnections(int curConns)
Setter for current number of connections used

Specified by:
setCurrentConnections in interface STCManagedConnectionMonitorBean

getCurrentConnections

public java.lang.Integer getCurrentConnections()
Getter for current number of connections

Specified by:
getCurrentConnections in interface STCManagedConnectionMonitorBean

setName

public void setName(java.lang.String name)
Setter for this mbean's name

Specified by:
setName in interface STCManagedConnectionMonitorBean

getName

public java.lang.String getName()
Getter for this mbean's name

Specified by:
getName in interface STCManagedConnectionMonitorBean