Package io.grpc
Class ServerRegistry
java.lang.Object
io.grpc.ServerRegistry
Registry of
ServerProvider
s. The default instance
loads
providers at runtime through the Java service provider mechanism.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Thrown when no suitableServerProvider
objects can be found. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deregister
(ServerProvider provider) Deregisters a provider.static ServerRegistry
Returns the default registry that loads providers via the Java service loader mechanism.void
register
(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.
-