com.sun.jdmk
Class MetaDataImpl

java.lang.Object
  extended by com.sun.jdmk.DynamicMetaDataImpl
      extended by com.sun.jdmk.MetaDataImpl
All Implemented Interfaces:
MetaData

Deprecated. This class is kept as a utility class, though it is no longer used. It may not be supported in future releases.

public class MetaDataImpl
extends DynamicMetaDataImpl

The MetaData class provides local access to the metadata service in an agent.

Since:
Java DMK 5.0

Field Summary
 
Fields inherited from class com.sun.jdmk.DynamicMetaDataImpl
instantiator
 
Method Summary
static Class findClassForPrim(String primName)
          Deprecated. Get the class of the constructed type corresponding to the given primitive type
static Constructor findConstructor(Class theClass, Class[] parameterTypes)
          Deprecated. Finds a specific constructor of a class Returns the requested constructor or null if not found
static Method findGetter(Class classObj, String attribute)
          Deprecated. Finds the getter of a specific attribute in an object.
static Method findMethod(Class classObj, String name)
          Deprecated. Finds a specific method of an object without knowing the parameter types.
static Method findMethod(Class classObj, String name, Class[] parameterTypes)
          Deprecated. Finds a specific method of an object.
static Method findMethod(Class classObj, String name, int paramCount)
          Deprecated. Finds a specific method of an object given the number of parameters.
static Class findPrimForClass(Object value)
          Deprecated. Get the class of the primitive type corresponding to the given constructed object.
static Method findSetter(Class classObj, String attribute)
          Deprecated. Finds the setter of a specific attribute without knowing its type.
static Method findSetter(Class classObj, String attribute, Class type)
          Deprecated. Finds the setter of a specific attribute in an object.
 Object getAttribute(Object instance, String attribute)
          Deprecated. Gets the value of a specific attribute of an MBean.
protected  Object getAttribute(Object instance, String attribute, Class mbeanClass)
          Deprecated. Invoke getAttribute through reflection on a standard MBean instance.
 AttributeList getAttributes(Object instance, String[] attributes)
          Deprecated. Enables the values of several attributes of an MBean.
 String getMBeanClassName(Object moi)
          Deprecated. This method returns the class name of an MBean.
 MBeanInfo getMBeanInfo(Object moi)
          Deprecated. This method discovers the attributes and operations that an MBean exposes for management.
 MBeanInfo getMBeanInfoFromClass(Class beanClass)
          Deprecated. This method discovers the attributes and operations that an MBean exposes for management.
 Class getMBeanInterfaceFromClass(Class c)
          Deprecated. This methods returns the MBean interface of an MBean
 Object invoke(Object instance, String operationName, Object[] params, String[] signature)
          Deprecated. Invokes an operation on an MBean.
 boolean isInstanceOf(Object instance, String className)
          Deprecated. Determine whether the given MBean is an instance of a given class/interface.
 Object setAttribute(Object instance, Attribute attribute)
          Deprecated. Sets the value of a specific attribute of an MBean.
protected  Object setAttribute(Object instance, Attribute attribute, Class mbeanClass)
          Deprecated. Invoke setAttribute through reflection on a standard MBean instance.
 AttributeList setAttributes(Object instance, AttributeList attributes)
          Deprecated. Sets the values of several attributes of an MBean.
 void testCompliance(Class c)
          Deprecated. This methods tests if the MBean is JMX compliant
 
Methods inherited from class com.sun.jdmk.DynamicMetaDataImpl
postDeregisterInvoker, postRegisterInvoker, preDeregisterInvoker, preRegisterInvoker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

testCompliance

public void testCompliance(Class c)
                    throws NotCompliantMBeanException
Deprecated. 
This methods tests if the MBean is JMX compliant

Specified by:
testCompliance in interface MetaData
Overrides:
testCompliance in class DynamicMetaDataImpl
Throws:
NotCompliantMBeanException

getMBeanInterfaceFromClass

public Class getMBeanInterfaceFromClass(Class c)
Deprecated. 
This methods returns the MBean interface of an MBean


getMBeanInfoFromClass

public MBeanInfo getMBeanInfoFromClass(Class beanClass)
                                throws IntrospectionException,
                                       NotCompliantMBeanException
Deprecated. 
This method discovers the attributes and operations that an MBean exposes for management.

Parameters:
beanClass - The class to be analyzed.
Returns:
An instance of MBeanInfo allowing to retrieve all methods and operations of this class.
Throws:
IntrospectionException - if an exception occurs during introspection.
NotCompliantMBeanException - if the MBean class is not MBean compliant.

findMethod

public static Method findMethod(Class classObj,
                                String name,
                                Class[] parameterTypes)
Deprecated. 
Finds a specific method of an object. Returns the method or null if not found


findMethod

public static Method findMethod(Class classObj,
                                String name)
Deprecated. 
Finds a specific method of an object without knowing the parameter types. Returns the method or null if not found


findMethod

public static Method findMethod(Class classObj,
                                String name,
                                int paramCount)
Deprecated. 
Finds a specific method of an object given the number of parameters. Returns the method or null if not found


findGetter

public static Method findGetter(Class classObj,
                                String attribute)
Deprecated. 
Finds the getter of a specific attribute in an object. Returns the method for accessing the attributes, null otherwise


findSetter

public static Method findSetter(Class classObj,
                                String attribute,
                                Class type)
Deprecated. 
Finds the setter of a specific attribute in an object. Returns the method for accessing the attribute, null otherwise


findSetter

public static Method findSetter(Class classObj,
                                String attribute)
Deprecated. 
Finds the setter of a specific attribute without knowing its type. Returns the method for accessing the attribute, null otherwise


findConstructor

public static Constructor findConstructor(Class theClass,
                                          Class[] parameterTypes)
Deprecated. 
Finds a specific constructor of a class Returns the requested constructor or null if not found


findClassForPrim

public static Class findClassForPrim(String primName)
Deprecated. 
Get the class of the constructed type corresponding to the given primitive type


findPrimForClass

public static Class findPrimForClass(Object value)
Deprecated. 
Get the class of the primitive type corresponding to the given constructed object.


getMBeanClassName

public String getMBeanClassName(Object moi)
                         throws IntrospectionException,
                                NotCompliantMBeanException
Deprecated. 
Description copied from interface: MetaData
This method returns the class name of an MBean.

Specified by:
getMBeanClassName in interface MetaData
Overrides:
getMBeanClassName in class DynamicMetaDataImpl
Parameters:
moi - The MBean whose class is to be analyzed.
Returns:
The class name of the MBean, as registered in its MBeanInfo.
Throws:
IntrospectionException - if an exception occurs during introspection.
NotCompliantMBeanException

getMBeanInfo

public MBeanInfo getMBeanInfo(Object moi)
                       throws IntrospectionException
Deprecated. 
Description copied from interface: MetaData
This method discovers the attributes and operations that an MBean exposes for management.

Specified by:
getMBeanInfo in interface MetaData
Overrides:
getMBeanInfo in class DynamicMetaDataImpl
Parameters:
moi - The MBean whose class is to be analyzed.
Returns:
An instance of MBeanInfo allowing to retrieve all methods and operations of this MBean.
Throws:
IntrospectionException - if an exception occurs during introspection.

getAttribute

public Object getAttribute(Object instance,
                           String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           ReflectionException
Deprecated. 
Description copied from interface: MetaData
Gets the value of a specific attribute of an MBean.

Specified by:
getAttribute in interface MetaData
Overrides:
getAttribute in class DynamicMetaDataImpl
Parameters:
instance - The MBean from which the attribute is to be retrieved.
attribute - An String specifying the name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.
Throws:
MBeanException - Wraps an exception thrown by the MBean's getter.
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the getter.

getAttributes

public AttributeList getAttributes(Object instance,
                                   String[] attributes)
                            throws ReflectionException
Deprecated. 
Description copied from interface: MetaData
Enables the values of several attributes of an MBean.

Specified by:
getAttributes in interface MetaData
Overrides:
getAttributes in class DynamicMetaDataImpl
Parameters:
instance - The MBean from which the attributes are to be retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The list of the retrieved attributes.
Throws:
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.

setAttributes

public AttributeList setAttributes(Object instance,
                                   AttributeList attributes)
                            throws ReflectionException
Deprecated. 
Description copied from interface: MetaData
Sets the values of several attributes of an MBean.

Specified by:
setAttributes in interface MetaData
Overrides:
setAttributes in class DynamicMetaDataImpl
Parameters:
instance - The MBean within which the attributes are to be set.
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The list of attributes that were set, with their new values.
Throws:
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.

setAttribute

public Object setAttribute(Object instance,
                           Attribute attribute)
                    throws AttributeNotFoundException,
                           InvalidAttributeValueException,
                           MBeanException,
                           ReflectionException
Deprecated. 
Description copied from interface: MetaData
Sets the value of a specific attribute of an MBean.

Specified by:
setAttribute in interface MetaData
Overrides:
setAttribute in class DynamicMetaDataImpl
Parameters:
instance - The MBean within which the attribute is to be set.
attribute - The identification of the attribute to be set and the value it is to be set to.
Returns:
The value of the attribute that has been set.
Throws:
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
InvalidAttributeValueException - The specified value for the attribute is not valid.
MBeanException - Wraps an exception thrown by the MBean's setter.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the setter.

invoke

public Object invoke(Object instance,
                     String operationName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Deprecated. 
Description copied from interface: MetaData
Invokes an operation on an MBean.

Specified by:
invoke in interface MetaData
Overrides:
invoke in class DynamicMetaDataImpl
Parameters:
instance - The MBean on which the method is to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when the operation is invoked
signature - An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the MBean on which the operation was invoked.
Returns:
The object returned by the operation, which represents the result of invoking the operation on the MBean specified.
Throws:
MBeanException - Wraps an exception thrown by the MBean's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.

isInstanceOf

public boolean isInstanceOf(Object instance,
                            String className)
                     throws ReflectionException
Deprecated. 
Description copied from interface: MetaData
Determine whether the given MBean is an instance of a given class/interface.

Specified by:
isInstanceOf in interface MetaData
Overrides:
isInstanceOf in class DynamicMetaDataImpl
Parameters:
instance - The MBean concerned.
className - The name of the class or interface.
Returns:
true if the MBean is an instance of the given class, false otherwise.
Throws:
ReflectionException - if

getAttribute

protected Object getAttribute(Object instance,
                              String attribute,
                              Class mbeanClass)
                       throws MBeanException,
                              AttributeNotFoundException,
                              ReflectionException
Deprecated. 
Invoke getAttribute through reflection on a standard MBean instance.

Throws:
MBeanException
AttributeNotFoundException
ReflectionException

setAttribute

protected Object setAttribute(Object instance,
                              Attribute attribute,
                              Class mbeanClass)
                       throws AttributeNotFoundException,
                              InvalidAttributeValueException,
                              MBeanException,
                              ReflectionException
Deprecated. 
Invoke setAttribute through reflection on a standard MBean instance.

Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.