@ThreadSafe @ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/933") public final class MutableHandlerRegistry extends HandlerRegistry
MutableHandlerRegistry
.
Uses ConcurrentHashMap
to avoid service registration excessively
blocking method lookup.
Constructor and Description |
---|
MutableHandlerRegistry() |
Modifier and Type | Method and Description |
---|---|
ServerServiceDefinition |
addService(ServerServiceDefinition service) |
ServerMethodDefinition<?,?> |
lookupMethod(String methodName,
String authority)
Note: This does not actually honor the authority provided.
|
boolean |
removeService(ServerServiceDefinition service) |
lookupMethod
@Nullable public ServerServiceDefinition addService(ServerServiceDefinition service)
public boolean removeService(ServerServiceDefinition service)
@Nullable public ServerMethodDefinition<?,?> lookupMethod(String methodName, @Nullable String authority)
lookupMethod
in class HandlerRegistry
methodName
- to lookup ServerMethodDefinition
for.authority
- the authority for the desired method (to do virtual hosting). If null
the first matching method will be returned.null
if no method for that name exists.