@ThreadSafe public abstract class Channel extends Object
ClientCall
and
ClientCall.Listener
exchange parsed request and response objects whereas the
transport layer only works with serialized data.
Applications can add common cross-cutting behaviors to stubs by decorating Channel
implementations using ClientInterceptor
. It is expected that most application
code will not use this class directly but rather work with stubs that have been bound to a
Channel that was decorated during application initialization,
Constructor and Description |
---|
Channel() |
Modifier and Type | Method and Description |
---|---|
<RequestT,ResponseT> |
newCall(MethodDescriptor<RequestT,ResponseT> methodDescriptor)
Deprecated.
|
abstract <RequestT,ResponseT> |
newCall(MethodDescriptor<RequestT,ResponseT> methodDescriptor,
CallOptions callOptions)
Create a
ClientCall to the remote operation specified by the given
MethodDescriptor . |
@Deprecated public final <RequestT,ResponseT> ClientCall<RequestT,ResponseT> newCall(MethodDescriptor<RequestT,ResponseT> methodDescriptor)
newCall(MethodDescriptor, CallOptions)
ClientCall
to the remote operation specified by the given
MethodDescriptor
, and with the default call options.methodDescriptor
- describes the name and parameter types of the operation to call.ClientCall
bound to the specified method.public abstract <RequestT,ResponseT> ClientCall<RequestT,ResponseT> newCall(MethodDescriptor<RequestT,ResponseT> methodDescriptor, CallOptions callOptions)
ClientCall
to the remote operation specified by the given
MethodDescriptor
. The returned ClientCall
does not trigger any remote
behavior until ClientCall.start(ClientCall.Listener, Metadata.Headers)
is
invoked.methodDescriptor
- describes the name and parameter types of the operation to call.callOptions
- runtime options to be applied to this call.ClientCall
bound to the specified method.