|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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 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, 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 inName)
Returns a ModelMBeanAttributeInfo requested by name. |
MBeanAttributeInfo[] |
getAttributes()
Returns the list of attributes exposed for management as ModelMBeanAttributeInfo objects. |
ModelMBeanConstructorInfo |
getConstructor(java.lang.String inName)
|
MBeanConstructorInfo[] |
getConstructors()
Returns the list of constructors exposed for management as ModelMBeanConstructorInfo objects. |
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 DescriptorList. |
Descriptor |
getMBeanDescriptor()
Returns the ModelMBean's descriptor which contains mbean wide policies. |
ModelMBeanNotificationInfo |
getNotification(java.lang.String inName)
Returns a ModelMBeanNotificationInfo requested by name. |
MBeanNotificationInfo[] |
getNotifications()
Returns the list of notifications exposed for management as ModelMBeanNotificationInfo objects. |
ModelMBeanOperationInfo |
getOperation(java.lang.String inName)
Returns a ModelMBeanOperationInfo requested by name. |
MBeanOperationInfo[] |
getOperations()
Returns the list of operations exposed for management as ModelMBeanOperationInfo objects. |
void |
setDescriptor(Descriptor inDescriptor,
java.lang.String inDescriptorType)
Adds or replaces a descriptor in the ModelMBeanInfoSupport. |
void |
setDescriptors(Descriptor[] inDescriptors)
Adds or replaces descriptors in all the ModelMBeanInfoSupport for the ModelMBean. |
void |
setMBeanDescriptor(Descriptor inMBeanDescriptor)
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 |
Constructor Detail |
public ModelMBeanInfoSupport(ModelMBeanInfo mbi)
ModelMBeanInfo
- mbi - 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 ModelMBeanModelMBeanAttributeInfo[]
- attributes - array of ModelMBeanAttributeInfo objects which have descriptorsModelMBeanConstructorInfo[]
- constructors - array of ModelMBeanConstructorInfo objects which have descriptorModelMBeanOperationInfo[]
- operations - array of ModelMBeanOperationInfo objects which have descriptorModelMBeanNotificationInfo[]
- notifications - array of ModelMBeanNotificationInfo objects which have descriptorpublic ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
className
- - classname of ModelMBeanInfodescription
- - human readable description of the ModelMBeanModelMBeanAttributeInfo[]
- attributes - array of ModelMBeanAttributeInfo objects which have descriptorsModelMBeanConstructorInfo[]
- constructors - array of ModelMBeanConstructorInfo objects which have descriptorModelMBeanOperationInfo[]
- operations - array of ModelMBeanOperationInfo objects which have descriptorModelMBeanNotificationInfo[]
- notifications - array of ModelMBeanNotificationInfo objects which have descriptorMBeanDescriptor
- - 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()
public Descriptor[] getDescriptors(java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
public void setDescriptors(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
DescriptorList
- 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.public Descriptor getDescriptor(java.lang.String inDescriptorName) throws MBeanException, RuntimeOperationsException
String
- descriptorName The name of the descriptor.public Descriptor getDescriptor(java.lang.String inDescriptorName, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
String
- descriptorName The name of the descriptor.String
- 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".public void setDescriptor(Descriptor inDescriptor, java.lang.String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptor
- 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.String
- 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".public ModelMBeanAttributeInfo getAttribute(java.lang.String inName) throws MBeanException, RuntimeOperationsException
String
- inName The name of the ModelMBeanAttributeInfo to get.public ModelMBeanOperationInfo getOperation(java.lang.String inName) throws MBeanException, RuntimeOperationsException
String
- inName The name of the ModelMBeanOperationInfo to get.public ModelMBeanConstructorInfo getConstructor(java.lang.String inName) throws MBeanException, RuntimeOperationsException
public ModelMBeanNotificationInfo getNotification(java.lang.String inName) throws MBeanException, RuntimeOperationsException
String
- inName The name of the ModelMBeanNotificationInfo to get.public MBeanAttributeInfo[] getAttributes()
public MBeanOperationInfo[] getOperations()
public MBeanConstructorInfo[] getConstructors()
public MBeanNotificationInfo[] getNotifications()
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.
public void setMBeanDescriptor(Descriptor inMBeanDescriptor) throws MBeanException, RuntimeOperationsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |