Package io.grpc.internal
Interface ManagedClientTransport.Listener
- 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 Summary
Modifier and TypeMethodDescriptiondefault Attributes
filterTransport
(Attributes attributes) Called just beforetransportReady()
to allow direct modification of transport Attributes.void
transportInUse
(boolean inUse) Called whenever the transport's in-use state has changed.void
The transport is ready to accept traffic, because the connection is established.void
The transport is shutting down.void
The transport completed shutting down.
-
Method Details
-
transportShutdown
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 processClientTransport.newStream(io.grpc.MethodDescriptor<?, ?>, io.grpc.Metadata, io.grpc.CallOptions, io.grpc.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 withoutManagedClientTransport.shutdown(io.grpc.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 processClientTransport.newStream(io.grpc.MethodDescriptor<?, ?>, io.grpc.Metadata, io.grpc.CallOptions, io.grpc.ClientStreamTracer[])
as long as it doesn't own the new streams.This is called exactly once, and must be called after
transportShutdown(io.grpc.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
Called just beforetransportReady()
to allow direct modification of transport Attributes.
-