|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 | |
|---|---|
java.lang.String |
comment
Used to explain the task in both the log and the configuration. |
static java.lang.String |
PARAMETER_COMMENT
|
static java.lang.String |
PARAMETER_VARIABLE
|
protected java.lang.String |
requestor
|
java.lang.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. |
java.lang.String |
getComment()
|
java.lang.String |
getDefaultReportTemplate(boolean isSuccess)
User-defined Diagnostic Task subclasses should redefine this method to provide reporttemplates for both a successful and failed run. |
abstract java.lang.String |
getDescription()
|
java.lang.String |
getRequestor()
Return the identifier for the object that created and will register this task. |
java.lang.String |
getTaskName()
On default, the task is the unqualified name for the class in lowercase. |
java.lang.String |
getVariableName()
|
boolean |
hasComment()
|
void |
initializeFromAttributes(org.xml.sax.Attributes attributes)
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. |
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(java.lang.String comment)
|
void |
setRequestor(java.lang.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(java.lang.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 java.lang.String PARAMETER_VARIABLE
public static final java.lang.String PARAMETER_COMMENT
protected java.lang.String requestor
public java.lang.String variableName
public java.lang.String comment
| Constructor Detail |
|---|
public DiagnosticTask()
| Method Detail |
|---|
public DiagnosticTaskResult createResult()
public abstract java.lang.String getDescription()
public java.lang.String getTaskName()
public java.lang.String getRequestor()
public void setUp(ExecutionContext ctx)
throws DiagnoseException
ctx - ExecutionContext
DiagnoseExceptionpublic DiagnosticTaskResult run()
public DiagnosticTaskResult run(ExecutionContext ctx)
ctx - : ExecutionContext
public abstract void run(ExecutionContext ctx,
DiagnosticTaskResult result)
throws DiagnoseException
ctx - ExecutionContextresult - DiagnosticTaskResult
DiagnoseExceptionpublic void setRequestor(java.lang.String identifier)
identifier - public void initializeFromAttributes(org.xml.sax.Attributes attributes)
attributes - org.xml.sax.Attributespublic java.lang.String getDefaultReportTemplate(boolean isSuccess)
isSuccess - result of running the task
public java.lang.String getVariableName()
public void setVariableName(java.lang.String varName)
varName - : Stringpublic boolean hasComment()
public java.lang.String getComment()
public void setComment(java.lang.String comment)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||