public interface ClientExecutor
Modifier and Type | Method and Description |
---|---|
<T> ScheduledFuture<T> |
schedule(Callable<T> callable,
long delay,
TimeUnit unit)
Creates and executes a
ScheduledFuture that becomes enabled after the given delay. |
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
<T> Future<T> |
submit(Callable<T> task)
Submits a value-returning task for execution and returns a
Future representing the pending results of the task. |
Future<?> |
submit(Runnable task)
|
<T> Future<T> |
submit(Runnable task,
T result)
|
<T> Future<T> submit(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 nullFuture<?> submit(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> Future<T> submit(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> ScheduledFuture<T> schedule(Callable<T> callable, long delay, 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 nullScheduledFuture<?> schedule(Runnable command, long delay, 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 completionCopyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.