public class ZeroSizeThreadPool extends Object implements ThreadPool
 This is class is a simple implementation of a zero size thread pool, based on the
 ThreadPool
 The pool has zero Threads and does not grow or shrink based on demand.
 Which means it is obviously not useful for most scenarios.  When it may be useful
 is to prevent creating any worker threads at all - which may be desirable for
 the sole purpose of preserving system resources in the case where the scheduler
 instance only exists in order to schedule jobs, but which will never execute
 jobs (e.g. will never have start() called on it).
 
| Constructor and Description | 
|---|
| ZeroSizeThreadPool()
 Create a new  ZeroSizeThreadPool. | 
| Modifier and Type | Method and Description | 
|---|---|
| int | blockForAvailableThreads()
 Determines the number of threads that are currently available in in
 the pool. | 
| org.slf4j.Logger | getLog() | 
| int | getPoolSize()Get the current number of threads in the  ThreadPool. | 
| void | initialize()
 Must be called before the  ThreadPoolis
 used, in order to give the it a chance to initialize. | 
| boolean | runInThread(Runnable runnable)
 Execute the given  in the next
 availableThread. | 
| void | setInstanceId(String schedInstId)Inform the  ThreadPoolof the Scheduler instance's Id,
 prior to initialize being invoked. | 
| void | setInstanceName(String schedName)Inform the  ThreadPoolof the Scheduler instance's name,
 prior to initialize being invoked. | 
| void | shutdown() | 
| void | shutdown(boolean waitForJobsToComplete)
 Called by the QuartzScheduler to inform the  ThreadPoolthat it should free up all of it's resources because the scheduler is
 shutting down. | 
public org.slf4j.Logger getLog()
public int getPoolSize()
ThreadPoolGet the current number of threads in the ThreadPool.
getPoolSize in interface ThreadPoolpublic void initialize()
                throws SchedulerConfigException
ThreadPool
 Must be called before the ThreadPool is
 used, in order to give the it a chance to initialize.
 
Typically called by the SchedulerFactory.
initialize in interface ThreadPoolSchedulerConfigExceptionpublic void shutdown()
public void shutdown(boolean waitForJobsToComplete)
ThreadPool
 Called by the QuartzScheduler to inform the ThreadPool
 that it should free up all of it's resources because the scheduler is
 shutting down.
 
shutdown in interface ThreadPoolpublic boolean runInThread(Runnable runnable)
ThreadPool
 Execute the given RunnableThread.
 
 The implementation of this interface should not throw exceptions unless
 there is a serious problem (i.e. a serious misconfiguration). If there
 are no immediately available threads false should be returned.
 
runInThread in interface ThreadPoolpublic int blockForAvailableThreads()
ThreadPool
 Determines the number of threads that are currently available in in
 the pool.  Useful for determining the number of times
 runInThread(Runnable) can be called before returning
 false.
 
The implementation of this method should block until there is at least one available thread.
blockForAvailableThreads in interface ThreadPoolpublic void setInstanceId(String schedInstId)
ThreadPoolInform the ThreadPool of the Scheduler instance's Id,
 prior to initialize being invoked.
setInstanceId in interface ThreadPoolpublic void setInstanceName(String schedName)
ThreadPoolInform the ThreadPool of the Scheduler instance's name,
 prior to initialize being invoked.
setInstanceName in interface ThreadPoolCopyright 2001-2019, Terracotta, Inc.