Package io.grpc.util

Class ForwardingSubchannel

    • Constructor Detail

      • ForwardingSubchannel

        public ForwardingSubchannel()
    • Method Detail

      • shutdown

        public void shutdown()
        Description copied from class: LoadBalancer.Subchannel
        Shuts down the Subchannel. After this method is called, this Subchannel should no longer be returned by the latest picker, and can be safely discarded.

        Calling it on an already shut-down Subchannel has no effect.

        It should be called from the Synchronization Context. Currently will log a warning if violated. It will become an exception eventually. See #5015 for the background.

        Specified by:
        shutdown in class LoadBalancer.Subchannel
      • requestConnection

        public void requestConnection()
        Description copied from class: LoadBalancer.Subchannel
        Asks the Subchannel to create a connection (aka transport), if there isn't an active one.

        It should be called from the Synchronization Context. Currently will log a warning if violated. It will become an exception eventually. See #5015 for the background.

        Specified by:
        requestConnection in class LoadBalancer.Subchannel
      • getAllAddresses

        public java.util.List<EquivalentAddressGroup> getAllAddresses()
        Description copied from class: LoadBalancer.Subchannel
        Returns the addresses that this Subchannel is bound to. The returned list will not be empty.

        It should be called from the Synchronization Context. Currently will log a warning if violated. It will become an exception eventually. See #5015 for the background.

        Overrides:
        getAllAddresses in class LoadBalancer.Subchannel
      • getInternalSubchannel

        public java.lang.Object getInternalSubchannel()
        Description copied from class: LoadBalancer.Subchannel
        (Internal use only) returns an object that represents the underlying subchannel that is used by the Channel for sending RPCs when this LoadBalancer.Subchannel is picked. This is an opaque object that is both provided and consumed by the Channel. Its type is not Subchannel.

        Warning: this is INTERNAL API, is not supposed to be used by external users, and may change without notice. If you think you must use it, please file an issue and we can consider removing its "internal" status.

        Overrides:
        getInternalSubchannel in class LoadBalancer.Subchannel
      • updateAddresses

        public void updateAddresses​(java.util.List<EquivalentAddressGroup> addrs)
        Description copied from class: LoadBalancer.Subchannel
        Replaces the existing addresses used with this Subchannel. If the new and old addresses overlap, the Subchannel can continue using an existing connection.

        It must be called from the Synchronization Context or will throw.

        Overrides:
        updateAddresses in class LoadBalancer.Subchannel
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object