Interface ManagedClientTransport
- All Superinterfaces:
ClientTransport, InternalInstrumented<InternalChannelz.SocketStats>, InternalWithLogId
- All Known Subinterfaces:
ConnectionClientTransport
- All Known Implementing Classes:
CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport, DelayedClientTransport, ForwardingConnectionClientTransport, InProcessTransport, InternalSubchannel.CallTracingTransport, NettyClientTransport
A
ClientTransport that has life-cycle management.
start(ManagedClientTransport.Listener) must be the first method call to this interface and return before calling other
methods.
Typically the transport owns the streams it creates through ClientTransport.newStream(MethodDescriptor, Metadata, CallOptions, ClientStreamTracer[]), while some
implementations may transfer the streams to somewhere else. Either way they must conform to the
contract defined by shutdown(Status), ManagedClientTransport.Listener.transportShutdown(Status) and
ManagedClientTransport.Listener.transportTerminated().
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceReceives notifications for the transport life-cycle events.Nested classes/interfaces inherited from interface ClientTransport
ClientTransport.PingCallback -
Method Summary
Modifier and TypeMethodDescriptionvoidInitiates an orderly shutdown of the transport.voidshutdownNow(Status reason) Initiates a forceful shutdown in which preexisting and new calls are closed.start(ManagedClientTransport.Listener listener) Starts transport.Methods inherited from interface ClientTransport
newStream, pingMethods inherited from interface InternalInstrumented
getStatsMethods inherited from interface InternalWithLogId
getLogId
-
Method Details
-
start
Starts transport. This method may only be called once.This method and the returned
Runnableshould not throw any exceptions.- Parameters:
listener- non-nulllistener of transport events- Returns:
- a
Runnablethat is executed after-the-fact by the original caller, typically after locks are released
-
shutdown
Initiates an orderly shutdown of the transport. Existing streams continue, but the transport will not own any new streams. New streams will either fail (onceManagedClientTransport.Listener.transportShutdown(Status)callback called), or be transferred off this transport (in which case they may succeed). This method may only be called once. -
shutdownNow
Initiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the providedreason.
-