XMOJO 5 API Docs

javax.management.modelmbean
Class ModelMBeanInfoSupport

java.lang.Object
  |
  +--javax.management.MBeanInfo
        |
        +--javax.management.modelmbean.ModelMBeanInfoSupport
All Implemented Interfaces:
java.lang.Cloneable, ModelMBeanInfo, java.io.Serializable

public class ModelMBeanInfoSupport
extends MBeanInfo
implements ModelMBeanInfo, java.io.Serializable

This class represents the meta data for ModelMBeans. Descriptors have been added on the meta data objects.

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 and operations exposed via the ModelMBeanInfo for the ModelMBean 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 and operations 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 RuntimeOperationsException must be thrown on every public method. This allows for wrappering exceptions from distributed communications (RMI, EJB, etc.)

See Also:
Serialized Form

Constructor Summary
ModelMBeanInfoSupport(ModelMBeanInfo mbi)
          Constructs a ModelMBeanInfoSupport which is a duplicate of the one passed in.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
          Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
          Creates a ModelMBeanInfoSupport with the provided information
 
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()
          Returns the name of the Java class of the MBean described by this ModelMBeanInfo.
 ModelMBeanConstructorInfo getConstructor(java.lang.String inName)
          Returns a ModelMBeanConstructorInfo requested by name.
 MBeanConstructorInfo[] getConstructors()
          Gets the constructors info of the ModelMBean targetted object.
 java.lang.String getDescription()
          Returns a human readable description of the MBean.
 Descriptor getDescriptor(java.lang.String inDescriptorName)
          Returns a Descriptor requested by name
 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).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(ModelMBeanInfo mbi)
Constructs a ModelMBeanInfoSupport which is a duplicate of the one passed in.
Parameters:
mbi - the ModelMBeanInfo instance from which the ModelMBeanInfo being created is initialized

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(java.lang.String className,
                             java.lang.String description,
                             ModelMBeanAttributeInfo[] attributes,
                             ModelMBeanConstructorInfo[] constructors,
                             ModelMBeanOperationInfo[] operations,
                             ModelMBeanNotificationInfo[] notifications)
Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default. The default descriptor is: name=mbeanName, descriptorType=mbean, displayName=this.getClassName(), persistPolicy=never, log=F,export=F,visiblity=1
Parameters:
className - classname of ModelMBeanInfo
description - human readable description of the ModelMBean
attributes - array of ModelMBeanAttributeInfo objects which have descriptors
constructors - array of ModelMBeanConstructorInfo objects which have descriptor
operations - array of ModelMBeanOperationInfo objects which have descriptor
notifications - array of ModelMBeanNotificationInfo objects which have descriptor

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(java.lang.String className,
                             java.lang.String description,
                             ModelMBeanAttributeInfo[] attributes,
                             ModelMBeanConstructorInfo[] constructors,
                             ModelMBeanOperationInfo[] operations,
                             ModelMBeanNotificationInfo[] notifications,
                             Descriptor mbeandescriptor)
Creates a ModelMBeanInfoSupport with the provided information
Parameters:
className - classname of ModelMBeanInfo
description - human readable description of the ModelMBean
attributes - array of ModelMBeanAttributeInfo objects which have descriptors
constructors - array of ModelMBeanConstructorInfo objects which have descriptor
operations - array of ModelMBeanOperationInfo objects which have descriptor
notifications - array of ModelMBeanNotificationInfo objects which have descriptor
mbeandescriptor - the descriptor to be used as the MBeanDescriptor containing mbean wide policy. If the descriptor is invalid or null, a default descriptor will be constructed. The default descriptor is: name=mbeanName, descriptorType=mbean, displayName=this.getClassName(), persistPolicy=never, log=F, export=F, visiblity=1. If the descriptor does not contain all these fields, they will be added with these default values.
Method Detail

getClassName

public java.lang.String getClassName()
Returns the name of the Java class of the MBean described by this ModelMBeanInfo.
Specified by:
getClassName in interface ModelMBeanInfo
Overrides:
getClassName in class MBeanInfo
Returns:
the name of the Java class of the MBean described by this ModelMBeanInfo.

getDescription

public java.lang.String getDescription()
Returns a human readable description of the MBean. Optional.
Specified by:
getDescription in interface ModelMBeanInfo
Overrides:
getDescription in class MBeanInfo
Returns:
a human readable description of the MBean. Optional.

clone

public java.lang.Object clone()
To clone this ModelMBeanInfo implementation object as ModelMBeanInfoSupport object.
Specified by:
clone in interface ModelMBeanInfo
Overrides:
clone in class MBeanInfo
Returns:
The duplicate copy of the object

getAttributes

public MBeanAttributeInfo[] getAttributes()
Gets the attributes info of the ModelMBean targetted object. The return object will be a array of ModelMBeanAttributeInfo objcts.
Specified by:
getAttributes in interface ModelMBeanInfo
Overrides:
getAttributes in class MBeanInfo
Returns:
The array of MBeanAttributeInfo objects are returned after getting the attributes info of ModelMBean targetted object

getConstructors

public MBeanConstructorInfo[] getConstructors()
Gets the constructors info of the ModelMBean targetted object. The return object will be a array of ModelMBeanConstructorInfo objects.
Specified by:
getConstructors in interface ModelMBeanInfo
Overrides:
getConstructors in class MBeanInfo
Returns:
The array of MBeanConstructorInfo objects are returned after getting the constructors info of ModelMBean targetted object.

getNotifications

public MBeanNotificationInfo[] getNotifications()
Gets the notifications info emitted by the ModelMBean targetted object. The return object will be a array of ModelMBeanNotificationInfo objects.
Specified by:
getNotifications in interface ModelMBeanInfo
Overrides:
getNotifications in class MBeanInfo
Returns:
The array of MBeanNotificationInfo objects are returned after getting the notifications info of the ModelMBean targetted object.

getOperations

public MBeanOperationInfo[] getOperations()
Gets the operations info of the ModelMBean targetted object. The return object will be a array of ModelMBeanOperationInfo objects.
Specified by:
getOperations in interface ModelMBeanInfo
Overrides:
getOperations in class MBeanInfo
Returns:
The array of MBeanOperationInfo objects are returned after getting the operations info of the ModelMBean targetted object.

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.
Specified by:
getDescriptors in interface ModelMBeanInfo
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 void setDescriptors(Descriptor[] inDescriptors)
                    throws MBeanException,
                           RuntimeOperationsException
Adds or replaces descriptors in the ModelMBeanInfo.
Specified by:
setDescriptors in interface 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.
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps exceptions for illegal or null arguments

getDescriptor

public Descriptor getDescriptor(java.lang.String inDescriptorName)
                         throws MBeanException,
                                RuntimeOperationsException
Returns a Descriptor requested by name
Parameters:
inDescriptorName - The name of the descriptor.
Returns:
Descriptor containing the descriptor for the ModelMBean with the same name. If a descriptor is not found, null is returned.
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps exceptions for invalid input name or type.

getDescriptor

public Descriptor getDescriptor(java.lang.String inDescriptorName,
                                java.lang.String inDescriptorType)
                         throws MBeanException,
                                RuntimeOperationsException
Returns a Descriptor requested by name and descriptorType.
Specified by:
getDescriptor in interface ModelMBeanInfo
Parameters:
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.
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.

setDescriptor

public void setDescriptor(Descriptor inDescriptor,
                          java.lang.String inDescriptorType)
                   throws MBeanException,
                          RuntimeOperationsException
Adds or replaces descriptors in all the info arrays for the ModelMBean.
Specified by:
setDescriptor in interface ModelMBeanInfo
Parameters:
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".
Throws:
RuntimeOperationsException - Wraps exceptions for illegal or null arguments.

getMBeanDescriptor

public Descriptor getMBeanDescriptor()
                              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.
Specified by:
getMBeanDescriptor in interface ModelMBeanInfo
Returns:
The MBeanDescriptor
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception

setMBeanDescriptor

public void setMBeanDescriptor(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.
Specified by:
setMBeanDescriptor in interface ModelMBeanInfo
Parameters:
inDescriptor - This descriptor contains metadata about the MBean and default policies for persistence and caching for the entire MBean.
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception

getAttribute

public ModelMBeanAttributeInfo getAttribute(java.lang.String inName)
                                     throws MBeanException,
                                            RuntimeOperationsException
Returns a ModelMBeanAttributeInfo requested by name.
Specified by:
getAttribute in interface ModelMBeanInfo
Parameters:
inName - The name of the ModelMBeanAttributeInfo to get.
Returns:
ModelMBeanAttributeInfo requested by name
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for invalid attribute name or ModelMBeanAttributeInfo to be returned.

getOperation

public ModelMBeanOperationInfo getOperation(java.lang.String inName)
                                     throws MBeanException,
                                            RuntimeOperationsException
Returns a ModelMBeanOperationInfo requested by name.
Specified by:
getOperation in interface ModelMBeanInfo
Parameters:
inName - The name of the ModelMBeanOperationInfo to get.
Returns:
ModelMBeanOperationInfo requested by name
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for invalid attribute name or ModelMBeanOperationInfo to be returned.

getConstructor

public ModelMBeanConstructorInfo getConstructor(java.lang.String inName)
                                         throws MBeanException,
                                                RuntimeOperationsException
Returns a ModelMBeanConstructorInfo requested by name.
Parameters:
String - inName The name of the ModelMBeanConstructorInfo to get.
Returns:
ModelMBeanConstructorInfo requested by name
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for invalid attribute name or ModelMBeanConstructorInfo to be returned.

getNotification

public ModelMBeanNotificationInfo getNotification(java.lang.String inName)
                                           throws MBeanException,
                                                  RuntimeOperationsException
Returns a ModelMBeanNotificationInfo requested by name.
Specified by:
getNotification in interface ModelMBeanInfo
Parameters:
inName - The name of the ModelMBeanNotificationInfo to get.
Returns:
ModelMBeanNotificationInfo requested by name
Throws:
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception

XMOJO 5 API Docs

Copyright ©2003 XMOJO.org. All Rights Reserved.