Save This Page
Home » quartz-1.6.0 » org » quartz » simpl » [javadoc | source]
org.quartz.simpl
public class: SimpleThreadPool [javadoc | source]
java.lang.Object
   org.quartz.simpl.SimpleThreadPool

All Implemented Interfaces:
    ThreadPool

This is class is a simple implementation of a thread pool, based on the org.quartz.spi.ThreadPool interface.

Runnable objects are sent to the pool with the #runInThread(Runnable) method, which blocks until a Thread becomes available.

The pool has a fixed number of Threads, and does not grow or shrink based on demand.

Nested Class Summary:
class  SimpleThreadPool.WorkerThread  

A Worker loops, waiting to execute tasks.

 
Constructor:
 public SimpleThreadPool() 
 public SimpleThreadPool(int threadCount,
    int threadPriority) 
Method from org.quartz.simpl.SimpleThreadPool Summary:
blockForAvailableThreads,   createWorkerThreads,   getLog,   getPoolSize,   getThreadCount,   getThreadNamePrefix,   getThreadPriority,   initialize,   isMakeThreadsDaemons,   isThreadsInheritContextClassLoaderOfInitializingThread,   isThreadsInheritGroupOfInitializingThread,   makeAvailable,   runInThread,   setMakeThreadsDaemons,   setThreadCount,   setThreadNamePrefix,   setThreadPriority,   setThreadsInheritContextClassLoaderOfInitializingThread,   setThreadsInheritGroupOfInitializingThread,   shutdown,   shutdown
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.quartz.simpl.SimpleThreadPool Detail:
 public int blockForAvailableThreads() 
 protected List createWorkerThreads(int count) 
 public Log getLog() 
 public int getPoolSize() 
 public int getThreadCount() 

    Get the number of worker threads in the pool.

 public String getThreadNamePrefix() 
 public int getThreadPriority() 

    Get the thread priority of worker threads in the pool.

 public  void initialize() throws SchedulerConfigException 
 public boolean isMakeThreadsDaemons() 
 public boolean isThreadsInheritContextClassLoaderOfInitializingThread() 
 public boolean isThreadsInheritGroupOfInitializingThread() 
 protected  void makeAvailable(SimpleThreadPool.WorkerThread wt) 
 public boolean runInThread(Runnable runnable) 

    Run the given Runnable object in the next available Thread. If while waiting the thread pool is asked to shut down, the Runnable is executed immediately within a new additional thread.

 public  void setMakeThreadsDaemons(boolean makeThreadsDaemons) 
 public  void setThreadCount(int count) 

    Set the number of worker threads in the pool - has no effect after initialize() has been called.

 public  void setThreadNamePrefix(String prfx) 
 public  void setThreadPriority(int prio) 

    Set the thread priority of worker threads in the pool - has no effect after initialize() has been called.

 public  void setThreadsInheritContextClassLoaderOfInitializingThread(boolean inheritLoader) 
 public  void setThreadsInheritGroupOfInitializingThread(boolean inheritGroup) 
 public  void shutdown() 

    Terminate any worker threads in this thread group.

    Jobs currently in progress will complete.

 public  void shutdown(boolean waitForJobsToComplete) 

    Terminate any worker threads in this thread group.

    Jobs currently in progress will complete.