Class RequestHandlerRegistry<T>
java.lang.Object
org.apache.hc.core5.http.protocol.RequestHandlerRegistry<T>
- Type Parameters:
T- request handler type.
- All Implemented Interfaces:
HttpRequestMapper<T>
@Contract(threading=SAFE_CONDITIONAL)
public class RequestHandlerRegistry<T>
extends Object
implements HttpRequestMapper<T>
Generic registry of request handlers that can be resolved by properties of request messages.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate static final Stringprivate static final Stringprivate final LookupRegistry<T> private final Supplier<LookupRegistry<T>> private final ConcurrentMap<String, LookupRegistry<T>> -
Constructor Summary
ConstructorsConstructorDescriptionRequestHandlerRegistry(String canonicalHostName, Supplier<LookupRegistry<T>> registrySupplier) RequestHandlerRegistry(String canonicalHostName, UriPatternType patternType) RequestHandlerRegistry(UriPatternType patternType) -
Method Summary
Modifier and TypeMethodDescriptionprivate LookupRegistry<T> getPatternMatcher(String hostname) voidresolve(HttpRequest request, HttpContext context) Resolves a handler matching the given request.
-
Field Details
-
LOCALHOST
- See Also:
-
IP_127_0_0_1
- See Also:
-
canonicalHostName
-
registrySupplier
-
-
virtualMap
-
-
Constructor Details
-
RequestHandlerRegistry
public RequestHandlerRegistry(String canonicalHostName, Supplier<LookupRegistry<T>> registrySupplier) -
RequestHandlerRegistry
-
RequestHandlerRegistry
-
RequestHandlerRegistry
public RequestHandlerRegistry()
-
-
Method Details
-
getPatternMatcher
-
resolve
Description copied from interface:HttpRequestMapperResolves a handler matching the given request.- Specified by:
resolvein interfaceHttpRequestMapper<T>- Parameters:
request- the request to map to a handler- Returns:
- HTTP request handler or
nullif no match is found. - Throws:
MisdirectedRequestException
-
register
-