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