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
Direct Known Subclasses:
DynamicMBeanWRegisterImpl

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

Field Summary
protected  InstanceManager m_instanceManager
          The instance manager.
 
Constructor Summary
DynamicMBeanImpl(JmxConfigFieldMap properties, InstanceManager instanceManager)
          Constructor.
 
Method Summary
 Object getAttribute(String arg0)
          Gets the value of the required attribute.
 javax.management.AttributeList getAttributes(String[] attributeNames)
          Gets values of required attributes.
 javax.management.MBeanInfo getMBeanInfo()
          Returns the MBean Class builded.
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
          Gets the notification informations (use by JMX).
 Object invoke(String operationName, Object[] params, String[] signature)
          Invokes the required method on the targeted POJO.
 void sendNotification(String msg, String attributeName, String attributeType, Object oldValue, Object newValue)
          Sends a notification to a subscriber.
 void setAttribute(javax.management.Attribute attribute)
          Changes specified attribute value.
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
          Changes 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
 

Field Detail

m_instanceManager

protected final InstanceManager m_instanceManager
The instance manager. Used to store the InstanceManager instance.

Constructor Detail

DynamicMBeanImpl

public DynamicMBeanImpl(JmxConfigFieldMap properties,
                        InstanceManager instanceManager)
Constructor.

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

getAttribute

public Object getAttribute(String arg0)
                    throws javax.management.AttributeNotFoundException,
                           javax.management.MBeanException,
                           javax.management.ReflectionException
Gets the value of the required attribute.

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

getAttributes

public javax.management.AttributeList getAttributes(String[] attributeNames)
Gets values of required attributes.

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

getMBeanInfo

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

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

invoke

public Object invoke(String operationName,
                     Object[] params,
                     String[] signature)
              throws javax.management.MBeanException,
                     javax.management.ReflectionException
Invokes the required method on the targeted POJO.

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

setAttribute

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

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

setAttributes

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

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

getNotificationInfo

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

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

sendNotification

public void sendNotification(String msg,
                             String attributeName,
                             String attributeType,
                             Object oldValue,
                             Object newValue)
Sends a notification to a subscriber.

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


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.