站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

DynamicMBean (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


javax.management
Interface DynamicMBean

All Known Subinterfaces:
MBeanInvoker, ModelMBean
All Known Implementing Classes:
AbstractMBeanInvoker, DynamicMBeanSupport, ModelMBeanInvoker, ReflectedMBeanDispatcher, RequiredModelMBean, StandardMBean

public interface DynamicMBean

The DynamicMBean interface is implemented by resources that expose their definition at runtime. The implementation exposes its attributes, methods and notifications through the getMBeanInfo method.

From a management point of view, the DynamicMBean behaves like any other MBean.

It is the responsibility of the implementation to ensure the MBean works as self-described. The MBeanServer makes no attempt to validate it.

Although the self-description is retrieved at runtime and is therefore dynamic, the implementation must not change it once it has been retrieved. A manager can expect the attributes, methods and notifications to remain constant. It is the implementation's responsibility to conform to this behaviour.

Version:
$Revision: 1.2 $
Author:
Adrian Brock.
See Also:
MBeanInfo

Method Summary
 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.
 MBeanInfo getMBeanInfo()
          Returns the management interface that describes this dynamic resource.
 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.
 

Method Detail

getAttribute

public Object getAttribute(String attribute)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
Returns the value of the attribute with the name matching the passed string.

Parameters:
attribute - the name of the attribute.
Returns:
the value of the attribute.
Throws:
AttributeNotFoundException - when there is no such attribute.
MBeanException - wraps any error thrown by the resource when getting the attribute.
ReflectionException - wraps any error invoking the resource.

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Sets the value of an attribute. The attribute and new value are passed in the name value pair Attribute.

Parameters:
attribute - the name and new value of the attribute.
Throws:
AttributeNotFoundException - when there is no such attribute.
InvalidAttributeValueException - when the new value cannot be converted to the type of the attribute.
MBeanException - wraps any error thrown by the resource when setting the new value.
ReflectionException - wraps any error invoking the resource.
See Also:
Attribute

getAttributes

public AttributeList getAttributes(String[] attributes)
Returns the values of the attributes with names matching the passed string array.

Parameters:
attributes - the names of the attribute.
Returns:
an AttributeList of name and value pairs.

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Sets the values of the attributes passed as an AttributeList of name and new value pairs.

Parameters:
attributes - the name an new value pairs.
Returns:
an AttributeList of name and value pairs that were actually set.

invoke

public Object invoke(String actionName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Invokes a resource operation.

Parameters:
actionName - the name of the operation to perform.
params - the parameters to pass to the operation.
signature - the signartures of the parameters.
Returns:
the result of the operation.
Throws:
MBeanException - wraps any error thrown by the resource when performing the operation.
ReflectionException - wraps any error invoking the resource.

getMBeanInfo

public MBeanInfo getMBeanInfo()
Returns the management interface that describes this dynamic resource. It is the responsibility of the implementation to make sure the description is accurate.

Returns:
the management interface.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.