public class OpenMBean extends Object implements DynamicMBean
DynamicMBean and returns an OpenMBeanInfo object.
SimpleType and ArrayType are supported (no composite type).| Modifier | Constructor and Description |
|---|---|
protected |
OpenMBean()
Creates a new OpenMBean instance and instrospects its child class for attributes
and operations.
|
| Modifier and Type | Method and Description |
|---|---|
static OpenMBean |
createMBean(Class<?> beanClass,
Object instance)
Creates a new OpenMBean by introspecting the beanClass parameter and wrapping
the instance parameter.
|
static OpenMBean |
createMBean(Object instance)
Creates a new OpenMBean by introspecting and wrapping the instance parameter.
|
Object |
getAttribute(String attribute) |
AttributeList |
getAttributes(String[] names) |
MBeanInfo |
getMBeanInfo() |
Object |
invoke(String actionName,
Object[] params,
String[] signature) |
void |
setAttribute(Attribute attribute) |
AttributeList |
setAttributes(AttributeList attributes) |
protected OpenMBean()
public static OpenMBean createMBean(Object instance)
instance - an instance of a bean to introspect.public static OpenMBean createMBean(Class<?> beanClass, Object instance)
beanClass - a class (or interface) used for introspection.instance - the bean to encapsulate.IllegalArgumentException - if instance is not an instance of beanClass.public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute in interface DynamicMBeanAttributeNotFoundExceptionMBeanExceptionReflectionExceptionpublic AttributeList getAttributes(String[] names)
getAttributes in interface DynamicMBeanpublic MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBeanpublic Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke in interface DynamicMBeanMBeanExceptionReflectionExceptionpublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionExceptionpublic AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBean