public interface ClientExecutor
Modifier and Type | Method and Description |
---|---|
<T> java.util.concurrent.ScheduledFuture<T> |
schedule(java.util.concurrent.Callable<T> callable,
long delay,
java.util.concurrent.TimeUnit unit)
Creates and executes a
ScheduledFuture that becomes enabled after the given delay. |
java.util.concurrent.ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns a
Future representing the pending results of the task. |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task)
Submits a
Runnable task for execution and returns a Future representing that task. |
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result)
Submits a
Runnable task for execution and returns a Future representing that task. |
<T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
Future
representing the pending results of the task.
The Future's get()
method will return the task's result upon successful completion.T
- task's return typetask
- task to submitFuture
representing pending completion of the task{@link
- java.util.concurrent.RejectedExecutionException} if the task cannot be scheduled for execution{@link
- NullPointerException} if the task is nulljava.util.concurrent.Future<?> submit(java.lang.Runnable task)
Runnable
task for execution and returns a Future
representing that task. The Future's get()
method will return the given result upon successful completion.task
- the task to submitFuture
representing pending completion of the task{@link
- java.util.concurrent.RejectedExecutionException} if the task cannot be scheduled for execution{@link
- NullPointerException} if the task is null<T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
Runnable
task for execution and returns a Future
representing that task. The Future's get()
method will return the given result upon successful completion.T
- result typetask
- the task to submitresult
- the result to returnFuture
representing pending completion of the task{@link
- java.util.concurrent.RejectedExecutionException} if the task cannot be scheduled for execution{@link
- NullPointerException} if the task is null<T> java.util.concurrent.ScheduledFuture<T> schedule(java.util.concurrent.Callable<T> callable, long delay, java.util.concurrent.TimeUnit unit)
ScheduledFuture
that becomes enabled after the given delay.T
- return type of the functioncallable
- the function to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterScheduledFuture
that can be used to extract result or cancel{@link
- java.util.concurrent.RejectedExecutionException} if the task cannot be scheduled for execution{@link
- NullPointerException} if callable is nulljava.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the daly parameterget()
method will return null
upon completion