Package io.grpc
Class ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>
- java.lang.Object
-
- io.grpc.ServerCall.Listener<ReqT>
-
- io.grpc.ForwardingServerCallListener<ReqT>
-
- io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>
-
- Enclosing class:
- ForwardingServerCallListener<ReqT>
public abstract static class ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT> extends ForwardingServerCallListener<ReqT>
A simplified version ofForwardingServerCallListener
where subclasses can pass in aServerCall.Listener
as the delegate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ForwardingServerCallListener
ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleForwardingServerCallListener(ServerCall.Listener<ReqT> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ServerCall.Listener<ReqT>
delegate()
Returns the delegatedServerCall.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 andServerCall.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 (viaServerCall.sendMessage(RespT)
) without requiring excessive buffering internally.String
toString()
-
Methods inherited from class io.grpc.ForwardingServerCallListener
onMessage
-
-
-
-
Constructor Detail
-
SimpleForwardingServerCallListener
protected SimpleForwardingServerCallListener(ServerCall.Listener<ReqT> delegate)
-
-
Method Detail
-
delegate
protected ServerCall.Listener<ReqT> delegate()
Description copied from class:ForwardingServerCallListener
Returns the delegatedServerCall.Listener
.- Specified by:
delegate
in classForwardingServerCallListener<ReqT>
-
onHalfClose
public void onHalfClose()
Description copied from class:ServerCall.Listener
The client completed all message sending. However, the call may still be cancelled.- Overrides:
onHalfClose
in classServerCall.Listener<ReqT>
-
onCancel
public void onCancel()
Description copied from class:ServerCall.Listener
The call was cancelled and the server is encouraged to abort processing to save resources, since the client will not process any further messages. Cancellations can be caused by timeouts, explicit cancellation by the client, network errors, etc.There will be no further callbacks for the call.
- Overrides:
onCancel
in classServerCall.Listener<ReqT>
-
onComplete
public void onComplete()
Description copied from class:ServerCall.Listener
The call is considered complete andServerCall.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.
- Overrides:
onComplete
in classServerCall.Listener<ReqT>
-
onReady
public void onReady()
Description copied from class:ServerCall.Listener
This indicates that the call may now be capable of sending additional messages (viaServerCall.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 checkingisReady()
's current value instead of assuming it is nowtrue
. IfisReady() == false
the normal expectations apply, so there would be anotheronReady()
callback.- Overrides:
onReady
in classServerCall.Listener<ReqT>
-
-