javax.management.modelmbean
Class ModelMBeanInfoSupport

java.lang.Object
  extended byjavax.management.MBeanInfo (src) 
      extended byjavax.management.modelmbean.ModelMBeanInfoSupport
All Implemented Interfaces:
java.lang.Cloneable, ModelMBeanInfo (src) , java.io.Serializable

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

Support class for ModelMBeanInfo interface.

See Also:
ModelMBeanInfo (src) , Serialized Form

Constructor Summary
ModelMBeanInfoSupport(ModelMBeanInfo (src)  mbi)
          Copy constructor for Model MBean info.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo (src) [] modelAttributes, ModelMBeanConstructorInfo (src) [] modelConstructors, ModelMBeanOperationInfo (src) [] modelOperations, ModelMBeanNotificationInfo (src) [] modelNotifications)
          Creates an instance of Model MBean info implementation based on the given values.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo (src) [] modelAttributes, ModelMBeanConstructorInfo (src) [] modelConstructors, ModelMBeanOperationInfo (src) [] modelOperations, ModelMBeanNotificationInfo (src) [] modelNotifications, Descriptor (src)  mbeandescriptor)
          Creates an instance of Model MBean info implementation based on the given values and descriptor.
 
Method Summary
 java.lang.Object clone()
           
 ModelMBeanAttributeInfo (src) getAttribute(java.lang.String inName)
          Returns the attribute info for the named attribute, or null if there is none.
 MBeanAttributeInfo (src) [] getAttributes()
           
 ModelMBeanConstructorInfo (src) getConstructor(java.lang.String inName)
          Returns the constructor info for the named attribute, or null if there is none.
 MBeanConstructorInfo (src) [] getConstructors()
           
 Descriptor (src) getDescriptor(java.lang.String descrName)
          Deprecated. use getDescriptor(String, String) instead.
 Descriptor (src) getDescriptor(java.lang.String descrName, java.lang.String descrType)
          Returns a descriptor of a management interface element matching the given name and type.
 Descriptor (src) [] getDescriptors(java.lang.String descrType)
          Returns the descriptors of an Model MBean for a given management interface element type.
 Descriptor (src) getMBeanDescriptor()
           
 ModelMBeanNotificationInfo (src) getNotification(java.lang.String inName)
          Returns the attribute info for the named attribute, or null if there is none.
 MBeanNotificationInfo (src) [] getNotifications()
           
 ModelMBeanOperationInfo (src) getOperation(java.lang.String inName)
          Returns the operation info for the named attribute, or null if there is none.
 MBeanOperationInfo (src) [] getOperations()
           
 void setDescriptor(Descriptor (src)  descr, java.lang.String descrType)
          Adds or replaces the descriptor in this Model MBean.
 void setDescriptors(Descriptor (src) [] inDescriptors)
          Adds or replaces the descriptors in this Model MBean.
 void setMBeanDescriptor(Descriptor (src)  inDescriptor)
          Sets the ModelMBean's descriptor.
 
Methods inherited from class javax.management.MBeanInfo (src)
equals, getClassName, getDescription, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.management.modelmbean.ModelMBeanInfo (src)
getClassName, getDescription
 

Constructor Detail

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(ModelMBeanInfo (src)  mbi)
Copy constructor for Model MBean info. This instance is initialized with the values of the given Model MBean info.

Parameters:
mbi - Model MBean info used to initialize this instance

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(java.lang.String className,
                             java.lang.String description,
                             ModelMBeanAttributeInfo (src) [] modelAttributes,
                             ModelMBeanConstructorInfo (src) [] modelConstructors,
                             ModelMBeanOperationInfo (src) [] modelOperations,
                             ModelMBeanNotificationInfo (src) [] modelNotifications)
Creates an instance of Model MBean info implementation based on the given values. The Model MBean is configured with a default MBean descriptor.

Parameters:
className - name of the Model MBean implementation class
description - human readable description string for this Model MBean
modelAttributes - an array of Model MBean attribute metadata to describe the management modelAttributes of this Model MBean
modelConstructors - an array of Model MBean constructor metadata that describes the modelConstructors of this Model MBean implementation class
modelOperations - an array of Model MBean operation metadata to describe the management modelOperations of this Model MBean
modelNotifications - an array of Model MBean notification metadata to describe the management modelNotifications of this Model MBean

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(java.lang.String className,
                             java.lang.String description,
                             ModelMBeanAttributeInfo (src) [] modelAttributes,
                             ModelMBeanConstructorInfo (src) [] modelConstructors,
                             ModelMBeanOperationInfo (src) [] modelOperations,
                             ModelMBeanNotificationInfo (src) [] modelNotifications,
                             Descriptor (src)  mbeandescriptor)
                      throws RuntimeOperationsException (src) 
Creates an instance of Model MBean info implementation based on the given values and descriptor.

Parameters:
className - name of the Model MBean implementation class
description - human readable description string for this Model MBean
modelAttributes - an array of Model MBean attribute metadata to describe the management modelAttributes of this Model MBean
modelConstructors - an array of Model MBean constructor metadata that describes the modelConstructors of this Model MBean implementation class
modelOperations - an array of Model MBean operation metadata to describe the management modelOperations of this Model MBean
modelNotifications - an array of Model MBean notification metadata to describe the management modelNotifications of this Model MBean
mbeandescriptor - descriptor for the MBean
Method Detail

getDescriptors

public Descriptor (src) [] getDescriptors(java.lang.String descrType)
                            throws MBeanException (src) 
Returns the descriptors of an Model MBean for a given management interface element type. The descriptor type must be one of the following:

   - MBEAN_DESCRIPTOR
   - ATTRIBUTE_DESCRIPTOR
   - OPERATION_DESCRIPTOR
   - NOTIFICATION_DESCRIPTOR
   - CONSTRUCTOR_DESCRIPTOR
   - ALL_DESCRIPTORS

 
Using ALL_DESCRIPTORS returns descriptors for the MBean, and all its modelAttributes, modelOperations, modelNotifications and modelConstructors.

Specified by:
getDescriptors in interface ModelMBeanInfo (src)
Parameters:
descrType - descriptor type string
Returns:
MBean descriptors.
Throws:
MBeanException (src) - for no good reason

getDescriptor

public Descriptor (src)  getDescriptor(java.lang.String descrName,
                                java.lang.String descrType)
                         throws MBeanException (src) 
Returns a descriptor of a management interface element matching the given name and type. The descriptor type string must be one of the following:

   - MBEAN_DESCRIPTOR
   - ATTRIBUTE_DESCRIPTOR
   - OPERATION_DESCRIPTOR
   - NOTIFICATION_DESCRIPTOR
   - CONSTRUCTOR_DESCRIPTOR

 

Specified by:
getDescriptor in interface ModelMBeanInfo (src)
Parameters:
descrName - name of the descriptor
descrType - type of the descriptor
Returns:
the requested descriptor or null if it was not found
Throws:
RuntimeOperationsException (src) - if an illegal descriptor type was given
MBeanException (src)

setDescriptors

public void setDescriptors(Descriptor (src) [] inDescriptors)
                    throws MBeanException (src) 
Adds or replaces the descriptors in this Model MBean. All descriptors must be valid. Null references will be ignored.

Specified by:
setDescriptors in interface ModelMBeanInfo (src)
Parameters:
inDescriptors - array of descriptors
Throws:
MBeanException (src)

setDescriptor

public void setDescriptor(Descriptor (src)  descr,
                          java.lang.String descrType)
                   throws MBeanException (src) 
Adds or replaces the descriptor in this Model MBean. Descriptor must be valid. If descrType is not specified, the descriptorType field of the given descriptor is used.

The descriptorType must contain one of the following values:


   - MBEAN_DESCRIPTOR
   - ATTRIBUTE_DESCRIPTOR
   - OPERATION_DESCRIPTOR
   - NOTIFICATION_DESCRIPTOR
   - CONSTRUCTOR_DESCRIPTOR

 

Specified by:
setDescriptor in interface ModelMBeanInfo (src)
Parameters:
descr - descriptor to set
descrType - descriptor type string, can be null
Throws:
RuntimeOperationsException (src) - if descr is null, or descriptor is not valid.
MBeanException (src)

getAttribute

public ModelMBeanAttributeInfo (src)  getAttribute(java.lang.String inName)
                                     throws MBeanException (src) 
Returns the attribute info for the named attribute, or null if there is none.

Specified by:
getAttribute in interface ModelMBeanInfo (src)
Throws:
MBeanException (src)

getOperation

public ModelMBeanOperationInfo (src)  getOperation(java.lang.String inName)
                                     throws MBeanException (src) 
Returns the operation info for the named attribute, or null if there is none.

Specified by:
getOperation in interface ModelMBeanInfo (src)
Throws:
MBeanException (src)

getConstructor

public ModelMBeanConstructorInfo (src)  getConstructor(java.lang.String inName)
                                         throws MBeanException (src) 
Returns the constructor info for the named attribute, or null if there is none.

Throws:
MBeanException (src)

getNotification

public ModelMBeanNotificationInfo (src)  getNotification(java.lang.String inName)
                                           throws MBeanException (src) 
Returns the attribute info for the named attribute, or null if there is none.

Specified by:
getNotification in interface ModelMBeanInfo (src)
Throws:
MBeanException (src)

getAttributes

public MBeanAttributeInfo (src) [] getAttributes()
Specified by:
getAttributes in interface ModelMBeanInfo (src)
Overrides:
getAttributes in class MBeanInfo (src)

getOperations

public MBeanOperationInfo (src) [] getOperations()
Specified by:
getOperations in interface ModelMBeanInfo (src)
Overrides:
getOperations in class MBeanInfo (src)

getConstructors

public MBeanConstructorInfo (src) [] getConstructors()
Specified by:
getConstructors in interface ModelMBeanInfo (src)
Overrides:
getConstructors in class MBeanInfo (src)

getNotifications

public MBeanNotificationInfo (src) [] getNotifications()
Specified by:
getNotifications in interface ModelMBeanInfo (src)
Overrides:
getNotifications in class MBeanInfo (src)

getMBeanDescriptor

public Descriptor (src)  getMBeanDescriptor()
                              throws MBeanException (src) 
Specified by:
getMBeanDescriptor in interface ModelMBeanInfo (src)
Throws:
MBeanException (src)

setMBeanDescriptor

public void setMBeanDescriptor(Descriptor (src)  inDescriptor)
                        throws MBeanException (src) ,
                               RuntimeOperationsException (src) 
Sets the ModelMBean's descriptor. This descriptor contains default, MBean wide metadata about the MBean and default policies for persistence and caching. This operation does a complete replacement of the descriptor, no merging is done. If the descriptor to set to is null then the default descriptor will be created. 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. See getMBeanDescriptor method javadoc for description of valid field names.

Specified by:
setMBeanDescriptor in interface ModelMBeanInfo (src)
Throws:
MBeanException (src)
RuntimeOperationsException (src)

getDescriptor

public Descriptor (src)  getDescriptor(java.lang.String descrName)
                         throws MBeanException (src) 
Deprecated. use getDescriptor(String, String) instead.

Throws:
MBeanException (src)

clone

public java.lang.Object clone()
Specified by:
clone in interface ModelMBeanInfo (src)
Overrides:
clone in class MBeanInfo (src)