Class FutureResponse

  • All Implemented Interfaces:
    com.google.common.util.concurrent.ListenableFuture<Response>, ResponseHandler, java.util.concurrent.Future<Response>

    public final class FutureResponse
    extends com.google.common.util.concurrent.AbstractFuture<Response>
    implements ResponseHandler
    This class provides an implementation of ResponseHandler that allows you to wait for a Response to be returned.
    Author:
    Simon Thoresen Hult
    • Method Detail

      • handleResponse

        public ContentChannel handleResponse​(Response response)
        Description copied from interface: ResponseHandler
        This method will process the given Response and return a ContentChannel into which the caller can write the Response's content.
        Specified by:
        handleResponse in interface ResponseHandler
        Parameters:
        response - the Response to handle
        Returns:
        the ContentChannel to write the Response content to. Notice that the ContentChannel holds a Container reference, so failure to close this will prevent the Container from ever shutting down.
      • cancel

        public final boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<Response>
        Overrides:
        cancel in class com.google.common.util.concurrent.AbstractFuture<Response>
      • isCancelled

        public final boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<Response>
        Overrides:
        isCancelled in class com.google.common.util.concurrent.AbstractFuture<Response>