org.jdiagnose.runtime
Class DefaultDiagnosticRunner
java.lang.Object
org.jdiagnose.runtime.DefaultDiagnosticRunner
- All Implemented Interfaces:
- DiagnosticRunner
- public class DefaultDiagnosticRunner
- extends java.lang.Object
- implements DiagnosticRunner
The DiagnosticRunner is responsible for running a diagnostic and all
of it's children. It has been design to support synchronous and
asynchronous running. Usage is usually:
SucceedingDiagnostic diagnostic = new SucceedingDiagnostic();
DiagnosticRunner runner = new DiagnosticRunner(diagnostic);
runner.run();
if(runnner.getResult().getState() == ResultState.FAILURE) {
log.warn("Diagnostics failed");
}
TODO jamie there is an issue with diagnostic results and concurrency
TODO jamie consider attaching the listeners to the inner class
TODO jamie consider creating new diagnostic results per run
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultDiagnosticRunner
public DefaultDiagnosticRunner(DiagnosticContainer container)
runDiagnosticContainerResult
protected void runDiagnosticContainerResult(java.util.Stack stack,
DiagnosticContainerResult container)
realRun
protected void realRun()
run
public DiagnosticContainerResult run()
- Specified by:
run
in interface DiagnosticRunner
runAsynchronously
public DiagnosticContainerResult runAsynchronously()
throws java.lang.InterruptedException
- Specified by:
runAsynchronously
in interface DiagnosticRunner
- Throws:
java.lang.InterruptedException
fireDiagnosticRunStarted
protected void fireDiagnosticRunStarted(RunEvent event)
fireDiagnosticRunFinished
protected void fireDiagnosticRunFinished(RunEvent event)
fireDiagnosticResultStarted
protected void fireDiagnosticResultStarted(ResultEvent event)
fireDiagnosticResultFinished
protected void fireDiagnosticResultFinished(ResultEvent event)
addRunListener
public void addRunListener(RunListener runListener)
- Specified by:
addRunListener
in interface DiagnosticRunner
removeRunListener
public void removeRunListener(RunListener runListener)
- Specified by:
removeRunListener
in interface DiagnosticRunner
addResultListener
public void addResultListener(ResultListener resultListener)
- Specified by:
addResultListener
in interface DiagnosticRunner
removeResultListener
public void removeResultListener(ResultListener resultListener)
- Specified by:
removeResultListener
in interface DiagnosticRunner
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface DiagnosticRunner
getContainerResult
public DiagnosticContainerResult getContainerResult()
- Specified by:
getContainerResult
in interface DiagnosticRunner
setRunListeners
public void setRunListeners(java.util.List runListeners)
- Specified by:
setRunListeners
in interface DiagnosticRunner
setResultListeners
public void setResultListeners(java.util.List resultListeners)
- Specified by:
setResultListeners
in interface DiagnosticRunner
Copyright © 2004-2005 Grape Design Limited. All Rights Reserved.