public class ObjectMBean extends Object implements DynamicMBean
A dynamic MBean that can wrap an arbitrary Object instance.
The attributes and operations exposed by this bean are controlled by the merge of annotations discovered in all superclasses and all superinterfaces.
Given class com.acme.Foo, then com.acme.jmx.FooMBean
is searched; if found, it is instantiated with the com.acme.Foo
instance passed to the constructor.
Class com.acme.jmx.FooMBean can then override the default
behavior of ObjectMBean and provide a custom ObjectName, or custom
ObjectName properties name and context, etc.
| Constructor and Description |
|---|
ObjectMBean(Object managedObject)
Creates a new ObjectMBean wrapping the given
managedObject. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name) |
AttributeList |
getAttributes(String[] names) |
Object |
getManagedObject() |
MBeanContainer |
getMBeanContainer() |
MBeanInfo |
getMBeanInfo() |
String |
getObjectContextBasis()
Allows to customize the ObjectName property
context. |
ObjectName |
getObjectName()
Allows to customize the ObjectName of this MBean.
|
String |
getObjectNameBasis()
Allows to customize the ObjectName property
name. |
Object |
invoke(String name,
Object[] params,
String[] signature) |
static Object |
mbeanFor(Object o)
Deprecated.
Use
MBeanContainer.mbeanFor(Object) instead |
void |
setAttribute(Attribute attribute) |
AttributeList |
setAttributes(AttributeList attributes) |
public ObjectMBean(Object managedObject)
managedObject.managedObject - the object to managepublic Object getManagedObject()
public ObjectName getObjectName()
Allows to customize the ObjectName of this MBean.
MBeanContainer to create a default ObjectNamepublic String getObjectContextBasis()
Allows to customize the ObjectName property context.
When MBeanContainer creates default ObjectNames, the context property
is "inherited" recursively by MBeans that are children of this MBean; this allows to
"group" descendant MBeans so that it is clear who is the ancestor they belong to.
For example, if object A has a child component B which has children components C, then AMBean can override this method to return "alpha", and then the ObjectNames will be:
contextpublic String getObjectNameBasis()
Allows to customize the ObjectName property name.
Certain components have a natural name and returning it from this method allows it to be part of the ObjectName.
namepublic MBeanContainer getMBeanContainer()
@Deprecated public static Object mbeanFor(Object o)
MBeanContainer.mbeanFor(Object) insteado - the object to wrap as MBeanpublic MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBeanpublic Object getAttribute(String name) throws AttributeNotFoundException, ReflectionException, MBeanException
getAttribute in interface DynamicMBeanAttributeNotFoundExceptionReflectionExceptionMBeanExceptionpublic AttributeList getAttributes(String[] names)
getAttributes in interface DynamicMBeanpublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, ReflectionException, MBeanException
setAttribute in interface DynamicMBeanAttributeNotFoundExceptionReflectionExceptionMBeanExceptionpublic AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBeanpublic Object invoke(String name, Object[] params, String[] signature) throws ReflectionException, MBeanException
invoke in interface DynamicMBeanReflectionExceptionMBeanExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved