|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.wsspi.pmi.factory.StatsFactory
public class StatsFactory
StatsFactory is main class in Custom PMI. It is designed to simplify the process of "PMI enabling" a WebSphere application or runtime component.
The following steps are required to instrument a component using Custom PMI:
StatsFactory allows runtime component to create a custom Stats/PMI (Stats is the J2EE terminology) module using an XML template. The template
should follow the DTD com/ibm/websphere/pmi/xml/stats.dtd
.
The statistics created via Custom PMI will be available to the external client programs via JMX MBean and PMI API. The Custom PMI will support all the Statistic types (CountStatistic, TimeStatistic, etc.) defined in the J2EE 1.4 Performance Data Framework. The Custom PMI cannot support any user-defined Statistic type.
This factory class can create objects of type StatsInstance and StatsGroup. The StatsInstance/StatsGroup will be part of the Performance Monitoring Infrastructure (PMI) tree structure. Each StatsInstance/StatsGroup is identified by a unique name in the PMI tree. It is suggested that the name be prefixed with the component/product name. By default each StatsInstance/StatsGroup will be added to the PMI tree at the root level. StatsFactory allows to add a StatsInstance/StatsGroup to a parent StatsInstance/StatsGroup.
Each StatsInstance or StatsGroup should be associated with an MBean in order to access the statistics via JMX interface. There are two ways to access the statistics via JMX:
In order to access the statistics via managed object MBean the user should provide the MBean when creating the StatsInstance or StatsGroup.
All Stats (with or without an MBean) can be fetched via the Perf MBean.
Stats without an MBean is identified using the StatDescriptor
. Stats with an MBean can be identified using the StatDescriptor
or the javax.management.ObjectName
.
Constructor Summary | |
---|---|
StatsFactory()
|
Method Summary | |
---|---|
static StatsGroup |
createStatsGroup(java.lang.String groupName,
java.lang.String statsTemplate,
javax.management.ObjectName mBean)
Create a StatsGroup using the Stats template and add to the PMI tree at the root level. |
static StatsGroup |
createStatsGroup(java.lang.String groupName,
java.lang.String statsTemplate,
StatsGroup parentGroup,
javax.management.ObjectName mBean)
Create a StatsGroup using the Stats template and add to the PMI tree under the specified parent group. |
static StatsGroup |
createStatsGroup(java.lang.String groupName,
java.lang.String statsTemplate,
StatsInstance parentInstance,
javax.management.ObjectName mBean)
Create a StatsGroup using the Stats template and add to the PMI tree under the specified parent instance. |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
StatsGroup parentGroup,
javax.management.ObjectName mBean,
com.ibm.wsspi.pmi.factory.StatisticActionListener listener)
Deprecated. As of 6.1, replaced by createStatsInstance(String, StatsGroup, ObjectName, StatisticActions ). |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
StatsGroup parentGroup,
javax.management.ObjectName mBean,
StatisticActions listener)
Create a StatsInstance under the specified parent group. |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
java.lang.String statsTemplate,
javax.management.ObjectName mBean,
com.ibm.wsspi.pmi.factory.StatisticActionListener listener)
Deprecated. As of 6.1, replaced by createStatsInstance(String, String, ObjectName, StatisticActions ). |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
java.lang.String statsTemplate,
javax.management.ObjectName mBean,
StatisticActions listener)
Create a StatsInstance using the Stats template and add to the PMI tree at the root level. |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
java.lang.String statsTemplate,
StatsGroup parentGroup,
javax.management.ObjectName mBean,
com.ibm.wsspi.pmi.factory.StatisticActionListener listener)
Deprecated. As of 6.1, replaced by createStatsInstance(String, String, StatsGroup, StatsGroup, ObjectName, StatisticActions ). |
static StatsInstance |
createStatsInstance(java.lang.String instanceName,
java.lang.String statsTemplate,
StatsGroup parentGroup,
javax.management.ObjectName mBean,
StatisticActions listener)
Create a StatsInstance using the template and add to the PMI tree under the specified parent group. |
static StatsGroup |
getStatsGroup(java.lang.String[] path)
This method may be used to retrieve an existing StatsGroup object. |
static StatsInstance |
getStatsInstance(java.lang.String[] path)
This method may be used to retrieve an existing StatsInstance object. |
static boolean |
isPMIEnabled()
Returns PMI service status. |
static void |
registerStatsTemplateLookup(StatsTemplateLookup lookupClass)
Registers a StatsTemplateLookup object with the PMI service (WebSphere internal use only). |
static void |
removeStatsGroup(StatsGroup group)
Removes a StatsGroup from the PMI tree. |
static void |
removeStatsInstance(StatsInstance instance)
Removes a StatsInstance from the PMI tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StatsFactory()
Method Detail |
---|
public static boolean isPMIEnabled()
public static StatsGroup createStatsGroup(java.lang.String groupName, java.lang.String statsTemplate, javax.management.ObjectName mBean) throws StatsFactoryException
groupName
- name of the groupstatsTemplate
- location of the Stats template XML filemBean
- MBean that needs to be associated with the Stats group
StatsFactoryException
- if error while creating Stats grouppublic static StatsGroup createStatsGroup(java.lang.String groupName, java.lang.String statsTemplate, StatsGroup parentGroup, javax.management.ObjectName mBean) throws StatsFactoryException
groupName
- name of the groupstatsTemplate
- location of the Stats template XML fileparentGroup
- parent Stats groupmBean
- MBean that needs to be associated with the Stats group
StatsFactoryException
- if error while creating Stats grouppublic static StatsGroup createStatsGroup(java.lang.String groupName, java.lang.String statsTemplate, StatsInstance parentInstance, javax.management.ObjectName mBean) throws StatsFactoryException
groupName
- name of the groupstatsTemplate
- location of the Stats template XML fileparentInstance
- parent Stats instancemBean
- MBean that needs to be associated with the Stats group
StatsFactoryException
- if error while creating Stats grouppublic static StatsInstance createStatsInstance(java.lang.String instanceName, java.lang.String statsTemplate, javax.management.ObjectName mBean, com.ibm.wsspi.pmi.factory.StatisticActionListener listener) throws StatsFactoryException
instanceName
- name of the instancestatsTemplate
- location of the Stats template XML filemBean
- MBean that needs to be associated with the Stats instancelistener
- a StatisticActionListener object. This object will be called when a statistic is created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static StatsInstance createStatsInstance(java.lang.String instanceName, java.lang.String statsTemplate, javax.management.ObjectName mBean, StatisticActions listener) throws StatsFactoryException
instanceName
- name of the instancestatsTemplate
- location of the Stats template XML filemBean
- MBean that needs to be associated with the Stats instancelistener
- A StatisticActions object. This object will be called when events occur on statistics created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static StatsInstance createStatsInstance(java.lang.String instanceName, StatsGroup parentGroup, javax.management.ObjectName mBean, com.ibm.wsspi.pmi.factory.StatisticActionListener listener) throws StatsFactoryException
instanceName
- name of the instanceparentGroup
- parent Stats groupmBean
- MBean that needs to be associated with the Stats instancelistener
- a StatisticActionListener object. This object will be called when a statistic is created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static StatsInstance createStatsInstance(java.lang.String instanceName, StatsGroup parentGroup, javax.management.ObjectName mBean, StatisticActions listener) throws StatsFactoryException
instanceName
- name of the instanceparentGroup
- parent Stats groupmBean
- MBean that needs to be associated with the Stats instancelistener
- A StatisticActions object. This object will be called when events occur on statistics created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static StatsInstance createStatsInstance(java.lang.String instanceName, java.lang.String statsTemplate, StatsGroup parentGroup, javax.management.ObjectName mBean, com.ibm.wsspi.pmi.factory.StatisticActionListener listener) throws StatsFactoryException
instanceName
- name of the instancestatsTemplate
- location of the Stats template XML fileparentGroup
- parent Stats groupmBean
- MBean that needs to be associated with the Stats instancelistener
- a StatisticActionListener object. This object will be called when a statistic is created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static StatsInstance createStatsInstance(java.lang.String instanceName, java.lang.String statsTemplate, StatsGroup parentGroup, javax.management.ObjectName mBean, StatisticActions listener) throws StatsFactoryException
instanceName
- name of the instancestatsTemplate
- location of the Stats template XML fileparentGroup
- parent Stats groupmBean
- MBean that needs to be associated with the Stats instancelistener
- A StatisticActions object. This object will be called when events occur on statistics created for this instance
StatsFactoryException
- if error while creating Stats instancepublic static void removeStatsInstance(StatsInstance instance) throws StatsFactoryException
instance
- StatsInstance to be removed
StatsFactoryException
- if error while removing Stats instancepublic static void removeStatsGroup(StatsGroup group) throws StatsFactoryException
group
- StatsGroup to be removed
StatsFactoryException
- if error while removing Stats grouppublic static void registerStatsTemplateLookup(StatsTemplateLookup lookupClass)
lookupClass
- An instance of StatsTemplateLookup
public static StatsGroup getStatsGroup(java.lang.String[] path)
path
- A String array. The string elements in this parameter specify the hierarchy of the stats group being retrieved. If no stats group is found matching the path provided, the response object will be null.public static StatsInstance getStatsInstance(java.lang.String[] path)
path
- A String array. The string elements in this parameter specify the hierarchy of the stats instance being retrieved. If no stats instance is found matching the path provided, the response object will be null.
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |