T
- The concrete type of this builder.public abstract class ManagedChannelBuilder<T extends ManagedChannelBuilder<T>> extends Object
ManagedChannel
instances.Constructor and Description |
---|
ManagedChannelBuilder() |
Modifier and Type | Method and Description |
---|---|
abstract ManagedChannel |
build()
Builds a channel using the given parameters.
|
abstract T |
executor(Executor executor)
Provides a custom executor.
|
static ManagedChannelBuilder<?> |
forAddress(String name,
int port) |
abstract T |
intercept(ClientInterceptor... interceptors)
Adds interceptors that will be called before the channel performs its real work.
|
abstract T |
intercept(List<ClientInterceptor> interceptors)
Adds interceptors that will be called before the channel performs its real work.
|
abstract T |
overrideAuthority(String authority)
Overrides the authority used with TLS and HTTP virtual hosting.
|
abstract T |
usePlaintext(boolean skipNegotiation) |
abstract T |
userAgent(String userAgent)
Provides a custom
User-Agent for the application. |
public static ManagedChannelBuilder<?> forAddress(String name, int port)
public abstract T executor(Executor executor)
It's an optional parameter. If the user has not provided an executor when the channel is built, the builder will use a static cached thread pool.
The channel won't take ownership of the given executor. It's caller's responsibility to shut down the executor when it's desired.
public abstract T intercept(List<ClientInterceptor> interceptors)
ClientInterceptors.intercept(Channel, List)
, but while
still having access to the original ManagedChannel
.public abstract T intercept(ClientInterceptor... interceptors)
ClientInterceptors.intercept(Channel,
ClientInterceptor...)
, but while still having access to the original ManagedChannel
.public abstract T userAgent(String userAgent)
User-Agent
for the application.
It's an optional parameter. If provided, the given agent will be prepended by the
grpc User-Agent
.
@ExperimentalApi(value="primarily for testing") public abstract T overrideAuthority(String authority)
host:port
.
Should only used by tests.
@ExperimentalApi(value="primarily for testing") public abstract T usePlaintext(boolean skipNegotiation)
public abstract ManagedChannel build()