com.atlassian.sal.core.executor
Class ThreadLocalDelegateExecutorService<C>
java.lang.Object
com.atlassian.sal.core.executor.ThreadLocalDelegateExecutorService<C>
- All Implemented Interfaces:
- Executor, ExecutorService
- Direct Known Subclasses:
- ThreadLocalDelegateScheduledExecutorService
public class ThreadLocalDelegateExecutorService<C>
- extends Object
- implements ExecutorService
Executor service that wraps executing callables and runnables in a wrapper that transfers the thread local state of
the caller to the thread of the executing task.
- Since:
- 2.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
manager
protected final ThreadLocalContextManager<C> manager
ThreadLocalDelegateExecutorService
public ThreadLocalDelegateExecutorService(ThreadLocalContextManager<C> manager,
ExecutorService delegate)
shutdown
public void shutdown()
- Specified by:
shutdown in interface ExecutorService
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNow in interface ExecutorService
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown in interface ExecutorService
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated in interface ExecutorService
awaitTermination
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
awaitTermination in interface ExecutorService
- Throws:
InterruptedException
submit
public <T> Future<T> submit(Callable<T> callable)
- Specified by:
submit in interface ExecutorService
submit
public <T> Future<T> submit(Runnable runnable,
T t)
- Specified by:
submit in interface ExecutorService
submit
public Future<?> submit(Runnable runnable)
- Specified by:
submit in interface ExecutorService
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables)
throws InterruptedException
- Specified by:
invokeAll in interface ExecutorService
- Throws:
InterruptedException
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
invokeAll in interface ExecutorService
- Throws:
InterruptedException
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> callables)
throws InterruptedException,
ExecutionException
- Specified by:
invokeAny in interface ExecutorService
- Throws:
InterruptedException
ExecutionException
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> callables,
long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
invokeAny in interface ExecutorService
- Throws:
InterruptedException
ExecutionException
TimeoutException
execute
public void execute(Runnable runnable)
- Specified by:
execute in interface Executor
Copyright © 2015 Atlassian. All rights reserved.