@BetaApi public abstract static class HttpJsonClientCall.Listener<T> extends Object
Implementations are discouraged to block for extended periods of time. Implementations are not required to be thread-safe, but they must not be thread-hostile. The caller is free to call an instance from multiple threads, but only one call simultaneously.
| Constructor and Description |
|---|
Listener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onClose(int statusCode,
HttpJsonMetadata trailers)
The ClientCall has been closed.
|
void |
onHeaders(HttpJsonMetadata responseHeaders)
The response headers have been received.
|
void |
onMessage(T message)
A response message has been received.
|
public void onHeaders(HttpJsonMetadata responseHeaders)
responseHeaders - containing metadata sent by the server at the start of the responsepublic void onMessage(T message)
message - returned by the serverpublic void onClose(int statusCode,
HttpJsonMetadata trailers)
ClientCall will not be
processed by the server. No further receiving will occur and no further notifications will be
made.
This method should not throw. If this method throws, there is no way to be notified of the exception. Implementations should therefore be careful of exceptions which can accidentally leak resources.
statusCode - the HTTP status code representing the result of the remote calltrailers - metadata provided at call completion