javax.management.DynamicMBean
LogMBean
public class ObjectMBean
extends java.lang.Object
implements javax.management.DynamicMBean
A dynamic MBean that can wrap an arbitary Object instance. the attributes and methods exposed by this bean are controlled by the merge of property bundles discovered by names related to all superclasses and all superinterfaces.
Attributes and methods exported may be "Object" and must exist on the wrapped object, or "MBean" and must exist on a subclass of OBjectMBean or "MObject" which exists on the wrapped object, but whose values are converted to MBean object names.
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.Object |
_managed |
Constructor | Description |
---|---|
ObjectMBean(java.lang.Object managedObject) |
Modifier and Type | Method | Description |
---|---|---|
javax.management.MBeanAttributeInfo |
defineAttribute(java.lang.reflect.Method method,
ManagedAttribute attributeAnnotation) |
TODO update to new behavior
Define an attribute on the managed object.
|
java.lang.Object |
getAttribute(java.lang.String name) |
|
javax.management.AttributeList |
getAttributes(java.lang.String[] names) |
|
java.lang.Object |
getManagedObject() |
|
MBeanContainer |
getMBeanContainer() |
|
javax.management.MBeanInfo |
getMBeanInfo() |
|
java.lang.String |
getObjectContextBasis() |
|
javax.management.ObjectName |
getObjectName() |
|
java.lang.String |
getObjectNameBasis() |
|
java.lang.Object |
invoke(java.lang.String name,
java.lang.Object[] params,
java.lang.String[] signature) |
|
protected boolean |
isAnnotationPresent(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
|
static java.lang.Object |
mbeanFor(java.lang.Object o) |
Create MBean for Object.
|
void |
setAttribute(javax.management.Attribute attr) |
|
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attrs) |
|
protected void |
setMBeanContainer(MBeanContainer container) |
|
protected java.lang.String |
toVariableName(java.lang.String methodName) |
public static java.lang.Object mbeanFor(java.lang.Object o)
class com.acme.MyClass extends com.acme.util.BaseClass implements com.acme.IfaceThen this method would look for the following classes:
o
- The objectpublic java.lang.Object getManagedObject()
public javax.management.ObjectName getObjectName()
public java.lang.String getObjectContextBasis()
public java.lang.String getObjectNameBasis()
protected void setMBeanContainer(MBeanContainer container)
public MBeanContainer getMBeanContainer()
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo
in interface javax.management.DynamicMBean
public java.lang.Object getAttribute(java.lang.String name) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
getAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList getAttributes(java.lang.String[] names)
getAttributes
in interface javax.management.DynamicMBean
public void setAttribute(javax.management.Attribute attr) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
setAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList setAttributes(javax.management.AttributeList attrs)
setAttributes
in interface javax.management.DynamicMBean
public java.lang.Object invoke(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException
invoke
in interface javax.management.DynamicMBean
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.MBeanAttributeInfo defineAttribute(java.lang.reflect.Method method, ManagedAttribute attributeAnnotation)
method
- the method to defineattributeAnnotation
- "description" or "access:description" or "type:access:description" where type is
one of: protected java.lang.String toVariableName(java.lang.String methodName)
protected boolean isAnnotationPresent(java.lang.Class<?> clazz, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Copyright © 1995–2018 Webtide. All rights reserved.