Package io.grpc.internal
Class ManagedChannelImpl.ConfigSelectingClientCall<ReqT,RespT>
- java.lang.Object
-
- io.grpc.ClientCall<ReqT,RespT>
-
- io.grpc.PartialForwardingClientCall<ReqT,RespT>
-
- io.grpc.ForwardingClientCall<ReqT,RespT>
-
- io.grpc.internal.ManagedChannelImpl.ConfigSelectingClientCall<ReqT,RespT>
-
- Enclosing class:
- ManagedChannelImpl
static final class ManagedChannelImpl.ConfigSelectingClientCall<ReqT,RespT> extends ForwardingClientCall<ReqT,RespT>
A client call for a given channel that applies a given config selector when it starts.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ForwardingClientCall
ForwardingClientCall.SimpleForwardingClientCall<ReqT,RespT>
-
Nested classes/interfaces inherited from class io.grpc.ClientCall
ClientCall.Listener<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Executor
callExecutor
private CallOptions
callOptions
private Channel
channel
private InternalConfigSelector
configSelector
private Context
context
private ClientCall<ReqT,RespT>
delegate
private MethodDescriptor<ReqT,RespT>
method
-
Constructor Summary
Constructors Constructor Description ConfigSelectingClientCall(InternalConfigSelector configSelector, Channel channel, java.util.concurrent.Executor channelExecutor, MethodDescriptor<ReqT,RespT> method, CallOptions callOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(java.lang.String message, java.lang.Throwable cause)
Prevent any further processing for thisClientCall
.protected ClientCall<ReqT,RespT>
delegate()
Returns the delegatedClientCall
.private void
executeCloseObserverInContext(ClientCall.Listener<RespT> observer, Status status)
void
start(ClientCall.Listener<RespT> observer, Metadata headers)
Start a call, usingresponseListener
for processing response messages.-
Methods inherited from class io.grpc.ForwardingClientCall
sendMessage
-
Methods inherited from class io.grpc.PartialForwardingClientCall
getAttributes, halfClose, isReady, request, setMessageCompression, toString
-
-
-
-
Field Detail
-
configSelector
private final InternalConfigSelector configSelector
-
channel
private final Channel channel
-
callExecutor
private final java.util.concurrent.Executor callExecutor
-
method
private final MethodDescriptor<ReqT,RespT> method
-
context
private final Context context
-
callOptions
private CallOptions callOptions
-
delegate
private ClientCall<ReqT,RespT> delegate
-
-
Constructor Detail
-
ConfigSelectingClientCall
ConfigSelectingClientCall(InternalConfigSelector configSelector, Channel channel, java.util.concurrent.Executor channelExecutor, MethodDescriptor<ReqT,RespT> method, CallOptions callOptions)
-
-
Method Detail
-
delegate
protected ClientCall<ReqT,RespT> delegate()
Description copied from class:ForwardingClientCall
Returns the delegatedClientCall
.- Specified by:
delegate
in classForwardingClientCall<ReqT,RespT>
-
start
public void start(ClientCall.Listener<RespT> observer, Metadata headers)
Description copied from class:ClientCall
Start a call, usingresponseListener
for processing response messages.It must be called prior to any other method on this class, except for
ClientCall.cancel(java.lang.String, java.lang.Throwable)
which may be called at any time.Since
Metadata
is not thread-safe, the caller must not access (read or write)headers
after this point.- Overrides:
start
in classForwardingClientCall<ReqT,RespT>
- Parameters:
observer
- receives response messagesheaders
- which can contain extra call metadata, e.g. authentication credentials.
-
executeCloseObserverInContext
private void executeCloseObserverInContext(ClientCall.Listener<RespT> observer, Status status)
-
cancel
public void cancel(@Nullable java.lang.String message, @Nullable java.lang.Throwable cause)
Description copied from class:ClientCall
Prevent any further processing for thisClientCall
. No further messages may be sent or will be received. The server is informed of cancellations, but may not stop processing the call. Cancellation is permitted even if previouslyClientCall.halfClose()
d. Cancelling an alreadycancel()
edClientCall
has no effect.No other methods on this class can be called after this method has been called.
It is recommended that at least one of the arguments to be non-
null
, to provide useful debug information. Both argument being null may log warnings and result in suboptimal performance. Also note that the provided information will not be sent to the server.- Overrides:
cancel
in classPartialForwardingClientCall<ReqT,RespT>
- Parameters:
message
- if notnull
, will appear as the description of the CANCELLED statuscause
- if notnull
, will appear as the cause of the CANCELLED status
-
-