com.gridsystems.jmx
Class AnnotatedStandardMXBean

java.lang.Object
  extended by javax.management.StandardMBean
      extended by com.gridsystems.jmx.AnnotatedStandardMXBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration
Direct Known Subclasses:
KernelConfig

public class AnnotatedStandardMXBean
extends javax.management.StandardMBean

AnnotatedStandardMBean type.

This class has lots of commented code that only works in Java 6.

Author:
Rodrigo Ruiz

Constructor Summary
protected AnnotatedStandardMXBean(java.lang.Class<T> iface)
          Make a DynamicMBean out of this, using the specified mbeanInterface class.
  AnnotatedStandardMXBean(T impl, java.lang.Class<T> iface)
          Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.
 
Method Summary
protected  java.lang.String getDescription(javax.management.MBeanConstructorInfo ctor, javax.management.MBeanParameterInfo param, int sequence)
          
protected  java.lang.String getDescription(javax.management.MBeanFeatureInfo info)
          
protected  java.lang.String getDescription(javax.management.MBeanOperationInfo op, javax.management.MBeanParameterInfo param, int sequence)
          
protected  java.lang.Object getField(javax.management.MBeanFeatureInfo info, java.lang.String fieldName)
          Gets the value of an MBean feature info descriptor field.
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedStandardMXBean

public AnnotatedStandardMXBean(T impl,
                               java.lang.Class<T> iface)
                        throws javax.management.NotCompliantMBeanException

Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.

Type Parameters:
T - Allows the compiler to check that implementation does indeed implement the class described by mbeanInterface. The compiler can only check this if mbeanInterface is a class literal such as MyMBean.class.
Parameters:
impl - The implementation of this MBean.
iface - The Management Interface exported by this MBean's implementation. If null, then this object will use standard JMX design pattern to determine the management interface associated with the given implementation.
Throws:
java.lang.IllegalArgumentException - if the given implementation is null.
javax.management.NotCompliantMBeanException - if the iface does not follow JMX design patterns for Management Interfaces, or if the given implementation does not implement the specified interface.

AnnotatedStandardMXBean

protected AnnotatedStandardMXBean(java.lang.Class<T> iface)
                           throws javax.management.NotCompliantMBeanException

Make a DynamicMBean out of this, using the specified mbeanInterface class.

Call this(this,mbeanInterface). This constructor is reserved to subclasses.

Type Parameters:
T - Allows the compiler to check that implementation does indeed implement the class described by mbeanInterface. The compiler can only check this if mbeanInterface is a class literal such as MyMBean.class.
Parameters:
iface - The Management Interface exported by this MBean.
Throws:
javax.management.NotCompliantMBeanException - if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if this does not implement the specified interface.
Method Detail

getField

protected java.lang.Object getField(javax.management.MBeanFeatureInfo info,
                                    java.lang.String fieldName)
Gets the value of an MBean feature info descriptor field.

Parameters:
info - The mbean instance
fieldName - The descriptor field name
Returns:
The field value, or null

getDescription

protected java.lang.String getDescription(javax.management.MBeanConstructorInfo ctor,
                                          javax.management.MBeanParameterInfo param,
                                          int sequence)

Overrides:
getDescription in class javax.management.StandardMBean

getDescription

protected java.lang.String getDescription(javax.management.MBeanFeatureInfo info)

Overrides:
getDescription in class javax.management.StandardMBean

getDescription

protected java.lang.String getDescription(javax.management.MBeanOperationInfo op,
                                          javax.management.MBeanParameterInfo param,
                                          int sequence)

Overrides:
getDescription in class javax.management.StandardMBean


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.