javax.management.modelmbean
Interface ModelMBeanInfo
All Known Implementing Classes:
- ModelMBeanInfoSupport
- public interface
ModelMBeanInfo
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 objec 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.)
Version:
- 1.3
Author:
- Max Parlione
Method Summary
java.lang.Object clone()
Overrides: clone in class java.lang.Objec (We can't find a way to write 'Overrides' to generate a javadoc)ModelMBeanAttributeInfo java.lang.String)">getAttribute(java.lang.String inName)
returns a ModelMBeanAttributeInfo requested by name.MBeanAttributeInfo[] getAttributes()
java.lang.String getClassName()
MBeanConstructorInfo[] getConstructors()
java.lang.String getDescription()
Descriptor java.lang.String, java.lang.String)">getDescriptor(java.lang.String inDescriptorName, java.lang.String inDescriptorType)
returns a Descriptor requested by name and descriptorType.Descriptor[] java.lang.String)">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 java.lang.String)">getNotification(java.lang.String inName)
returns a ModelMBeanNotificationInfo requested by name.MBeanNotificationInfo[] getNotifications()
ModelMBeanOperationInfo java.lang.String)">getOperation(java.lang.String inName)
returns a ModelMBeanOperationInfo requested by name.MBeanOperationInfo[] getOperations()
void java.lang.String)">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 javax.management.Descriptor)">setMBeanDescriptor(Descriptor inDescriptor)
sets the ModelMBean's descriptor (fully replace).java.lang.String)">
Method Detail
getDescriptors
public Descriptor[]getDescriptors
(java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
- returns a Descriptor array consisting of all Descriptors for the ModelMBeanInfo including the MBean Descriptor, attribute Descriptors, operation Descriptors, constructor Descriptors, and notification Descriptors.
Parameters:
- 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.
Returns:
- Descriptor array containing all descriptors for the ModelMBean
- Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - Wraps another exception
setDescriptors
public voidsetDescriptors
(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
- adds or replaces descriptors in the ModelMBeanInfo.
Parameters:
- 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.
Returns:
- void
- Throws:
- RuntimeOperationsException - Wraps exceptions for illegal or null arguments
java.lang.String, java.lang.String)">
getDescriptor
public DescriptorgetDescriptor
(java.lang.String inDescriptorName, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
- returns a Descriptor requested by name and descriptorType.
Parameters:
- String - descriptorName The name of the descriptor.
- Returns:
- Descriptor containing the descriptor for the ModelMBean with the same name and descriptorType. If a descriptor is not found, null is returned.
Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - Wraps exceptions for invalid input name or type.
java.lang.String)">
setDescriptor
public voidsetDescriptor
(Descriptor inDescriptor, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
- adds or replaces descriptors in all the info arrays for the ModelMBean.
Parameters:
- Descriptor - The descriptor to be set in the ModelMBean. It must NOT be null. All descriptors must have name and descriptorType fields.
- String - descriptorType 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".
Returns:
- void
- Throws:
- RuntimeOperationsException - Wraps exceptions for illegal or null arguments
getMBeanDescriptor
public DescriptorgetMBeanDescriptor
() throws MBeanException, RuntimeOperationsException
- returns a MBean's descriptor. This descriptor contains metadata about the MBean and default policies for persistence and caching for the entire MBean. Policies may be overridden by descriptors associated with attribute, constructors, or operations with the same fieldNames.
Throws:
- MBeanException - - Wraps another exception
- RuntimeOperationsException - - Wraps another exception
javax.management.Descriptor)">
setMBeanDescriptor
public voidsetMBeanDescriptor
(Descriptor inDescriptor) throws MBeanException, RuntimeOperationsException
- sets the ModelMBean's descriptor (fully replace). This descriptor contains metadata about the MBean and default policies for persistence and caching for the entire MBean. Policies may be overridden by descriptors associated with attribute, constructors, or operations with the same fieldNames. This operation does a complete replacement of the descriptor, no merging is done. The default MBeanDescriptor is
Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - Wraps another exception
java.lang.String)">
getAttribute
public ModelMBeanAttributeInfogetAttribute
(java.lang.String inName) throws MBeanException, RuntimeOperationsException
- returns a ModelMBeanAttributeInfo requested by name.
Parameters:
- String - inName The name of the ModelMBeanAttributeInfo to get.
Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - - Wraps another exception for invalid attribute name or ModelMBeanAttributeInfo to be returned.
java.lang.String)">
getOperation
public ModelMBeanOperationInfogetOperation
(java.lang.String inName) throws MBeanException, RuntimeOperationsException
- returns a ModelMBeanOperationInfo requested by name.
Parameters:
- String - inName The name of the ModelMBeanOperationInfo to get.
Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - Wraps another exception for invalid attribute name or ModelMBeanAttributeInfo to be returned.
java.lang.String)">
getNotification
public ModelMBeanNotificationInfogetNotification
(java.lang.String inName) throws MBeanException, RuntimeOperationsException
- returns a ModelMBeanNotificationInfo requested by name.
Parameters:
- String - inName The name of the ModelMBeanNotificationInfo to get.
Throws:
- MBeanException - Wraps another exception
- RuntimeOperationsException - Wraps another exception
clone
public java.lang.Objectclone
()
- Overrides: clone in class java.lang.Objec (We can't find a way to write 'Overrides' to generate a javadoc)
Overrides:
- clone in class java.lang.Object
getAttributes
public MBeanAttributeInfo[]getAttributes
()
getClassName
public java.lang.StringgetClassName
()
getConstructors
public MBeanConstructorInfo[]getConstructors
()
getDescription
public java.lang.StringgetDescription
()
getNotifications
public MBeanNotificationInfo[]getNotifications
()
getOperations
public MBeanOperationInfo[]getOperations
()