com.ibm.websphere.pmi
Class PmiJmxTest

java.lang.Object
  |
  +--com.ibm.websphere.pmi.PmiJmxTest
All Implemented Interfaces:
PmiConstants

public class PmiJmxTest
extends java.lang.Object
implements PmiConstants

Sample code to use AdminClient API directly to get PMI data from PerfMBean and individual MBeans which support getStats method.


Field Summary
 
Fields inherited from interface com.ibm.websphere.pmi.PmiConstants
AE_35, AE_40, AES_40, ALL_DATA, APPSERVER_MODULE, BEAN_METHODS_SUBMODULE, BEAN_MODULE, CACHE_MODULE, COLLECTION_DESC, CONNPOOL_MODULE, DEFAULT_MODULE_PREFIX, EJB_ENTITY, EJB_MESSAGEDRIVEN, EJB_STATEFUL, EJB_STATELESS, INITIALIZATION_FAILED, INITIALIZING, INTERCEPTOR_SUBMODULE, J2C_CF, J2C_DS, J2C_JMS_CONNECTIONS, J2C_MODULE, JAVA_TIME_CONVERT_RATIO, JVMPI_MODULE, LEVEL_DISABLE, LEVEL_ENABLE, LEVEL_HIGH, LEVEL_HIGH_STRING, LEVEL_LOW, LEVEL_LOW_STRING, LEVEL_MAX, LEVEL_MAX_STRING, LEVEL_MEDIUM, LEVEL_MEDIUM_STRING, LEVEL_NONE, LEVEL_NONE_STRING, LEVEL_UNDEFINED, LOAD_AVG, LOST_CONTACT, METHODS_SUBMODULE_SHORTNAME, MSG_BUNDLE, NOT_IN_SUBMODULE, ORBPERF_MODULE, PMI_DISABLE_STRING, ROOT_DESC, ROOT_NAME, RUNNING, RUNTIME_MODULE, SERVLET_SUBMODULE, SERVLETS_SUBMODULE_SHORTNAME, SESSIONS_MODULE, STOPPED, SYSTEM_MODULE, TEMPLATE_SUBMODULE, TERMINATING, THREADPOOL_MODULE, TRAN_MODULE, TYPE_CATEGORY, TYPE_COLLECTION, TYPE_DATA, TYPE_DOUBLE, TYPE_INSTANCE, TYPE_INT, TYPE_INVALID, TYPE_LOAD, TYPE_LONG, TYPE_MODULE, TYPE_MODULEROOT, TYPE_NODE, TYPE_ROOT, TYPE_SERVER, TYPE_STAT, TYPE_SUBINSTANCE, TYPE_SUBMODULE, TYPE_UNDEFINED, UNINITIALIZED, UNKNOWN_ID, WEBAPP_MODULE, WEBSERVICES_MODULE, WEBSERVICES_SUBMODULE, WLM_CLIENT_MODULE, WLM_MODULE, WLM_SERVER_MODULE, WSGW_MODULE, XML_COLLECTION, XML_COUNT, XML_CREATETIME, XML_DOUBLE, XML_ENDCOLLECTION, XML_ENDLINE, XML_ENDMODULE, XML_ENDNODE, XML_ENDSERVER, XML_ENDTAG, XML_ID, XML_INT, XML_INTEGRAL, XML_LASTVALUE, XML_LOAD, XML_LONG, XML_MODULE, XML_NAME, XML_NODE, XML_QUOTE, XML_SERVER, XML_START, XML_STAT, XML_SUMOFSQUARES, XML_TIME, XML_TOTAL, XML_VALUE, XML_VIEW
 
Constructor Summary
PmiJmxTest()
          Creates a new test object (Need a default constructor for the testing framework)
 
Method Summary
 void doTest()
          Some sample code to set level, get data, and display data.
 PmiModuleConfig findConfig(javax.management.ObjectName on)
          Deprecated. Use com.ibm.websphere.pmi.client.PmiClient.findConfig()
 PmiModuleConfig findConfig(java.lang.String moduleName)
          Deprecated. Use com.ibm.websphere.pmi.client.PmiClient.findConfig()
 com.ibm.websphere.management.AdminClient getAdminClient(java.lang.String hostStr, java.lang.String portStr, java.lang.String connector)
          get AdminClient using the given host, port, and connector
protected  com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on, boolean recursive)
          Sample code to get level
protected  com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on, com.ibm.websphere.pmi.stat.StatDescriptor sd, boolean recursive)
          Sample code to get level
 void getObjectNames()
          get all the ObjectNames.
 com.ibm.websphere.pmi.stat.MBeanStatDescriptor getStatDescriptor(javax.management.ObjectName oName, java.lang.String name)
          sample code to show how to get a specific MBeanStatDescriptor
 com.ibm.websphere.pmi.stat.Stats getStatsObject(javax.management.ObjectName on, boolean recursive)
          Sample code to get a Stats object
 com.ibm.websphere.pmi.stat.Stats getStatsObject(javax.management.ObjectName on, com.ibm.websphere.pmi.stat.StatDescriptor sd, boolean recursive)
          Sample code to get a Stats object
 void init(java.lang.String[] args)
          parse args and getAdminClient
 com.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(com.ibm.websphere.pmi.stat.MBeanStatDescriptor mName)
          Sample code to get MBeanStatDescriptors
 com.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(javax.management.ObjectName mName)
          sample code to show you how to navigate MBeanStatDescriptor via listStatMembers
static void main(java.lang.String[] args)
           
protected  void setInstrumentationLevel(javax.management.ObjectName on, com.ibm.websphere.pmi.stat.StatDescriptor sd, int level)
          Sample code to set level
 void setServerConfig(com.ibm.websphere.pmi.stat.Stats stats)
          The Stats object returned from server does not have static config info.
 void testEJB()
          sample code to get PMI data from beanModule
 void testJSR77Stats()
          Sample code to show how to call getStats on StatisticProvider MBean directly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmiJmxTest

public PmiJmxTest()
Creates a new test object (Need a default constructor for the testing framework)

Method Detail

main

public static void main(java.lang.String[] args)

init

public void init(java.lang.String[] args)
parse args and getAdminClient


getAdminClient

public com.ibm.websphere.management.AdminClient getAdminClient(java.lang.String hostStr,
                                                               java.lang.String portStr,
                                                               java.lang.String connector)
get AdminClient using the given host, port, and connector


getObjectNames

public void getObjectNames()
get all the ObjectNames.


doTest

public void doTest()
Some sample code to set level, get data, and display data.


getInstrumentationLevel

protected com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on,
                                                                              com.ibm.websphere.pmi.stat.StatDescriptor sd,
                                                                              boolean recursive)
Sample code to get level


getInstrumentationLevel

protected com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on,
                                                                              boolean recursive)
Sample code to get level


setInstrumentationLevel

protected void setInstrumentationLevel(javax.management.ObjectName on,
                                       com.ibm.websphere.pmi.stat.StatDescriptor sd,
                                       int level)
Sample code to set level


getStatsObject

public com.ibm.websphere.pmi.stat.Stats getStatsObject(javax.management.ObjectName on,
                                                       com.ibm.websphere.pmi.stat.StatDescriptor sd,
                                                       boolean recursive)
Sample code to get a Stats object


getStatsObject

public com.ibm.websphere.pmi.stat.Stats getStatsObject(javax.management.ObjectName on,
                                                       boolean recursive)
Sample code to get a Stats object


setServerConfig

public void setServerConfig(com.ibm.websphere.pmi.stat.Stats stats)
The Stats object returned from server does not have static config info. You have to set it on client side.


getStatDescriptor

public com.ibm.websphere.pmi.stat.MBeanStatDescriptor getStatDescriptor(javax.management.ObjectName oName,
                                                                        java.lang.String name)
sample code to show how to get a specific MBeanStatDescriptor


listStatMembers

public com.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(javax.management.ObjectName mName)
sample code to show you how to navigate MBeanStatDescriptor via listStatMembers


listStatMembers

public com.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(com.ibm.websphere.pmi.stat.MBeanStatDescriptor mName)
Sample code to get MBeanStatDescriptors


testEJB

public void testEJB()
sample code to get PMI data from beanModule


testJSR77Stats

public void testJSR77Stats()
Sample code to show how to call getStats on StatisticProvider MBean directly.


findConfig

public PmiModuleConfig findConfig(javax.management.ObjectName on)
Deprecated. Use com.ibm.websphere.pmi.client.PmiClient.findConfig()

Get PmiModuleConfig based on MBean ObjectName


findConfig

public PmiModuleConfig findConfig(java.lang.String moduleName)
Deprecated. Use com.ibm.websphere.pmi.client.PmiClient.findConfig()

Get PmiModuleConfig based on PMI module name



 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.