Class SettableListenableFuture<T>

  • Type Parameters:
    T - The data type of the Future's value
    All Implemented Interfaces:
    com.google.common.util.concurrent.ListenableFuture<T>, Future<T>

    public class SettableListenableFuture<T>
    extends com.google.common.util.concurrent.AbstractFuture<T>
    The future implementation to be used in cases where a class is responsible for setting the Future's outcome (value/exception), and the future should be a ListenableFuture. Notes: 1) The implementation should not expose this class through its API, and should expose it as ListenableFuture. 2) This class should not be used in cases where the ListenableFuture doesn't need to be created and managed (e.g. when using ListeningExecutorService).
    Author:
    Eyal Schneider
    • Constructor Detail

      • SettableListenableFuture

        public SettableListenableFuture()
    • Method Detail

      • set

        public boolean set​(T value)
        Overrides:
        set in class com.google.common.util.concurrent.AbstractFuture<T>
      • setException

        public boolean setException​(Throwable throwable)
        Overrides:
        setException in class com.google.common.util.concurrent.AbstractFuture<T>