org.jboss.mx.capability
Class ReflectedMBeanDispatcher

java.lang.Object
  extended by org.jboss.mx.capability.ReflectedMBeanDispatcher
All Implemented Interfaces:
DynamicMBean

public class ReflectedMBeanDispatcher
extends Object
implements DynamicMBean

Directs DynamicMBean calls to underlying resource via reflection. It's suitable for use as a StandardMBean or as the resource for a ModelMBean.

Author:
Trevor Squires., Juha Lindfors

Nested Class Summary
static class ReflectedMBeanDispatcher.MethodPair
           
 
Constructor Summary
ReflectedMBeanDispatcher(MBeanInfo mbinfo, AttributeOperationResolver resolver, Object resource)
           
 
Method Summary
 void bindAttributeAt(int position, Method getter, Method setter)
           
 void bindOperationAt(int position, Method method)
           
 Object getAttribute(String attribute)
           
 AttributeList getAttributes(String[] attributes)
           
 MBeanInfo getMBeanInfo()
           
protected  MBeanNotificationInfo[] getNotificationInfo()
           
 String getResourceClassName()
           
protected  Object getResourceObject()
           
 Object invoke(String actionName, Object[] params, String[] signature)
           
protected  String opKeyString(String name, String[] signature)
           
 void setAttribute(Attribute attribute)
           
 AttributeList setAttributes(AttributeList attributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectedMBeanDispatcher

public ReflectedMBeanDispatcher(MBeanInfo mbinfo,
                                AttributeOperationResolver resolver,
                                Object resource)
Method Detail

bindOperationAt

public void bindOperationAt(int position,
                            Method method)

bindAttributeAt

public void bindAttributeAt(int position,
                            Method getter,
                            Method setter)

getResourceClassName

public String getResourceClassName()

getAttribute

public Object getAttribute(String attribute)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
Specified by:
getAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Specified by:
setAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

getAttributes

public AttributeList getAttributes(String[] attributes)
Specified by:
getAttributes in interface DynamicMBean

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Specified by:
setAttributes in interface DynamicMBean

invoke

public Object invoke(String actionName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Specified by:
invoke in interface DynamicMBean
Throws:
MBeanException
ReflectionException

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean

getNotificationInfo

protected MBeanNotificationInfo[] getNotificationInfo()

getResourceObject

protected Object getResourceObject()

opKeyString

protected final String opKeyString(String name,
                                   String[] signature)


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.