
Public Member Functions | |
| DefaultImplementation () | |
| boolean | isDone () |
| ERXLongResponse | longResponse () |
| WOComponent | nextPage () |
| abstract Object | performAction () |
| void | run () |
| void | setLongResponse (ERXLongResponse sender) |
| void | start () |
| Object | status () |
| void | stop () |
Public Attributes | |
| Logger | log = Logger.getLogger(ERXUtilities.class) |
Protected Member Functions | |
| void | _finishInitialization () |
| WOComponent | cancelPageForStatus (Object aStatus) |
| Exception | exception () |
| boolean | isCancelled () |
| WOComponent | pageForException (Exception exception) |
| WOComponent | pageForResult (Object aResult) |
| WOComponent | refreshPageForStatus (Object aStatus) |
| Object | result () |
| void | setException (Exception anObject) |
| void | setResult (Object anObject) |
| void | setStatus (Object anObject) |
Protected Attributes | |
| boolean | _cancelled |
| boolean | _done |
| Exception | _exception |
| ERXLongResponse | _longResponse |
| Object | _result |
| Object | _status |
| Thread | _thread |
Constructor
| void _finishInitialization | ( | ) | [protected] |
Sets up the object.
| WOComponent cancelPageForStatus | ( | Object | aStatus | ) | [protected] |
Override this to return a sensible page to show after the task was stopped. The default implementation returns the refresh component's top-level page
| aStatus | some status object |
| Exception exception | ( | ) | [protected] |
Returns the exception that may have occurred in the run() method.
| boolean isCancelled | ( | ) | [protected] |
Checks if the task was stopped externally.
| boolean isDone | ( | ) |
(non-Javadoc)
Implements ERXLongResponseTask.
| ERXLongResponse longResponse | ( | ) |
Returns the long response for this task.
| WOComponent nextPage | ( | ) |
Default implementation that controls the pages returned on each iteration.
Implements ERXLongResponseTask.
| WOComponent pageForException | ( | Exception | exception | ) | [protected] |
Override this to return an exception page suitable for the given exception. This implementation just re-throws the exception.
| exception |
| WOComponent pageForResult | ( | Object | aResult | ) | [protected] |
Override this to return the page after the task was completed without beeing stopped. Whether or not this counts as a success should be divined from the result object. This is the same object you return after being asked for result().
| aResult | some result object |
| abstract Object performAction | ( | ) | [pure virtual] |
You need to override this and perform your long running task.
| WOComponent refreshPageForStatus | ( | Object | aStatus | ) | [protected] |
Override this to return and modify the refresh page. This is called while the task is still running. Note that is the place where you can call ERXLongResponse.setRefreshInterval(int) to set the next refresh time.
| aStatus |
| Object result | ( | ) | [protected] |
The abstract result object that has been returned by performAction().
| void run | ( | ) |
Implementation of the Runnable interface.
| void setException | ( | Exception | anObject | ) | [protected] |
Use this method to flag if an exception page should get displayed after finishing the current step.
| anObject |
| void setLongResponse | ( | ERXLongResponse | sender | ) |
Sets the long response that controls this task.
Implements ERXLongResponseTask.
| void setResult | ( | Object | anObject | ) | [protected] |
Abstract result object that will get set when the task is finished.
| anObject |
| void setStatus | ( | Object | anObject | ) | [protected] |
| void start | ( | ) |
Default implementation of the ERXLongResponseTask.start() method. Creates a new thread unless there already exists one.
Implements ERXLongResponseTask.
| Object status | ( | ) |
Returns a current status. This can be any object and will given again to you to divine the next step.
| void stop | ( | ) |
Stops the task. This just sets the cancel flag. Its up to you to check in your task if you are interruptable. So you should check isCancelled() in your performAction().
Implements ERXLongResponseTask.
boolean _cancelled [protected] |
Holds the cancel flag
boolean _done [protected] |
Holds the done flag
Exception _exception [protected] |
Exception code
ERXLongResponse _longResponse [protected] |
Refresh page that controls this task
Object _result [protected] |
Result code
Object _status [protected] |
Status code
Thread _thread [protected] |
Hold the thread that performs the task
1.5.8