WOLongReponsePage is an abstract subclass of WOComponent that
spawns a separate thread in which to perform the action and returns
a status page indicating that the request is being processed. Use
WOLongReponsePage when a requested action will take a long time
to complete (more than 5 seconds, say).
If you access WebObjects
framework objects from within your implementation of performAction, you
must check out the session (using WOSessionStore's checkOutSessionWithID method)
just before invoking the WebObjects framework method, and check
it back in (using WOSessionStore's checkInSessionForContext method)
just after. |
Method Types
- Performing the computation
- performAction
- Returning pages
- cancelPageForStatus
- pageForException
- pageForResult
- refreshPageForStatus
- Locking
- lock
- unlock
- Managing refresh
- refresh
- refreshInterval
- setRefreshInterval
- setStatus
- Managing cancellation
- cancel
- isCancelled
Instance Methods
public WOComponent cancel()
Cancels the request. You should bind a
cancel button on the refresh page to this method.
See
Also: isCancelled
public WOComponent cancelPageForStatus(Object status)
Returns the cancel page, which is displayed
when the request is cancelled.
public boolean isCancelled()
Returns true if the request has been cancelled.
The long running computation should check this value to see if it
should abort.
See Also: cancel
public void lock()
Locks the page.
See
Also: unlock
public WOComponent pageForException(Throwable anException)
Returns the exception page, which is displayed
when an exception occurs in performAction.
public WOComponent pageForResult(Object aResult)
Returns the result page that is displayed when performAction completes.
public Object performAction()
Override this method to perform the requested
long computation. Returns the result of that computation as an object.
public WOComponent refresh()
Called by the WOMetaRefresh invokeAction callback
(can also be called manually if the page is not self refreshing).
This method either invokes pageForException, pageForResult, refreshPageForStatus,
or cancelPageForStatus depending
on the state of the long response.
public double refreshInterval()
Returns the interval after which the refresh
page is refreshed.
public WOComponent refreshPageForStatus(Object status)
Returns the page that is displayed while the
long-running computation is running. This page displays the current
status of the computation.
public void setRefreshInterval(double interval)
Sets the refresh interval.
See
Also: refreshInterval
public void setStatus(Object status)
Sets the status of the computation to status.
The long computation should send this message periodically so that
the refresh page reflects the status of the computation.
public void unlock()
Unlocks the page.
See
Also: lock