Package io.grpc.inprocess
Class InProcessChannelBuilder.InProcessClientTransportFactory
- java.lang.Object
-
- io.grpc.inprocess.InProcessChannelBuilder.InProcessClientTransportFactory
-
- All Implemented Interfaces:
ClientTransportFactory,java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- InProcessChannelBuilder
static final class InProcessChannelBuilder.InProcessClientTransportFactory extends java.lang.Object implements ClientTransportFactory
Creates InProcess transports. Exposed for internal use, as it should be private.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.grpc.internal.ClientTransportFactory
ClientTransportFactory.ClientTransportOptions, ClientTransportFactory.SwapChannelCredentialsResult
-
-
Field Summary
Fields Modifier and Type Field Description private longassumedMessageSizeprivate booleanclosedprivate booleanincludeCauseWithStatusprivate intmaxInboundMetadataSizeprivate java.util.concurrent.ScheduledExecutorServicetimerServiceprivate booleanuseSharedTimer
-
Constructor Summary
Constructors Modifier Constructor Description privateInProcessClientTransportFactory(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, int maxInboundMetadataSize, boolean includeCauseWithStatus, long assumedMessageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases any resources.java.util.concurrent.ScheduledExecutorServicegetScheduledExecutorService()Returns an executor for scheduling provided by the transport.java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>>getSupportedSocketAddressTypes()Returns theSocketAddresstypes this transport supports.ConnectionClientTransportnewClientTransport(java.net.SocketAddress addr, ClientTransportFactory.ClientTransportOptions options, ChannelLogger channelLogger)Creates an unstarted transport for exclusive use.ClientTransportFactory.SwapChannelCredentialsResultswapChannelCredentials(ChannelCredentials channelCreds)Swaps to a new ChannelCredentials with all other settings unchanged.
-
-
-
Field Detail
-
timerService
private final java.util.concurrent.ScheduledExecutorService timerService
-
useSharedTimer
private final boolean useSharedTimer
-
maxInboundMetadataSize
private final int maxInboundMetadataSize
-
closed
private boolean closed
-
includeCauseWithStatus
private final boolean includeCauseWithStatus
-
assumedMessageSize
private long assumedMessageSize
-
-
Method Detail
-
newClientTransport
public ConnectionClientTransport newClientTransport(java.net.SocketAddress addr, ClientTransportFactory.ClientTransportOptions options, ChannelLogger channelLogger)
Description copied from interface:ClientTransportFactoryCreates an unstarted transport for exclusive use. Ownership ofoptionsis passed to the callee; the caller should not reuse or read from the options after this method is called.- Specified by:
newClientTransportin interfaceClientTransportFactory- Parameters:
addr- the address that the transport is connected tooptions- additional configurationchannelLogger- logger for the transport.
-
getScheduledExecutorService
public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
Description copied from interface:ClientTransportFactoryReturns 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:
getScheduledExecutorServicein interfaceClientTransportFactory
-
swapChannelCredentials
public ClientTransportFactory.SwapChannelCredentialsResult swapChannelCredentials(ChannelCredentials channelCreds)
Description copied from interface:ClientTransportFactorySwaps to a new ChannelCredentials with all other settings unchanged. Returns null if the ChannelCredentials is not supported by the current ClientTransportFactory settings.- Specified by:
swapChannelCredentialsin interfaceClientTransportFactory
-
close
public void close()
Description copied from interface:ClientTransportFactoryReleases 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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceClientTransportFactory- Specified by:
closein interfacejava.io.Closeable
-
getSupportedSocketAddressTypes
public java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getSupportedSocketAddressTypes()
Description copied from interface:ClientTransportFactoryReturns theSocketAddresstypes this transport supports.- Specified by:
getSupportedSocketAddressTypesin interfaceClientTransportFactory
-
-