Interface ManagedClientTransport.Listener

All Known Implementing Classes:
InternalSubchannel.TransportListener, ManagedChannelImpl.DelayedTransportListener
Enclosing interface:
ManagedClientTransport

public static interface ManagedClientTransport.Listener
Receives notifications for the transport life-cycle events. Implementation does not need to be thread-safe, so notifications must be properly synchronized externally.
  • Method Details

    • transportShutdown

      void transportShutdown(Status s)
      The transport is shutting down. This transport will stop owning new streams, but existing streams may continue, and the transport may still be able to process ClientTransport.newStream(MethodDescriptor, Metadata, CallOptions, ClientStreamTracer[]) as long as it doesn't own the new streams. Shutdown could have been caused by an error or normal operation. It is possible that this method is called without ManagedClientTransport.shutdown(Status) being called.

      This is called exactly once, and must be called prior to transportTerminated().

      Parameters:
      s - the reason for the shutdown.
    • transportTerminated

      void transportTerminated()
      The transport completed shutting down. All resources have been released. All streams have either been closed or transferred off this transport. This transport may still be able to process ClientTransport.newStream(MethodDescriptor, Metadata, CallOptions, ClientStreamTracer[]) as long as it doesn't own the new streams.

      This is called exactly once, and must be called after transportShutdown(Status) has been called.

    • transportReady

      void transportReady()
      The transport is ready to accept traffic, because the connection is established. This is called at most once.

      Streams created before this milestone are not guaranteed to function.

    • transportInUse

      void transportInUse(boolean inUse)
      Called whenever the transport's in-use state has changed. A transport is in-use when it has at least one stream.
    • filterTransport

      default Attributes filterTransport(Attributes attributes)
      Called just before transportReady() to allow direct modification of transport Attributes.