Package io.grpc.internal
Class CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport
- java.lang.Object
-
- io.grpc.internal.ForwardingConnectionClientTransport
-
- io.grpc.internal.CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport
-
- All Implemented Interfaces:
ClientTransport
,ConnectionClientTransport
,ManagedClientTransport
,InternalInstrumented<InternalChannelz.SocketStats>
,InternalWithLogId
- Enclosing class:
- CallCredentialsApplyingTransportFactory
private class CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport extends ForwardingConnectionClientTransport
-
-
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
-
-
Field Summary
Fields Modifier and Type Field Description private MetadataApplierImpl.MetadataApplierListener
applierListener
private java.lang.String
authority
private ConnectionClientTransport
delegate
private java.util.concurrent.atomic.AtomicInteger
pendingApplier
private Status
savedShutdownNowStatus
private Status
savedShutdownStatus
private Status
shutdownStatus
-
Constructor Summary
Constructors Constructor Description CallCredentialsApplyingTransport(ConnectionClientTransport delegate, java.lang.String authority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConnectionClientTransport
delegate()
private void
maybeShutdown()
ClientStream
newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)
Creates a new stream for sending messages to a remote end-point.void
shutdown(Status status)
Initiates an orderly shutdown of the transport.void
shutdownNow(Status status)
Initiates a forceful shutdown in which preexisting and new calls are closed.-
Methods inherited from class io.grpc.internal.ForwardingConnectionClientTransport
getAttributes, getLogId, getStats, ping, start, toString
-
-
-
-
Field Detail
-
delegate
private final ConnectionClientTransport delegate
-
authority
private final java.lang.String authority
-
pendingApplier
private final java.util.concurrent.atomic.AtomicInteger pendingApplier
-
shutdownStatus
private volatile Status shutdownStatus
-
savedShutdownStatus
private Status savedShutdownStatus
-
savedShutdownNowStatus
private Status savedShutdownNowStatus
-
applierListener
private final MetadataApplierImpl.MetadataApplierListener applierListener
-
-
Constructor Detail
-
CallCredentialsApplyingTransport
CallCredentialsApplyingTransport(ConnectionClientTransport delegate, java.lang.String authority)
-
-
Method Detail
-
delegate
protected ConnectionClientTransport delegate()
- Specified by:
delegate
in classForwardingConnectionClientTransport
-
newStream
public ClientStream newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)
Description copied from interface:ClientTransport
Creates 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
Context
of theClientCall
.- Specified by:
newStream
in interfaceClientTransport
- Overrides:
newStream
in classForwardingConnectionClientTransport
- 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.
-
shutdown
public void shutdown(Status status)
Description copied from interface:ManagedClientTransport
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(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:
shutdown
in interfaceManagedClientTransport
- Overrides:
shutdown
in classForwardingConnectionClientTransport
-
shutdownNow
public void shutdownNow(Status status)
Description copied from interface:ManagedClientTransport
Initiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the providedreason
.- Specified by:
shutdownNow
in interfaceManagedClientTransport
- Overrides:
shutdownNow
in classForwardingConnectionClientTransport
-
maybeShutdown
private void maybeShutdown()
-
-