|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ewe.sys.SlowTaskException
This class can be thrown by a method if its operations, under some circumstances may take a long time. Instead of hanging the calling thread, it can throw this exception, which contains a Handle that can be used to monitor the state of the operation and retrieve the results.
However Handles cannot be used by non-mThread threads and so a static method is provided that will provide a SlowTaskException ONLY if the current thread is a mThread thread. The method that wants to throw such an exception can then call this static method and check if a SlowTaskException was returned. If one was, then it can start up a new Thread to perform the task, and use the handle to report the progress of the operation. If a SlowTaskException was not returned, then it should just go ahead and do the task as normal.
| Constructor Summary | |
SlowTaskException(Handle h)
|
|
SlowTaskException(String message,
Handle h)
|
|
SlowTaskException(String message,
Throwable cause)
|
|
SlowTaskException(Throwable cause)
|
|
| Method Summary | |
Handle |
getHandle()
Get the handle for the task being performed. |
static SlowTaskException |
getNew()
This returns a new SlowTaskException ONLY if the calling thread is an mThread thread. |
static SlowTaskException |
getNew(String message)
This returns a new SlowTaskException ONLY if the calling thread is an mThread thread. |
static SlowTaskException |
getNew(String message,
Handle h)
This returns a new SlowTaskException ONLY if the calling thread is an mThread thread. |
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getMessage, initCause, printStackTrace, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Constructor Detail |
public SlowTaskException(Handle h)
public SlowTaskException(String message,
Handle h)
public SlowTaskException(Throwable cause)
public SlowTaskException(String message,
Throwable cause)
| Method Detail |
public Handle getHandle()
public static SlowTaskException getNew(String message)
message - An optional message for the exception.
public static SlowTaskException getNew(String message,
Handle h)
message - An optional message for the exception.h - A Handle to be used for the task.
public static SlowTaskException getNew()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||