|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 runMethod Detail |
public AsyncJobRunner getAsyncJobRunner()
getAsyncJobRunner
in interface AsyncJobExecution
public AsyncJob getAsyncJob()
getAsyncJob
in interface AsyncJobExecution
public boolean waitForCompletion() throws InterruptedException
waitForCompletion
in interface AsyncJobExecution
InterruptedException
public boolean isStarted()
isStarted
in interface AsyncJobExecution
public boolean isFinished()
isFinished
in interface AsyncJobExecution
public Object getResult()
getResult
in interface AsyncJobExecution
public AsyncJobException getException()
getException
in interface AsyncJobExecution
public void addAsyncJobListener(AsyncJobListener listener)
addAsyncJobListener
in interface AsyncJobExecution
listener
- listener to addpublic void removeAsyncJobListener(AsyncJobListener listener)
removeAsyncJobListener
in interface AsyncJobExecution
listener
- listener to removepublic void runJobSynchronously()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |