Top Description Constructors Methods
io.grpc

public abstract Class Channel

extends Object
Class Inheritance
Known Direct Subclasses
io.grpc.ClientInterceptors.InterceptorChannel, io.grpc.ManagedChannel
Annotations
@ThreadSafe
Imports
javax.annotation.concurrent.ThreadSafe

A virtual connection to a conceptual endpoint, to perform RPCs. A channel is free to have zero or many actual connections to the endpoint based on configuration, load, etc. A channel is also free to determine which actual endpoints to use and may change it every RPC, permitting client-side load balancing. Applications are generally expected to use stubs instead of calling this class directly.

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 Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String
authority()

The authority of the destination this channel connects to.

public abstract <RequestT, ResponseT> ClientCall<RequestT, ResponseT>

Returns:

a ClientCall bound to the specified method.
newCall
(MethodDescriptor<RequestT, ResponseT>
describes the name and parameter types of the operation to call.
methodDescriptor
,
CallOptions
runtime options to be applied to this call.
callOptions
)

Create a ClientCall to the remote operation specified by the given MethodDescriptor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Channelback to summary
public Channel()

Method Detail

authorityback to summary
public abstract String authority()

The authority of the destination this channel connects to. Typically this is in the format host:port.

Since
1.0.0
newCallback to summary
public abstract <RequestT, ResponseT> ClientCall<RequestT, ResponseT> newCall(MethodDescriptor<RequestT, ResponseT> methodDescriptor, CallOptions callOptions)

Create a 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) is invoked.

Parameters
methodDescriptor:MethodDescriptor<RequestT, ResponseT>

describes the name and parameter types of the operation to call.

callOptions:CallOptions

runtime options to be applied to this call.

Returns:ClientCall<RequestT, ResponseT>

a ClientCall bound to the specified method.

Since
1.0.0