|
|||||||||
| Home >> All >> org >> apache >> tomcat >> util >> [ threads overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.tomcat.util.threads
Class ThreadPool.ControlRunnable

java.lang.Objectorg.apache.tomcat.util.threads.ThreadPool.ControlRunnable
- All Implemented Interfaces:
- java.lang.Runnable
- Enclosing class:
- ThreadPool
- public static class ThreadPool.ControlRunnable
- extends java.lang.Object
- implements java.lang.Runnable
- extends java.lang.Object
A Thread object that executes various actions ( ThreadPoolRunnable ) under control of ThreadPool
| Field Summary | |
private boolean |
noThData
Per thread data - can be used only if all actions are of the same type. |
private ThreadPool |
p
ThreadPool where this thread will be returned |
private boolean |
shouldRun
Activate the execution of the action |
private boolean |
shouldTerminate
Stop this thread |
private ThreadWithAttributes |
t
The thread that executes the actions |
private ThreadPoolRunnable |
toRun
The method that is executed in this thread |
private java.lang.Runnable |
toRunRunnable
|
| Constructor Summary | |
(package private) |
ThreadPool.ControlRunnable(ThreadPool p)
Start a new thread, with no method in it |
| Method Summary | |
void |
kill()
|
void |
run()
This method will be called by whoever wishes to run your class implementing Runnable. |
void |
runIt(java.lang.Runnable toRun)
Run a task |
void |
runIt(ThreadPoolRunnable toRun)
Run a task |
void |
stop()
|
void |
terminate()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
p
private ThreadPool p
- ThreadPool where this thread will be returned
t
private ThreadWithAttributes t
- The thread that executes the actions
toRun
private ThreadPoolRunnable toRun
- The method that is executed in this thread
toRunRunnable
private java.lang.Runnable toRunRunnable
shouldTerminate
private boolean shouldTerminate
- Stop this thread
shouldRun
private boolean shouldRun
- Activate the execution of the action
noThData
private boolean noThData
- Per thread data - can be used only if all actions are
of the same type.
A better mechanism is possible ( that would allow association of
thread data with action type ), but right now it's enough.
| Constructor Detail |
ThreadPool.ControlRunnable
ThreadPool.ControlRunnable(ThreadPool p)
- Start a new thread, with no method in it
| Method Detail |
run
public void run()
- Description copied from interface:
java.lang.Runnable - This method will be called by whoever wishes to run your class
implementing Runnable. Note that there are no restrictions on what
you are allowed to do in the run method, except that you cannot
throw a checked exception.
- Specified by:
runin interfacejava.lang.Runnable
runIt
public void runIt(java.lang.Runnable toRun)
- Run a task
runIt
public void runIt(ThreadPoolRunnable toRun)
- Run a task
stop
public void stop()
kill
public void kill()
terminate
public void terminate()
|
|||||||||
| Home >> All >> org >> apache >> tomcat >> util >> [ threads overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.tomcat.util.threads.ThreadPool.ControlRunnable