Class SpringAsyncExecutor

  • All Implemented Interfaces:
    AsyncExecutor

    public class SpringAsyncExecutor
    extends DefaultAsyncJobExecutor

    This is a spring based implementation of the Job Executor using spring abstraction TaskExecutor for 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 Detail

      • taskExecutor

        protected org.springframework.core.task.TaskExecutor taskExecutor
    • 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 injected TaskExecutor implementation that will be used to execute runnable jobs.
        Parameters:
        taskExecutor -
      • setRejectedJobsHandler

        public void setRejectedJobsHandler​(SpringRejectedJobsHandler rejectedJobsHandler)
        Required spring injected SpringRejectedJobsHandler implementation that will be used when jobs were rejected by the task executor.
        Parameters:
        rejectedJobsHandler -