Class CallableResponseDispatch

  • All Implemented Interfaces:
    com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean>, java.util.concurrent.Callable<java.lang.Boolean>, java.util.concurrent.Future<java.lang.Boolean>

    public abstract class CallableResponseDispatch
    extends ResponseDispatch
    implements java.util.concurrent.Callable<java.lang.Boolean>
    This is a convenient subclass of ResponseDispatch that implements the Callable interface. This should be used in place of ResponseDispatch if you intend to schedule its execution. Because call() does not return until the entirety of the Response and its content have been consumed, you can use the Future return value of ExecutorService.submit(Callable) to wait for it to complete.
    Author:
    Simon Thoresen Hult
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingListenableFuture

        com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture<V extends java.lang.Object>
      • Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingFuture

        com.google.common.util.concurrent.ForwardingFuture.SimpleForwardingFuture<V extends java.lang.Object>
    • Constructor Detail

      • CallableResponseDispatch

        public CallableResponseDispatch​(ResponseHandler handler)
        Constructs a new instances of this class over the given ResponseHandler. Invoking call() will dispatch to this handler.
        Parameters:
        handler - The ResponseHandler to dispatch to.
    • Method Detail

      • call

        public final java.lang.Boolean call()
                                     throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<java.lang.Boolean>
        Throws:
        java.lang.Exception