org.apache.jcs.utils.threads
Class ThreadPool.ControlRunnable

java.lang.Object
  extended byorg.apache.jcs.utils.threads.ThreadPool.ControlRunnable
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ThreadPool

class ThreadPool.ControlRunnable
extends java.lang.Object
implements java.lang.Runnable

A Thread object that executes various actions ( IThreadPoolRunnable ) under control of ThreadPool

Author:
asmuts

Field Summary
(package private)  boolean noThData
          Per thread data - can be used only if all actions are of the same type.
(package private)  ThreadPool p
          ThreadPool where this thread will be returned
(package private)  boolean shouldRun
          Activate the execution of the action
(package private)  boolean shouldTerminate
          Stop this thread
(package private)  java.lang.Thread t
          The thread that executes the actions
(package private)  java.lang.Object[] thData
           
(package private)  IThreadPoolRunnable toRun
          The method that is executed in this thread
 
Constructor Summary
(package private) ThreadPool.ControlRunnable(ThreadPool p)
          Start a new thread, with no method in it
 
Method Summary
 void run()
          Main processing method for the ControlRunnable object
 void runIt(IThreadPoolRunnable toRun)
          Description of the Method
 void terminate()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p

ThreadPool p
ThreadPool where this thread will be returned


t

java.lang.Thread t
The thread that executes the actions


toRun

IThreadPoolRunnable toRun
The method that is executed in this thread


shouldTerminate

boolean shouldTerminate
Stop this thread


shouldRun

boolean shouldRun
Activate the execution of the action


noThData

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.


thData

java.lang.Object[] thData
Constructor Detail

ThreadPool.ControlRunnable

ThreadPool.ControlRunnable(ThreadPool p)
Start a new thread, with no method in it

Parameters:
p -
Method Detail

run

public void run()
Main processing method for the ControlRunnable object

Specified by:
run in interface java.lang.Runnable

runIt

public void runIt(IThreadPoolRunnable toRun)
Description of the Method


terminate

public void terminate()
Description of the Method