|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.virtuosotechnologies.lib.asyncjob.AbstractAsyncJobRunner.ExecutionImpl
Basic execution tracker implementation. Subclasses can implement startJob() by creating an instance of this class, and then calling runJobSynchronously() in an appropriate thread context. This class is fully synchronized and thread safe.
| Constructor Summary | |
protected |
AbstractAsyncJobRunner.ExecutionImpl(AsyncJob job)
Subclass-visible constructor. |
| Method Summary | |
void |
addAsyncJobListener(AsyncJobListener listener)
Add an execution listener. |
AsyncJob |
getAsyncJob()
Get the job being run |
AsyncJobRunner |
getAsyncJobRunner()
Get the runner running this job |
AsyncJobException |
getException()
Get the job failure exception. |
Object |
getResult()
Get the job result value. |
boolean |
isFinished()
Has the job finished yet? |
boolean |
isStarted()
Has the job started yet? |
void |
removeAsyncJobListener(AsyncJobListener listener)
Remove an execution listener. |
void |
runJobSynchronously()
Run a job synchronously in the current thread. |
boolean |
waitForCompletion()
Wait until the job is finished. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected AbstractAsyncJobRunner.ExecutionImpl(AsyncJob job)
job - the AsyncJob that will be run| Method Detail |
public AsyncJobRunner getAsyncJobRunner()
getAsyncJobRunner in interface AsyncJobExecutionpublic AsyncJob getAsyncJob()
getAsyncJob in interface AsyncJobExecution
public boolean waitForCompletion()
throws InterruptedException
waitForCompletion in interface AsyncJobExecutionInterruptedExceptionpublic boolean isStarted()
isStarted in interface AsyncJobExecutionpublic boolean isFinished()
isFinished in interface AsyncJobExecutionpublic Object getResult()
getResult in interface AsyncJobExecutionpublic AsyncJobException getException()
getException in interface AsyncJobExecutionpublic void addAsyncJobListener(AsyncJobListener listener)
addAsyncJobListener in interface AsyncJobExecutionlistener - listener to addpublic void removeAsyncJobListener(AsyncJobListener listener)
removeAsyncJobListener in interface AsyncJobExecutionlistener - listener to removepublic void runJobSynchronously()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||