|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.philemonworks.selfdiagnose.DiagnosticTask
public abstract class DiagnosticTask
DiagnosticTask is the abstract class for all tasks that can be registered with SelfDiagnose. Typically tasks are parameterized in order to run. Tasks may want to re-implement the setUp method in which parameter verification should be done.
Field Summary | |
---|---|
String |
comment
Used to explain the task in both the log and the configuration. |
static String |
PARAMETER_COMMENT
|
static String |
PARAMETER_REPORT
|
static String |
PARAMETER_VARIABLE
|
boolean |
reportResults
Indication for whether the receiver will report the result. |
protected String |
requestor
|
String |
variableName
Name of the reference that refers to the value of the property. |
Constructor Summary | |
---|---|
DiagnosticTask()
|
Method Summary | |
---|---|
DiagnosticTaskResult |
createResult()
Return an object to store the results of running the receiver. |
String |
getComment()
|
String |
getDefaultReportTemplate(boolean isSuccess)
User-defined Diagnostic Task subclasses should redefine this method to provide reporttemplates for both a successful and failed run. |
abstract String |
getDescription()
|
String |
getRequestor()
Return the identifier for the object that created and will register this task. |
String |
getTaskName()
On default, the task is the unqualified name for the class in lowercase. |
String |
getVariableName()
|
boolean |
hasComment()
|
void |
initializeFromAttributes(Attributes attributes)
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. |
boolean |
isReportResults()
|
DiagnosticTaskResult |
run()
Run the task and answer the result. |
DiagnosticTaskResult |
run(ExecutionContext ctx)
Run the task and answer the result. |
abstract void |
run(ExecutionContext ctx,
DiagnosticTaskResult result)
Run the task. |
void |
setComment(String comment)
|
void |
setReportResults(boolean reportResults)
|
void |
setRequestor(String identifier)
Set the identifier for the object that created and registered this task. |
void |
setUp(ExecutionContext ctx)
Override this method to verify that task parameters are initialized/set correctly. |
void |
setVariableName(String varName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PARAMETER_VARIABLE
public static final String PARAMETER_COMMENT
public static final String PARAMETER_REPORT
protected String requestor
public String variableName
public String comment
public boolean reportResults
Constructor Detail |
---|
public DiagnosticTask()
Method Detail |
---|
public DiagnosticTaskResult createResult()
public abstract String getDescription()
public String getTaskName()
public String getRequestor()
public void setUp(ExecutionContext ctx) throws DiagnoseException
ctx
- ExecutionContext
DiagnoseException
public DiagnosticTaskResult run()
public DiagnosticTaskResult run(ExecutionContext ctx)
ctx
- : ExecutionContext
public abstract void run(ExecutionContext ctx, DiagnosticTaskResult result) throws DiagnoseException
ctx
- ExecutionContextresult
- DiagnosticTaskResult
DiagnoseException
public void setRequestor(String identifier)
identifier
- public void initializeFromAttributes(Attributes attributes)
attributes
- org.xml.sax.Attributespublic String getDefaultReportTemplate(boolean isSuccess)
isSuccess
- result of running the task
public String getVariableName()
public void setVariableName(String varName)
varName
- : Stringpublic boolean hasComment()
public String getComment()
public void setComment(String comment)
public boolean isReportResults()
public void setReportResults(boolean reportResults)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |