@Configuration
@EnableScheduling
public class TaskConfig
extends java.lang.Object
| Constructor and Description |
|---|
TaskConfig() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.context.event.ApplicationEventMulticaster |
applicationEventMulticaster(org.springframework.core.task.TaskExecutor taskExecutor)
A multicast (async) event publisher to replace the synchronous one used by Spring via the ApplicationContext.
|
org.apache.commons.exec.Executor |
processExecutor()
Get an
Executor to use for executing processes from tasks. |
org.springframework.core.task.AsyncTaskExecutor |
taskExecutor(int poolSize)
Get a task executor for executing tasks asynchronously that don't need to be scheduled at a recurring rate.
|
org.springframework.scheduling.TaskScheduler |
taskScheduler(int poolSize)
Get a task scheduler.
|
@Bean public org.apache.commons.exec.Executor processExecutor()
Executor to use for executing processes from tasks.@Bean public org.springframework.context.event.ApplicationEventMulticaster applicationEventMulticaster(org.springframework.core.task.TaskExecutor taskExecutor)
taskExecutor - The task executor to use@Bean
public org.springframework.scheduling.TaskScheduler taskScheduler(@Value(value="${genie.tasks.scheduler.pool.size:1}")
int poolSize)
poolSize - The initial size of the thread pool that should be allocated@Bean
public org.springframework.core.task.AsyncTaskExecutor taskExecutor(@Value(value="${genie.tasks.executor.pool.size:1}")
int poolSize)
poolSize - The number of threads desired for this system. Likely best to do one more than number of CPUs