org.apache.felix.ipojo.handlers.jmx
Class DynamicMBeanImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.apache.felix.ipojo.handlers.jmx.DynamicMBeanImpl
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class DynamicMBeanImpl
extends javax.management.NotificationBroadcasterSupport
implements javax.management.DynamicMBean

this class implements iPOJO DynamicMBean. it builds the dynamic MBean

Author:
Felix Project Team

Constructor Summary
DynamicMBeanImpl(JmxConfigFieldMap properties, org.apache.felix.ipojo.InstanceManager instanceManager)
          DynamicMBeanImpl : constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String arg0)
          getAttribute implements from JMX.
 javax.management.AttributeList getAttributes(java.lang.String[] attributeNames)
          getAttributes : implement from JMX.
 javax.management.MBeanInfo getMBeanInfo()
          getMBeanInfo : return the MBean Class builded.
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
          getNotificationInfo : get the notification informations (use by JMX).
 java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          invoke : invoke the required method on the targeted POJO.
 void sendNotification(java.lang.String msg, java.lang.String attributeName, java.lang.String attributeType, java.lang.Object oldValue, java.lang.Object newValue)
          sendNotification : send a notification to a subscriver.
 void setAttribute(javax.management.Attribute attribute)
          setAttribute : change specified attribute value.
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
          setAttributes : change all the attributes value.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicMBeanImpl

public DynamicMBeanImpl(JmxConfigFieldMap properties,
                        org.apache.felix.ipojo.InstanceManager instanceManager)
DynamicMBeanImpl : constructor.

Parameters:
properties - : data extracted from metadat.xml file
instanceManager - : InstanceManager instance
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String arg0)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
getAttribute implements from JMX. get the value of the required attribute

Specified by:
getAttribute in interface javax.management.DynamicMBean
Parameters:
arg0 - name of required attribute
Returns:
the object attribute
Throws:
javax.management.AttributeNotFoundException - : if the attribute doesn't exist
javax.management.MBeanException - :
javax.management.ReflectionException - :

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributeNames)
getAttributes : implement from JMX. get values of reuqired attributes

Specified by:
getAttributes in interface javax.management.DynamicMBean
Parameters:
attributeNames - : names of the required attributes
Returns:
return the list of the attribute

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo : return the MBean Class builded.

Specified by:
getMBeanInfo in interface javax.management.DynamicMBean
Returns:
return MBeanInfo class constructed by buildMBeanInfo

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
invoke : invoke the required method on the targeted POJO.

Specified by:
invoke in interface javax.management.DynamicMBean
Parameters:
operationName - : name of the method called
params - : parameters given to the method
signature - : determine which method called
Returns:
Object : the object return by the method
Throws:
javax.management.MBeanException - :
javax.management.ReflectionException - :

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
setAttribute : change specified attribute value.

Specified by:
setAttribute in interface javax.management.DynamicMBean
Parameters:
attribute - : attribute with new value to be changed
Throws:
javax.management.AttributeNotFoundException - : if the requiered attribute was not found
javax.management.InvalidAttributeValueException - : the value is inccorrect type
javax.management.MBeanException - :
javax.management.ReflectionException - :

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes : change all the attributes value.

Specified by:
setAttributes in interface javax.management.DynamicMBean
Parameters:
attributes - : list of attribute value to be changed
Returns:
AttributeList : list of new attribute

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo : get the notification informations (use by JMX).

Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Overrides:
getNotificationInfo in class javax.management.NotificationBroadcasterSupport
Returns:
MBeanNotificationInfo[] : structure which describe the notifications

sendNotification

public void sendNotification(java.lang.String msg,
                             java.lang.String attributeName,
                             java.lang.String attributeType,
                             java.lang.Object oldValue,
                             java.lang.Object newValue)
sendNotification : send a notification to a subscriver.

Parameters:
msg - : msg to send
attributeName - : name of the attribute
attributeType - : type of the attribute
oldValue - : oldvalue of the attribute
newValue - : new value of the attribute