Class LazyTraceAsyncTaskExecutor

java.lang.Object
org.springframework.cloud.sleuth.instrument.async.LazyTraceAsyncTaskExecutor
All Implemented Interfaces:
Executor, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor

public class LazyTraceAsyncTaskExecutor extends Object implements org.springframework.core.task.AsyncTaskExecutor
AsyncTaskExecutor that wraps Runnable and Callable in a trace representation.
Since:
2.1.0
Author:
Marcin Grzejszczak
  • Constructor Details

    • LazyTraceAsyncTaskExecutor

      public LazyTraceAsyncTaskExecutor(org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.core.task.AsyncTaskExecutor delegate)
    • LazyTraceAsyncTaskExecutor

      public LazyTraceAsyncTaskExecutor(org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.core.task.AsyncTaskExecutor delegate, String beanName)
  • Method Details

    • wrap

      public static LazyTraceAsyncTaskExecutor wrap(org.springframework.beans.factory.BeanFactory beanFactory, @NonNull org.springframework.core.task.AsyncTaskExecutor delegate, String beanName)
      Wraps the Executor in a trace instance.
      Parameters:
      beanFactory - bean factory
      delegate - delegate to wrap
      beanName - bean name
      Returns:
      traced instance
    • wrap

      public static LazyTraceAsyncTaskExecutor wrap(org.springframework.beans.factory.BeanFactory beanFactory, @NonNull org.springframework.core.task.AsyncTaskExecutor delegate)
      Wraps the Executor in a trace instance.
      Parameters:
      beanFactory - bean factory
      delegate - delegate to wrap
      Returns:
      traced instance
    • execute

      public void execute(Runnable task)
      Specified by:
      execute in interface Executor
      Specified by:
      execute in interface org.springframework.core.task.TaskExecutor
    • execute

      public void execute(Runnable task, long startTimeout)
      Specified by:
      execute in interface org.springframework.core.task.AsyncTaskExecutor
    • submit

      public Future<?> submit(Runnable task)
      Specified by:
      submit in interface org.springframework.core.task.AsyncTaskExecutor
    • submit

      public <T> Future<T> submit(Callable<T> task)
      Specified by:
      submit in interface org.springframework.core.task.AsyncTaskExecutor