public class DefaultJobExecutor extends JobExecutor
This is a simple implementation of the JobExecutor using self-managed
threads for performing background work.
This implementation uses a ThreadPoolExecutor backed by a queue to which
work is submitted.
NOTE: use this class in environments in which self-management of threads is permitted. Consider using a different thread-management strategy in J(2)EE-Environments.
| Modifier and Type | Field and Description |
|---|---|
protected int |
corePoolSize |
protected int |
queueSize |
protected ThreadPoolExecutor |
threadPoolExecutor |
protected BlockingQueue<Runnable> |
threadPoolQueue |
acquireJobsCmd, acquireJobsRunnable, clockReader, commandExecutor, isActive, isAutoActivate, jobAcquisitionThread, lockOwner, lockTimeInMillis, maxJobsPerAcquisition, name, rejectedJobsHandler, waitTimeInMillis| Constructor and Description |
|---|
DefaultJobExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
executeJobs(List<String> jobIds) |
int |
getCorePoolSize() |
int |
getMaxPoolSize() |
int |
getQueueSize() |
ThreadPoolExecutor |
getThreadPoolExecutor() |
BlockingQueue<Runnable> |
getThreadPoolQueue() |
void |
setCorePoolSize(int corePoolSize) |
void |
setMaxPoolSize(int maxPoolSize) |
void |
setQueueSize(int queueSize) |
void |
setThreadPoolExecutor(ThreadPoolExecutor threadPoolExecutor) |
void |
setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue) |
protected void |
startExecutingJobs() |
protected void |
stopExecutingJobs() |
ensureCleanup, ensureInitialization, getAcquireJobsCmd, getCommandExecutor, getCurrentTime, getLockOwner, getLockTimeInMillis, getMaxJobsPerAcquisition, getName, getRejectedJobsHandler, getWaitTimeInMillis, isActive, isAutoActivate, jobWasAdded, setAcquireJobsCmd, setAutoActivate, setClockReader, setCommandExecutor, setLockOwner, setLockTimeInMillis, setMaxJobsPerAcquisition, setRejectedJobsHandler, setWaitTimeInMillis, shutdown, start, startJobAcquisitionThread, stopJobAcquisitionThreadprotected int queueSize
protected int corePoolSize
protected BlockingQueue<Runnable> threadPoolQueue
protected ThreadPoolExecutor threadPoolExecutor
protected void startExecutingJobs()
startExecutingJobs in class JobExecutorprotected void stopExecutingJobs()
stopExecutingJobs in class JobExecutorpublic void executeJobs(List<String> jobIds)
executeJobs in class JobExecutorpublic int getQueueSize()
public void setQueueSize(int queueSize)
public int getCorePoolSize()
public void setCorePoolSize(int corePoolSize)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
public BlockingQueue<Runnable> getThreadPoolQueue()
public void setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue)
public ThreadPoolExecutor getThreadPoolExecutor()
public void setThreadPoolExecutor(ThreadPoolExecutor threadPoolExecutor)
Copyright © 2014 Alfresco. All rights reserved.