Package io.grpc.internal
Class CallCredentialsApplyingTransportFactory
java.lang.Object
io.grpc.internal.CallCredentialsApplyingTransportFactory
- All Implemented Interfaces:
ClientTransportFactory
,Closeable
,AutoCloseable
final class CallCredentialsApplyingTransportFactory
extends Object
implements ClientTransportFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Nested classes/interfaces inherited from interface io.grpc.internal.ClientTransportFactory
ClientTransportFactory.ClientTransportOptions, ClientTransportFactory.SwapChannelCredentialsResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Executor
private final CallCredentials
private final ClientTransportFactory
-
Constructor Summary
ConstructorsConstructorDescriptionCallCredentialsApplyingTransportFactory
(ClientTransportFactory delegate, CallCredentials channelCallCredentials, Executor appExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Releases any resources.Returns an executor for scheduling provided by the transport.Collection
<Class<? extends SocketAddress>> Returns theSocketAddress
types this transport supports.newClientTransport
(SocketAddress serverAddress, ClientTransportFactory.ClientTransportOptions options, ChannelLogger channelLogger) Creates an unstarted transport for exclusive use.swapChannelCredentials
(ChannelCredentials channelCreds) Swaps to a new ChannelCredentials with all other settings unchanged.
-
Field Details
-
delegate
-
channelCallCredentials
-
appExecutor
-
-
Constructor Details
-
CallCredentialsApplyingTransportFactory
CallCredentialsApplyingTransportFactory(ClientTransportFactory delegate, CallCredentials channelCallCredentials, Executor appExecutor)
-
-
Method Details
-
newClientTransport
public ConnectionClientTransport newClientTransport(SocketAddress serverAddress, ClientTransportFactory.ClientTransportOptions options, ChannelLogger channelLogger) Description copied from interface:ClientTransportFactory
Creates an unstarted transport for exclusive use. Ownership ofoptions
is passed to the callee; the caller should not reuse or read from the options after this method is called.- Specified by:
newClientTransport
in interfaceClientTransportFactory
- Parameters:
serverAddress
- the address that the transport is connected tooptions
- additional configurationchannelLogger
- logger for the transport.
-
getScheduledExecutorService
Description copied from interface:ClientTransportFactory
Returns an executor for scheduling provided by the transport. The service should be configured to allow cancelled scheduled runnables to be GCed.The executor should not be used after the factory has been closed. The caller should ensure any outstanding tasks are cancelled before the factory is closed. However, it is a known issue that ClientCallImpl may use this executor after close, so implementations should not go out of their way to prevent usage.
- Specified by:
getScheduledExecutorService
in interfaceClientTransportFactory
-
swapChannelCredentials
public ClientTransportFactory.SwapChannelCredentialsResult swapChannelCredentials(ChannelCredentials channelCreds) Description copied from interface:ClientTransportFactory
Swaps to a new ChannelCredentials with all other settings unchanged. Returns null if the ChannelCredentials is not supported by the current ClientTransportFactory settings.- Specified by:
swapChannelCredentials
in interfaceClientTransportFactory
-
close
public void close()Description copied from interface:ClientTransportFactory
Releases any resources.After this method has been called, it's no longer valid to call
ClientTransportFactory.newClientTransport(java.net.SocketAddress, io.grpc.internal.ClientTransportFactory.ClientTransportOptions, io.grpc.ChannelLogger)
. No guarantees about thread-safety are made.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceClientTransportFactory
- Specified by:
close
in interfaceCloseable
-
getSupportedSocketAddressTypes
Description copied from interface:ClientTransportFactory
Returns theSocketAddress
types this transport supports.- Specified by:
getSupportedSocketAddressTypes
in interfaceClientTransportFactory
-