Interface GrpcChannelFactory

All Known Implementing Classes:
CompositeGrpcChannelFactory, DefaultGrpcChannelFactory, InProcessGrpcChannelFactory, NettyGrpcChannelFactory, ShadedNettyGrpcChannelFactory

public interface GrpcChannelFactory
Factory interface for creating ManagedChannel instances.
Author:
Dave Syer, Chris Bono
  • Method Summary

    Modifier and Type
    Method
    Description
    default io.grpc.ManagedChannel
    Creates a ManagedChannel for the given target string.
    io.grpc.ManagedChannel
    Creates a ManagedChannel for the given target string.
    default boolean
    supports(io.grpc.ClientInterceptor interceptor)
    Whether this factory supports the given global ClientInterceptor.
    boolean
    supports(String target)
    Whether this factory supports the given target string.
  • Method Details

    • supports

      boolean supports(String target)
      Whether this factory supports the given target string.

      The target can be either a valid nameresolver-compliant URI or an authority string as described in Grpc.newChannelBuilder(String, ChannelCredentials), or the name of a user-configured channel (e.g. 'my-channel').

      Parameters:
      target - the target string
      Returns:
      whether this factory supports the given target string
    • supports

      default boolean supports(io.grpc.ClientInterceptor interceptor)
      Whether this factory supports the given global ClientInterceptor.
      Parameters:
      interceptor - the client interceptor to check support for
      Returns:
      whether this factory supports the given interceptor
    • createChannel

      default io.grpc.ManagedChannel createChannel(String target)
      Creates a ManagedChannel for the given target string.

      The target can be either a valid nameresolver-compliant URI or an authority string as described in Grpc.newChannelBuilder(String, ChannelCredentials), or the name of a user-configured channel (e.g. 'my-channel').

      The returned channel is configured to use all globally registered interceptors.

      Parameters:
      target - the target string
      Returns:
      a channel for the given target
    • createChannel

      io.grpc.ManagedChannel createChannel(String target, ChannelBuilderOptions options)
      Creates a ManagedChannel for the given target string. The target can be

      The target can be either a valid nameresolver-compliant URI or an authority string as described in Grpc.newChannelBuilder(String, ChannelCredentials), or the name of a user-configured channel (e.g. 'my-channel').

      The returned channel is configured to use all globally registered interceptors and any user-provided interceptor if specified in the options.

      Parameters:
      target - the target string as described in method javadocs
      options - the options for building the created channel, or ChannelBuilderOptions.defaults() to use default options
      Returns:
      a channel for the given target