|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.apache.excalibur.thread.impl.WorkerThread
This class extends the Thread class to add recyclable functionalities.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
protected |
WorkerThread(AbstractThreadPool pool,
java.lang.ThreadGroup group,
java.lang.String name)
Allocates a new Worker object. |
Method Summary | |
void |
clearInterruptFlag()
Clears the interrupt flag for this thread. |
protected void |
debug(java.lang.String message)
Used to log major events against the worker. |
protected void |
debug(java.lang.String message,
java.lang.Throwable throwable)
Used to log major events against the worker. |
protected void |
detailDebug(java.lang.String message)
Used to log minor events against the worker. |
protected void |
detailDebug(java.lang.String message,
java.lang.Throwable throwable)
Used to log minor events against the worker. |
void |
dispose()
Set the alive variable to false causing the worker to die. |
protected ThreadControl |
execute(Executable work)
Set the Work code this Worker must execute and notifies its thread to do it. |
protected void |
executeAndWait(Executable work)
Set the Work code this Worker must execute and notifies its thread to do it. |
protected void |
postExecute()
Overide this method to execute something after each bit of "work". |
protected void |
preExecute()
Overide this method to execute something before each bit of "work". |
protected void |
recycleThread()
Implement this method to replace thread back into pool. |
void |
run()
The main execution loop. |
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 |
protected WorkerThread(AbstractThreadPool pool, java.lang.ThreadGroup group, java.lang.String name)
Worker
object.
Method Detail |
public final void run()
protected void recycleThread()
protected void postExecute()
protected void preExecute()
public void clearInterruptFlag()
public void dispose()
This is called by the pool when it is removed.
protected ThreadControl execute(Executable work)
protected void executeAndWait(Executable work)
protected void debug(java.lang.String message)
This implementation is a Noop. Subclasses can override to actually do some logging.
message
- Message to log.protected void debug(java.lang.String message, java.lang.Throwable throwable)
This implementation is a Noop. Subclasses can override to actually do some logging.
message
- Message to log.throwable
- Throwable to log with the message.protected void detailDebug(java.lang.String message)
This implementation is a Noop. Subclasses can override to actually do some logging.
message
- Message to log.protected void detailDebug(java.lang.String message, java.lang.Throwable throwable)
This implementation is a Noop. Subclasses can override to actually do some logging.
message
- Message to log.throwable
- Throwable to log with the message.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |