java.io.Closeable
, java.lang.AutoCloseable
, java.util.concurrent.Executor
, java.util.concurrent.ExecutorService
brave.propagation.CurrentTraceContext
@Deprecated
public class BraveExecutorService
extends java.lang.Object
implements java.util.concurrent.ExecutorService, java.io.Closeable
ExecutorService
that wraps around an existing ExecutorService
and that makes sure the threads are executed
in the same Span/Trace context as the the thread that invoked execution of the threads.
It uses ServerTracer
and ServerSpanThreadBinder
to accomplish this in a transparent way for the user.
It also implements Closeable
, calling shutdown()
, so the executor service is
shut down properly when for example using Spring.BraveCallable
,
BraveRunnable
Constructor | Description |
---|---|
BraveExecutorService(java.util.concurrent.ExecutorService wrappedExecutor,
ServerSpanThreadBinder serverSpanThreadBinder) |
Deprecated.
use
wrap(ExecutorService, Brave) because this constructor loses thread
state for local span parents. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
Deprecated.
|
void |
close() |
Deprecated.
Convenience for try-with-resources, or frameworks such as Spring that automatically process this.
|
void |
execute(java.lang.Runnable arg0) |
Deprecated.
|
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0) |
Deprecated.
|
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0,
long arg1,
java.util.concurrent.TimeUnit arg2) |
Deprecated.
|
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0) |
Deprecated.
|
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0,
long arg1,
java.util.concurrent.TimeUnit arg2) |
Deprecated.
|
boolean |
isShutdown() |
Deprecated.
|
boolean |
isTerminated() |
Deprecated.
|
void |
shutdown() |
Deprecated.
|
java.util.List<java.lang.Runnable> |
shutdownNow() |
Deprecated.
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable arg0) |
Deprecated.
|
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable arg0,
T arg1) |
Deprecated.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> arg0) |
Deprecated.
|
static BraveExecutorService |
wrap(java.util.concurrent.ExecutorService wrappedExecutor,
Brave brave) |
Deprecated.
|
@Deprecated public BraveExecutorService(java.util.concurrent.ExecutorService wrappedExecutor, ServerSpanThreadBinder serverSpanThreadBinder)
wrap(ExecutorService, Brave)
because this constructor loses thread
state for local span parents.public static BraveExecutorService wrap(java.util.concurrent.ExecutorService wrappedExecutor, Brave brave)
public void execute(java.lang.Runnable arg0)
execute
in interface java.util.concurrent.Executor
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0, long arg1, java.util.concurrent.TimeUnit arg2) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> arg0, long arg1, java.util.concurrent.TimeUnit arg2) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> arg0)
submit
in interface java.util.concurrent.ExecutorService
public java.util.concurrent.Future<?> submit(java.lang.Runnable arg0)
submit
in interface java.util.concurrent.ExecutorService
public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable arg0, T arg1)
submit
in interface java.util.concurrent.ExecutorService
public void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
Copyright © 2018 OpenZipkin. All rights reserved.