Class ForwardingConnectionClientTransport
- java.lang.Object
-
- io.grpc.internal.ForwardingConnectionClientTransport
-
- All Implemented Interfaces:
ClientTransport,ConnectionClientTransport,ManagedClientTransport,InternalInstrumented<InternalChannelz.SocketStats>,InternalWithLogId
- Direct Known Subclasses:
CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport,InternalSubchannel.CallTracingTransport
abstract class ForwardingConnectionClientTransport extends java.lang.Object implements ConnectionClientTransport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.grpc.internal.ClientTransport
ClientTransport.PingCallback
-
Nested classes/interfaces inherited from interface io.grpc.internal.ManagedClientTransport
ManagedClientTransport.Listener
-
-
Constructor Summary
Constructors Constructor Description ForwardingConnectionClientTransport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ConnectionClientTransportdelegate()AttributesgetAttributes()Returns a set of attributes, which may vary depending on the state of the transport.InternalLogIdgetLogId()Returns an ID that is primarily used in debug logs.com.google.common.util.concurrent.ListenableFuture<InternalChannelz.SocketStats>getStats()Returns the stats object.ClientStreamnewStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)Creates a new stream for sending messages to a remote end-point.voidping(ClientTransport.PingCallback callback, java.util.concurrent.Executor executor)Pings a remote endpoint.voidshutdown(Status status)Initiates an orderly shutdown of the transport.voidshutdownNow(Status status)Initiates a forceful shutdown in which preexisting and new calls are closed.java.lang.Runnablestart(ManagedClientTransport.Listener listener)Starts transport.java.lang.StringtoString()
-
-
-
Method Detail
-
start
public java.lang.Runnable start(ManagedClientTransport.Listener listener)
Description copied from interface:ManagedClientTransportStarts transport. This method may only be called once.This method and the returned
Runnableshould not throw any exceptions.- Specified by:
startin interfaceManagedClientTransport- 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
public void shutdown(Status status)
Description copied from interface:ManagedClientTransportInitiates 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(io.grpc.Status)callback called), or be transferred off this transport (in which case they may succeed). This method may only be called once.- Specified by:
shutdownin interfaceManagedClientTransport
-
shutdownNow
public void shutdownNow(Status status)
Description copied from interface:ManagedClientTransportInitiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the providedreason.- Specified by:
shutdownNowin interfaceManagedClientTransport
-
newStream
public ClientStream newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)
Description copied from interface:ClientTransportCreates a new stream for sending messages to a remote end-point.This method returns immediately and does not wait for any validation of the request. If creation fails for any reason,
ClientStreamListener.closed(io.grpc.Status, io.grpc.internal.ClientStreamListener.RpcProgress, io.grpc.Metadata)will be called to provide the error information. Any sent messages for this stream will be buffered until creation has completed (either successfully or unsuccessfully).This method is called under the
Contextof theClientCall.- Specified by:
newStreamin interfaceClientTransport- Parameters:
method- the descriptor of the remote method to be called for this stream.headers- to send at the beginning of the callcallOptions- runtime options of the calltracers- a non-empty array of tracers. The last element in it is reserved to be set by the load balancer's pick result and otherwise is a no-op tracer.- Returns:
- the newly created stream.
-
ping
public void ping(ClientTransport.PingCallback callback, java.util.concurrent.Executor executor)
Description copied from interface:ClientTransportPings a remote endpoint. When an acknowledgement is received, the given callback will be invoked using the given executor.Pings are not necessarily sent to the same endpoint, thus a successful ping only means at least one endpoint responded, but doesn't imply the availability of other endpoints (if there is any).
This is an optional method. Transports that do not have any mechanism by which to ping the remote endpoint may throw
UnsupportedOperationException.- Specified by:
pingin interfaceClientTransport
-
getLogId
public InternalLogId getLogId()
Description copied from interface:InternalWithLogIdReturns an ID that is primarily used in debug logs. It usually contains the class name and a numeric ID that is unique among the instances.The subclasses of this interface usually want to include the log ID in their
Object.toString()results.- Specified by:
getLogIdin interfaceInternalWithLogId
-
getAttributes
public Attributes getAttributes()
Description copied from interface:ConnectionClientTransportReturns a set of attributes, which may vary depending on the state of the transport. The keys should define in what states they will be present.- Specified by:
getAttributesin interfaceConnectionClientTransport
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getStats
public com.google.common.util.concurrent.ListenableFuture<InternalChannelz.SocketStats> getStats()
Description copied from interface:InternalInstrumentedReturns the stats object.- Specified by:
getStatsin interfaceInternalInstrumented<InternalChannelz.SocketStats>
-
delegate
protected abstract ConnectionClientTransport delegate()
-
-