com.philemonworks.selfdiagnose.check
Class CheckMBeanProperty

java.lang.Object
  extended by com.philemonworks.selfdiagnose.DiagnosticTask
      extended by com.philemonworks.selfdiagnose.PatternMatchingTask
          extended by com.philemonworks.selfdiagnose.check.CheckProperty
              extended by com.philemonworks.selfdiagnose.check.CheckMBeanProperty
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CheckWebsphereJMSListenerPort

public class CheckMBeanProperty
extends CheckProperty

CheckMBeanProperty is a DiagnosticTask that checks a property and matches its (String) value to a regular expression pattern.

<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.

Author:
Ernest Micklei
See Also:
Serialized Form

Field Summary
protected  java.lang.String mbeanServerFactoryClassName
           
protected  java.lang.String operation
           
protected static java.lang.String PARAMETER_FACTORY
           
protected static java.lang.String PARAMETER_OPERATION
           
protected  java.lang.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_VARIABLE, requestor, variableName
 
Constructor Summary
CheckMBeanProperty()
           
 
Method Summary
protected  java.lang.Object accessAttributeFromMBean(javax.management.ObjectName nodeAgent, javax.management.MBeanServer server)
          Access the attribute of the MBean using the MBeanServer
 java.lang.String getAttribute()
           
 java.lang.String getDescription()
           
protected  javax.management.MBeanServer getMBeanServer()
          Create a new MBeanServer.
 java.lang.String getMbeanServerFactoryClassName()
           
 java.lang.String getOperation()
           
 java.lang.String getQuery()
           
 void initializeFromAttributes(org.xml.sax.Attributes attributes)
          This method is sent from the SelfDiagnoseHandler when a configuration is being processed.
protected  java.lang.Object invokeOperationOnMBean(javax.management.ObjectName nodeAgent, javax.management.MBeanServer server)
          Invoke the method on the MBean using the MBeanServer
protected  java.lang.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(java.lang.String mbeanFactoryClassName)
           
 void setOperation(java.lang.String operation)
           
 void setQuery(java.lang.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, 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, run, run, setComment, setRequestor, setVariableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_OPERATION

protected static final java.lang.String PARAMETER_OPERATION
See Also:
Constant Field Values

PARAMETER_FACTORY

protected static final java.lang.String PARAMETER_FACTORY
See Also:
Constant Field Values

operation

protected java.lang.String operation

query

protected java.lang.String query

mbeanServerFactoryClassName

protected java.lang.String mbeanServerFactoryClassName
Constructor Detail

CheckMBeanProperty

public CheckMBeanProperty()
Method Detail

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class DiagnosticTask
Returns:
String the description

run

public void run(ExecutionContext ctx,
                DiagnosticTaskResult result)
         throws DiagnoseException
Description copied from class: DiagnosticTask
Run the task. If an error is detected then raise a DiagnoseException. Otherwise use the result object to the report any messages when a run is completed.

Specified by:
run in class DiagnosticTask
Parameters:
ctx - ExecutionContext
result - DiagnosticTaskResult
Throws:
DiagnoseException

getMBeanServer

protected javax.management.MBeanServer getMBeanServer()
                                               throws DiagnoseException
Create a new MBeanServer.

Returns:
MBeanServer
Throws:
DiagnoseException

setUp

public void setUp(ExecutionContext ctx)
           throws DiagnoseException
Override this method to verify that task parameters are initialized/set correctly.

Overrides:
setUp in class CheckProperty
Parameters:
ctx - : ExecutionContext
Throws:
DiagnoseException

initializeFromAttributes

public void initializeFromAttributes(org.xml.sax.Attributes attributes)
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. Use the passed attributes to initialize the receiver.

Overrides:
initializeFromAttributes in class CheckProperty
Parameters:
attributes - : org.xml.sax.Attributes

invokePropertyOnMBean

protected java.lang.Object invokePropertyOnMBean(DiagnosticTaskResult result)
                                          throws DiagnoseException
Find the MBean and invoke the property as a method

Parameters:
result - : DiagnosticTaskResult
Returns:
Object
Throws:
DiagnoseException

invokeOperationOnMBean

protected java.lang.Object invokeOperationOnMBean(javax.management.ObjectName nodeAgent,
                                                  javax.management.MBeanServer server)
                                           throws DiagnoseException
Invoke the method on the MBean using the MBeanServer

Parameters:
ObjectName - nodeAgent
MBeanServer - server
Returns:
Object
Throws:
DiagnoseException

accessAttributeFromMBean

protected java.lang.Object accessAttributeFromMBean(javax.management.ObjectName nodeAgent,
                                                    javax.management.MBeanServer server)
                                             throws DiagnoseException
Access the attribute of the MBean using the MBeanServer

Parameters:
ObjectName - nodeAgent
MBeanServer - server
Returns:
Object
Throws:
DiagnoseException

getAttribute

public java.lang.String getAttribute()

getMbeanServerFactoryClassName

public java.lang.String getMbeanServerFactoryClassName()

setMbeanServerFactoryClassName

public void setMbeanServerFactoryClassName(java.lang.String mbeanFactoryClassName)

getQuery

public java.lang.String getQuery()

setQuery

public void setQuery(java.lang.String query)

getOperation

public java.lang.String getOperation()

setOperation

public void setOperation(java.lang.String operation)


Copyright © 2008. All Rights Reserved.