| java.lang.Object javax.management.MBeanInfo javax.management.modelmbean.ModelMBeanInfoSupport
ModelMBeanInfoSupport | public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo,Serializable(Code) | | 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.)
author: Young Yang |
Constructor Summary | |
public | ModelMBeanInfoSupport(ModelMBeanInfo mbeanInfo) constructs a ModelMBeanInfoSupport which is a duplicate of the one passed in. | public | ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications) Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default. | public | ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor descriptor) Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default.
Parameters: className - - classname of ModelMBeanInfo Parameters: description - - human readable description of the ModelMBean Parameters: attributes - - array of ModelMBeanAttributeInfo objects which have descriptors Parameters: constructors - - array of ModelMBeanConstructorInfo objects which have descriptor Parameters: operations - - array of ModelMBeanOperationInfo objects which have descriptor Parameters: notifications - - array of ModelMBeanNotificationInfo objects which have descriptor Parameters: descriptor - - descriptor to be used as the MBeanDescriptor containing mbean wide policy. |
ModelMBeanInfoSupport | public ModelMBeanInfoSupport(ModelMBeanInfo mbeanInfo)(Code) | | constructs a ModelMBeanInfoSupport which is a duplicate of the one passed in.
Parameters: mbeanInfo - - the ModelMBeanInfo instance from which the ModelMBeanInfobeing created is initialized. |
ModelMBeanInfoSupport | public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)(Code) | | 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 Parameters: description - - human readable description of the ModelMBean Parameters: attributes - - array of ModelMBeanAttributeInfo objects which have descriptors Parameters: constructors - - array of ModelMBeanConstructorInfo objects which have descriptor Parameters: operations - - array of ModelMBeanOperationInfo objects which have descriptor Parameters: notifications - - array of ModelMBeanNotificationInfo objects which have descriptor |
ModelMBeanInfoSupport | public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor descriptor)(Code) | | Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default.
Parameters: className - - classname of ModelMBeanInfo Parameters: description - - human readable description of the ModelMBean Parameters: attributes - - array of ModelMBeanAttributeInfo objects which have descriptors Parameters: constructors - - array of ModelMBeanConstructorInfo objects which have descriptor Parameters: operations - - array of ModelMBeanOperationInfo objects which have descriptor Parameters: notifications - - array of ModelMBeanNotificationInfo objects which have descriptor Parameters: descriptor - - descriptor to be used as the MBeanDescriptor containing mbean wide policy. if thedescriptor 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. |
clone | public Object clone()(Code) | | returns a new ModelMBeanInfoSupport object that is a copy of this ModelMBeanInfoSupport.
|
getAttributes | public MBeanAttributeInfo[] getAttributes()(Code) | | Returns the list of attributes exposed for management as ModelMBeanAttributeInfo objects.
This method signature must specify MBeanAttributeInfo to be compliant with the
the DynamicMBean interface.
MBeanAttributeInfo object array. |
getConstructors | public MBeanConstructorInfo[] getConstructors()(Code) | | Returns the list of constructors exposed for management as ModelMBeanConstructorInfo objects.
This method signature must specify MBeanConstructorInfo to be compliant with the
the DynamicMBean interface.
MBeanConstructorInfo object array. |
getDescriptor | public Descriptor getDescriptor(String descriptorName, String descriptorType) throws MBeanException, RuntimeOperationsException(Code) | | Returns a Descriptor requested by name and descriptorType.
Parameters: descriptorName - The name of the descriptor. Parameters: descriptorType - The type of the descriptor being requested. If this is nulla RuntimeOperationsException will be thrown.Type must match that in the 'descriptorType' field on the Descriptor. It must be "mbean","attribute", "operation", or "notification". Descriptor containing the descriptor for the ModelMBean with the same name and descriptorType. exception: MBeanException - Wraps another exception exception: RuntimeOperationsException - Wraps another exception |
getMBeanDescriptor | public Descriptor getMBeanDescriptor() throws MBeanException, RuntimeOperationsException(Code) | | Returns the ModelMBean's descriptor which contains mbean wide policies. This descriptor contains
metadata about the MBean and default policies for persistence and caching.
The fields in the descriptor are defined, but not limited to, the following:
name : mbean name
descriptorType : must be "mbean"
displayName : name of attribute to be used in displays
persistPolicy : OnUpdate|OnTimer|NoMoreOftenThan|Always|Never
persistLocation : The fully qualified directory name where the MBean should be persisted (if appropriate)
persistFile : File name into which the MBean should be persisted
persistPeriod : seconds - frequency of persist cycle for OnTime and NoMoreOftenThan PersistPolicy
persistLocation : directory name in which to store mbeans that support the PersistentMBean interface
currencyTimeLimit : how long value is valid, <0 never, =0 always, >0 seconds
log : where t: log all notifications f: log no notifications
logfile : fully qualified filename to log events to
visibility : 1-4 where 1: always visible 4: rarely visible
export : name to be used to export/expose this MBean so that it is findable by
other JMX Agents.
presentationString : xml formatted string to allow presentation of data to be associated with the MBean.
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.
exception: MBeanException - Wraps another exception exception: RuntimeOperationsException - Wraps another exception |
getNotifications | public MBeanNotificationInfo[] getNotifications()(Code) | | Returns the list of notifications exposed for management as ModelMBeanNotificationInfo objects.
This method signature must specify MBeanNotificationInfo to be compliant with the
the DynamicMBean interface.
MBeanNotificationInfo object array. |
getOperations | public MBeanOperationInfo[] getOperations()(Code) | | Returns the list of operations exposed for management as ModelMBeanOperationInfo objects.
This method signature must specify MBeanOperationInfo to be compliant with the
the DynamicMBean interface.
MBeanOperationInfo object array. |
setDescriptor | public void setDescriptor(Descriptor descriptor, String descriptorType) throws MBeanException, RuntimeOperationsException(Code) | | Adds or replaces a descriptor in the ModelMBeanInfoSupport.
Parameters: descriptor - The descriptor to be set in the ModelMBean.If the descriptor to be set is null, no sets will be done.All descriptors must have name and descriptorType fields. Parameters: descriptorType - The type of the descriptor being requested. If this is null thenthe value of the 'descriptorType' field in the inDescriptor will be used.Type must match that in the 'descriptorType' field on the Descriptor. It must be "mbean","attribute", "operation", or "notification". exception: RuntimeOperationsException - Wraps exceptions for illegal or null arguments |
setDescriptors | public void setDescriptors(Descriptor[] descriptors) throws MBeanException, RuntimeOperationsException(Code) | | Adds or replaces descriptors in all the ModelMBeanInfoSupport for the ModelMBean.
Parameters: descriptors - The descriptors to be set in the ModelMBean.All descriptors must have name and descriptorType fields and be valid.If the descriptor list is empty, no sets will occur. If it is null, an exceptionwill be thrown. Null elements of the list will be ignored. exception: RuntimeOperationsException - Wraps exceptions for illegal or null arguments |
setMBeanDescriptor | public void setMBeanDescriptor(Descriptor descriptor) throws MBeanException, RuntimeOperationsException(Code) | | 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 invalid then the existing or default descriptor will be preserved.
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.
exception: MBeanException - Wraps another exception exception: RuntimeOperationsException - Wraps another exception for bad descriptor. |
|
|