Class DelegatingExecutor

  • All Implemented Interfaces:
    Executor, org.springframework.core.task.TaskExecutor

    public class DelegatingExecutor
    extends Object
    implements org.springframework.core.task.TaskExecutor
    Task executor that delegates to the task executor configured for a task.

    In addition to the delegate, the async configuration properties and the task name is stored, so we know which task this executor is for and we are able to determine the timeout.

    Since:
    2.0.0
    Author:
    Rutger Lubbers, Paul Klos
    • Constructor Detail

      • DelegatingExecutor

        public DelegatingExecutor​(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor delegate,
                                  ExecutorConfigurationProperties executorConfigurationProperties,
                                  String taskName)
        Constructor.
        Parameters:
        delegate - the delegate
        executorConfigurationProperties - the configuration properties
        taskName - the task name
    • Method Detail

      • execute

        public void execute​(Runnable task)

        Configures a SharedTaskContextHolder before delegating execution.

        Specified by:
        execute in interface Executor
        Specified by:
        execute in interface org.springframework.core.task.TaskExecutor
      • getExecutorStatistics

        public ExecutorStatisticsView getExecutorStatistics()
        Return the view on the statistics.