T
- the type parameter for the AsyncCallback
public class RpcCallbackAdapter<T> extends Object implements RequestCallback
RequestCallback
interface to an AsyncCallback
interface.
For internal use only.Constructor and Description |
---|
RpcCallbackAdapter(SerializationStreamFactory streamFactory,
String methodName,
RpcStatsContext statsContext,
AsyncCallback<T> callback) |
Modifier and Type | Method and Description |
---|---|
void |
onError(Request request,
Throwable exception)
Called when a
Request does not complete
normally. |
void |
onResponseReceived(Request request,
Response response)
Called when a pending
Request completes
normally. |
public RpcCallbackAdapter(SerializationStreamFactory streamFactory, String methodName, RpcStatsContext statsContext, AsyncCallback<T> callback)
public void onError(Request request, Throwable exception)
RequestCallback
Request
does not complete
normally. A RequestTimeoutException
is
one example of the type of error that a request may encounter.onError
in interface RequestCallback
request
- the request object which has experienced the error
condition, may be null if the request was never generatedexception
- the error that was encounteredpublic void onResponseReceived(Request request, Response response)
RequestCallback
Request
completes
normally. Note this method is called even when the status code of the
HTTP response is not "OK", 200.onResponseReceived
in interface RequestCallback
request
- the object that generated this eventresponse
- an instance of the
Response
classCopyright © 2018. All rights reserved.