Package io.grpc
Class ServerRegistry
java.lang.Object
io.grpc.ServerRegistry
Registry of
ServerProviders. The default instance loads
providers at runtime through the Java service provider mechanism.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThrown when no suitableServerProviderobjects can be found. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(ServerProvider provider) Deregisters a provider.static ServerRegistryReturns the default registry that loads providers via the Java service loader mechanism.voidregister(ServerProvider provider) Register a provider.
-
Constructor Details
-
ServerRegistry
public ServerRegistry()
-
-
Method Details
-
register
Register a provider.If the provider's
isAvailable()returnsfalse, this method will throwIllegalArgumentException.Providers will be used in priority order. In case of ties, providers are used in registration order.
-
deregister
Deregisters a provider. No-op if the provider is not in the registry.- Parameters:
provider- the provider that was added to the register viaregister(io.grpc.ServerProvider).
-
getDefaultRegistry
Returns the default registry that loads providers via the Java service loader mechanism.
-