Class ListenableFutureTask<T>

java.lang.Object
java.util.concurrent.FutureTask<T>
org.springframework.util.concurrent.ListenableFutureTask<T>
Type Parameters:
T - the result type returned by this Future's get method
All Implemented Interfaces:
Runnable, Future<T>, RunnableFuture<T>, ListenableFuture<T>

public class ListenableFutureTask<T> extends FutureTask<T> implements ListenableFuture<T>
Extension of FutureTask that implements ListenableFuture.
Since:
4.0
Author:
Arjen Poutsma
  • Constructor Details

    • ListenableFutureTask

      public ListenableFutureTask(Callable<T> callable)
      Create a new ListenableFutureTask that will, upon running, execute the given Callable.
      Parameters:
      callable - the callable task
    • ListenableFutureTask

      public ListenableFutureTask(Runnable runnable, @Nullable T result)
      Create a ListenableFutureTask that will, upon running, execute the given Runnable, and arrange that FutureTask.get() will return the given result on successful completion.
      Parameters:
      runnable - the runnable task
      result - the result to return on successful completion
  • Method Details