Class ReflectionMbean
java.lang.Object
com.j256.simplejmx.server.ReflectionMbean
- All Implemented Interfaces:
DynamicMBean
This wraps an object that has been registered in the server using
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.- Author:
- graywatson
-
Constructor Summary
ConstructorsConstructorDescriptionReflectionMbean(PublishAllBeanWrapper wrapper) Create a mbean associated with a wrapped object that exposes all public fields and methods.ReflectionMbean(Object target, String description) Create a mbean associated with a target object that must have aJmxResourceannotation.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. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String attributeName) getAttributes(String[] attributeNames) voidsetAttribute(Attribute attribute) setAttributes(AttributeList attributes)
-
Constructor Details
-
ReflectionMbean
Create a mbean associated with a target object that must have aJmxResourceannotation. -
ReflectionMbean
Create a mbean associated with a wrapped object that exposes all public fields and methods. -
ReflectionMbean
public 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.
-
-
Method Details
-
getMBeanInfo
- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
getAttribute
public Object getAttribute(String attributeName) throws AttributeNotFoundException, ReflectionException - Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionReflectionException
-
getAttributes
- Specified by:
getAttributesin interfaceDynamicMBean
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, ReflectionException - Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionReflectionException
-
setAttributes
- Specified by:
setAttributesin interfaceDynamicMBean
-
invoke
public Object invoke(String actionName, Object[] params, String[] signatureTypes) throws MBeanException, ReflectionException - Specified by:
invokein interfaceDynamicMBean- Throws:
MBeanExceptionReflectionException
-