JBossMX Parent POM 6.0.0.GA

org.jboss.mx.metadata
Class StandardMetaData

java.lang.Object
  extended by org.jboss.mx.metadata.AbstractBuilder
      extended by org.jboss.mx.metadata.StandardMetaData
All Implemented Interfaces:
MetaDataBuilder

public class StandardMetaData
extends AbstractBuilder

This metadata builder implementation builds a MBean info based on the naming rules of the Standard MBeans. The MBean server uses this builder to generate the metadata for Standard MBeans.

In cooperation with the MBeanInfoConversion class you can use this builder as a migration tool from Standard to Model MBeans, or for cases where you want the management interface be based on a compile-time type safe interface. It is also possible to subclass this builder implementation to extend it to support more sophisticated introspection rules such as adding descriptors to management interface elements.

Author:
Juha Lindfors., Trevor Squires., Thomas Diesler., Dimitris Andreadis.

Field Summary
 
Fields inherited from class org.jboss.mx.metadata.AbstractBuilder
properties
 
Constructor Summary
StandardMetaData(Class<?> mbeanClass)
          Initializes the Standard metadata builder.
StandardMetaData(Object mbeanInstance)
          Initializes the Standard metadata builder.
StandardMetaData(Object mbInstance, Class<?> mbInterface)
          Initializes the Standard metadata builder.
 
Method Summary
 MBeanInfo build()
          Constructs the Model MBean metadata.
 MBeanInfo buildFromAnnotations()
           
static Class<?> findStandardInterface(Class<?> mbeanClass)
          Locates an interface for a class that matches the Standard MBean naming convention.
 Class<?> getMBeanInterface()
          Retrieve the management interface
protected  MBeanParameterInfo[] getSignature(Class<?>[] parameterTypes, Annotation[][] annotations)
           
protected  MBeanParameterInfo[] getSignature(Constructor<?> constructor)
           
protected  MBeanParameterInfo[] getSignature(Method method)
           
protected  String getSignatureString(Method method)
           
 
Methods inherited from class org.jboss.mx.metadata.AbstractBuilder
getBooleanProperty, getProperties, getProperty, getStringProperty, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardMetaData

public StandardMetaData(Object mbeanInstance)
                 throws NotCompliantMBeanException
Initializes the Standard metadata builder. The JMX metadata is based on the class of the given resource instance.

Parameters:
mbeanInstance - MBean instance
Throws:
NotCompliantMBeanException - for any error

StandardMetaData

public StandardMetaData(Class<?> mbeanClass)
                 throws NotCompliantMBeanException
Initializes the Standard metadata builder. The JMX metadata is based on the given class.

Parameters:
mbeanClass - resource class that implements an interface adhering to the Standard MBean naming conventions
Throws:
NotCompliantMBeanException - for any error

StandardMetaData

public StandardMetaData(Object mbInstance,
                        Class<?> mbInterface)
                 throws NotCompliantMBeanException
Initializes the Standard metadata builder. The JMX metadata is based on the passed mbean interface.

Parameters:
mbInstance - MBean instance
mbInterface - the management interface
Throws:
NotCompliantMBeanException - for any error
Method Detail

findStandardInterface

public static Class<?> findStandardInterface(Class<?> mbeanClass)
Locates an interface for a class that matches the Standard MBean naming convention.

Parameters:
mbeanClass - the class to investigate
Returns:
the Standard MBean interface class or null if not found

getMBeanInterface

public Class<?> getMBeanInterface()
Retrieve the management interface

Returns:
the interface

build

public MBeanInfo build()
                throws NotCompliantMBeanException
Description copied from interface: MetaDataBuilder
Constructs the Model MBean metadata.

Specified by:
build in interface MetaDataBuilder
Specified by:
build in class AbstractBuilder
Returns:
initialized MBean info
Throws:
NotCompliantMBeanException - if there were errors building the MBean info from the given data source

buildFromAnnotations

public MBeanInfo buildFromAnnotations()
                               throws NotCompliantMBeanException
Throws:
NotCompliantMBeanException

getSignature

protected MBeanParameterInfo[] getSignature(Constructor<?> constructor)

getSignature

protected MBeanParameterInfo[] getSignature(Method method)

getSignature

protected MBeanParameterInfo[] getSignature(Class<?>[] parameterTypes,
                                            Annotation[][] annotations)

getSignatureString

protected String getSignatureString(Method method)

JBossMX Parent POM 6.0.0.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.