Package org.glassfish.jersey.client
Interface ClientExecutor
-
- All Known Implementing Classes:
ClientRuntime
public interface ClientExecutor
Executor for client async processing and background task scheduling.- Since:
- 2.26
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.ScheduledFuture<T>
schedule(java.util.concurrent.Callable<T> callable, long delay, java.util.concurrent.TimeUnit unit)
Creates and executes aScheduledFuture
that becomes enabled after the given delay.java.util.concurrent.Future<?>
submit(java.lang.Runnable task)
Submits aRunnable
task for execution and returns aFuture
representing that task.<T> java.util.concurrent.Future<T>
submit(java.lang.Runnable task, T result)
Submits aRunnable
task for execution and returns aFuture
representing that task.<T> java.util.concurrent.Future<T>
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns aFuture
representing the pending results of the task.
-
-
-
Method Detail
-
submit
<T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns aFuture
representing the pending results of the task. The Future'sget()
method will return the task's result upon successful completion.- Type Parameters:
T
- task's return type- Parameters:
task
- task to submit- Returns:
- a
Future
representing pending completion of the task
-
submit
java.util.concurrent.Future<?> submit(java.lang.Runnable task)
Submits aRunnable
task for execution and returns aFuture
representing that task. The Future'sget()
method will return the given result upon successful completion.- Parameters:
task
- the task to submit- Returns:
- a
Future
representing pending completion of the task
-
submit
<T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
Submits aRunnable
task for execution and returns aFuture
representing that task. The Future'sget()
method will return the given result upon successful completion.- Type Parameters:
T
- result type- Parameters:
task
- the task to submitresult
- the result to return- Returns:
- a
Future
representing pending completion of the task
-
schedule
<T> java.util.concurrent.ScheduledFuture<T> schedule(java.util.concurrent.Callable<T> callable, long delay, java.util.concurrent.TimeUnit unit)
Creates and executes aScheduledFuture
that becomes enabled after the given delay.- Type Parameters:
T
- return type of the function- Parameters:
callable
- the function to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameter- Returns:
- a
ScheduledFuture
that can be used to extract result or cancel
-
schedule
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.- Parameters:
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the daly parameter- Returns:
- a scheduledFuture representing pending completion of the task and whose
get()
method will returnnull
upon completion
-
-