Object createExecutorServiceProxy(Object bean, boolean cglibProxy, ExecutorService executor) { return getProxiedObject(bean, cglibProxy, executor, () -> new TraceableExecutorService(this.beanFactory, executor)); }
private <T> Collection<? extends Callable<T>> wrapCallableCollection( Collection<? extends Callable<T>> tasks) { List<Callable<T>> ts = new ArrayList<>(); for (Callable<T> task : tasks) { if (!(task instanceof TraceCallable)) { ts.add(new TraceCallable<>(tracing(), spanNamer(), task, this.spanName)); } } return ts; }
@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 <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); }
Object createExecutorServiceProxy(Object bean, boolean cglibProxy, ExecutorService executor) { return getProxiedObject(bean, cglibProxy, executor, () -> new TraceableExecutorService(this.beanFactory, executor)); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { return this.delegate.invokeAll(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks)); }
@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 <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); }
private <T> Collection<? extends Callable<T>> wrapCallableCollection( Collection<? extends Callable<T>> tasks) { List<Callable<T>> ts = new ArrayList<>(); for (Callable<T> task : tasks) { if (!(task instanceof TraceCallable)) { ts.add(new TraceCallable<>(tracing(), spanNamer(), task, this.spanName)); } } return ts; }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { return this.delegate.invokeAll(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks)); }
@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 <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return this.delegate.invokeAny(ContextUtil.isContextInCreation(this.beanFactory) ? tasks : wrapCallableCollection(tasks)); }