Package io.grpc.internal
Class InternalSubchannel.TransportListener
- java.lang.Object
-
- io.grpc.internal.InternalSubchannel.TransportListener
-
- All Implemented Interfaces:
ManagedClientTransport.Listener
- Enclosing class:
- InternalSubchannel
private class InternalSubchannel.TransportListener extends java.lang.Object implements ManagedClientTransport.Listener
Listener for real transports.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
shutdownInitiated
(package private) ConnectionClientTransport
transport
-
Constructor Summary
Constructors Constructor Description TransportListener(ConnectionClientTransport transport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributes
filterTransport(Attributes attributes)
Called just beforeManagedClientTransport.Listener.transportReady()
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.
-
-
-
Field Detail
-
transport
final ConnectionClientTransport transport
-
shutdownInitiated
boolean shutdownInitiated
-
-
Constructor Detail
-
TransportListener
TransportListener(ConnectionClientTransport transport)
-
-
Method Detail
-
filterTransport
public Attributes filterTransport(Attributes attributes)
Description copied from interface:ManagedClientTransport.Listener
Called just beforeManagedClientTransport.Listener.transportReady()
to allow direct modification of transport Attributes.- Specified by:
filterTransport
in interfaceManagedClientTransport.Listener
-
transportReady
public void transportReady()
Description copied from interface:ManagedClientTransport.Listener
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.
- Specified by:
transportReady
in interfaceManagedClientTransport.Listener
-
transportInUse
public void transportInUse(boolean inUse)
Description copied from interface:ManagedClientTransport.Listener
Called whenever the transport's in-use state has changed. A transport is in-use when it has at least one stream.- Specified by:
transportInUse
in interfaceManagedClientTransport.Listener
-
transportShutdown
public void transportShutdown(Status s)
Description copied from interface:ManagedClientTransport.Listener
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
ManagedClientTransport.Listener.transportTerminated()
.- Specified by:
transportShutdown
in interfaceManagedClientTransport.Listener
- Parameters:
s
- the reason for the shutdown.
-
transportTerminated
public void transportTerminated()
Description copied from interface:ManagedClientTransport.Listener
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
ManagedClientTransport.Listener.transportShutdown(io.grpc.Status)
has been called.- Specified by:
transportTerminated
in interfaceManagedClientTransport.Listener
-
-