@Internal @ThreadSafe public final class ServerRegistry extends Object
ServerProvider
s. The default instance
loads
providers at runtime through the Java service provider mechanism.Modifier and Type | Class and Description |
---|---|
static class |
ServerRegistry.ProviderNotFoundException
Thrown when no suitable
ServerProvider objects can be found. |
Constructor and Description |
---|
ServerRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
deregister(ServerProvider provider)
Deregisters a provider.
|
static ServerRegistry |
getDefaultRegistry()
Returns the default registry that loads providers via the Java service loader mechanism.
|
void |
register(ServerProvider provider)
Register a provider.
|
public void register(ServerProvider provider)
If the provider's isAvailable()
returns
false
, this method will throw IllegalArgumentException
.
Providers will be used in priority order. In case of ties, providers are used in registration order.
public void deregister(ServerProvider provider)
provider
- the provider that was added to the register via register(io.grpc.ServerProvider)
.public static ServerRegistry getDefaultRegistry()