|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jwo.landserf.process.LSThread
Processing thread that times itself and allows messages
to be logged. Any class that inherits this must place
the body of the thread in the doProcessing
method.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
LSThread(String startMessage,
GISFrame gisFrame)
Creates thread and stores GISFrame to store output and report progress and any error/info messages generated by the process. |
Method Summary | |
boolean |
checkStoppedThread()
Reports whether a request has been made to stop or pause this thread. |
abstract void |
doProcessing()
Abstract method that will contain processing. |
void |
interruptionRequested()
Responds to a request for an interruption to this process. |
void |
resetTimer()
Resets the timer for threads that have GUI processes that shouldn't contribute to the time of the process. |
void |
run()
Starts the thread's processing and reports on progress. |
void |
setErrorMessage(String m)
Sets an error message to be displayed once the thread has completed. |
void |
setMessage(String m)
Sets the final message once the processing has been completed. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LSThread(String startMessage, GISFrame gisFrame)
startMessage
- Message to display when thread starts.gisFrame
- Frame that called the thread.Method Detail |
public void run()
doProcessing()
method.
run
in interface Runnable
public void resetTimer()
public abstract void doProcessing()
public void setMessage(String m)
m
- Message to display when processing has been completed.public void setErrorMessage(String m)
m
- Error message to display.public void interruptionRequested()
interruptionRequested
in interface JWInterruptionListener
public boolean checkStoppedThread()
doProcessing
method loop to allow it to be stopped or paused
externally with a graceful exit. This approach is used in
preference to the inherantly unsafe (and deprecated) methods stop()
,
suspend()
and resume()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |