public class NonBlockingQuartzThreadPool
extends java.lang.Object
implements org.quartz.spi.ThreadPool
ThreadPool
implementation for use with Quartz.
QuartzCronPoller
will default to using this implementation unless explictly configured not to via
QuartzCronPoller.setUseCustomThreadPool(Boolean)
. Under the covers it uses a
Executors.newScheduledThreadPool(int)
as the thread execution pool. It does not need to block as polling consumers have
an internal locking mechanism that handles that behaviour. The reason for using it is to ensure that ManagedThreadFactory
is used to create any threads required for execution allowing a more graceful shutdown.
Constructor and Description |
---|
NonBlockingQuartzThreadPool() |
Modifier and Type | Method and Description |
---|---|
int |
blockForAvailableThreads() |
int |
getPoolSize() |
void |
initialize() |
boolean |
runInThread(java.lang.Runnable runnable) |
void |
setInstanceId(java.lang.String schedInstId) |
void |
setInstanceName(java.lang.String schedName) |
void |
setMakeThreadsDaemons(boolean b)
NoOp Method mirroring
org.quartz.simpl.SimpleThreadPool#setMakeThreadsDaemons(boolean) |
void |
setThreadCount(int count) |
void |
setThreadNamePrefix(java.lang.String prfx)
NoOp Method mirroring
org.quartz.simpl.SimpleThreadPool#setThreadNamePrefix(String) |
void |
setThreadPriority(int prio)
Setting that matches
org.quartz.simpl.SimpleThreadPool#setThreadPriority(int) |
void |
setThreadsInheritContextClassLoaderOfInitializingThread(boolean inheritLoader)
NoOp Method mirroring
org.quartz.simpl.SimpleThreadPool#setThreadsInheritContextClassLoaderOfInitializingThread(boolean) |
void |
setThreadsInheritGroupOfInitializingThread(boolean inheritGroup)
NoOp Method mirroring
org.quartz.simpl.SimpleThreadPool#setThreadsInheritGroupOfInitializingThread(boolean) |
void |
shutdown(boolean waitForJobsToComplete) |
public int blockForAvailableThreads()
blockForAvailableThreads
in interface org.quartz.spi.ThreadPool
public void setThreadCount(int count)
public void setThreadPriority(int prio)
org.quartz.simpl.SimpleThreadPool#setThreadPriority(int)
public void initialize() throws org.quartz.SchedulerConfigException
initialize
in interface org.quartz.spi.ThreadPool
org.quartz.SchedulerConfigException
public boolean runInThread(java.lang.Runnable runnable)
runInThread
in interface org.quartz.spi.ThreadPool
public void shutdown(boolean waitForJobsToComplete)
shutdown
in interface org.quartz.spi.ThreadPool
public int getPoolSize()
getPoolSize
in interface org.quartz.spi.ThreadPool
public void setInstanceId(java.lang.String schedInstId)
setInstanceId
in interface org.quartz.spi.ThreadPool
public void setInstanceName(java.lang.String schedName)
setInstanceName
in interface org.quartz.spi.ThreadPool
public void setThreadNamePrefix(java.lang.String prfx)
org.quartz.simpl.SimpleThreadPool#setThreadNamePrefix(String)
public void setThreadsInheritGroupOfInitializingThread(boolean inheritGroup)
org.quartz.simpl.SimpleThreadPool#setThreadsInheritGroupOfInitializingThread(boolean)
public void setThreadsInheritContextClassLoaderOfInitializingThread(boolean inheritLoader)
org.quartz.simpl.SimpleThreadPool#setThreadsInheritContextClassLoaderOfInitializingThread(boolean)
public void setMakeThreadsDaemons(boolean b)
org.quartz.simpl.SimpleThreadPool#setMakeThreadsDaemons(boolean)