-
public final class BinderServerBuilder extends ForwardingServerBuilder<BinderServerBuilder>
Builder for a server that services requests from an Android Service.
-
-
Method Summary
Modifier and Type Method Description static BinderServerBuilderforAddress(AndroidComponentAddress listenAddress, IBinderReceiver receiver)Creates a server builder that will listen for bindings to the specified address. static BinderServerBuilderforPort(int port)Always fails. BinderServerBuilderenableStats()Enable stats collection using census. BinderServerBuilderenableTracing()Enable tracing using census. BinderServerBuilderscheduledExecutorService(ScheduledExecutorService scheduledExecutorService)Provides a custom scheduled executor service. BinderServerBuildersecurityPolicy(ServerSecurityPolicy securityPolicy)Provides a custom security policy. BinderServerBuilderinboundParcelablePolicy(InboundParcelablePolicy inboundParcelablePolicy)Sets the policy for inbound parcelable objects. BinderServerBuilderuseTransportSecurity(File certChain, File privateKey)Always fails. Serverbuild()Builds a Server according to this builder's parameters and stores its listening in the IBinderReceiver passed to forAddress. -
Methods inherited from class io.grpc.ForwardingServerBuilder
addService, addStreamTracerFactory, addTransportFilter, build, callExecutor, compressorRegistry, decompressorRegistry, directExecutor, executor, fallbackHandlerRegistry, forPort, handshakeTimeout, intercept, keepAliveTime, keepAliveTimeout, maxConnectionAge, maxConnectionAgeGrace, maxConnectionIdle, maxInboundMessageSize, maxInboundMetadataSize, permitKeepAliveTime, permitKeepAliveWithoutCalls, setBinaryLog, toString, useTransportSecurity -
Methods inherited from class io.grpc.ServerBuilder
addServices -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
forAddress
static BinderServerBuilder forAddress(AndroidComponentAddress listenAddress, IBinderReceiver receiver)
Creates a server builder that will listen for bindings to the specified address.
The listening IBinder associated with new Servers will be storedin
{@code binderReceiver}upon build. Callers should return it from when the binding intent matches{@code listenAddress}.- Parameters:
listenAddress- an Android Service and binding Intent associated with this server.receiver- an "out param" for the new Server's listening IBinder
-
forPort
static BinderServerBuilder forPort(int port)
Always fails. Call forAddress instead.
-
enableStats
@ExperimentalApi(value = https://github.com/grpc/grpc-java/issues/8022) BinderServerBuilder enableStats()
Enable stats collection using census.
-
enableTracing
@ExperimentalApi(value = https://github.com/grpc/grpc-java/issues/8022) BinderServerBuilder enableTracing()
Enable tracing using census.
-
scheduledExecutorService
BinderServerBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Provides a custom scheduled executor service.
It's an optional parameter. If the user has not provided a scheduled executor service whenthe channel is built, the builder will use a static cached thread pool.
-
securityPolicy
BinderServerBuilder securityPolicy(ServerSecurityPolicy securityPolicy)
Provides a custom security policy.
This is optional. If the user has not provided a security policy, the server will default toonly accepting calls from the same application UID.
-
inboundParcelablePolicy
@ExperimentalApi(value = https://github.com/grpc/grpc-java/issues/8022) BinderServerBuilder inboundParcelablePolicy(InboundParcelablePolicy inboundParcelablePolicy)
Sets the policy for inbound parcelable objects.
-
useTransportSecurity
BinderServerBuilder useTransportSecurity(File certChain, File privateKey)
Always fails. TLS is not supported in BinderServer.
-
build
Server build()
Builds a Server according to this builder's parameters and stores its listening in the IBinderReceiver passed to forAddress.
-
-
-
-