Object createThreadPoolTaskExecutorProxy(Object bean, boolean cglibProxy, ThreadPoolTaskExecutor executor) { return getProxiedObject(bean, cglibProxy, executor, () -> new LazyTraceThreadPoolTaskExecutor(this.beanFactory, executor)); }
Object createExecutorServiceProxy(Object bean, boolean cglibProxy, ExecutorService executor) { return getProxiedObject(bean, cglibProxy, executor, () -> new TraceableExecutorService(this.beanFactory, executor)); }
@Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof AsyncConfigurer && !(bean instanceof LazyTraceAsyncCustomizer)) { AsyncConfigurer configurer = (AsyncConfigurer) bean; return new LazyTraceAsyncCustomizer(this.beanFactory, configurer); } return bean; }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return getScheduledExecutorService().scheduleWithFixedDelay( ContextUtil.isContextInCreation(this.beanFactory) ? command : new TraceRunnable(tracing(), spanNamer(), command), initialDelay, delay, unit); }
@Override public void execute(Runnable task) { this.delegate.execute(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task)); }
@Override public Future<?> submit(Runnable task) { return this.delegate.submit(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task, this.spanName)); }
@Override public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { return getScheduledExecutorService().schedule( ContextUtil.isContextInCreation(this.beanFactory) ? callable : new TraceCallable<>(tracing(), spanNamer(), callable), delay, unit); }
@Override public <T> Future<T> submit(Callable<T> task) { return this.delegate.submit(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceCallable<>(tracing(), spanNamer(), task)); }
@Override public <T> Future<T> submit(Callable<T> task) { return this.delegate.submit(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceCallable<>(tracing(), spanNamer(), task, this.spanName)); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return this.delegate.invokeAny(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks)); }
@Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { return getScheduledExecutorService().schedule( ContextUtil.isContextInCreation(this.beanFactory) ? command : new TraceRunnable(tracing(), spanNamer(), command), delay, unit); }
@Override public void execute(Runnable task, long startTimeout) { this.delegate.execute(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task), startTimeout); }
@Override public void execute(Runnable command) { this.delegate.submit(ContextUtil.isContextInCreation(this.beanFactory) ? command : new TraceRunnable(tracing(), spanNamer(), command, this.spanName)); }
@Override public <T> ListenableFuture<T> submitListenable(Callable<T> task) { return this.delegate .submitListenable(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceCallable<>(tracing(), spanNamer(), task)); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return this.delegate.invokeAll(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks), timeout, unit); }
@Override public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return getScheduledExecutorService().scheduleAtFixedRate( ContextUtil.isContextInCreation(this.beanFactory) ? command : new TraceRunnable(tracing(), spanNamer(), command), initialDelay, period, unit); }
@Override public Future<?> submit(Runnable task) { return this.delegate.submit(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task)); }
@Override public <T> Future<T> submit(Runnable task, T result) { return this.delegate.submit( ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task, this.spanName), result); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.delegate.invokeAny(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks), timeout, unit); }
@Override public ListenableFuture<?> submitListenable(Runnable task) { return this.delegate .submitListenable(ContextUtil.isContextInCreation(this.beanFactory) ? task : new TraceRunnable(tracing(), spanNamer(), task)); }