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 withMBean
annotation.- 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 Object
getAttribute(String name)
AttributeList
getAttributes(String[] names)
MBeanInfo
getMBeanInfo()
String
getObjectName()
Throwable
getRootCause(Throwable throwable)
Object
invoke(String name, Object[] args, String[] sig)
void
setAttribute(Attribute attribute)
AttributeList
setAttributes(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:
getMBeanInfo
in interfaceDynamicMBean
-
getAttribute
public Object getAttribute(String name) throws AttributeNotFoundException
- Specified by:
getAttribute
in interfaceDynamicMBean
- Throws:
AttributeNotFoundException
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException
- Specified by:
setAttribute
in interfaceDynamicMBean
- Throws:
AttributeNotFoundException
MBeanException
-
getAttributes
public AttributeList getAttributes(String[] names)
- Specified by:
getAttributes
in interfaceDynamicMBean
-
setAttributes
public AttributeList setAttributes(AttributeList list)
- Specified by:
setAttributes
in interfaceDynamicMBean
-
invoke
public Object invoke(String name, Object[] args, String[] sig) throws MBeanException, ReflectionException
- Specified by:
invoke
in interfaceDynamicMBean
- Throws:
MBeanException
ReflectionException
-
getObjectName
public String getObjectName()
-
-