public interface ClientTransportFactory extends Closeable
ConnectionClientTransport
instances.Modifier and Type | Interface and Description |
---|---|
static class |
ClientTransportFactory.ClientTransportOptions
Options passed to
#newClientTransport(SocketAddress, ClientTransportOptions) . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases any resources.
|
ScheduledExecutorService |
getScheduledExecutorService()
Returns an executor for scheduling provided by the transport.
|
ConnectionClientTransport |
newClientTransport(SocketAddress serverAddress,
ClientTransportFactory.ClientTransportOptions options,
ChannelLogger channelLogger)
Creates an unstarted transport for exclusive use.
|
ConnectionClientTransport newClientTransport(SocketAddress serverAddress, ClientTransportFactory.ClientTransportOptions options, ChannelLogger channelLogger)
options
is passed to the
callee; the caller should not reuse or read from the options after this method is called.serverAddress
- the address that the transport is connected tooptions
- additional configurationchannelLogger
- logger for the transport.ScheduledExecutorService getScheduledExecutorService()
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.
void close()
After this method has been called, it's no longer valid to call
newClientTransport(java.net.SocketAddress, io.grpc.internal.ClientTransportFactory.ClientTransportOptions, io.grpc.ChannelLogger)
. No guarantees about thread-safety are made.
close
in interface AutoCloseable
close
in interface Closeable