Class ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT>
- java.lang.Object
-
- io.grpc.ClientCall.Listener<RespT>
-
- io.grpc.ForwardingClientCallListener<RespT>
-
- io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT>
-
- Enclosing class:
- ForwardingClientCallListener<RespT>
public abstract static class ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT> extends ForwardingClientCallListener<RespT>
A simplified version ofForwardingClientCallListenerwhere subclasses can pass in aClientCall.Listeneras the delegate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ForwardingClientCallListener
ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleForwardingClientCallListener(ClientCall.Listener<RespT> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientCall.Listener<RespT>delegate()Returns the delegatedClientCall.Listener.voidonClose(Status status, Metadata trailers)The ClientCall has been closed.voidonHeaders(Metadata headers)The response headers have been received.voidonReady()This indicates that the ClientCall may now be capable of sending additional messages (viaClientCall.sendMessage(ReqT)) without requiring excessive buffering internally.StringtoString()-
Methods inherited from class io.grpc.ForwardingClientCallListener
onMessage
-
-
-
-
Constructor Detail
-
SimpleForwardingClientCallListener
protected SimpleForwardingClientCallListener(ClientCall.Listener<RespT> delegate)
-
-
Method Detail
-
delegate
protected ClientCall.Listener<RespT> delegate()
Description copied from class:ForwardingClientCallListenerReturns the delegatedClientCall.Listener.- Specified by:
delegatein classForwardingClientCallListener<RespT>
-
onHeaders
public void onHeaders(Metadata headers)
Description copied from class:ClientCall.ListenerThe response headers have been received. Headers always precede messages.Since
Metadatais not thread-safe, the caller must not access (read or write)headersafter this point.- Overrides:
onHeadersin classClientCall.Listener<RespT>- Parameters:
headers- containing metadata sent by the server at the start of the response.
-
onClose
public void onClose(Status status, Metadata trailers)
Description copied from class:ClientCall.ListenerThe ClientCall has been closed. Any additional calls to theClientCallwill not be processed by the server. No further receiving will occur and no further notifications will be made.Since
Metadatais not thread-safe, the caller must not access (read or write)trailersafter this point.If
statusreturns false forStatus.isOk(), then the call failed. An additional block of trailer metadata may be received at the end of the call from the server. An emptyMetadataobject is passed if no trailers are received.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.
- Overrides:
onClosein classClientCall.Listener<RespT>- Parameters:
status- the result of the remote call.trailers- metadata provided at call completion.
-
onReady
public void onReady()
Description copied from class:ClientCall.ListenerThis indicates that the ClientCall may now be capable of sending additional messages (viaClientCall.sendMessage(ReqT)) without requiring excessive buffering internally. This event is just a suggestion and the application is free to ignore it, however doing so may result in excessive buffering within the ClientCall.Because there is a processing delay to deliver this notification, it is possible for concurrent writes to cause
isReady() == falsewithin this callback. Handle "spurious" notifications by checkingisReady()'s current value instead of assuming it is nowtrue. IfisReady() == falsethe normal expectations apply, so there would be anotheronReady()callback.If the type of a call is either
MethodDescriptor.MethodType.UNARYorMethodDescriptor.MethodType.SERVER_STREAMING, this callback may not be fired. Calls that send exactly one message should not await this callback.- Overrides:
onReadyin classClientCall.Listener<RespT>
-
-