|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ModelMBeanInfo interface is used to expose its metadat of management attributes, operations and notifications for use by the management system.
This interface is the implemented by the ModelMBeanInfo for every ModelMBean. An implementation of this interface must be shipped with every JMX Agent.
Java resources wishing to be manageable instatiate the ModelMBean using the MBeanServer's createMBean method. The resource then sets the ModelMBeanInfo and Descriptors for the ModelMBean instance. The attributes, operations, and notifications exposed via the ModelMBeanInfo for the ModelMBean comprise the management interface and are accessible from Mbeans, connectors/adapters like other MBeans. Through the Descriptors, values and methods in the managed application can be defined and mapped to attributes and operations of the ModelMBean. This mapping can be defined during development in a file or dynamically and programmatically at runtime.
Every ModelMBean which is instantiated in the MBeanServer becomes manageable: its attributes, operations, and notifications become remotely accessible through the connectors/adaptors connected to that MBeanServer. A Java object cannot be registered in the MBeanServer unless it is a JMX compliant MBean. By instantiating a ModelMBean, resources are guaranteed that the MBean is valid. MBeanException and RuntimeOperatiosException must be thrown on every public method. This allows for wrappering exceptions from distributed communications (RMI, EJB, etc.)
Method Summary | |
java.lang.Object |
clone()
To clone this ModelMBeanInfo implementation object as ModelMBeanInfoSupport object. |
ModelMBeanAttributeInfo |
getAttribute(java.lang.String inName)
Returns a ModelMBeanAttributeInfo requested by name. |
MBeanAttributeInfo[] |
getAttributes()
Gets the attributes info of the ModelMBean targetted object. |
java.lang.String |
getClassName()
Gets the className of the ModelMBean |
MBeanConstructorInfo[] |
getConstructors()
Gets the constructors info of the ModelMBean targetted object. |
java.lang.String |
getDescription()
Gets the description of this ModelMBean |
Descriptor |
getDescriptor(java.lang.String inDescriptorName,
java.lang.String inDescriptorType)
Returns a Descriptor requested by name and descriptorType. |
Descriptor[] |
getDescriptors(java.lang.String inDescriptorType)
Returns a Descriptor array consisting of all Descriptors for the ModelMBeanInfo including the MBean Descriptor, attribute Descriptors, operation Descriptors, constructor Descriptors, and notification Descriptors. |
Descriptor |
getMBeanDescriptor()
Returns a MBean's descriptor. |
ModelMBeanNotificationInfo |
getNotification(java.lang.String inName)
Returns a ModelMBeanNotificationInfo requested by name. |
MBeanNotificationInfo[] |
getNotifications()
Gets the notifications info emitted by the ModelMBean targetted object. |
ModelMBeanOperationInfo |
getOperation(java.lang.String inName)
Returns a ModelMBeanOperationInfo requested by name. |
MBeanOperationInfo[] |
getOperations()
Gets the operations info of the ModelMBean targetted object. |
void |
setDescriptor(Descriptor inDescriptor,
java.lang.String inDescriptorType)
Adds or replaces descriptors in all the info arrays for the ModelMBean. |
void |
setDescriptors(Descriptor[] inDescriptors)
Adds or replaces descriptors in the ModelMBeanInfo. |
void |
setMBeanDescriptor(Descriptor inDescriptor)
Sets the ModelMBean's descriptor (fully replace). |
Method Detail |
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getClassName()
public java.lang.String getDescription()
public MBeanAttributeInfo[] getAttributes()
public MBeanConstructorInfo[] getConstructors()
public MBeanNotificationInfo[] getNotifications()
public MBeanOperationInfo[] getOperations()
public Descriptor[] getDescriptors(java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptorType
- value of descriptorType field that must be set
for the descriptor to be returned. Must be "mbean",
"attribute", "operation", "constructor", or "notification".
If it is null then all types will be returned.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exceptionpublic void setDescriptors(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
inDescriptors
- The descriptors to be set in the ModelMBeanInfo.
Null elements of the list will be ignored. All descriptors
must have name and descriptorType fields.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps exceptions for illegal
or null argumentspublic Descriptor getDescriptor(java.lang.String inDescriptorName, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptorName
- The name of the descriptor.inDescriptorType
- The type of the descriptor being requested.
If this is null then all types are searched. Valid types
are 'attribute', 'constructor', 'operation', and
'notification'. This value must be equal to the
'descriptorType' field in the descriptor that is returned.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps exceptions for invalid
input name or type.public void setDescriptor(Descriptor inDescriptor, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptor
- The descriptor to be set in the ModelMBean.
It must NOT be null. All descriptors must have name and
descriptorType fields.inDescriptorType
- The type of the descriptor being set. If this
is null then the descriptorType field in the descriptor
is used. If specified this value must be set in the
descriptorType field for the descriptor to be returned.
Must be "mbean","attribute", "operation", "constructor",
or "notification".RuntimeOperationsException
- Wraps exceptions for illegal
or null arguments.public Descriptor getMBeanDescriptor() throws MBeanException, RuntimeOperationsException
MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exceptionpublic void setMBeanDescriptor(Descriptor inDescriptor) throws MBeanException, RuntimeOperationsException
inDescriptor
- This descriptor contains metadata about the MBean
and default policies for persistence and caching for
the entire MBean.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exceptionpublic ModelMBeanAttributeInfo getAttribute(java.lang.String inName) throws MBeanException, RuntimeOperationsException
inName
- The name of the ModelMBeanAttributeInfo to get.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exception for
invalid attribute name or ModelMBeanAttributeInfo to be returned.public ModelMBeanOperationInfo getOperation(java.lang.String inName) throws MBeanException, RuntimeOperationsException
inName
- The name of the ModelMBeanOperationInfo to get.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exception for
invalid attribute name or ModelMBeanAttributeInfo to be returned.public ModelMBeanNotificationInfo getNotification(java.lang.String inName) throws MBeanException, RuntimeOperationsException
inName
- The name of the ModelMBeanNotificationInfo to get.MBeanException
- Wraps another exceptionRuntimeOperationsException
- Wraps another exception
|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |