Top Description Constructors Methods
io.grpc

pack-priv abstract Class PartialForwardingClientCallListener<RespT>

extends ClientCall.Listener<RespT>
Class Inheritance
Known Direct Subclasses
io.grpc.ForwardingClientCallListener
Imports
com.google.common.base.MoreObjects

A ClientCall.Listener which forwards all of its methods to another ClientCall.Listener which may have a different parameterized type than the onMessage() message type.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected abstract ClientCall.Listener<?>
delegate()

Returns the delegated ClientCall.Listener.

public void
onClose(Status
the result of the remote call.
status
,
Metadata
metadata provided at call completion.
trailers
)

Overrides io.grpc.ClientCall.Listener.onClose.

The ClientCall has been closed.
public void
onHeaders(Metadata
containing metadata sent by the server at the start of the response.
headers
)

Overrides io.grpc.ClientCall.Listener.onHeaders.

The response headers have been received.
public void
onReady()

Overrides io.grpc.ClientCall.Listener.onReady.

This indicates that the ClientCall may now be capable of sending additional messages (via sendMessage) without requiring excessive buffering internally.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from io.grpc.ClientCall.Listener:
onMessage

Constructor Detail

PartialForwardingClientCallListenerback to summary
pack-priv PartialForwardingClientCallListener()

Method Detail

delegateback to summary
protected abstract ClientCall.Listener<?> delegate()

Returns the delegated ClientCall.Listener.

onCloseback to summary
public void onClose(Status status, Metadata trailers)

Overrides io.grpc.ClientCall.Listener.onClose.

Doc from io.grpc.ClientCall.Listener.onClose.

The ClientCall has been closed. Any additional calls to the ClientCall will not be processed by the server. No further receiving will occur and no further notifications will be made.

Since Metadata is not thread-safe, the caller must not access (read or write) trailers after this point.

If status returns false for Status#isOk(), then the call failed. An additional block of trailer metadata may be received at the end of the call from the server. An empty Metadata object 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.

Parameters
status:Status

the result of the remote call.

trailers:Metadata

metadata provided at call completion.

Annotations
@Override
onHeadersback to summary
public void onHeaders(Metadata headers)

Overrides io.grpc.ClientCall.Listener.onHeaders.

Doc from io.grpc.ClientCall.Listener.onHeaders.

The response headers have been received. Headers always precede messages.

Since Metadata is not thread-safe, the caller must not access (read or write) headers after this point.

Parameters
headers:Metadata

containing metadata sent by the server at the start of the response.

Annotations
@Override
onReadyback to summary
public void onReady()

Overrides io.grpc.ClientCall.Listener.onReady.

Doc from io.grpc.ClientCall.Listener.onReady.

This indicates that the ClientCall may now be capable of sending additional messages (via sendMessage) 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() == false within this callback. Handle "spurious" notifications by checking isReady()'s current value instead of assuming it is now true. If isReady() == false the normal expectations apply, so there would be another onReady() callback.

If the type of a call is either MethodDescriptor.MethodType#UNARY or MethodDescriptor.MethodType#SERVER_STREAMING, this callback may not be fired. Calls that send exactly one message should not await this callback.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override