com.philemonworks.selfdiagnose
Class CustomDiagnosticTask

java.lang.Object
  extended by com.philemonworks.selfdiagnose.DiagnosticTask
      extended by com.philemonworks.selfdiagnose.CustomDiagnosticTask
All Implemented Interfaces:
Serializable

public class CustomDiagnosticTask
extends DiagnosticTask

CustomDiagnosticTask is a wrapper on a custom defined DiagnosticTask. If the custom task could be created and initialized at configuration time then all messages are delegated to the task. If the custom task could not be created then this class provides the error message with the reason every it is asked to run.

Author:
Ernest Micklei
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.philemonworks.selfdiagnose.DiagnosticTask
comment, PARAMETER_COMMENT, PARAMETER_REPORT, PARAMETER_VARIABLE, reportResults, requestor, variableName
 
Constructor Summary
CustomDiagnosticTask()
           
 
Method Summary
 DiagnosticTaskResult createResult()
          Return an object to store the results of running the receiver.
 String getComment()
           
 String getDescription()
           
 String getErrorMessage()
           
 DiagnosticTask getTask()
           
 void run(ExecutionContext ctx, DiagnosticTaskResult result)
          Run the task.
 void setErrorMessage(String errorMessage)
           
 void setTask(DiagnosticTask task)
           
 void setUp(ExecutionContext ctx)
          Override this method to verify that task parameters are initialized/set correctly.
 
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask
getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, initializeFromAttributes, 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
 

Constructor Detail

CustomDiagnosticTask

public CustomDiagnosticTask()
Method Detail

getDescription

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

createResult

public DiagnosticTaskResult createResult()
Description copied from class: DiagnosticTask
Return an object to store the results of running the receiver.

Overrides:
createResult in class DiagnosticTask
Returns:
DiagnosticTaskResult

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

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 DiagnosticTask
Parameters:
ctx - ExecutionContext
Throws:
DiagnoseException

getErrorMessage

public String getErrorMessage()

setErrorMessage

public void setErrorMessage(String errorMessage)

getTask

public DiagnosticTask getTask()

setTask

public void setTask(DiagnosticTask task)

getComment

public String getComment()
Overrides:
getComment in class DiagnosticTask


Copyright © 2012. All Rights Reserved.