@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/8022") public final class BinderChannelBuilder extends io.grpc.ForwardingChannelBuilder<BinderChannelBuilder>
| Modifier and Type | Method and Description |
|---|---|
protected io.grpc.ManagedChannelBuilder<?> |
delegate() |
static BinderChannelBuilder |
forAddress(AndroidComponentAddress directAddress,
android.content.Context sourceContext)
Creates a channel builder that will bind to a remote Android service.
|
static BinderChannelBuilder |
forAddress(java.lang.String name,
int port)
Always fails.
|
static BinderChannelBuilder |
forTarget(java.lang.String target)
Always fails.
|
static BinderChannelBuilder |
forTarget(java.lang.String target,
android.content.Context sourceContext)
Creates a channel builder that will bind to a remote Android service, via a string
target name which will be resolved.
|
BinderChannelBuilder |
inboundParcelablePolicy(InboundParcelablePolicy inboundParcelablePolicy)
Sets the policy for inbound parcelable objects.
|
BinderChannelBuilder |
mainThreadExecutor(java.util.concurrent.Executor mainThreadExecutor)
Provides a custom
Executor for accessing this application's main thread. |
BinderChannelBuilder |
scheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
Provides a custom scheduled executor service.
|
BinderChannelBuilder |
securityPolicy(SecurityPolicy securityPolicy)
Provides a custom security policy.
|
BinderChannelBuilder |
setBindServiceFlags(BindServiceFlags bindServiceFlags)
Specifies certain optional aspects of the underlying Android Service binding.
|
build, compressorRegistry, decompressorRegistry, defaultLoadBalancingPolicy, defaultServiceConfig, directExecutor, disableRetry, disableServiceConfigLookUp, enableFullStreamDecompression, enableRetry, executor, idleTimeout, intercept, intercept, keepAliveTime, keepAliveTimeout, keepAliveWithoutCalls, maxHedgedAttempts, maxInboundMessageSize, maxInboundMetadataSize, maxRetryAttempts, maxTraceEvents, nameResolverFactory, offloadExecutor, overrideAuthority, perRpcBufferLimit, proxyDetector, retryBufferSize, setBinaryLog, thisT, toString, usePlaintext, userAgent, useTransportSecuritypublic static BinderChannelBuilder forAddress(AndroidComponentAddress directAddress, android.content.Context sourceContext)
The underlying Android binding will be torn down when the channel becomes idle. This happens
after 30 minutes without use by default but can be configured via ManagedChannelBuilder.idleTimeout(long, TimeUnit) or triggered manually with ManagedChannel.enterIdle().
You the caller are responsible for managing the lifecycle of any channels built by the resulting builder. They will not be shut down automatically.
directAddress - the AndroidComponentAddress referencing the service to bind to.sourceContext - the context to bind from (e.g. The current Activity or Application).public static BinderChannelBuilder forTarget(java.lang.String target, android.content.Context sourceContext)
The underlying Android binding will be torn down when the channel becomes idle. This happens
after 30 minutes without use by default but can be configured via ManagedChannelBuilder.idleTimeout(long, TimeUnit) or triggered manually with ManagedChannel.enterIdle().
You the caller are responsible for managing the lifecycle of any channels built by the resulting builder. They will not be shut down automatically.
target - A target uri which should resolve into an AndroidComponentAddress
referencing the service to bind to.sourceContext - the context to bind from (e.g. The current Activity or Application).public static BinderChannelBuilder forAddress(java.lang.String name, int port)
forAddress(AndroidComponentAddress, Context) instead.public static BinderChannelBuilder forTarget(java.lang.String target)
forAddress(AndroidComponentAddress, Context) instead.protected io.grpc.ManagedChannelBuilder<?> delegate()
delegate in class io.grpc.ForwardingChannelBuilder<BinderChannelBuilder>public BinderChannelBuilder setBindServiceFlags(BindServiceFlags bindServiceFlags)
public BinderChannelBuilder scheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
This is 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 BinderChannelBuilder mainThreadExecutor(java.util.concurrent.Executor mainThreadExecutor)
Executor for accessing this application's main thread.
Optional. A default implementation will be used if no custom Executor is provided.
public BinderChannelBuilder securityPolicy(SecurityPolicy securityPolicy)
This is optional. If the user has not provided a security policy, this channel will only communicate with the same application UID.
public BinderChannelBuilder inboundParcelablePolicy(InboundParcelablePolicy inboundParcelablePolicy)