Class AltsProtocolNegotiator.LazyChannel

java.lang.Object
io.grpc.alts.internal.AltsProtocolNegotiator.LazyChannel
Enclosing class:
AltsProtocolNegotiator

static final class AltsProtocolNegotiator.LazyChannel extends Object
Channel created from a channel pool lazily.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private io.grpc.Channel
     
    private final io.grpc.internal.ObjectPool<io.grpc.Channel>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LazyChannel(io.grpc.internal.ObjectPool<io.grpc.Channel> channelPool)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Returns the cached channel to the channel pool.
    (package private) io.grpc.Channel
    get()
    If channel is null, gets a channel from the channel pool, otherwise, returns the cached channel.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • channelPool

      private final io.grpc.internal.ObjectPool<io.grpc.Channel> channelPool
    • channel

      private io.grpc.Channel channel
  • Constructor Details

    • LazyChannel

      LazyChannel(io.grpc.internal.ObjectPool<io.grpc.Channel> channelPool)
  • Method Details

    • get

      io.grpc.Channel get()
      If channel is null, gets a channel from the channel pool, otherwise, returns the cached channel.
    • close

      void close()
      Returns the cached channel to the channel pool.