|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.management.MBeanInfo
|
+--javax.management.modelmbean.ModelMBeanInfoSupport
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.)
| Constructor Summary | |
ModelMBeanInfoSupport(ModelMBeanInfo mbeanInfo)
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 descriptor)
Creates a ModelMBeanInfoSupport with the provided information, but the descriptor is a default. |
|
| Method Summary | |
java.lang.Object |
clone()
returns a new ModelMBeanInfoSupport object that is a copy of this ModelMBeanInfoSupport. |
ModelMBeanAttributeInfo |
getAttribute(java.lang.String name)
Returns a ModelMBeanAttributeInfo requested by name. |
MBeanAttributeInfo[] |
getAttributes()
Returns the list of attributes exposed for management as ModelMBeanAttributeInfo objects. |
ModelMBeanConstructorInfo |
getConstructor(java.lang.String name)
Returns a ModelMBeanConstructorInfo requested by name. |
MBeanConstructorInfo[] |
getConstructors()
Returns the list of constructors exposed for management as ModelMBeanConstructorInfo objects. |
Descriptor |
getDescriptor(java.lang.String descriptorName)
Returns a Descriptor requested by name |
Descriptor |
getDescriptor(java.lang.String descriptorName,
java.lang.String descriptorType)
Returns a Descriptor requested by name and descriptorType. |
Descriptor[] |
getDescriptors(java.lang.String descriptionType)
Returns a DescriptorList. |
Descriptor |
getMBeanDescriptor()
Returns the ModelMBean's descriptor which contains mbean wide policies. |
ModelMBeanNotificationInfo |
getNotification(java.lang.String name)
Returns a ModelMBeanNotificationInfo requested by name. |
MBeanNotificationInfo[] |
getNotifications()
Returns the list of notifications exposed for management as ModelMBeanNotificationInfo objects. |
ModelMBeanOperationInfo |
getOperation(java.lang.String name)
Returns a ModelMBeanOperationInfo requested by name. |
MBeanOperationInfo[] |
getOperations()
Returns the list of operations exposed for management as ModelMBeanOperationInfo objects. |
void |
setDescriptor(Descriptor descriptor,
java.lang.String descriptorType)
Adds or replaces a descriptor in the ModelMBeanInfoSupport. |
void |
setDescriptors(Descriptor[] descriptors)
Adds or replaces descriptors in all the ModelMBeanInfoSupport for the ModelMBean. |
void |
setMBeanDescriptor(Descriptor descriptor)
Sets the ModelMBean's descriptor. |
| Methods inherited from class javax.management.MBeanInfo |
getClassName, getDescription |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.management.modelmbean.ModelMBeanInfo |
getClassName, getDescription |
| Constructor Detail |
public ModelMBeanInfoSupport(ModelMBeanInfo mbeanInfo)
mbeanInfo - - the ModelMBeanInfo instance from which the ModelMBeanInfo
being created is initialized.
public ModelMBeanInfoSupport(java.lang.String className,
java.lang.String description,
ModelMBeanAttributeInfo[] attributes,
ModelMBeanConstructorInfo[] constructors,
ModelMBeanOperationInfo[] operations,
ModelMBeanNotificationInfo[] notifications)
className - - classname of ModelMBeanInfodescription - - human readable description of the ModelMBeanattributes - - array of ModelMBeanAttributeInfo objects which have descriptorsconstructors - - array of ModelMBeanConstructorInfo objects which have descriptoroperations - - array of ModelMBeanOperationInfo objects which have descriptornotifications - - array of ModelMBeanNotificationInfo objects which have descriptor
public ModelMBeanInfoSupport(java.lang.String className,
java.lang.String description,
ModelMBeanAttributeInfo[] attributes,
ModelMBeanConstructorInfo[] constructors,
ModelMBeanOperationInfo[] operations,
ModelMBeanNotificationInfo[] notifications,
Descriptor descriptor)
className - - classname of ModelMBeanInfodescription - - human readable description of the ModelMBeanattributes - - array of ModelMBeanAttributeInfo objects which have descriptorsconstructors - - array of ModelMBeanConstructorInfo objects which have descriptoroperations - - array of ModelMBeanOperationInfo objects which have descriptornotifications - - array of ModelMBeanNotificationInfo objects which have descriptordescriptor - - 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 |
public java.lang.Object clone()
clone in interface ModelMBeanInfoclone in class MBeanInfo
public Descriptor[] getDescriptors(java.lang.String descriptionType)
throws MBeanException,
RuntimeOperationsException
getDescriptors in interface ModelMBeanInfodescriptionType - 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.
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception
public void setDescriptors(Descriptor[] descriptors)
throws MBeanException,
RuntimeOperationsException
setDescriptors in interface ModelMBeanInfodescriptors - 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 exception
will be thrown. Null elements of the list will be ignored.
RuntimeOperationsException - Wraps exceptions for illegal or null arguments
MBeanException
public Descriptor getDescriptor(java.lang.String descriptorName)
throws MBeanException,
RuntimeOperationsException
descriptorName - The name of the descriptor.
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception
public Descriptor getDescriptor(java.lang.String descriptorName,
java.lang.String descriptorType)
throws MBeanException,
RuntimeOperationsException
getDescriptor in interface ModelMBeanInfodescriptorName - The name of the descriptor.descriptorType - The type of the descriptor being requested. If this is null
a RuntimeOperationsException will be thrown.
Type must match that in the 'descriptorType' field on the Descriptor. It must be "mbean",
"attribute", "operation", or "notification".
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception
public void setDescriptor(Descriptor descriptor,
java.lang.String descriptorType)
throws MBeanException,
RuntimeOperationsException
setDescriptor in interface ModelMBeanInfodescriptor - 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.descriptorType - The type of the descriptor being requested. If this is null then
the 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".
RuntimeOperationsException - Wraps exceptions for illegal or null arguments
MBeanException
public ModelMBeanAttributeInfo getAttribute(java.lang.String name)
throws MBeanException,
RuntimeOperationsException
getAttribute in interface ModelMBeanInfoname - The name of the ModelMBeanAttributeInfo to get.
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for invalid attribute
name or ModelMBeanAttributeInfo to be returned.
public ModelMBeanOperationInfo getOperation(java.lang.String name)
throws MBeanException,
RuntimeOperationsException
getOperation in interface ModelMBeanInfoname - The name of the ModelMBeanOperationInfo to get.
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for invalid attribute
name or ModelMBeanAttributeInfo to be returned.
public ModelMBeanConstructorInfo getConstructor(java.lang.String name)
throws MBeanException,
RuntimeOperationsException
MBeanException
RuntimeOperationsException
public ModelMBeanNotificationInfo getNotification(java.lang.String name)
throws MBeanException,
RuntimeOperationsException
getNotification in interface ModelMBeanInfoname - The name of the ModelMBeanNotificationInfo to get.
MBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exceptionpublic MBeanAttributeInfo[] getAttributes()
getAttributes in interface ModelMBeanInfogetAttributes in class MBeanInfopublic MBeanOperationInfo[] getOperations()
getOperations in interface ModelMBeanInfogetOperations in class MBeanInfopublic MBeanConstructorInfo[] getConstructors()
getConstructors in interface ModelMBeanInfogetConstructors in class MBeanInfopublic MBeanNotificationInfo[] getNotifications()
getNotifications in interface ModelMBeanInfogetNotifications in class MBeanInfo
public Descriptor getMBeanDescriptor()
throws MBeanException,
RuntimeOperationsException
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.
getMBeanDescriptor in interface ModelMBeanInfoMBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception
public void setMBeanDescriptor(Descriptor descriptor)
throws MBeanException,
RuntimeOperationsException
setMBeanDescriptor in interface ModelMBeanInfoMBeanException - Wraps another exception
RuntimeOperationsException - Wraps another exception for bad descriptor.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||