Package org.hawaiiframework.async
Class DelegatingExecutor
- java.lang.Object
-
- org.hawaiiframework.async.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 Summary
Constructors Constructor Description DelegatingExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor delegate, ExecutorConfigurationProperties executorConfigurationProperties, String taskName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(Runnable task)
ExecutorStatisticsView
getExecutorStatistics()
Return the view on the statistics.
-
-
-
Constructor Detail
-
DelegatingExecutor
public DelegatingExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor delegate, ExecutorConfigurationProperties executorConfigurationProperties, String taskName)
Constructor.- Parameters:
delegate
- the delegateexecutorConfigurationProperties
- the configuration propertiestaskName
- the task name
-
-
Method Detail
-
execute
public void execute(Runnable task)
Configures a
SharedTaskContextHolder
before delegating execution.
-
getExecutorStatistics
public ExecutorStatisticsView getExecutorStatistics()
Return the view on the statistics.
-
-