public class ReflectionMbean extends Object implements DynamicMBean
JmxServer.register(Object)
. We wrap the
object so we can expose its attributes and operations using annotations and reflection. This handles the JMX server
calls to attributes and operations by calling through the delegation object.Constructor and Description |
---|
ReflectionMbean(Object target,
String description)
Create a mbean associated with a target object that must have a
JmxResource annotation. |
ReflectionMbean(Object target,
String description,
JmxAttributeFieldInfo[] attributeFieldInfos,
JmxAttributeMethodInfo[] attributeMethodInfos,
JmxOperationInfo[] operationInfos,
boolean ignoreErrors)
Create a mbean associated with a target object with user provided attribute and operation information.
|
ReflectionMbean(PublishAllBeanWrapper wrapper)
Create a mbean associated with a wrapped object that exposes all public fields and methods.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String attributeName) |
AttributeList |
getAttributes(String[] attributeNames) |
MBeanInfo |
getMBeanInfo() |
Object |
invoke(String actionName,
Object[] params,
String[] signatureTypes) |
void |
setAttribute(Attribute attribute) |
AttributeList |
setAttributes(AttributeList attributes) |
public ReflectionMbean(Object target, String description)
JmxResource
annotation.public ReflectionMbean(PublishAllBeanWrapper wrapper)
public ReflectionMbean(Object target, String description, JmxAttributeFieldInfo[] attributeFieldInfos, JmxAttributeMethodInfo[] attributeMethodInfos, JmxOperationInfo[] operationInfos, boolean ignoreErrors)
public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean
public Object getAttribute(String attributeName) throws AttributeNotFoundException, ReflectionException
getAttribute
in interface DynamicMBean
AttributeNotFoundException
ReflectionException
public AttributeList getAttributes(String[] attributeNames)
getAttributes
in interface DynamicMBean
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, ReflectionException
setAttribute
in interface DynamicMBean
AttributeNotFoundException
ReflectionException
public AttributeList setAttributes(AttributeList attributes)
setAttributes
in interface DynamicMBean
public Object invoke(String actionName, Object[] params, String[] signatureTypes) throws MBeanException, ReflectionException
invoke
in interface DynamicMBean
MBeanException
ReflectionException
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.