Added missing delegates to ThreadPoolTaskExecutor; fixes #722
This commit is contained in:
@@ -19,6 +19,8 @@ package org.springframework.cloud.sleuth.instrument.async;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.RejectedExecutionHandler;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -29,6 +31,7 @@ import org.springframework.cloud.sleuth.DefaultSpanNamer;
|
||||
import org.springframework.cloud.sleuth.SpanNamer;
|
||||
import org.springframework.cloud.sleuth.TraceKeys;
|
||||
import org.springframework.cloud.sleuth.Tracer;
|
||||
import org.springframework.core.task.TaskDecorator;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
|
||||
@@ -85,11 +88,49 @@ public class LazyTraceThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
|
||||
return this.delegate.submitListenable(new SpanContinuingTraceCallable<>(tracer(), traceKeys(), spanNamer(), task));
|
||||
}
|
||||
|
||||
@Override public boolean prefersShortLivedTasks() {
|
||||
return this.delegate.prefersShortLivedTasks();
|
||||
}
|
||||
|
||||
@Override public void setThreadFactory(ThreadFactory threadFactory) {
|
||||
this.delegate.setThreadFactory(threadFactory);
|
||||
}
|
||||
|
||||
@Override public void setThreadNamePrefix(String threadNamePrefix) {
|
||||
this.delegate.setThreadNamePrefix(threadNamePrefix);
|
||||
}
|
||||
|
||||
@Override public void setRejectedExecutionHandler(
|
||||
RejectedExecutionHandler rejectedExecutionHandler) {
|
||||
this.delegate.setRejectedExecutionHandler(rejectedExecutionHandler);
|
||||
}
|
||||
|
||||
@Override public void setWaitForTasksToCompleteOnShutdown(
|
||||
boolean waitForJobsToCompleteOnShutdown) {
|
||||
this.delegate.setWaitForTasksToCompleteOnShutdown(waitForJobsToCompleteOnShutdown);
|
||||
}
|
||||
|
||||
@Override public void setAwaitTerminationSeconds(int awaitTerminationSeconds) {
|
||||
this.delegate.setAwaitTerminationSeconds(awaitTerminationSeconds);
|
||||
}
|
||||
|
||||
@Override public void setBeanName(String name) {
|
||||
this.delegate.setBeanName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreadPoolExecutor getThreadPoolExecutor() throws IllegalStateException {
|
||||
return this.delegate.getThreadPoolExecutor();
|
||||
}
|
||||
|
||||
@Override public int getPoolSize() {
|
||||
return this.delegate.getPoolSize();
|
||||
}
|
||||
|
||||
@Override public int getActiveCount() {
|
||||
return this.delegate.getActiveCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.delegate.destroy();
|
||||
@@ -102,9 +143,90 @@ public class LazyTraceThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
|
||||
super.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override public void initialize() {
|
||||
this.delegate.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
this.delegate.shutdown();
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
@Override public Thread newThread(Runnable runnable) {
|
||||
return this.delegate.newThread(runnable);
|
||||
}
|
||||
|
||||
@Override public String getThreadNamePrefix() {
|
||||
return this.delegate.getThreadNamePrefix();
|
||||
}
|
||||
|
||||
@Override public void setThreadPriority(int threadPriority) {
|
||||
this.delegate.setThreadPriority(threadPriority);
|
||||
}
|
||||
|
||||
@Override public int getThreadPriority() {
|
||||
return this.delegate.getThreadPriority();
|
||||
}
|
||||
|
||||
@Override public void setDaemon(boolean daemon) {
|
||||
this.delegate.setDaemon(daemon);
|
||||
}
|
||||
|
||||
@Override public boolean isDaemon() {
|
||||
return this.delegate.isDaemon();
|
||||
}
|
||||
|
||||
@Override public void setThreadGroupName(String name) {
|
||||
this.delegate.setThreadGroupName(name);
|
||||
}
|
||||
|
||||
@Override public void setThreadGroup(ThreadGroup threadGroup) {
|
||||
this.delegate.setThreadGroup(threadGroup);
|
||||
}
|
||||
|
||||
@Override public ThreadGroup getThreadGroup() {
|
||||
return this.delegate.getThreadGroup();
|
||||
}
|
||||
|
||||
@Override public Thread createThread(Runnable runnable) {
|
||||
return this.delegate.createThread(runnable);
|
||||
}
|
||||
|
||||
@Override public void setCorePoolSize(int corePoolSize) {
|
||||
this.delegate.setCorePoolSize(corePoolSize);
|
||||
}
|
||||
|
||||
@Override public int getCorePoolSize() {
|
||||
return this.delegate.getCorePoolSize();
|
||||
}
|
||||
|
||||
@Override public void setMaxPoolSize(int maxPoolSize) {
|
||||
this.delegate.setMaxPoolSize(maxPoolSize);
|
||||
}
|
||||
|
||||
@Override public int getMaxPoolSize() {
|
||||
return this.delegate.getMaxPoolSize();
|
||||
}
|
||||
|
||||
@Override public void setKeepAliveSeconds(int keepAliveSeconds) {
|
||||
this.delegate.setKeepAliveSeconds(keepAliveSeconds);
|
||||
}
|
||||
|
||||
@Override public int getKeepAliveSeconds() {
|
||||
return this.delegate.getKeepAliveSeconds();
|
||||
}
|
||||
|
||||
@Override public void setQueueCapacity(int queueCapacity) {
|
||||
this.delegate.setQueueCapacity(queueCapacity);
|
||||
}
|
||||
|
||||
@Override public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
|
||||
this.delegate.setAllowCoreThreadTimeOut(allowCoreThreadTimeOut);
|
||||
}
|
||||
|
||||
@Override public void setTaskDecorator(TaskDecorator taskDecorator) {
|
||||
this.delegate.setTaskDecorator(taskDecorator);
|
||||
}
|
||||
|
||||
private Tracer tracer() {
|
||||
|
||||
Reference in New Issue
Block a user