Package io.grpc
Class ServerRegistry.ServerPriorityAccessor
- java.lang.Object
-
- io.grpc.ServerRegistry.ServerPriorityAccessor
-
- All Implemented Interfaces:
ServiceProviders.PriorityAccessor<ServerProvider>
- Enclosing class:
- ServerRegistry
private static final class ServerRegistry.ServerPriorityAccessor extends java.lang.Object implements ServiceProviders.PriorityAccessor<ServerProvider>
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ServerPriorityAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPriority(ServerProvider provider)
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.boolean
isAvailable(ServerProvider provider)
Checks this provider is available for use, taking the current environment into consideration.
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable(ServerProvider provider)
Description copied from interface:ServiceProviders.PriorityAccessor
Checks this provider is available for use, taking the current environment into consideration. Iffalse
, no other methods are safe to be called.- Specified by:
isAvailable
in interfaceServiceProviders.PriorityAccessor<ServerProvider>
-
getPriority
public int getPriority(ServerProvider provider)
Description copied from interface:ServiceProviders.PriorityAccessor
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
getPriority
in interfaceServiceProviders.PriorityAccessor<ServerProvider>
-
-