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

java.lang.Object
  extended by org.apache.felix.ipojo.Handler
      extended by org.apache.felix.ipojo.PrimitiveHandler
          extended by org.apache.felix.ipojo.handlers.jmx.MBeanHandler
All Implemented Interfaces:
org.apache.felix.ipojo.FieldInterceptor, org.apache.felix.ipojo.MethodInterceptor

public class MBeanHandler
extends org.apache.felix.ipojo.PrimitiveHandler

This class implements iPOJO Handler. it builds the dynamic MBean from metadata.xml and expose it to the MBean Server.

Author:
Felix Project Team

Field Summary
 
Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler
HANDLER_TYPE
 
Fields inherited from class org.apache.felix.ipojo.Handler
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid
 
Constructor Summary
MBeanHandler()
           
 
Method Summary
 void configure(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary dict)
          configure : construct the structure JmxConfigFieldMap.and the Dynamic Mbean.
 java.lang.Object onGet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
          getterCallback : call when a POJO member is modified by the MBean.
 void onSet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
          setterCallback : call when a POJO member is modified externally.
 void start()
          start : register the Dynamic Mbean.
 void stop()
          stop : unregister the Dynamic Mbean.
 
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler
attach, getFactory, getHandler, getInstanceManager, getLogger, getMetadata, getPojoMetadata, onCreation, onEntry, onError, onExit, onFinally, setFactory
 
Methods inherited from class org.apache.felix.ipojo.Handler
error, error, getDescription, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, stateChanged, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanHandler

public MBeanHandler()
Method Detail

configure

public void configure(org.apache.felix.ipojo.metadata.Element metadata,
                      java.util.Dictionary dict)
configure : construct the structure JmxConfigFieldMap.and the Dynamic Mbean.

Specified by:
configure in class org.apache.felix.ipojo.Handler
Parameters:
metadata - Element
dict - Dictionary

start

public void start()
start : register the Dynamic Mbean.

Specified by:
start in class org.apache.felix.ipojo.Handler

stop

public void stop()
stop : unregister the Dynamic Mbean.

Specified by:
stop in class org.apache.felix.ipojo.Handler

onSet

public void onSet(java.lang.Object pojo,
                  java.lang.String fieldName,
                  java.lang.Object value)
setterCallback : call when a POJO member is modified externally.

Specified by:
onSet in interface org.apache.felix.ipojo.FieldInterceptor
Overrides:
onSet in class org.apache.felix.ipojo.PrimitiveHandler
Parameters:
pojo - : the POJO object
fieldName - : name of the modified field
value - : new value of the field

onGet

public java.lang.Object onGet(java.lang.Object pojo,
                              java.lang.String fieldName,
                              java.lang.Object value)
getterCallback : call when a POJO member is modified by the MBean.

Specified by:
onGet in interface org.apache.felix.ipojo.FieldInterceptor
Overrides:
onGet in class org.apache.felix.ipojo.PrimitiveHandler
Parameters:
pojo - : pojo object.
fieldName - : name of the modified field
value - : old value of the field
Returns:
: new value of the field