public class DefaultJobExecutor extends ThreadPoolJobExecutor
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 |
threadPoolExecutor
acquireJobsCmd, acquireJobsRunnable, isActive, isAutoActivate, jobAcquisitionThread, lockOwner, lockTimeInMillis, maxJobsPerAcquisition, name, processEngines, rejectedJobsHandler, waitTimeInMillis
Constructor and Description |
---|
DefaultJobExecutor() |
Modifier and Type | Method and Description |
---|---|
int |
getCorePoolSize() |
int |
getMaxPoolSize() |
int |
getQueueSize() |
void |
setCorePoolSize(int corePoolSize) |
void |
setMaxPoolSize(int maxPoolSize) |
void |
setQueueSize(int queueSize) |
protected void |
startExecutingJobs() |
protected void |
stopExecutingJobs() |
executeJobs, getThreadPoolExecutor, setThreadPoolExecutor
ensureCleanup, ensureInitialization, executeJobs, getAcquireJobsCmd, getAcquireJobsRunnable, getCommandExecutor, getLockOwner, getLockTimeInMillis, getMaxJobsPerAcquisition, getName, getProcessEngines, getRejectedJobsHandler, getWaitTimeInMillis, isActive, isAutoActivate, jobWasAdded, registerProcessEngine, setAcquireJobsCmd, setAutoActivate, setCommandExecutor, setLockOwner, setLockTimeInMillis, setMaxJobsPerAcquisition, setProcessEngines, setRejectedJobsHandler, setWaitTimeInMillis, shutdown, start, startJobAcquisitionThread, stopJobAcquisitionThread, unregisterProcessEngine
protected void startExecutingJobs()
startExecutingJobs
in class ThreadPoolJobExecutor
protected void stopExecutingJobs()
stopExecutingJobs
in class ThreadPoolJobExecutor
public int getQueueSize()
public void setQueueSize(int queueSize)
public int getCorePoolSize()
public void setCorePoolSize(int corePoolSize)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
Copyright © 2015. All rights reserved.