Package io.grpc

Class Channel

  • Direct Known Subclasses:

    public abstract class Channel
    extends java.lang.Object
    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

      Constructor Description
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract java.lang.String authority()
      The authority of the destination this channel connects to.
      abstract <RequestT,​ResponseT>
      newCall​(MethodDescriptor<RequestT,​ResponseT> methodDescriptor, CallOptions callOptions)
      Create a ClientCall to the remote operation specified by the given MethodDescriptor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Channel

        public Channel()
    • Method Detail

      • authority

        public abstract java.lang.String authority()
        The authority of the destination this channel connects to. Typically this is in the format host:port.