|
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.rasdiag.DiagnosticProviderHelper
public class DiagnosticProviderHelper
The DiagnosticProviderHelper
class provides numerous methods used by
implementers of the DiagnosticProvider
interface to simplify and commonize
implementation of that interface.
Constructor Summary | |
---|---|
DiagnosticProviderHelper()
|
Method Summary | |
---|---|
static void |
addDiagnosticProviderIDtoLogger(java.util.logging.Logger aLogger,
java.lang.String aDPid)
adds the DiagnosticProvider ID information to a logger for static update of the logger. |
static java.lang.Object |
callJmxServer(com.ibm.websphere.management.AdminService aAdminSvc,
javax.management.ObjectName aObjectName,
java.lang.String aMethod,
java.lang.Object[] aParms,
java.lang.String[] aSignatures)
performs JMX invoke function against DiagnosticProvider objects. |
static void |
deregisterMBeanFromDiagnosticService(java.lang.String dPName,
javax.management.ObjectName dPid,
boolean aDiagnosticConfigRlse)
deregisters this MBean with DiagnosticService MBean to clean up resources, including DiagnosticConfig resources Input can specify dPName, dPid, or both. |
static void |
filterEventPayload(java.lang.String aAttributeId,
java.util.HashMap payLoad)
filter a payload generated by a DiagnosticProvider down to what was requested with the AttributeId passed in on the JMX invocation. |
static int |
findAttrib(java.lang.String attribId,
AttributeInfo[] attribInfo)
find first match between the regular expression ID field in the AttributeInfo object array and the string with the name of hte current object |
static javax.management.ObjectName |
getDiagnosticService(com.ibm.websphere.management.AdminService adminSvc)
retrieves the JMX ObjectName for the DiagnosticService MBean in this JMX server. |
static java.lang.Object |
getJmxAttrib(com.ibm.websphere.management.AdminService aAdminSvc,
javax.management.ObjectName aObjectName,
java.lang.String aAttrName)
performs JMX invoke function to retrieve attribute values. |
static boolean |
isPropertyReportable(java.lang.String aAttributeId,
AttributeInfo[] inAttrs,
java.lang.String nameToCheck,
boolean aRegisteredOnly)
returns a boolean indicating whether the Property name argument should be included in the currently requested DP operation or not. |
static DiagnosticProviderInfo |
loadRegistry(java.io.File aFile,
java.lang.String aDPName)
parses an XML config file and extracts the data for the DiagnosticProviderInfo
object. |
static DiagnosticProviderInfo |
loadRegistry(java.io.InputStream aInStream,
java.lang.String aDPName)
parses an XML config input stream and extracts the data for the DiagnosticProviderInfo
object. |
static java.lang.String[] |
localize(java.util.ResourceBundle aResourceBundle,
java.lang.String[] aKeys)
localizes a set of keys for display. |
static java.lang.String[] |
localize(java.lang.String aResourceBundleName,
java.lang.String[] aKeys,
java.util.Locale aLocale)
localizes a set of keys for display. |
static AttributeInfo[] |
queryMatchingDPInfoAttributes(java.lang.String aAttributeId,
AttributeInfo[] inAttrs,
java.lang.String[] namesToCheck,
boolean aRegisteredOnly)
returns a populated AttributeInfo structure (with fully qualified name having replaced regular expression name) for all Property names in the array that match both the AttributeId, and a registry entry (registry checking only if required). |
static AttributeInfo |
queryMatchingDPInfoAttributes(java.lang.String aAttributeId,
AttributeInfo[] inAttrs,
java.lang.String nameToCheck,
boolean aRegisteredOnly)
returns a populated AttributeInfo structure (with fully qualified name having replaced regular expression name) for Property name if it matches the AttributeId and a registry entry (registry checking only if required). |
static void |
registerMBeanWithDiagnosticService(java.lang.String dPName,
javax.management.ObjectName dPid)
registers this MBean with DiagnosticService MBean so that DiagnosticService can be the front-end for this DiagnosticProvider. |
static java.util.Iterator |
resolveObjNm(com.ibm.websphere.management.AdminService sAdminSvc,
javax.management.ObjectName aDPidOn)
resolves the incoming objectName via a jmx query from which it will return a list of matching object names (in most cases, just one) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiagnosticProviderHelper()
Method Detail |
---|
public static java.lang.String[] localize(java.util.ResourceBundle aResourceBundle, java.lang.String[] aKeys)
aResourceBundle
- ResourceBundle object to use in localization. This added since not all RBNames
resolvable based on origin of MBeanaKeys
- array of keys into the resource bundle
public static java.lang.String[] localize(java.lang.String aResourceBundleName, java.lang.String[] aKeys, java.util.Locale aLocale)
aResourceBundleName
- name of the ResourceBundle to use in localizationaKeys
- array of keys into the resource bundle
public static void registerMBeanWithDiagnosticService(java.lang.String dPName, javax.management.ObjectName dPid)
dPName
- DiagnosticProvider name to register (required)dPid
- JMX ObjectName for the DiagnosticProvider being registered.public static void deregisterMBeanFromDiagnosticService(java.lang.String dPName, javax.management.ObjectName dPid, boolean aDiagnosticConfigRlse)
dPName
- DiagnosticProvider name to register. Caller can specify this parm, or leave it null and
specify the dPid parm (or specify both). CrossRef is held, so whichever is available can be used.dPid
- JMX ObjectName for the DiagnosticProvider being registered. Caller can specify this parm, or leave
it null and specify the dPName parm (or specify both). CrossRef is held, so whichever is available can be used.aDiagnosticConfigRlse
- true or false to free up DiagnosticConfig object. If false, then a call to
DiagnosticConfigHome.releaseDiagnosticConfig(String aDPName)
should also be calledpublic static javax.management.ObjectName getDiagnosticService(com.ibm.websphere.management.AdminService adminSvc)
registerMBeanWithDiagnosticSerivce
method will retrieve it if called with a null for the DiagnosticService ObjectName.
adminSvc
- JMX AdminService object from the factory. Can be null and method will
retrieve one if it is.
public static DiagnosticProviderInfo loadRegistry(java.io.File aFile, java.lang.String aDPName)
DiagnosticProviderInfo
object. Uses SAX2 as dynamic navigation was not needed.
aFile
- File containing the XMLaDPName
- diagnostic provider name
public static DiagnosticProviderInfo loadRegistry(java.io.InputStream aInStream, java.lang.String aDPName)
DiagnosticProviderInfo
object. Uses SAX2 as dynamic navigation was not needed.
aInStream
- containing the XMLaDPName
- diagnostic provider name
public static void addDiagnosticProviderIDtoLogger(java.util.logging.Logger aLogger, java.lang.String aDPid)
aLogger
- Logger to extend with the DiagnosticProvider IDaDPid
- DiagnosticProvider ID with which to extend the Loggerpublic static java.lang.Object callJmxServer(com.ibm.websphere.management.AdminService aAdminSvc, javax.management.ObjectName aObjectName, java.lang.String aMethod, java.lang.Object[] aParms, java.lang.String[] aSignatures)
aAdminSvc
- Admin Service object for JMX callsaObjectName
- JMX ObjectName containing method to be invokedaMethod
- Method to drive on the JMX ObjectaParms
- Array of parms to send to invocationaSignatures
- Array of signatures matching the parms
public static java.lang.Object getJmxAttrib(com.ibm.websphere.management.AdminService aAdminSvc, javax.management.ObjectName aObjectName, java.lang.String aAttrName)
aAdminSvc
- Admin Service object for JMX callsaObjectName
- JMX ObjectName containing method to be invokedaAttrName
- name attribute for which to get value
public static boolean isPropertyReportable(java.lang.String aAttributeId, AttributeInfo[] inAttrs, java.lang.String nameToCheck, boolean aRegisteredOnly)
aAttributeId
- AttributeId as passed in on the method callinAttrs
- Appropriate attributeArray (likely from ConfigInfo or
StateInfo object)nameToCheck
- Property names which may be sentaRegisteredOnly
- boolean to determine if we are only delivering registered
Properties, or if non-Registered properties can be sent
public static AttributeInfo[] queryMatchingDPInfoAttributes(java.lang.String aAttributeId, AttributeInfo[] inAttrs, java.lang.String[] namesToCheck, boolean aRegisteredOnly)
aAttributeId
- AttributeId as passed in on the method callinAttrs
- Appropriate attributeArray (likely from ConfigInfo or
StateInfo object)namesToCheck
- Array of Property names which may be sentaRegisteredOnly
- boolean to determine if we are only delivering registered
Properties, or if non-Registered properties can be sent
public static AttributeInfo queryMatchingDPInfoAttributes(java.lang.String aAttributeId, AttributeInfo[] inAttrs, java.lang.String nameToCheck, boolean aRegisteredOnly)
aAttributeId
- AttributeId as passed in on the method callinAttrs
- Appropriate attributeArray (likely from ConfigInfo or
StateInfo object)nameToCheck
- Property name which may be sentaRegisteredOnly
- boolean to determine if we are only delivering registered
Properties, or if non-Registered properties can be sent
public static void filterEventPayload(java.lang.String aAttributeId, java.util.HashMap payLoad)
aAttributeId
- regular expression string used to filter contents of the HashMappayLoad
- HashMap containing the current payload, but possibly with entries that should not be returned
This HashMap is updated in place to preserve any special HashMap handling/types of the caller.public static int findAttrib(java.lang.String attribId, AttributeInfo[] attribInfo)
attribId
- name of the Attribute to look forattribInfo
- array of Attribute objects in which to look for that name
public static java.util.Iterator resolveObjNm(com.ibm.websphere.management.AdminService sAdminSvc, javax.management.ObjectName aDPidOn)
sAdminSvc
- JMX AdminService reference, can be null ... if it is, this method will retrieve oneaDPidOn
- The incoming objectName that is used in the query
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |