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

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


javax.management.modelmbean
Class ModelMBeanInfoSupport

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

public class ModelMBeanInfoSupport
extends MBeanInfo
implements ModelMBeanInfo, Serializable

Support class for ModelMBeanInfo interface.

Version:
$Revision: 1.21 $
Author:
Juha Lindfors., Adrian Brock., Thomas Diesler.
See Also:
ModelMBeanInfo, Serialized Form

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

Constructor Detail

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(ModelMBeanInfo 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(String className,
                             String description,
                             ModelMBeanAttributeInfo[] modelAttributes,
                             ModelMBeanConstructorInfo[] modelConstructors,
                             ModelMBeanOperationInfo[] modelOperations,
                             ModelMBeanNotificationInfo[] 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(String className,
                             String description,
                             ModelMBeanAttributeInfo[] modelAttributes,
                             ModelMBeanConstructorInfo[] modelConstructors,
                             ModelMBeanOperationInfo[] modelOperations,
                             ModelMBeanNotificationInfo[] modelNotifications,
                             Descriptor mbeandescriptor)
                      throws RuntimeOperationsException
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[] getDescriptors(String descrType)
                            throws MBeanException
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
Parameters:
descrType - descriptor type string
Returns:
MBean descriptors.
Throws:
MBeanException - for no good reason

getDescriptor

public Descriptor getDescriptor(String descrName,
                                String descrType)
                         throws MBeanException
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
Parameters:
descrName - name of the descriptor
descrType - type of the descriptor
Returns:
the requested descriptor or null if it was not found
Throws:
RuntimeOperationsException - if an illegal descriptor type was given
MBeanException

setDescriptors

public void setDescriptors(Descriptor[] inDescriptors)
                    throws MBeanException
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
Parameters:
inDescriptors - array of descriptors
Throws:
MBeanException

setDescriptor

public void setDescriptor(Descriptor descr,
                          String descrType)
                   throws MBeanException
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
Parameters:
descr - descriptor to set
descrType - descriptor type string, can be null
Throws:
RuntimeOperationsException - if descr is null, or descriptor is not valid.
MBeanException

getAttribute

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

Specified by:
getAttribute in interface ModelMBeanInfo
Throws:
MBeanException

getOperation

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

Specified by:
getOperation in interface ModelMBeanInfo
Throws:
MBeanException

getConstructor

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

Throws:
MBeanException

getNotification

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

Specified by:
getNotification in interface ModelMBeanInfo
Throws:
MBeanException

getAttributes

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

getOperations

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

getConstructors

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

getNotifications

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

getMBeanDescriptor

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

setMBeanDescriptor

public void setMBeanDescriptor(Descriptor inDescriptor)
                        throws MBeanException,
                               RuntimeOperationsException
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
Throws:
MBeanException
RuntimeOperationsException

getDescriptor

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

Throws:
MBeanException

clone

public Object clone()
Specified by:
clone in interface ModelMBeanInfo
Overrides:
clone in class MBeanInfo


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