Package org.glassfish.jersey.client
Interface ClientExecutor
-
public interface ClientExecutorExecutor for client async processing and background task scheduling.- Since:
- 2.26
- Author:
- Adam Lindenthal
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScheduledFuture<?>schedule(Runnable command, long delay, TimeUnit unit)Creates and executes a one-shot action that becomes enabled after the given delay.<T> ScheduledFuture<T>schedule(Callable<T> callable, long delay, TimeUnit unit)Creates and executes aScheduledFuturethat becomes enabled after the given delay.Future<?>submit(Runnable task)<T> Future<T>submit(Runnable task, T result)<T> Future<T>submit(Callable<T> task)Submits a value-returning task for execution and returns aFuturerepresenting the pending results of the task.
-
-
-
Method Detail
-
submit
<T> Future<T> submit(Callable<T> task)
Submits a value-returning task for execution and returns aFuturerepresenting 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
Futurerepresenting pending completion of the task
-
submit
Future<?> submit(Runnable task)
Submits aRunnabletask for execution and returns aFuturerepresenting that task. The Future'sget()method will return the given result upon successful completion.- Parameters:
task- the task to submit- Returns:
- a
Futurerepresenting pending completion of the task
-
submit
<T> Future<T> submit(Runnable task, T result)
Submits aRunnabletask for execution and returns aFuturerepresenting 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
Futurerepresenting pending completion of the task
-
schedule
<T> ScheduledFuture<T> schedule(Callable<T> callable, long delay, TimeUnit unit)
Creates and executes aScheduledFuturethat 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
ScheduledFuturethat can be used to extract result or cancel
-
schedule
ScheduledFuture<?> schedule(Runnable command, long delay, 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 returnnullupon completion
-
-