Package io.grpc.internal
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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
transportReady()
The transport is ready to accept traffic, because the connection is established.void
transportShutdown(Status s)
The transport is shutting down.void
transportTerminated()
The transport completed shutting down.
-
-
-
Method Detail
-
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 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
default Attributes filterTransport(Attributes attributes)
Called just beforetransportReady()
to allow direct modification of transport Attributes.
-
-