@GwtIncompatible class SameThreadScheduledExecutorService extends java.util.concurrent.AbstractExecutorService implements ListeningScheduledExecutorService
See TestingExecutors.sameThreadScheduledExecutor()
for a full list of constraints.
Modifier and Type | Class and Description |
---|---|
private static class |
SameThreadScheduledExecutorService.ImmediateScheduledFuture<V> |
Modifier and Type | Field and Description |
---|---|
private ListeningExecutorService |
delegate |
Constructor and Description |
---|
SameThreadScheduledExecutorService() |
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> ListenableScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit) |
ListenableScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit) |
ListenableScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
ListenableScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> ListenableFuture<T> |
submit(java.util.concurrent.Callable<T> task) |
ListenableFuture<?> |
submit(java.lang.Runnable task) |
<T> ListenableFuture<T> |
submit(java.lang.Runnable task,
T result) |
private final ListeningExecutorService delegate
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 boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
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> ListenableFuture<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> ListenableFuture<T> submit(java.lang.Runnable task, T result)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic ListenableFuture<?> submit(java.lang.Runnable task)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
ListeningExecutorService
All elements in the returned list must be ListenableFuture
instances. The easiest
way to obtain a List<ListenableFuture<T>>
from this method is an unchecked (but safe)
cast:
@SuppressWarnings("unchecked") // guaranteed by invokeAll contract
List<ListenableFuture<T>> futures = (List) executor.invokeAll(tasks);
invokeAll
in interface ListeningExecutorService
invokeAll
in interface java.util.concurrent.ExecutorService
invokeAll
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
instances representing the tasks, in the same
sequential order as produced by the iterator for the given task list, each of which has
completed.java.lang.InterruptedException
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
ListeningExecutorService
All elements in the returned list must be ListenableFuture
instances. The easiest
way to obtain a List<ListenableFuture<T>>
from this method is an unchecked (but safe)
cast:
@SuppressWarnings("unchecked") // guaranteed by invokeAll contract
List<ListenableFuture<T>> futures = (List) executor.invokeAll(tasks, timeout, unit);
invokeAll
in interface ListeningExecutorService
invokeAll
in interface java.util.concurrent.ExecutorService
invokeAll
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
instances representing the tasks, in the same
sequential order as produced by the iterator for the given task list. If the operation did
not time out, each task will have completed. If it did time out, some of these tasks will
not have completed.java.lang.InterruptedException
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
invokeAny
in class java.util.concurrent.AbstractExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
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
invokeAny
in class java.util.concurrent.AbstractExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
public ListenableScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface ListeningScheduledExecutorService
schedule
in interface java.util.concurrent.ScheduledExecutorService
public <V> ListenableScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface ListeningScheduledExecutorService
schedule
in interface java.util.concurrent.ScheduledExecutorService
public ListenableScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface ListeningScheduledExecutorService
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
public ListenableScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface ListeningScheduledExecutorService
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService