com.ibm.websphere.pmi
Class PmiJmxTestjava.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
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 connectorprotected com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on, boolean recursive)
Sample code to get levelprotected com.ibm.websphere.pmi.stat.MBeanLevelSpec[] getInstrumentationLevel(javax.management.ObjectName on, com.ibm.websphere.pmi.stat.StatDescriptor sd, boolean recursive)
Sample code to get levelvoid 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 MBeanStatDescriptorcom.ibm.websphere.pmi.stat.Stats getStatsObject(javax.management.ObjectName on, boolean recursive)
Sample code to get a Stats objectcom.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 objectvoid init(java.lang.String[] args)
parse args and getAdminClientcom.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(com.ibm.websphere.pmi.stat.MBeanStatDescriptor mName)
Sample code to get MBeanStatDescriptorscom.ibm.websphere.pmi.stat.MBeanStatDescriptor[] listStatMembers(javax.management.ObjectName mName)
sample code to show you how to navigate MBeanStatDescriptor via listStatMembersstatic 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 levelvoid 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 beanModulevoid 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.