站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

ReflectedMBeanDispatcher (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.capability
Class ReflectedMBeanDispatcher

java.lang.Object
  extended byorg.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)
          Returns the value of the attribute with the name matching the passed string.
 AttributeList getAttributes(String[] attributes)
          Returns the values of the attributes with names matching the passed string array.
 MBeanInfo getMBeanInfo()
          Returns the management interface that describes this dynamic resource.
protected  MBeanNotificationInfo[] getNotificationInfo()
           
 String getResourceClassName()
           
protected  Object getResourceObject()
           
 Object invoke(String actionName, Object[] params, String[] signature)
          Invokes a resource operation.
protected  String opKeyString(String name, String[] signature)
           
 void setAttribute(Attribute attribute)
          Sets the value of an attribute.
 AttributeList setAttributes(AttributeList attributes)
          Sets the values of the attributes passed as an AttributeList of name and new value pairs.
 
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
Description copied from interface: DynamicMBean
Returns the value of the attribute with the name matching the passed string.

Specified by:
getAttribute in interface DynamicMBean
Parameters:
attribute - the name of the attribute.
Returns:
the value of the attribute.
Throws:
ReflectionException - wraps any error invoking the resource.
MBeanException - wraps any error thrown by the resource when getting the attribute.
AttributeNotFoundException - when there is no such attribute.

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Description copied from interface: DynamicMBean
Sets the value of an attribute. The attribute and new value are passed in the name value pair Attribute.

Specified by:
setAttribute in interface DynamicMBean
Parameters:
attribute - the name and new value of the attribute.
Throws:
MBeanException - wraps any error thrown by the resource when setting the new value.
ReflectionException - wraps any error invoking the resource.
InvalidAttributeValueException - when the new value cannot be converted to the type of the attribute.
AttributeNotFoundException - when there is no such attribute.
See Also:
Attribute

getAttributes

public AttributeList getAttributes(String[] attributes)
Description copied from interface: DynamicMBean
Returns the values of the attributes with names matching the passed string array.

Specified by:
getAttributes in interface DynamicMBean
Parameters:
attributes - the names of the attribute.
Returns:
an AttributeList of name and value pairs.

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Description copied from interface: DynamicMBean
Sets the values of the attributes passed as an AttributeList of name and new value pairs.

Specified by:
setAttributes in interface DynamicMBean
Parameters:
attributes - the name an new value pairs.
Returns:
an AttributeList of name and value pairs that were actually set.

invoke

public Object invoke(String actionName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Description copied from interface: DynamicMBean
Invokes a resource operation.

Specified by:
invoke in interface DynamicMBean
Parameters:
actionName - the name of the operation to perform.
params - the parameters to pass to the operation.
signature - the signartures of the parameters.
Returns:
the result of the operation.
Throws:
ReflectionException - wraps any error invoking the resource.
MBeanException - wraps any error thrown by the resource when performing the operation.

getMBeanInfo

public MBeanInfo getMBeanInfo()
Description copied from interface: DynamicMBean
Returns the management interface that describes this dynamic resource. It is the responsibility of the implementation to make sure the description is accurate.

Specified by:
getMBeanInfo in interface DynamicMBean
Returns:
the management interface.

getNotificationInfo

protected MBeanNotificationInfo[] getNotificationInfo()

getResourceObject

protected Object getResourceObject()

opKeyString

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.