com.philemonworks.selfdiagnose.check.vendor
Class CheckSpringBeanProperty

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.vendor.CheckSpringBeanProperty
All Implemented Interfaces:
Serializable, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class CheckSpringBeanProperty
extends CheckProperty
implements org.springframework.context.ApplicationContextAware

CheckSpringBeanProperty is a task to check a property from any Spring configured bean object.

Author:
ernestmicklei
        <checkspringbeanproperty id="myBean" property="someField" />
        <checkspringbeanproperty id="myBean" operation="someMethod" />
        <checkspringbeanproperty name="myBean" property="someField" pattern="[a-z-0-9]*" />
 
  <-- make the bean available by variable "myBeanVar" to the execution context of SelfDiagnose -->
        <checkspringbeanproperty id="myBean" var="myBeanVar" />
 
See Also:
Serialized Form

Field Summary
protected static String PARAMETER_ID
           
protected static String PARAMETER_NAME
           
protected static String PARAMETER_OPERATION
           
 
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
CheckSpringBeanProperty()
           
 
Method Summary
 String getDescription()
           
 String getId()
           
 String getName()
           
 String getOperation()
           
 void initializeFromAttributes(Attributes attributes)
          This method is sent from the SelfDiagnoseHandler when a configuration is being processed.
 void run(ExecutionContext ctx, DiagnosticTaskResult result)
          Run the task.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setId(String id)
           
 void setName(String name)
           
 void setOperation(String operation)
           
 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

PARAMETER_NAME

protected static final String PARAMETER_NAME
See Also:
Constant Field Values

PARAMETER_OPERATION

protected static final String PARAMETER_OPERATION
See Also:
Constant Field Values

PARAMETER_ID

protected static final String PARAMETER_ID
See Also:
Constant Field Values
Constructor Detail

CheckSpringBeanProperty

public CheckSpringBeanProperty()
Method Detail

getDescription

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

initializeFromAttributes

public void initializeFromAttributes(Attributes attributes)
Description copied from class: DiagnosticTask
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. Use the passed attributes to initialize the receiver. If a variable parameter is passed then store it.

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

setUp

public void setUp(ExecutionContext ctx)
           throws DiagnoseException
Description copied from class: DiagnosticTask
Override this method to verify that task parameters are initialized/set correctly.

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

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

getId

public String getId()

setId

public void setId(String id)

getName

public String getName()

setName

public void setName(String name)

getOperation

public String getOperation()

setOperation

public void setOperation(String operation)

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware


Copyright © 2012. All Rights Reserved.