Package org.activiti.spring
Class SpringAsyncExecutor
- java.lang.Object
-
- org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
-
- org.activiti.spring.SpringAsyncExecutor
-
- All Implemented Interfaces:
org.activiti.engine.impl.asyncexecutor.AsyncExecutor
public class SpringAsyncExecutor extends org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutorThis is a spring based implementation of the Job Executor using spring abstraction
TaskExecutorfor performing background task execution.The idea behind this implementation is to externalize the configuration of the task executor, so it can leverage to Application servers controller thread pools, for example using the commonj API. The use of unmanaged thread in application servers is discouraged by the Java EE spec.
-
-
Field Summary
Fields Modifier and Type Field Description protected SpringRejectedJobsHandlerrejectedJobsHandlerprotected org.springframework.core.task.TaskExecutortaskExecutor-
Fields inherited from class org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
asyncJobAcquisitionThread, asyncJobLockTimeInMillis, asyncJobsDueRunnable, corePoolSize, defaultAsyncJobAcquireWaitTimeInMillis, defaultQueueSizeFullWaitTime, defaultTimerJobAcquireWaitTimeInMillis, executeAsyncRunnableFactory, executorService, isActive, isAutoActivate, isMessageQueueMode, keepAliveTime, lockOwner, maxAsyncJobsDuePerAcquisition, maxPoolSize, maxTimerJobsPerAcquisition, processEngineConfiguration, queueSize, resetExpiredJobsInterval, resetExpiredJobsPageSize, resetExpiredJobsRunnable, resetExpiredJobThread, retryWaitTimeInMillis, secondsToWaitOnShutdown, temporaryJobQueue, threadPoolQueue, timerJobAcquisitionThread, timerJobRunnable, timerLockTimeInMillis
-
-
Constructor Summary
Constructors Constructor Description SpringAsyncExecutor()SpringAsyncExecutor(org.springframework.core.task.TaskExecutor taskExecutor, SpringRejectedJobsHandler rejectedJobsHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecuteAsyncJob(org.activiti.engine.runtime.Job job)SpringRejectedJobsHandlergetRejectedJobsHandler()org.springframework.core.task.TaskExecutorgetTaskExecutor()protected voidinitAsyncJobExecutionThreadPool()voidsetRejectedJobsHandler(SpringRejectedJobsHandler rejectedJobsHandler)Required spring injectedSpringRejectedJobsHandlerimplementation that will be used when jobs were rejected by the task executor.voidsetTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)Required spring injectedTaskExecutorimplementation that will be used to execute runnable jobs.-
Methods inherited from class org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
applyConfig, createRunnableForJob, executeTemporaryJobs, getAsyncJobAcquisitionThread, getAsyncJobLockTimeInMillis, getCorePoolSize, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getExecuteAsyncRunnableFactory, getExecutorService, getKeepAliveTime, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxPoolSize, getMaxTimerJobsPerAcquisition, getProcessEngineConfiguration, getQueueSize, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getResetExpiredJobThread, getRetryWaitTimeInMillis, getSecondsToWaitOnShutdown, getThreadPoolQueue, getTimerJobAcquisitionThread, getTimerLockTimeInMillis, isActive, isAutoActivate, isMessageQueueMode, setAsyncJobAcquisitionThread, setAsyncJobLockTimeInMillis, setAsyncJobsDueRunnable, setAutoActivate, setCorePoolSize, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setExecuteAsyncRunnableFactory, setExecutorService, setKeepAliveTime, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxPoolSize, setMaxTimerJobsPerAcquisition, setMessageQueueMode, setProcessEngineConfiguration, setQueueSize, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredJobThread, setRetryWaitTimeInMillis, setSecondsToWaitOnShutdown, setThreadPoolQueue, setTimerJobAcquisitionThread, setTimerJobRunnable, setTimerLockTimeInMillis, shutdown, start, startJobAcquisitionThread, startResetExpiredJobsThread, startTimerAcquisitionThread, stopExecutingAsyncJobs, stopJobAcquisitionThread, stopResetExpiredJobsThread, stopTimerAcquisitionThread
-
-
-
-
Field Detail
-
taskExecutor
protected org.springframework.core.task.TaskExecutor taskExecutor
-
rejectedJobsHandler
protected SpringRejectedJobsHandler rejectedJobsHandler
-
-
Constructor Detail
-
SpringAsyncExecutor
public SpringAsyncExecutor()
-
SpringAsyncExecutor
public SpringAsyncExecutor(org.springframework.core.task.TaskExecutor taskExecutor, SpringRejectedJobsHandler rejectedJobsHandler)
-
-
Method Detail
-
getTaskExecutor
public org.springframework.core.task.TaskExecutor getTaskExecutor()
-
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Required spring injectedTaskExecutorimplementation that will be used to execute runnable jobs.- Parameters:
taskExecutor-
-
getRejectedJobsHandler
public SpringRejectedJobsHandler getRejectedJobsHandler()
-
setRejectedJobsHandler
public void setRejectedJobsHandler(SpringRejectedJobsHandler rejectedJobsHandler)
Required spring injectedSpringRejectedJobsHandlerimplementation that will be used when jobs were rejected by the task executor.- Parameters:
rejectedJobsHandler-
-
executeAsyncJob
public boolean executeAsyncJob(org.activiti.engine.runtime.Job job)
- Specified by:
executeAsyncJobin interfaceorg.activiti.engine.impl.asyncexecutor.AsyncExecutor- Overrides:
executeAsyncJobin classorg.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
-
initAsyncJobExecutionThreadPool
protected void initAsyncJobExecutionThreadPool()
- Overrides:
initAsyncJobExecutionThreadPoolin classorg.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
-
-