TPTP 4.4.0 Monitoring Tools Project
Internal API Specification

org.eclipse.tptp.monitoring.instrumentation.internal.jmx.util
Class JmxUtils

java.lang.Object
  extended byorg.eclipse.tptp.monitoring.instrumentation.internal.jmx.util.JmxUtils

public class JmxUtils
extends java.lang.Object

A generic utiltiy class to support JMX.

Since:
TPTP 4.4

Constructor Summary
JmxUtils()
           
 
Method Summary
static StatisticsDescription createStatisticsDescription(java.lang.String className, java.lang.String methodName)
           
static java.beans.PropertyDescriptor findPropertyForMethod(java.lang.reflect.Method method)
          Finds the PropertyDescriptor for the given Method.
static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class clazz)
          Retruns an array of PropertyDescriptor for the given Class
static boolean isDeclaringInSuperClass(java.lang.reflect.Method method, java.lang.Object object, boolean checkSuper)
          Returns true if method exist in the the declaring object.
static boolean isMBean(java.lang.Class clazz)
          Returns true if the class is an Mbean.
static javax.management.MBeanServer locateMBeanServer(java.lang.String id)
          Returns an MBeanServer for a given agent id.
static javax.management.MBeanServer locateMBeanServerByDomain(java.lang.String domain)
          Returns an MBeanServer for a given domain.
static javax.management.MBeanServer locateMBeanServerFirstAvailable()
          Returns the first MBeanServer instance found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxUtils

public JmxUtils()
Method Detail

getPropertyDescriptors

public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class clazz)
                                                              throws java.beans.IntrospectionException
Retruns an array of PropertyDescriptor for the given Class

Parameters:
clazz - the Class
Returns:
an array of PropertyDescriptor
Throws:
java.beans.IntrospectionException - error from the introspection of the class

findPropertyForMethod

public static java.beans.PropertyDescriptor findPropertyForMethod(java.lang.reflect.Method method)
                                                           throws java.beans.IntrospectionException
Finds the PropertyDescriptor for the given Method.

Parameters:
method - the Method
Returns:
the PropertyDescriptor
Throws:
java.beans.IntrospectionException - error from the introspection of the class

locateMBeanServer

public static javax.management.MBeanServer locateMBeanServer(java.lang.String id)
                                                      throws MBeanServerNotFoundException
Returns an MBeanServer for a given agent id.

Parameters:
id - the agent id
Returns:
the MBeanServer
Throws:
MBeanServerNotFoundException - unable to find an MBeanServer

locateMBeanServerFirstAvailable

public static javax.management.MBeanServer locateMBeanServerFirstAvailable()
                                                                    throws MBeanServerNotFoundException
Returns the first MBeanServer instance found. If an MBeanServer is not found create a new one.

Returns:
the MBeanServer
Throws:
MBeanServerNotFoundException - unable to find an MBeanServer

locateMBeanServerByDomain

public static javax.management.MBeanServer locateMBeanServerByDomain(java.lang.String domain)
                                                              throws MBeanServerNotFoundException
Returns an MBeanServer for a given domain. If domain cannot be found will create new instances of MBeanServer for the given domain.

Parameters:
domain - the domain name
Returns:
the MBeanServer
Throws:
MBeanServerNotFoundException - unable to find an MBeanServer

isMBean

public static boolean isMBean(java.lang.Class clazz)
Returns true if the class is an Mbean.

Parameters:
clazz - the class to check
Returns:
true if class is an Mbean; Otherwise false

isDeclaringInSuperClass

public static boolean isDeclaringInSuperClass(java.lang.reflect.Method method,
                                              java.lang.Object object,
                                              boolean checkSuper)
Returns true if method exist in the the declaring object.

Parameters:
method - the Method
object - the declaring object
checkSuper - check super class
Returns:
true f method exist in the the declaring object; otherwise false

createStatisticsDescription

public static StatisticsDescription createStatisticsDescription(java.lang.String className,
                                                                java.lang.String methodName)

TPTP 4.4.0 Monitoring Tools Project
Internal API Specification