public final class FutureResponse extends com.google.common.util.concurrent.AbstractFuture<Response> implements ResponseHandler
ResponseHandler
that allows you to wait for a Response
to
be returned.Constructor and Description |
---|
FutureResponse()
Constructs a new FutureResponse that returns a
NullContent when handleResponse(Response) is
invoked. |
FutureResponse(ContentChannel content)
Constructs a new FutureResponse that returns the given
ContentChannel when handleResponse(Response) is invoked. |
FutureResponse(ResponseHandler handler)
Constructs a new FutureResponse that calls the given
ResponseHandler when handleResponse(Response) is invoked. |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
ContentChannel |
handleResponse(Response response)
This method will process the given
Response and return a ContentChannel into which the caller
can write the Response's content. |
boolean |
isCancelled() |
public FutureResponse()
Constructs a new FutureResponse that returns a NullContent
when handleResponse(Response)
is
invoked.
public FutureResponse(ContentChannel content)
Constructs a new FutureResponse that returns the given ContentChannel
when handleResponse(Response)
is invoked.
content
- The content channel for the Response.public FutureResponse(ResponseHandler handler)
Constructs a new FutureResponse that calls the given ResponseHandler
when handleResponse(Response)
is invoked.
handler
- The ResponseHandler to invoke.public ContentChannel handleResponse(Response response)
ResponseHandler
This method will process the given Response
and return a ContentChannel
into which the caller
can write the Response's content.
handleResponse
in interface ResponseHandler
response
- The Response to handle.public final boolean cancel(boolean mayInterruptIfRunning)
public final boolean isCancelled()
isCancelled
in interface Future<Response>
isCancelled
in class com.google.common.util.concurrent.AbstractFuture<Response>
Copyright © 2018. All rights reserved.