|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.philemonworks.selfdiagnose.DiagnosticTask com.philemonworks.selfdiagnose.PatternMatchingTask com.philemonworks.selfdiagnose.check.CheckProperty com.philemonworks.selfdiagnose.check.CheckMBeanProperty
public class CheckMBeanProperty
CheckMBeanProperty is a DiagnosticTask that checks a property and matches its (String) value to a regular expression pattern.
<checkmbeanproperty query="MyApp:name=myBean" operation="getVersion" /> <checkmbeanproperty mbeanfactory="com.ibm.websphere.management.AdminServiceFactory" query="WebSphere:type=ListenerPort,name=sli_caseStatusService-ontvangenBLIBerichtLp,*" operation="isStarted" pattern="true" />Stores the property value into the (optional) specified variable.
Field Summary | |
---|---|
protected String |
mbeanServerFactoryClassName
|
protected String |
operation
|
protected static String |
PARAMETER_FACTORY
|
protected static String |
PARAMETER_OPERATION
|
protected String |
query
|
Fields inherited from class com.philemonworks.selfdiagnose.check.CheckProperty |
---|
PARAMETER_PROPERTY, property |
Fields inherited from class com.philemonworks.selfdiagnose.PatternMatchingTask |
---|
PARAMETER_PATTERN, pattern |
Fields inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
---|
comment, PARAMETER_COMMENT, PARAMETER_REPORT, PARAMETER_VARIABLE, reportResults, requestor, variableName |
Constructor Summary | |
---|---|
CheckMBeanProperty()
|
Method Summary | |
---|---|
protected Object |
accessAttributeFromMBean(ObjectName nodeAgent,
MBeanServer server)
Access the attribute of the MBean using the MBeanServer |
String |
getAttribute()
|
String |
getDescription()
|
protected MBeanServer |
getMBeanServer()
Create a new MBeanServer. |
String |
getMbeanServerFactoryClassName()
|
String |
getOperation()
|
String |
getQuery()
|
void |
initializeFromAttributes(Attributes attributes)
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. |
protected Object |
invokeOperationOnMBean(ObjectName nodeAgent,
MBeanServer server)
Invoke the method on the MBean using the MBeanServer |
protected Object |
invokePropertyOnMBean(DiagnosticTaskResult result)
Find the MBean and invoke the property as a method |
void |
run(ExecutionContext ctx,
DiagnosticTaskResult result)
Run the task. |
void |
setMbeanServerFactoryClassName(String mbeanFactoryClassName)
|
void |
setOperation(String operation)
|
void |
setQuery(String query)
|
void |
setUp(ExecutionContext ctx)
Override this method to verify that task parameters are initialized/set correctly. |
Methods inherited from class com.philemonworks.selfdiagnose.check.CheckProperty |
---|
checkPropertyAccess, getProperty, isThisRequested, setProperty |
Methods inherited from class com.philemonworks.selfdiagnose.PatternMatchingTask |
---|
checkValueAgainstPattern, getPattern, setPattern |
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
---|
createResult, getComment, getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, isReportResults, run, run, setComment, setReportResults, setRequestor, setVariableName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PARAMETER_OPERATION
protected static final String PARAMETER_FACTORY
protected String operation
protected String query
protected String mbeanServerFactoryClassName
Constructor Detail |
---|
public CheckMBeanProperty()
Method Detail |
---|
public String getDescription()
getDescription
in class DiagnosticTask
public void run(ExecutionContext ctx, DiagnosticTaskResult result) throws DiagnoseException
DiagnosticTask
run
in class DiagnosticTask
ctx
- ExecutionContextresult
- DiagnosticTaskResult
DiagnoseException
protected MBeanServer getMBeanServer() throws DiagnoseException
DiagnoseException
public void setUp(ExecutionContext ctx) throws DiagnoseException
setUp
in class CheckProperty
ctx
- : ExecutionContext
DiagnoseException
public void initializeFromAttributes(Attributes attributes)
initializeFromAttributes
in class CheckProperty
attributes
- : org.xml.sax.Attributesprotected Object invokePropertyOnMBean(DiagnosticTaskResult result) throws DiagnoseException
result
- : DiagnosticTaskResult
DiagnoseException
protected Object invokeOperationOnMBean(ObjectName nodeAgent, MBeanServer server) throws DiagnoseException
ObjectName
- nodeAgentMBeanServer
- server
DiagnoseException
protected Object accessAttributeFromMBean(ObjectName nodeAgent, MBeanServer server) throws DiagnoseException
ObjectName
- nodeAgentMBeanServer
- server
DiagnoseException
public String getAttribute()
public String getMbeanServerFactoryClassName()
public void setMbeanServerFactoryClassName(String mbeanFactoryClassName)
public String getQuery()
public void setQuery(String query)
public String getOperation()
public void setOperation(String operation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |