public class ReflectionMBeanInvoker extends java.lang.Object implements MBeanInvoker
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.Object[] |
EMPTY_ARGS
A zero-length Object[] that indicates a parameterless argument list of a method
|
protected static java.lang.String[] |
EMPTY_PARAMS
A zero-length String[] that indicates a parameterless signature of a method.
|
| Constructor and Description |
|---|
ReflectionMBeanInvoker() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
doInvoke(MBeanMetaData metadata,
java.lang.String method,
java.lang.String[] signature,
java.lang.Object[] args)
Centralizes exception handling necessary to convert exceptions thrown by MBean's methods to
JMX exceptions.
|
java.lang.Object |
getAttribute(MBeanMetaData metadata,
java.lang.String attribute)
Returns the value of the specified attribute.
|
protected java.lang.String |
getMethodForAttribute(javax.management.MBeanAttributeInfo attribute,
boolean forRead)
Returns the method name for the given attribute.
|
protected javax.management.MBeanAttributeInfo |
getStandardAttributeInfo(MBeanMetaData metadata,
java.lang.String attribute,
boolean forWrite)
Returns the MBeanAttributeInfo for the given attribute, or null if the attribute
is not a management attribute.
|
protected java.lang.reflect.Method |
getStandardManagementMethod(MBeanMetaData metadata,
java.lang.String name,
java.lang.String[] signature)
Returns a java.lang.reflect.Method object for the given method name and signature.
|
protected javax.management.MBeanOperationInfo |
getStandardOperationInfo(MBeanMetaData metadata,
java.lang.String method,
java.lang.String[] signature)
Returns the MBeanOperationInfo for the given operation, or null if the operation
is not a management operation.
|
java.lang.Object |
invoke(MBeanMetaData metadata,
java.lang.String method,
java.lang.String[] params,
java.lang.Object[] args)
Invokes the specified operation on the MBean instance
|
protected java.lang.Object |
invokeImpl(MBeanMetaData metadata,
java.lang.String method,
java.lang.String[] signature,
java.lang.Object[] args)
Performs the actual invocation of the MBean's method.
|
void |
setAttribute(MBeanMetaData metadata,
javax.management.Attribute attribute)
Sets the value of the specified attribute.
|
protected static final java.lang.String[] EMPTY_PARAMS
protected static final java.lang.Object[] EMPTY_ARGS
public java.lang.Object invoke(MBeanMetaData metadata, java.lang.String method, java.lang.String[] params, java.lang.Object[] args) throws javax.management.MBeanException, javax.management.ReflectionException
MBeanInvokerinvoke in interface MBeanInvokerjavax.management.MBeanExceptionjavax.management.ReflectionExceptionpublic java.lang.Object getAttribute(MBeanMetaData metadata, java.lang.String attribute) throws javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.ReflectionException
MBeanInvokergetAttribute in interface MBeanInvokerjavax.management.MBeanExceptionjavax.management.AttributeNotFoundExceptionjavax.management.ReflectionExceptionpublic void setAttribute(MBeanMetaData metadata, javax.management.Attribute attribute) throws javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.ReflectionException
MBeanInvokersetAttribute in interface MBeanInvokerjavax.management.MBeanExceptionjavax.management.AttributeNotFoundExceptionjavax.management.InvalidAttributeValueExceptionjavax.management.ReflectionExceptionprotected java.lang.Object doInvoke(MBeanMetaData metadata, java.lang.String method, java.lang.String[] signature, java.lang.Object[] args) throws javax.management.ReflectionException, javax.management.MBeanException, mx4j.server.ReflectionMBeanInvoker.BadArgumentException
invokeImpl(mx4j.server.MBeanMetaData, java.lang.String, java.lang.String[], java.lang.Object[])javax.management.ReflectionExceptionjavax.management.MBeanExceptionmx4j.server.ReflectionMBeanInvoker.BadArgumentExceptionprotected java.lang.Object invokeImpl(MBeanMetaData metadata, java.lang.String method, java.lang.String[] signature, java.lang.Object[] args) throws java.lang.Throwable
doInvoke(mx4j.server.MBeanMetaData, java.lang.String, java.lang.String[], java.lang.Object[])
takes care of converting them to JMX exceptions.java.lang.Throwableprotected javax.management.MBeanOperationInfo getStandardOperationInfo(MBeanMetaData metadata, java.lang.String method, java.lang.String[] signature)
protected javax.management.MBeanAttributeInfo getStandardAttributeInfo(MBeanMetaData metadata, java.lang.String attribute, boolean forWrite)
protected java.lang.String getMethodForAttribute(javax.management.MBeanAttributeInfo attribute,
boolean forRead)
protected java.lang.reflect.Method getStandardManagementMethod(MBeanMetaData metadata, java.lang.String name, java.lang.String[] signature) throws javax.management.ReflectionException
javax.management.ReflectionException