|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfacets.util.Tracer
facets.util.app.AppWatcher
public abstract class AppWatcher
High-level monitor of application program operation.
AppWatcher has three closely-related functions.
WatchableOperations.
WatchableOperation.cancelStyle()s.
By frequent calls to its (GUI toolkit dependent) implementation of checkBusy(), AppWatcher detects blocks in the event loop. This
enables it to
BusyCursor
AppWatcher.WatcherCoupler when an WatchableOperation requesting
WatchableOperation.CancelStyle.Timeout fails to complete within timeoutBlock ms.
systemTimeout
ms
Exceptions thrown by WatchableOperations are passed to AppWatcher.WatcherCoupler.
While the WatchableOperation completes in a (high-priority) background
thread, client code can request cancellation as shown below. Cancellation
requests are passed to AppWatcher.WatcherCoupler for confirmation.
| Style | Enabled by | Signalled by |
WatchableOperation.CancelStyle.Dialog |
Blocking the event loop by presenting a modal dialog | Dialog cancelled |
WatchableOperation.CancelStyle.Timeout |
Blocking the event loop internally while checking for timeouts | Timeout detected during busy checking |
WatchableOperation.CancelStyle.Future |
Restricting input, setting busy cursor and offering status message
via AppWatcher.WatcherCoupler |
Input unrestricted |
| Nested Class Summary | |
|---|---|
static class |
AppWatcher.WatcherCoupler
Enables client code to communicate with AppWatcher. |
| Field Summary | |
|---|---|
protected java.lang.Thread |
blocking
|
static int |
systemTimeout
|
static int |
timeoutBlock
|
static java.lang.String |
traceName
|
| Constructor Summary | |
|---|---|
AppWatcher(boolean inApplet)
|
|
| Method Summary | |
|---|---|
protected void |
cancelBlockingDialog()
|
protected boolean |
checkBusy()
|
protected void |
futureRunning(boolean on)
|
protected void |
openBlockingDialog(WatchableOperation op)
|
void |
popCursor()
|
void |
pushCursor(BusyCursor cursor)
|
protected void |
runFuture(WatchableOperation op)
|
java.lang.Object |
runWatched(WatchableOperation op)
Runs (and possibly allows cancellation of) an WatchableOperation. |
protected void |
scheduleFuture(WatchableOperation op)
|
void |
setCoupler(AppWatcher.WatcherCoupler coupler)
|
protected void |
traceOutput(java.lang.String msg)
Outputs complete trace messages to console or elsewhere. |
| Methods inherited from class facets.util.Tracer |
|---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutputWithClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String traceName
public static int timeoutBlock
public static int systemTimeout
protected java.lang.Thread blocking
| Constructor Detail |
|---|
public AppWatcher(boolean inApplet)
| Method Detail |
|---|
protected final void traceOutput(java.lang.String msg)
TracerDefault prepends helpful classname to message.
traceOutput in class Tracermsg - passed from one of the public methodspublic final java.lang.Object runWatched(WatchableOperation op)
WatchableOperation.
Exceptions thrown are passed to the AppWatcher.WatcherCoupler returned by coupler.
op - may be created within another WatchableOperation providing
this specifies WatchableOperation.CancelStyle.None.
null or the value returned by WatchableOperation.doOperations(int)protected void openBlockingDialog(WatchableOperation op)
protected void cancelBlockingDialog()
protected boolean checkBusy()
protected void scheduleFuture(WatchableOperation op)
protected final void runFuture(WatchableOperation op)
protected void futureRunning(boolean on)
public final void setCoupler(AppWatcher.WatcherCoupler coupler)
public final void pushCursor(BusyCursor cursor)
public final void popCursor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||