|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.StandardMBean
A helper class to allow standard mbeans greater control over their management interface.
Extending this class actually makes the mbean a dynamic mbean, but with the convenience of a standard mbean.
Constructor Summary | |
protected |
StandardMBean(Class mbeanInterface)
Construct a DynamicMBean from this object and the passed management interface class. |
|
StandardMBean(Object implementation,
Class mbeanInterface)
Construct a DynamicMBean from the given implementation object and the passed management interface class. |
Method Summary | |
protected void |
cacheMBeanInfo(MBeanInfo info)
Sets the cached mbean info |
Object |
getAttribute(String attribute)
Returns the value of the attribute with the name matching the passed string. |
AttributeList |
getAttributes(String[] attributes)
Returns the values of the attributes with names matching the passed string array. |
protected MBeanInfo |
getCachedMBeanInfo()
Retrieve the cached mbean info |
protected String |
getClassName(MBeanInfo info)
Retrieve the class name of the mbean |
protected MBeanConstructorInfo[] |
getConstructors(MBeanConstructorInfo[] constructors,
Object implementation)
Retrieve the constructors |
protected String |
getDescription(MBeanAttributeInfo info)
Retrieve the description of the mbean attribute |
protected String |
getDescription(MBeanConstructorInfo info)
Retrieve the description of the mbean constructor |
protected String |
getDescription(MBeanConstructorInfo info,
MBeanParameterInfo param,
int sequence)
Retrieve the description of the mbean constructor parameter |
protected String |
getDescription(MBeanFeatureInfo info)
Retrieve the description of the mbean feature |
protected String |
getDescription(MBeanInfo info)
Retrieve the description of the mbean |
protected String |
getDescription(MBeanOperationInfo info)
Retrieve the description of the mbean operation |
protected String |
getDescription(MBeanOperationInfo info,
MBeanParameterInfo param,
int sequence)
Retrieve the description of the mbean operation parameter |
protected int |
getImpact(MBeanOperationInfo info)
Retrieve the impact of the mbean operation |
Object |
getImplementation()
Retrieve the implementation object |
Class |
getImplementationClass()
Retrieve the implementation class |
MBeanInfo |
getMBeanInfo()
Returns the management interface that describes this dynamic resource. |
Class |
getMBeanInterface()
Retrieve the management interface |
protected String |
getParameterName(MBeanConstructorInfo info,
MBeanParameterInfo param,
int sequence)
Retrieve the parameter name for a constructor |
protected String |
getParameterName(MBeanOperationInfo info,
MBeanParameterInfo param,
int sequence)
Retrieve the parameter name for an operation |
Object |
invoke(String actionName,
Object[] params,
String[] signature)
Invokes a resource operation. |
void |
setAttribute(Attribute attribute)
Sets the value of an attribute. |
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of the attributes passed as an AttributeList of name and new value pairs. |
void |
setImplementation(Object implementation)
Replace the implementation object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardMBean(Object implementation, Class mbeanInterface) throws NotCompliantMBeanException
implementation
- the object implementing the mbeanmbeanInterface
- the management interface of the mbean
IllegalArgumentException
- for a null implementation
NotCompliantMBeanException
- if the management interface
does not follow the JMX design patterns or the implementation
does not implement the interfaceprotected StandardMBean(Class mbeanInterface) throws NotCompliantMBeanException
Used in subclassing
mbeanInterface
- the management interface of the mbean
NotCompliantMBeanException
- if the management interface
does not follow the JMX design patterns or this
does not implement the interfaceMethod Detail |
public Object getImplementation()
public void setImplementation(Object implementation) throws NotCompliantMBeanException
implementation
- the new implementation
IllegalArgumentException
- for a null parameter
NotCompliantMBeanException
- if the new implementation
does not implement the interface supplied at
constructionpublic Class getImplementationClass()
public final Class getMBeanInterface()
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
DynamicMBean
getAttribute
in interface DynamicMBean
attribute
- the name of the attribute.
ReflectionException
- wraps any error invoking the resource.
MBeanException
- wraps any error thrown by the resource when
getting the attribute.
AttributeNotFoundException
- when there is no such attribute.public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
DynamicMBean
Attribute
.
setAttribute
in interface DynamicMBean
attribute
- the name and new value of the attribute.
MBeanException
- wraps any error thrown by the resource when
setting the new value.
ReflectionException
- wraps any error invoking the resource.
InvalidAttributeValueException
- when the new value cannot be
converted to the type of the attribute.
AttributeNotFoundException
- when there is no such attribute.Attribute
public AttributeList getAttributes(String[] attributes)
DynamicMBean
getAttributes
in interface DynamicMBean
attributes
- the names of the attribute.
AttributeList
of name and value pairs.public AttributeList setAttributes(AttributeList attributes)
DynamicMBean
AttributeList
of name and new value pairs.
setAttributes
in interface DynamicMBean
attributes
- the name an new value pairs.
AttributeList
of name and value pairs
that were actually set.public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
DynamicMBean
invoke
in interface DynamicMBean
actionName
- the name of the operation to perform.params
- the parameters to pass to the operation.signature
- the signartures of the parameters.
ReflectionException
- wraps any error invoking the resource.
MBeanException
- wraps any error thrown by the resource when
performing the operation.public MBeanInfo getMBeanInfo()
DynamicMBean
getMBeanInfo
in interface DynamicMBean
protected String getClassName(MBeanInfo info)
info
- the default mbeaninfo derived by reflection
protected String getDescription(MBeanInfo info)
info
- the default mbeaninfo derived by reflection
protected String getDescription(MBeanFeatureInfo info)
info
- the default mbeanfeatureinfo derived by reflection
protected String getDescription(MBeanAttributeInfo info)
info
- the default mbeanattributeinfo derived by reflection
protected String getDescription(MBeanConstructorInfo info)
info
- the default mbeanconstructorinfo derived by reflection
protected String getDescription(MBeanOperationInfo info)
info
- the default mbeanoperationinfo derived by reflection
protected String getDescription(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence)
info
- the default mbeanconstructorinfo derived by reflectionparam
- the parameter informationsequence
- the parameter index, starting with zero
protected String getDescription(MBeanOperationInfo info, MBeanParameterInfo param, int sequence)
info
- the default mbeanoperationinfo derived by reflectionparam
- the parameter informationsequence
- the parameter index, starting with zero
protected String getParameterName(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence)
info
- the default mbeanconstructorinfo derived by reflectionparam
- the parameter informationsequence
- the parameter index, starting with zero
protected String getParameterName(MBeanOperationInfo info, MBeanParameterInfo param, int sequence)
info
- the default mbeanoperationinfo derived by reflectionparam
- the parameter informationsequence
- the parameter index, starting with zero
protected int getImpact(MBeanOperationInfo info)
info
- the default mbeanoperationinfo derived by reflection
protected MBeanConstructorInfo[] getConstructors(MBeanConstructorInfo[] constructors, Object implementation)
constructors
- the default constructors derived by reflectionimplementation
- the implementation
protected MBeanInfo getCachedMBeanInfo()
protected void cacheMBeanInfo(MBeanInfo info)
info
- the mbeaninfo to cache, can be null to erase the cache
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |