Class TaskExecutorJobLauncher

All Implemented Interfaces:
JobLauncher, org.springframework.beans.factory.InitializingBean

public class TaskExecutorJobLauncher extends SimpleJobLauncher
Implementation of the JobLauncher interface based on a TaskExecutor. This means that the type of executor set is very important. If a SyncTaskExecutor is used, then the job will be processed within the same thread that called the launcher. Care should be taken to ensure any users of this class understand fully whether or not the implementation of TaskExecutor used will start tasks synchronously or asynchronously. The default setting uses a synchronous task executor.

There is only one required dependency of this Launcher, a JobRepository. The JobRepository is used to obtain a valid JobExecution. The Repository must be used because the provided Job could be a restart of an existing JobInstance, and only the Repository can reliably recreate it.

Lucas Ward, Dave Syer, Will Schipp, Michael Minella, Mahmoud Ben Hassine
See Also: