com.sun.jdmk
Interface MetaData

All Known Implementing Classes:
DynamicMetaDataImpl, MetaDataImpl

public interface MetaData

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

Since:
Java DMK 5.0

Method Summary
 Object getAttribute(Object instance, String attribute)
          Gets the value of a specific attribute of an MBean.
 AttributeList getAttributes(Object instance, String[] attributes)
          Enables the values of several attributes of an MBean.
 String getMBeanClassName(Object instance)
          This method returns the class name of an MBean.
 MBeanInfo getMBeanInfo(Object instance)
          This method discovers the attributes and operations that an MBean exposes for management.
 Object invoke(Object instance, String operationName, Object[] params, String[] signature)
          Invokes an operation on an MBean.
 boolean isInstanceOf(Object instance, String className)
          Determine whether the given MBean is an instance of a given class/interface.
 void postDeregisterInvoker(Object moi)
          Invokes the postDeregister method of an MBean that implements MBeanRegistration
 void postRegisterInvoker(Object moi, boolean registrationDone)
          Invokes the postRegister method of an MBean that implements MBeanRegistration
 void preDeregisterInvoker(Object moi)
          Invokes the preDeregister method of an MBean that implements MBeanRegistration
 ObjectName preRegisterInvoker(Object moi, ObjectName name, MBeanServer mbs)
          Invokes the preRegister method of an MBean that implements MBeanRegistration
 Object setAttribute(Object instance, Attribute attribute)
          Sets the value of a specific attribute of an MBean.
 AttributeList setAttributes(Object instance, AttributeList attributes)
          Sets the values of several attributes of an MBean.
 void testCompliance(Class c)
          This methods tests if the MBean is JMX compliant
 

Method Detail

testCompliance

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

Throws:
NotCompliantMBeanException

preRegisterInvoker

ObjectName preRegisterInvoker(Object moi,
                              ObjectName name,
                              MBeanServer mbs)
                              throws InstanceAlreadyExistsException,
                                     MBeanRegistrationException
Invokes the preRegister method of an MBean that implements MBeanRegistration

Throws:
InstanceAlreadyExistsException
MBeanRegistrationException

postRegisterInvoker

void postRegisterInvoker(Object moi,
                         boolean registrationDone)
Invokes the postRegister method of an MBean that implements MBeanRegistration


preDeregisterInvoker

void preDeregisterInvoker(Object moi)
                          throws MBeanRegistrationException
Invokes the preDeregister method of an MBean that implements MBeanRegistration

Throws:
MBeanRegistrationException

postDeregisterInvoker

void postDeregisterInvoker(Object moi)
Invokes the postDeregister method of an MBean that implements MBeanRegistration


getMBeanInfo

MBeanInfo getMBeanInfo(Object instance)
                       throws IntrospectionException
This method discovers the attributes and operations that an MBean exposes for management.

Parameters:
instance - 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.

getMBeanClassName

String getMBeanClassName(Object instance)
                         throws IntrospectionException,
                                NotCompliantMBeanException
This method returns the class name of an MBean.

Parameters:
instance - 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

getAttribute

Object getAttribute(Object instance,
                    String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           ReflectionException
Gets the value of a specific attribute of an MBean.

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:
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
MBeanException - Wraps an exception thrown by the MBean's getter.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the getter.

getAttributes

AttributeList getAttributes(Object instance,
                            String[] attributes)
                            throws ReflectionException
Enables the values of several attributes of an MBean.

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.

setAttribute

Object setAttribute(Object instance,
                    Attribute attribute)
                    throws AttributeNotFoundException,
                           InvalidAttributeValueException,
                           MBeanException,
                           ReflectionException
Sets the value of a specific attribute of an MBean.

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.

setAttributes

AttributeList setAttributes(Object instance,
                            AttributeList attributes)
                            throws ReflectionException
Sets the values of several attributes of an MBean.

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.

invoke

Object invoke(Object instance,
              String operationName,
              Object[] params,
              String[] signature)
              throws MBeanException,
                     ReflectionException
Invokes an operation on an MBean.

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

boolean isInstanceOf(Object instance,
                     String className)
                     throws ReflectionException
Determine whether the given MBean is an instance of a given class/interface.

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

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.