Package org.infinispan.jmx
Class ResourceDMBean
- java.lang.Object
-
- org.infinispan.jmx.ResourceDMBean
-
- All Implemented Interfaces:
DynamicMBean
public class ResourceDMBean extends Object implements DynamicMBean
This class was entirely copied from JGroups 2.7 (same name there). Couldn't simply reuse it because JGroups does not ship with MBean, ManagedAttribute and ManagedOperation. The original JGroup's ResourceDMBean logic has been modified so that invoke() method checks whether the operation called has been exposed as aManagedOperation, otherwise the call fails. JGroups deviated from this logic on purpose because they liked the fact that you could expose all class methods by simply annotating class withMBeanannotation.- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Galder ZamarreƱo
-
-
Constructor Summary
Constructors Constructor Description ResourceDMBean(Object instance, ManageableComponentMetadata mBeanMetadata)ResourceDMBean(Object instance, ManageableComponentMetadata mBeanMetadata, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)AttributeListgetAttributes(String[] names)MBeanInfogetMBeanInfo()StringgetObjectName()ThrowablegetRootCause(Throwable throwable)Objectinvoke(String name, Object[] args, String[] sig)voidsetAttribute(Attribute attribute)AttributeListsetAttributes(AttributeList list)
-
-
-
Constructor Detail
-
ResourceDMBean
public ResourceDMBean(Object instance, ManageableComponentMetadata mBeanMetadata) throws NoSuchFieldException, ClassNotFoundException
-
ResourceDMBean
public ResourceDMBean(Object instance, ManageableComponentMetadata mBeanMetadata, String name) throws NoSuchFieldException, ClassNotFoundException
-
-
Method Detail
-
getMBeanInfo
public MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
getAttribute
public Object getAttribute(String name) throws AttributeNotFoundException
- Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundException
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException
- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionMBeanException
-
getAttributes
public AttributeList getAttributes(String[] names)
- Specified by:
getAttributesin interfaceDynamicMBean
-
setAttributes
public AttributeList setAttributes(AttributeList list)
- Specified by:
setAttributesin interfaceDynamicMBean
-
invoke
public Object invoke(String name, Object[] args, String[] sig) throws MBeanException, ReflectionException
- Specified by:
invokein interfaceDynamicMBean- Throws:
MBeanExceptionReflectionException
-
getObjectName
public String getObjectName()
-
-