Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.management.modelmbean
Class ModelMBeanInfoSupport  view ModelMBeanInfoSupport download ModelMBeanInfoSupport.java

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

public class ModelMBeanInfoSupport
extends javax.management.MBeanInfo
implements ModelMBeanInfo, java.io.Serializable

Support class for ModelMBeanInfo interface.

Version:
$Revision: 1.9.4.1 $

Revisions:

20020319 Juha Lindfors:

  • Fixed ArrayIndexOutOfBoundsException bug in getOperationDescriptors()

20020525 Juha Lindfors:

  • Fixed the getDescriptor(name, type) exception behavior to match RI 1.0 javadoc: RuntimeOperationsException is thrown in case of a illegal descriptor type string.
  • setDescriptors() now implemented and no longer throws 'NYI' error.
  • clone() implemented

20020715 Adrian Brock:

  • Serialization

Field Summary
private  javax.management.Descriptor mbeanDescriptor
          MBean descriptor for this Model MBean.
private static java.io.ObjectStreamField[] serialPersistentFields
           
private static long serialVersionUID
           
 
Fields inherited from class javax.management.MBeanInfo
attributes, className, constructors, description, notifications, operations
 
Constructor Summary
ModelMBeanInfoSupport(ModelMBeanInfo mbi)
          Copy constructor for Model MBean info.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
          Creates an instance of Model MBean info implementation based on the given values.
ModelMBeanInfoSupport(java.lang.String className, java.lang.String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, javax.management.Descriptor mbeandescriptor)
          Creates an instance of Model MBean info implementation based on the given values and descriptor.
 
Method Summary
private  void addDefaultMBeanDescriptorFields(javax.management.Descriptor descr)
           
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
private  javax.management.Descriptor createDefaultDescriptor(java.lang.String className)
           
 ModelMBeanAttributeInfo getAttribute(java.lang.String inName)
           
private  java.util.Map getAttributeDescriptors()
           
 javax.management.MBeanAttributeInfo[] getAttributes()
           
 ModelMBeanConstructorInfo getConstructor(java.lang.String inName)
           
private  java.util.Map getConstructorDescriptors()
           
 javax.management.MBeanConstructorInfo[] getConstructors()
           
 javax.management.Descriptor getDescriptor(java.lang.String descrName)
          Deprecated. use getDescriptor(String, String) 55 instead.
 javax.management.Descriptor getDescriptor(java.lang.String descrName, java.lang.String descrType)
          Returns a descriptor of a management interface element matching the given name and type.
 javax.management.Descriptor[] getDescriptors(java.lang.String descrType)
          Returns the descriptors of an Model MBean for a given management interface element type.
 javax.management.Descriptor getMBeanDescriptor()
           
 ModelMBeanNotificationInfo getNotification(java.lang.String inName)
           
private  java.util.Map getNotificationDescriptors()
           
 javax.management.MBeanNotificationInfo[] getNotifications()
           
 ModelMBeanOperationInfo getOperation(java.lang.String inName)
           
private  java.util.Map getOperationDescriptors()
           
 javax.management.MBeanOperationInfo[] getOperations()
           
private  void readObject(java.io.ObjectInputStream ois)
           
 void setDescriptor(javax.management.Descriptor descr, java.lang.String descrType)
          Adds or replaces the descriptor in this Model MBean.
 void setDescriptors(javax.management.Descriptor[] inDescriptors)
          Adds or replaces the descriptors in this Model MBean.
 void setMBeanDescriptor(javax.management.Descriptor inMBeanDescriptor)
           
private  void writeObject(java.io.ObjectOutputStream oos)
           
 
Methods inherited from class javax.management.MBeanInfo
getClassName, getDescription, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.management.modelmbean.ModelMBeanInfo
getClassName, getDescription
 

Field Detail

mbeanDescriptor

private javax.management.Descriptor mbeanDescriptor
MBean descriptor for this Model MBean.


serialVersionUID

private static final long serialVersionUID

serialPersistentFields

private static final java.io.ObjectStreamField[] serialPersistentFields
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.


ModelMBeanInfoSupport

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


ModelMBeanInfoSupport

public ModelMBeanInfoSupport(java.lang.String className,
                             java.lang.String description,
                             ModelMBeanAttributeInfo[] attributes,
                             ModelMBeanConstructorInfo[] constructors,
                             ModelMBeanOperationInfo[] operations,
                             ModelMBeanNotificationInfo[] notifications,
                             javax.management.Descriptor mbeandescriptor)
Creates an instance of Model MBean info implementation based on the given values and descriptor.

Method Detail

getDescriptors

public javax.management.Descriptor[] getDescriptors(java.lang.String descrType)
                                             throws javax.management.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 55 
   - ATTRIBUTE_DESCRIPTOR 55 
   - OPERATION_DESCRIPTOR 55 
   - NOTIFICATION_DESCRIPTOR 55 
   - CONSTRUCTOR_DESCRIPTOR 55 
   - ALL_DESCRIPTORS 55 

 
Using ALL_DESCRIPTORS returns descriptors for the MBean, and all its attributes, operations, notifications and constructors.

Specified by:
getDescriptors in interface ModelMBeanInfo

getDescriptor

public javax.management.Descriptor getDescriptor(java.lang.String descrName,
                                                 java.lang.String descrType)
                                          throws javax.management.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 55 
   - ATTRIBUTE_DESCRIPTOR 55 
   - OPERATION_DESCRIPTOR 55 
   - NOTIFICATION_DESCRIPTOR 55 
   - CONSTRUCTOR_DESCRIPTOR 55 

 

Specified by:
getDescriptor in interface ModelMBeanInfo

setDescriptors

public void setDescriptors(javax.management.Descriptor[] inDescriptors)
                    throws javax.management.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

setDescriptor

public void setDescriptor(javax.management.Descriptor descr,
                          java.lang.String descrType)
                   throws javax.management.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 55 
   - ATTRIBUTE_DESCRIPTOR 55 
   - OPERATION_DESCRIPTOR 55 
   - NOTIFICATION_DESCRIPTOR 55 
   - CONSTRUCTOR_DESCRIPTOR 55 

 

Specified by:
setDescriptor in interface ModelMBeanInfo

getAttribute

public ModelMBeanAttributeInfo getAttribute(java.lang.String inName)
                                     throws javax.management.MBeanException
Specified by:
getAttribute in interface ModelMBeanInfo

getOperation

public ModelMBeanOperationInfo getOperation(java.lang.String inName)
                                     throws javax.management.MBeanException
Specified by:
getOperation in interface ModelMBeanInfo

getConstructor

public ModelMBeanConstructorInfo getConstructor(java.lang.String inName)
                                         throws javax.management.MBeanException

getNotification

public ModelMBeanNotificationInfo getNotification(java.lang.String inName)
                                           throws javax.management.MBeanException
Specified by:
getNotification in interface ModelMBeanInfo

getAttributes

public javax.management.MBeanAttributeInfo[] getAttributes()
Specified by:
getAttributes in interface ModelMBeanInfo

getOperations

public javax.management.MBeanOperationInfo[] getOperations()
Specified by:
getOperations in interface ModelMBeanInfo

getConstructors

public javax.management.MBeanConstructorInfo[] getConstructors()
Specified by:
getConstructors in interface ModelMBeanInfo

getNotifications

public javax.management.MBeanNotificationInfo[] getNotifications()
Specified by:
getNotifications in interface ModelMBeanInfo

getMBeanDescriptor

public javax.management.Descriptor getMBeanDescriptor()
                                               throws javax.management.MBeanException
Specified by:
getMBeanDescriptor in interface ModelMBeanInfo

setMBeanDescriptor

public void setMBeanDescriptor(javax.management.Descriptor inMBeanDescriptor)
                        throws javax.management.MBeanException
Specified by:
setMBeanDescriptor in interface ModelMBeanInfo

getDescriptor

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


clone

public java.lang.Object clone()
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 

Specified by:
clone in interface ModelMBeanInfo

addDefaultMBeanDescriptorFields

private void addDefaultMBeanDescriptorFields(javax.management.Descriptor descr)

createDefaultDescriptor

private javax.management.Descriptor createDefaultDescriptor(java.lang.String className)

getAttributeDescriptors

private java.util.Map getAttributeDescriptors()

getOperationDescriptors

private java.util.Map getOperationDescriptors()

getConstructorDescriptors

private java.util.Map getConstructorDescriptors()

getNotificationDescriptors

private java.util.Map getNotificationDescriptors()

readObject

private void readObject(java.io.ObjectInputStream ois)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException

writeObject

private void writeObject(java.io.ObjectOutputStream oos)
                  throws java.io.IOException