org.quartz.simpl
Class ZeroSizeThreadPool

java.lang.Object
  extended by org.quartz.simpl.ZeroSizeThreadPool
All Implemented Interfaces:
org.quartz.spi.ThreadPool

public class ZeroSizeThreadPool
extends Object
implements org.quartz.spi.ThreadPool

This is class is a simple implementation of a zero size thread pool, based on the ThreadPool interface.

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).

Author:
Wayne Fay

Constructor Summary
ZeroSizeThreadPool()
           Create a new ZeroSizeThreadPool.
 
Method Summary
 int blockForAvailableThreads()
           
 org.slf4j.Logger getLog()
           
 int getPoolSize()
           
 void initialize()
           
 boolean runInThread(Runnable runnable)
           
 void setInstanceId(String schedInstId)
           
 void setInstanceName(String schedName)
           
 void shutdown()
           
 void shutdown(boolean waitForJobsToComplete)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZeroSizeThreadPool

public ZeroSizeThreadPool()

Create a new ZeroSizeThreadPool.

Method Detail

getLog

public org.slf4j.Logger getLog()

getPoolSize

public int getPoolSize()
Specified by:
getPoolSize in interface org.quartz.spi.ThreadPool

initialize

public void initialize()
                throws SchedulerConfigException
Specified by:
initialize in interface org.quartz.spi.ThreadPool
Throws:
SchedulerConfigException

shutdown

public void shutdown()

shutdown

public void shutdown(boolean waitForJobsToComplete)
Specified by:
shutdown in interface org.quartz.spi.ThreadPool

runInThread

public boolean runInThread(Runnable runnable)
Specified by:
runInThread in interface org.quartz.spi.ThreadPool

blockForAvailableThreads

public int blockForAvailableThreads()
Specified by:
blockForAvailableThreads in interface org.quartz.spi.ThreadPool

setInstanceId

public void setInstanceId(String schedInstId)
Specified by:
setInstanceId in interface org.quartz.spi.ThreadPool

setInstanceName

public void setInstanceName(String schedName)
Specified by:
setInstanceName in interface org.quartz.spi.ThreadPool


Copyright 2001-2013, Terracotta, Inc.