Avoids the expense of thread creation by pooling threads after
their run methods exit for reuse.
If the maximum pool size is reached, jobs wait for a free thread.
By default there is no maximum pool size. Idle threads timeout
and terminate until the minimum number of threads are running.
author: Greg Wilkins author: Juancarlo Anez
Inner Class :public class PoolThread extends Thread
Stop the BoundedThreadPool.
New jobs are no longer accepted,idle threads are interrupted
and stopJob is called on active threads.
The method then waits
min(getMaxStopTimeMs(),getMaxIdleTimeMs()), for all jobs to
stop, at which time killJob is called.
public void setMaxIdleTimeMs(int maxIdleTimeMs)(Code)
Set the maximum thread idle time.
Threads that are idle for longer than this period may be
stopped.
Delegated to the named or anonymous Pool.
See Also:BoundedThreadPool.getMaxIdleTimeMs Parameters: maxIdleTimeMs - Max idle time in ms.
Set the maximum number of threads.
Delegated to the named or anonymous Pool.
See Also:BoundedThreadPool.getMaxThreads Parameters: maxThreads - maximum number of threads.
Set the minimum number of threads.
Delegated to the named or anonymous Pool.
See Also:BoundedThreadPool.getMinThreads Parameters: minThreads - minimum number of threads
Stop a Job.
This method is called by the Pool if a job needs to be stopped.
The default implementation does nothing and should be extended by a
derived thread pool class if special action is required.
Parameters: thread - The thread allocated to the job, or null if no thread allocated. Parameters: job - The job object passed to run.
Methods inherited from org.mortbay.component.AbstractLifeCycle