|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
util.ExitThread
public abstract class ExitThread
An exit thread monitors the start and end time of its execution.
Additionally, it allows recording of exceptions thrown during it's
execution. Subclasses must provide a runner() method, that should
return true on successful runs.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private long |
entertime
The time the exposure thread started. |
private Exception |
error
The exception thrown, if an error occured. |
private long |
exittime
The time the exposure thread exited. |
private boolean |
success
The outcome of the execution. |
private boolean |
syncthis
If true, we syncronize on this during the run method. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
ExitThread()
Constructs a new exit thread without synchronization in the run method. |
protected |
ExitThread(boolean sync)
Specifies, if the constructed thread should synchronize on itself at the run method or not. |
| Method Summary | |
|---|---|
private void |
clear()
Resets all field to invalid. |
private void |
dorun()
This method is called either synchronized or in an unsynchronized state directly from the run method. |
long |
getEnterTime()
Returns the enter time of the thread. |
Exception |
getError()
Returns the exception that occured during the runner() method. |
long |
getExecutionTime()
Returns the execution span as monitored by this thread. |
long |
getExitTime()
Returns the exit time of the thread. |
void |
run()
We monitor the enter and exit time, additionally, we notify any waiting object on exit. |
protected abstract boolean |
runner()
This method is the modified run method. |
boolean |
wasSuccess()
Returns true, if the last execution was successful. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean syncthis
private long entertime
private long exittime
private Exception error
private boolean success
| Constructor Detail |
|---|
protected ExitThread()
protected ExitThread(boolean sync)
| Method Detail |
|---|
private void clear()
public void run()
runner() method, this
thread is interrupted.
run in interface Runnablerun in class Threadprivate void dorun()
runner() method.
public Exception getError()
runner() method.
public long getExitTime()
public long getEnterTime()
public long getExecutionTime()
public boolean wasSuccess()
protected abstract boolean runner()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||