public abstract static class ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT> extends ForwardingServerCallListener<ReqT>
ForwardingServerCallListener
where subclasses can pass in a
ServerCall.Listener
as the delegate.ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>
Modifier | Constructor and Description |
---|---|
protected |
SimpleForwardingServerCallListener(ServerCall.Listener<ReqT> delegate) |
Modifier and Type | Method and Description |
---|---|
protected ServerCall.Listener<ReqT> |
delegate()
Returns the delegated
ServerCall.Listener . |
void |
onCancel()
The call was cancelled and the server is encouraged to abort processing to save resources,
since the client will not process any further messages.
|
void |
onComplete()
The call is considered complete and
ServerCall.Listener.onCancel() is guaranteed not to be called. |
void |
onHalfClose()
The client completed all message sending.
|
void |
onReady()
This indicates that the call may now be capable of sending additional messages (via
ServerCall.sendMessage(RespT) ) without requiring excessive buffering internally. |
String |
toString() |
onMessage
protected SimpleForwardingServerCallListener(ServerCall.Listener<ReqT> delegate)
protected ServerCall.Listener<ReqT> delegate()
ForwardingServerCallListener
ServerCall.Listener
.delegate
in class ForwardingServerCallListener<ReqT>
public void onHalfClose()
ServerCall.Listener
onHalfClose
in class ServerCall.Listener<ReqT>
public void onCancel()
ServerCall.Listener
There will be no further callbacks for the call.
onCancel
in class ServerCall.Listener<ReqT>
public void onComplete()
ServerCall.Listener
ServerCall.Listener.onCancel()
is guaranteed not to be called.
However, the client is not guaranteed to have received all messages.
There will be no further callbacks for the call.
onComplete
in class ServerCall.Listener<ReqT>
public void onReady()
ServerCall.Listener
ServerCall.sendMessage(RespT)
) 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 call.
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.
onReady
in class ServerCall.Listener<ReqT>