org.apache.xalan.transformer
Class TransformerImpl.ThreadControler

java.lang.Object
  extended byorg.apache.xalan.transformer.TransformerImpl.ThreadControler
Enclosing class:
TransformerImpl

public static class TransformerImpl.ThreadControler
extends Object

Base thread controler for xalan. Must be overriden with a derived class to support thread pooling. All thread-related stuff is in this class.

WARNING! This class will probably move since the DTM CoroutineSAXParser depends on it. This class should move to the CoroutineSAXParser. You can use it, but be aware that your code will have to change when the move occurs.


Constructor Summary
TransformerImpl.ThreadControler()
           
 
Method Summary
 Thread run(Runnable task, int priority)
          Will get a thread from the pool, execute the task and return the thread to the pool.
 void waitThread(Thread worker, Runnable task)
          Wait until the task is completed on the worker thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformerImpl.ThreadControler

public TransformerImpl.ThreadControler()
Method Detail

run

public Thread run(Runnable task,
                  int priority)
Will get a thread from the pool, execute the task and return the thread to the pool. The return value is used only to wait for completion NEEDSDOC @param task

Parameters:
priority - if >0 the task will run with the given priority ( doesn't seem to be used in xalan, since it's allways the default )

waitThread

public void waitThread(Thread worker,
                       Runnable task)
                throws InterruptedException
Wait until the task is completed on the worker thread. NEEDSDOC @param worker NEEDSDOC @param task

Throws:
InterruptedException