@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1783") public final class InProcessChannelBuilder extends io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
The channel is intended to be fully-featured, high performance, and useful in testing.
For usage examples, see InProcessServerBuilder
.
Modifier and Type | Method and Description |
---|---|
protected io.grpc.ManagedChannelBuilder<?> |
delegate() |
static InProcessChannelBuilder |
forAddress(SocketAddress address)
Create a channel builder that will connect to the server referenced by the given address.
|
static InProcessChannelBuilder |
forAddress(String name,
int port)
Always fails.
|
static InProcessChannelBuilder |
forName(String name)
Create a channel builder that will connect to the server with the given name.
|
static InProcessChannelBuilder |
forTarget(String target)
Create a channel builder that will connect to the server referenced by the given target URI.
|
InProcessChannelBuilder |
keepAliveTime(long keepAliveTime,
TimeUnit timeUnit)
Does nothing.
|
InProcessChannelBuilder |
keepAliveTimeout(long keepAliveTimeout,
TimeUnit timeUnit)
Does nothing.
|
InProcessChannelBuilder |
keepAliveWithoutCalls(boolean enable)
Does nothing.
|
InProcessChannelBuilder |
maxInboundMessageSize(int max) |
InProcessChannelBuilder |
maxInboundMetadataSize(int bytes)
Sets the maximum size of metadata allowed to be received.
|
InProcessChannelBuilder |
propagateCauseWithStatus(boolean enable)
Sets whether to include the cause with the status that is propagated
forward from the InProcessTransport.
|
InProcessChannelBuilder |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Provides a custom scheduled executor service.
|
InProcessChannelBuilder |
usePlaintext()
Does nothing.
|
InProcessChannelBuilder |
useTransportSecurity()
Does nothing.
|
build, compressorRegistry, decompressorRegistry, defaultLoadBalancingPolicy, defaultServiceConfig, directExecutor, disableRetry, disableServiceConfigLookUp, enableFullStreamDecompression, enableRetry, executor, idleTimeout, intercept, intercept, maxHedgedAttempts, maxRetryAttempts, maxTraceEvents, nameResolverFactory, offloadExecutor, overrideAuthority, perRpcBufferLimit, proxyDetector, retryBufferSize, setBinaryLog, thisT, toString, userAgent
public static InProcessChannelBuilder forName(String name)
name
- the identity of the server to connect topublic static InProcessChannelBuilder forTarget(String target)
target
- the identity of the server to connect topublic static InProcessChannelBuilder forAddress(SocketAddress address)
address
- the address of the server to connect topublic static InProcessChannelBuilder forAddress(String name, int port)
forName(java.lang.String)
instead.@Internal protected io.grpc.ManagedChannelBuilder<?> delegate()
delegate
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder maxInboundMessageSize(int max)
maxInboundMessageSize
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder useTransportSecurity()
useTransportSecurity
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder usePlaintext()
usePlaintext
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit)
keepAliveTime
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit)
keepAliveTimeout
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder keepAliveWithoutCalls(boolean enable)
keepAliveWithoutCalls
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
public InProcessChannelBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
It's an optional parameter. If the user has not provided a scheduled executor service when the channel is built, the builder will use a static cached thread pool.
public InProcessChannelBuilder maxInboundMetadataSize(int bytes)
Integer.MAX_VALUE
disables
the enforcement. Defaults to no limit (Integer.MAX_VALUE
).
There is potential for performance penalty when this setting is enabled, as the Metadata must actually be serialized. Since the current implementation of Metadata pre-serializes, it's currently negligible. But Metadata is free to change its implementation.
maxInboundMetadataSize
in class io.grpc.internal.AbstractManagedChannelImplBuilder<InProcessChannelBuilder>
bytes
- the maximum size of received metadataIllegalArgumentException
- if bytes is non-positivepublic InProcessChannelBuilder propagateCauseWithStatus(boolean enable)
By default, this is set to false. A default value of false maintains consistency with other transports which strip causal information from the status to avoid leaking information to untrusted clients, and to avoid sharing language-specific information with the client. For the in-process implementation, this is not a concern.
enable
- whether to include cause in status