Class TraceableScheduledExecutorService
java.lang.Object
org.springframework.cloud.sleuth.instrument.async.TraceableExecutorService
org.springframework.cloud.sleuth.instrument.async.TraceableScheduledExecutorService
- All Implemented Interfaces:
Executor,ExecutorService,ScheduledExecutorService
public class TraceableScheduledExecutorService
extends TraceableExecutorService
implements ScheduledExecutorService
A decorator class for
ScheduledExecutorService to support tracing in Executors.- Since:
- 1.0.0
- Author:
- Gaurav Rai Mazra
-
Constructor Summary
ConstructorsConstructorDescriptionTraceableScheduledExecutorService(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate) TraceableScheduledExecutorService(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate, String beanName) -
Method Summary
Modifier and TypeMethodDescription<V> ScheduledFuture<V>scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) wrap(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate) Wraps the Executor in a trace instance.wrap(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate, String beanName) Wraps the Executor in a trace instance.Methods inherited from class org.springframework.cloud.sleuth.instrument.async.TraceableExecutorService
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Constructor Details
-
TraceableScheduledExecutorService
public TraceableScheduledExecutorService(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate) -
TraceableScheduledExecutorService
public TraceableScheduledExecutorService(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate, String beanName)
-
-
Method Details
-
wrap
public static TraceableScheduledExecutorService wrap(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate, String beanName) Wraps the Executor in a trace instance.- Parameters:
beanFactory- bean factorydelegate- delegate to wrapbeanName- bean name- Returns:
- traced instance
-
wrap
public static TraceableScheduledExecutorService wrap(org.springframework.beans.factory.BeanFactory beanFactory, ExecutorService delegate) Wraps the Executor in a trace instance.- Parameters:
beanFactory- bean factorydelegate- delegate to wrap- Returns:
- traced instance
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-