|
com.im.commons.nbcommons 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.im.commons.progress.BackgroundRunner
public abstract class BackgroundRunner
The utility class which supports running of some task in request processor and after finishing transfer the code flow to AWT thread. It can be used also for delayed task running, but in this case override getRequestProcessor() method to return some RP with only one task running simultaneously.
| Constructor Summary | |
|---|---|
BackgroundRunner()
|
|
BackgroundRunner(int delay)
|
|
| Method Summary | |
|---|---|
protected RequestProcessor.Task |
createTask()
|
protected void |
failTask(Exception exc)
Finishes the task with the failure report passed as a parameter. |
protected Object |
getCreateLock()
|
protected int |
getDelay()
|
protected RequestProcessor |
getRequestProcessor()
Which RP to use for running tasks. |
RequestProcessor.Task |
getTask()
|
void |
interrupt()
|
boolean |
phase1Cancelled(CancelException exc)
|
boolean |
phase1Exception(Exception exc)
All subclasses must override this method and provide more user-friendly error notification. |
void |
phase1Finally()
|
protected void |
phase1FinallyInternal()
|
abstract void |
phase1InRequestProcessor()
This method code is executed in request processor. |
void |
phase2InAWT()
This method code is executed in AWT thread after phase1 finishes. |
protected void |
processTheTask()
|
void |
restart()
|
RequestProcessor.Task |
start()
Start runner. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BackgroundRunner()
public BackgroundRunner(int delay)
| Method Detail |
|---|
public RequestProcessor.Task start()
protected final Object getCreateLock()
protected RequestProcessor.Task createTask()
protected final void failTask(Exception exc)
exc - The failureprotected final void processTheTask()
public void interrupt()
protected int getDelay()
protected RequestProcessor getRequestProcessor()
public void restart()
public RequestProcessor.Task getTask()
public abstract void phase1InRequestProcessor()
public void phase2InAWT()
public boolean phase1Cancelled(CancelException exc)
public boolean phase1Exception(Exception exc)
protected void phase1FinallyInternal()
public void phase1Finally()
|
com.im.commons.nbcommons 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||