Java EE 5 SDK

com.sun.appserv.management.util.j2ee
Class J2EEUtil

java.lang.Object
  extended by com.sun.appserv.management.util.j2ee.J2EEUtil

public class J2EEUtil
extends Object

J2EE JSR 77 utilities


Method Summary
static Method[] getStatisticGetterMethodsUsingIntrospection(Stats stats)
           
static Method[] getStatisticGetterMethodsUsingNames(Stats stats)
           
static String getStatisticType(Statistic statistic)
          Get the type name for a Statistic.
static String getStatsType(Stats stats)
          Get the type for use in a CompositeType type.
static Map<String,Statistic> statisticsToMap(Statistic[] statistics)
          Convert a Statistic[] into a Map keyed by the name of the Statistic, with value being the Statistic.
static CompositeDataSupport statisticToCompositeData(Statistic statistic)
          Convert a Statistic into a JMX CompositeDataSupport.
static CompositeType statisticToCompositeType(Statistic statistic)
          Get the JMX OpenMBean CompositeType corresponding to the Statistic.
static Map<String,Object> statisticToMap(Statistic statistic)
          Convert the Statistic into a Map containing all the name/value pairs obtained by finding method names that match a getter pattern getXXX().
static CompositeDataSupport statsToCompositeData(Stats stats)
          Convert a Stats object into a CompositeDataSupport, which is a standard type in JMX which can be serialized.
static Map<String,Statistic> statsToMap(Stats stats)
          Turn a Stats object into a Map containing all its Statistics, keyed by Statistic.getName() and value of the Statistic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

statisticToMap

public static Map<String,Object> statisticToMap(Statistic statistic)
Convert the Statistic into a Map containing all the name/value pairs obtained by finding method names that match a getter pattern getXXX(). Any Statistic can thus be converted into a Map which preserves all its members.

Parameters:
statistic - any Statistic or subclass

getStatisticType

public static String getStatisticType(Statistic statistic)
Get the type name for a Statistic.


statisticToCompositeType

public static CompositeType statisticToCompositeType(Statistic statistic)
                                              throws OpenDataException
Get the JMX OpenMBean CompositeType corresponding to the Statistic.

Throws:
OpenDataException

statisticToCompositeData

public static CompositeDataSupport statisticToCompositeData(Statistic statistic)
                                                     throws OpenDataException
Convert a Statistic into a JMX CompositeDataSupport.

Parameters:
statistic - any Statistic or subclass
Throws:
OpenDataException

getStatsType

public static String getStatsType(Stats stats)
Get the type for use in a CompositeType type.


statsToCompositeData

public static CompositeDataSupport statsToCompositeData(Stats stats)
                                                 throws OpenDataException
Convert a Stats object into a CompositeDataSupport, which is a standard type in JMX which can be serialized.

The CompositeData entries will keyed by the name of the Statistic. The value of each Statistic will also be a CompositeData, keyed by the value names found in that statistic.

For example, the JVMStats object would be converted into a CompositeData with the entries:

Parameters:
stats - any JSR 77 Stats object
Throws:
OpenDataException

statsToMap

public static Map<String,Statistic> statsToMap(Stats stats)
Turn a Stats object into a Map containing all its Statistics, keyed by Statistic.getName() and value of the Statistic.


statisticsToMap

public static Map<String,Statistic> statisticsToMap(Statistic[] statistics)
Convert a Statistic[] into a Map keyed by the name of the Statistic, with value being the Statistic.

Returns:
Map keyed by name of the Statistic

getStatisticGetterMethodsUsingNames

public static Method[] getStatisticGetterMethodsUsingNames(Stats stats)
                                                    throws NoSuchMethodException
Throws:
NoSuchMethodException

getStatisticGetterMethodsUsingIntrospection

public static Method[] getStatisticGetterMethodsUsingIntrospection(Stats stats)

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.