R - Type of the response body to be received by this callback.public abstract class ServiceCallback<R> extends BaseServiceObject
Callback that may be used to receive a response for a particular
service request asynchronously and dispatch it to its receivers.NO_REQUEST, NO_SERVICE| Constructor and Description |
|---|
ServiceCallback() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
onDispatchError(ServiceError error)
Invoked to dispatch the given error object to its receivers.
|
protected abstract void |
onDispatchResponse(R responseBody)
Invoked to dispatch the given responseBody object to its receivers.
|
void |
onFailure(<any> call,
Throwable failure) |
void |
onResponse(<any> call,
<any> response) |
getRequestId, getServiceId, setRequestId, setServiceIdpublic void onResponse(<any> call,
<any> response)
protected abstract void onDispatchResponse(R responseBody)
responseBody - The response body to be dispatched.Response#body(),
onDispatchError(ServiceError)public void onFailure(<any> call,
Throwable failure)
protected abstract void onDispatchError(ServiceError error)
error - The error to be dispatched.onDispatchResponse(Object)