Package com.yahoo.jdisc.handler
Class CallableResponseDispatch
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.util.concurrent.ForwardingFuture<V>
-
- com.google.common.util.concurrent.ForwardingListenableFuture<java.lang.Boolean>
-
- com.yahoo.jdisc.handler.ResponseDispatch
-
- com.yahoo.jdisc.handler.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 ofResponseDispatch
that implements theCallable
interface. This should be used in place ofResponseDispatch
if you intend to schedule its execution. Becausecall()
does not return until the entirety of theResponse
and its content have been consumed, you can use theFuture
return value ofExecutorService.submit(Callable)
to wait for it to complete.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description CallableResponseDispatch(ResponseHandler handler)
Constructs a new instances of this class over the givenResponseHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
call()
-
Methods inherited from class com.yahoo.jdisc.handler.ResponseDispatch
cancel, connect, connectFastWriter, delegate, dispatch, isCancelled, newInstance, newInstance, newInstance, newInstance, newResponse, responseContent
-
Methods inherited from class com.google.common.util.concurrent.ForwardingListenableFuture
addListener
-
-
-
-
Constructor Detail
-
CallableResponseDispatch
public CallableResponseDispatch(ResponseHandler handler)
Constructs a new instances of this class over the givenResponseHandler
. Invokingcall()
will dispatch to this handler.- Parameters:
handler
- The ResponseHandler to dispatch to.
-
-