@ThreadSafe @ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/933") public final class MutableHandlerRegistryImpl extends MutableHandlerRegistry
MutableHandlerRegistry
.
Uses ConcurrentHashMap
to avoid service registration excessively
blocking method lookup.
Constructor and Description |
---|
MutableHandlerRegistryImpl() |
Modifier and Type | Method and Description |
---|---|
ServerServiceDefinition |
addService(ServerServiceDefinition service)
Returns
null , or previous service if service replaced an existing service. |
ServerMethodDefinition<?,?> |
lookupMethod(String methodName,
String authority)
Note: This does not actually honor the authority provided.
|
boolean |
removeService(ServerServiceDefinition service)
Returns
false if service was not registered. |
lookupMethod
@Nullable public ServerServiceDefinition addService(ServerServiceDefinition service)
MutableHandlerRegistry
null
, or previous service if service
replaced an existing service.addService
in class MutableHandlerRegistry
public boolean removeService(ServerServiceDefinition service)
MutableHandlerRegistry
false
if service
was not registered.removeService
in class MutableHandlerRegistry
@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.