mx4j.server

Class ReflectionMBeanInvoker

public class ReflectionMBeanInvoker extends Object implements MBeanInvoker

Stateless MBeanInvoker that uses reflection to invoke on MBean instances.

Version: $Revision: 1.6 $

Field Summary
protected static Object[]EMPTY_ARGS
A zero-length Object[] that indicates a parameterless argument list of a method
protected static String[]EMPTY_PARAMS
A zero-length String[] that indicates a parameterless signature of a method.
Method Summary
protected ObjectdoInvoke(MBeanMetaData metadata, String method, String[] signature, Object[] args)
Centralizes exception handling necessary to convert exceptions thrown by MBean's methods to JMX exceptions.
ObjectgetAttribute(MBeanMetaData metadata, String attribute)
protected StringgetMethodForAttribute(MBeanAttributeInfo attribute, boolean forRead)
Returns the method name for the given attribute.
protected MBeanAttributeInfogetStandardAttributeInfo(MBeanMetaData metadata, String attribute, boolean forWrite)
Returns the MBeanAttributeInfo for the given attribute, or null if the attribute is not a management attribute.
protected MethodgetStandardManagementMethod(MBeanMetaData metadata, String name, String[] signature)
Returns a java.lang.reflect.Method object for the given method name and signature.
protected MBeanOperationInfogetStandardOperationInfo(MBeanMetaData metadata, String method, String[] signature)
Returns the MBeanOperationInfo for the given operation, or null if the operation is not a management operation.
Objectinvoke(MBeanMetaData metadata, String method, String[] params, Object[] args)
protected ObjectinvokeImpl(MBeanMetaData metadata, String method, String[] signature, Object[] args)
Performs the actual invocation of the MBean's method.
voidsetAttribute(MBeanMetaData metadata, Attribute attribute)

Field Detail

EMPTY_ARGS

protected static final Object[] EMPTY_ARGS
A zero-length Object[] that indicates a parameterless argument list of a method

EMPTY_PARAMS

protected static final String[] EMPTY_PARAMS
A zero-length String[] that indicates a parameterless signature of a method.

Method Detail

doInvoke

protected Object doInvoke(MBeanMetaData metadata, String method, String[] signature, Object[] args)
Centralizes exception handling necessary to convert exceptions thrown by MBean's methods to JMX exceptions. Delegates the actual invocation to ReflectionMBeanInvoker

getAttribute

public Object getAttribute(MBeanMetaData metadata, String attribute)

getMethodForAttribute

protected String getMethodForAttribute(MBeanAttributeInfo attribute, boolean forRead)
Returns the method name for the given attribute.

getStandardAttributeInfo

protected MBeanAttributeInfo getStandardAttributeInfo(MBeanMetaData metadata, String attribute, boolean forWrite)
Returns the MBeanAttributeInfo for the given attribute, or null if the attribute is not a management attribute.

getStandardManagementMethod

protected Method getStandardManagementMethod(MBeanMetaData metadata, String name, String[] signature)
Returns a java.lang.reflect.Method object for the given method name and signature.

getStandardOperationInfo

protected MBeanOperationInfo getStandardOperationInfo(MBeanMetaData metadata, String method, String[] signature)
Returns the MBeanOperationInfo for the given operation, or null if the operation is not a management operation.

invoke

public Object invoke(MBeanMetaData metadata, String method, String[] params, Object[] args)

invokeImpl

protected Object invokeImpl(MBeanMetaData metadata, String method, String[] signature, Object[] args)
Performs the actual invocation of the MBean's method. Exceptions thrown by the MBean's methods should not be catched, since ReflectionMBeanInvoker takes care of converting them to JMX exceptions.

setAttribute

public void setAttribute(MBeanMetaData metadata, Attribute attribute)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.