|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.sapia.ubik.net.PooledThread
public abstract class PooledThread
Implements a pooled thread. Inheriting classes need only implementing
the doExec template method.
ThreadPool,
doExec(Object)| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Statistic |
_duration
|
protected HitsPerSecStatistic |
_tps
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
PooledThread()
|
| Method Summary | |
|---|---|
protected abstract void |
doExec(java.lang.Object task)
Executes the "task" passed in, which is an arbitrary application-specific unit of work that this method performs. |
void |
exec(java.lang.Object task)
Sets this pool's task, which represents a unit of work to perform. |
protected abstract void |
handleExecutionException(java.lang.Exception e)
|
void |
run()
|
void |
shutdown()
Stops this thread. |
| 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 |
|---|
protected HitsPerSecStatistic _tps
protected Statistic _duration
| Constructor Detail |
|---|
protected PooledThread()
| Method Detail |
|---|
public final void exec(java.lang.Object task)
doExec method.
doExec(Object)public void shutdown()
public final void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected abstract void doExec(java.lang.Object task)
This template method is to be implemented by subclasses.
a - task to execute, or data on which this method should act.protected abstract void handleExecutionException(java.lang.Exception e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||