Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.tomcat.util.threads
Class ThreadPool.ControlRunnable  view ThreadPool.ControlRunnable download ThreadPool.ControlRunnable.java

java.lang.Object
  extended byorg.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

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:
run in interface java.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()