|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.simpl.SimpleThreadPool
public class SimpleThreadPool
This is class is a simple implementation of a thread pool, based on the
interface.
ThreadPool
Runnable
objects are sent to the pool with the
method, which blocks until a runInThread(Runnable)
Thread
becomes available.
The pool has a fixed number of Thread
s, and does not grow or
shrink based on demand.
Constructor Summary | |
---|---|
SimpleThreadPool()
Create a new (unconfigured) SimpleThreadPool . |
|
SimpleThreadPool(int threadCount,
int threadPriority)
Create a new SimpleThreadPool with the specified number
of Thread s that have the given priority. |
Method Summary | |
---|---|
int |
blockForAvailableThreads()
|
protected void |
clearFromBusyWorkersList(org.quartz.simpl.SimpleThreadPool.WorkerThread wt)
|
protected List<org.quartz.simpl.SimpleThreadPool.WorkerThread> |
createWorkerThreads(int createCount)
|
org.slf4j.Logger |
getLog()
|
int |
getPoolSize()
|
int |
getThreadCount()
Get the number of worker threads in the pool. |
String |
getThreadNamePrefix()
|
int |
getThreadPriority()
Get the thread priority of worker threads in the pool. |
void |
initialize()
|
boolean |
isMakeThreadsDaemons()
|
boolean |
isThreadsInheritContextClassLoaderOfInitializingThread()
|
boolean |
isThreadsInheritGroupOfInitializingThread()
|
protected void |
makeAvailable(org.quartz.simpl.SimpleThreadPool.WorkerThread wt)
|
boolean |
runInThread(Runnable runnable)
Run the given Runnable object in the next available
Thread . |
void |
setInstanceId(String schedInstId)
|
void |
setInstanceName(String schedName)
|
void |
setMakeThreadsDaemons(boolean makeThreadsDaemons)
|
void |
setThreadCount(int count)
Set the number of worker threads in the pool - has no effect after initialize() has been called. |
void |
setThreadNamePrefix(String prfx)
|
void |
setThreadPriority(int prio)
Set the thread priority of worker threads in the pool - has no effect after initialize() has been called. |
void |
setThreadsInheritContextClassLoaderOfInitializingThread(boolean inheritLoader)
|
void |
setThreadsInheritGroupOfInitializingThread(boolean inheritGroup)
|
void |
shutdown()
Terminate any worker threads in this thread group. |
void |
shutdown(boolean waitForJobsToComplete)
Terminate any worker threads in this thread group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleThreadPool()
Create a new (unconfigured) SimpleThreadPool
.
setThreadCount(int)
,
setThreadPriority(int)
public SimpleThreadPool(int threadCount, int threadPriority)
Create a new SimpleThreadPool
with the specified number
of Thread
s that have the given priority.
threadCount
- the number of worker Threads
in the pool, must
be > 0.threadPriority
- the thread priority for the worker threads.Thread
Method Detail |
---|
public org.slf4j.Logger getLog()
public int getPoolSize()
getPoolSize
in interface org.quartz.spi.ThreadPool
public void setThreadCount(int count)
Set the number of worker threads in the pool - has no effect after
initialize()
has been called.
public int getThreadCount()
Get the number of worker threads in the pool.
public void setThreadPriority(int prio)
Set the thread priority of worker threads in the pool - has no effect
after initialize()
has been called.
public int getThreadPriority()
Get the thread priority of worker threads in the pool.
public void setThreadNamePrefix(String prfx)
public String getThreadNamePrefix()
public boolean isThreadsInheritContextClassLoaderOfInitializingThread()
public void setThreadsInheritContextClassLoaderOfInitializingThread(boolean inheritLoader)
inheritLoader
- The threadsInheritContextClassLoaderOfInitializingThread to
set.public boolean isThreadsInheritGroupOfInitializingThread()
public void setThreadsInheritGroupOfInitializingThread(boolean inheritGroup)
public boolean isMakeThreadsDaemons()
public void setMakeThreadsDaemons(boolean makeThreadsDaemons)
makeThreadsDaemons
- The value of makeThreadsDaemons to set.public void setInstanceId(String schedInstId)
setInstanceId
in interface org.quartz.spi.ThreadPool
public void setInstanceName(String schedName)
setInstanceName
in interface org.quartz.spi.ThreadPool
public void initialize() throws SchedulerConfigException
initialize
in interface org.quartz.spi.ThreadPool
SchedulerConfigException
protected List<org.quartz.simpl.SimpleThreadPool.WorkerThread> createWorkerThreads(int createCount)
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.
shutdown
in interface org.quartz.spi.ThreadPool
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.
runInThread
in interface org.quartz.spi.ThreadPool
runnable
- the Runnable
to be added.public int blockForAvailableThreads()
blockForAvailableThreads
in interface org.quartz.spi.ThreadPool
protected void makeAvailable(org.quartz.simpl.SimpleThreadPool.WorkerThread wt)
protected void clearFromBusyWorkersList(org.quartz.simpl.SimpleThreadPool.WorkerThread wt)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |