public class SharedScheduledExecutorService
extends java.lang.Object
implements java.util.concurrent.ScheduledExecutorService
ScheduledExecutorService
which cannot be shut down. This can be
safely injected into instances which should not be in control of the
ExecutorService
's lifecycle.Constructor and Description |
---|
SharedScheduledExecutorService(java.util.concurrent.ScheduledExecutorService wrapped) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isTerminated() |
<V> java.util.concurrent.ScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit) |
java.util.concurrent.ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit) |
java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task) |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task) |
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result) |
public SharedScheduledExecutorService(java.util.concurrent.ScheduledExecutorService wrapped)
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
ExecutorService.awaitTermination(long,
java.util.concurrent.TimeUnit)
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
command
- Executor.execute(java.lang.Runnable)
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
ExecutorService.invokeAll(java.util.Collection,
long, java.util.concurrent.TimeUnit)
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
ExecutorService.invokeAll(java.util.Collection)
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) 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
ExecutorService.invokeAny(java.util.Collection,
long, java.util.concurrent.TimeUnit)
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
ExecutorService.invokeAny(java.util.Collection)
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
ExecutorService.isShutdown()
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
ExecutorService.isTerminated()
public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
ScheduledExecutorService.schedule(java.util.concurrent.Callable,
long, java.util.concurrent.TimeUnit)
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
ScheduledExecutorService.schedule(java.lang.Runnable,
long, java.util.concurrent.TimeUnit)
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable,
long, long, java.util.concurrent.TimeUnit)
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService
ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable,
long, long, java.util.concurrent.TimeUnit)
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
ExecutorService.shutdown()
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
ExecutorService.shutdownNow()
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
ExecutorService.submit(java.util.concurrent.Callable)
public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
ExecutorService.submit(java.lang.Runnable,
java.lang.Object)
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit
in interface java.util.concurrent.ExecutorService
ExecutorService.submit(java.lang.Runnable)