@Contract(threading=SAFE) public class UriHttpAsyncRequestHandlerMapper extends Object implements HttpAsyncRequestHandlerMapper
*
*<uri>
<uri>*
HttpAsyncRequestHandler
matching a particular request URI. Usually the mapped request handler
will be used to process the request with the specified request URI.Modifier and Type | Field and Description |
---|---|
private UriPatternMatcher<HttpAsyncRequestHandler<?>> |
matcher |
Modifier | Constructor and Description |
---|---|
|
UriHttpAsyncRequestHandlerMapper() |
protected |
UriHttpAsyncRequestHandlerMapper(UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher) |
Modifier and Type | Method and Description |
---|---|
protected String |
getRequestPath(HttpRequest request)
Extracts request path from the given
HttpRequest |
HttpAsyncRequestHandler<?> |
lookup(HttpRequest request)
Looks up a handler matching the given request URI.
|
void |
register(String pattern,
HttpAsyncRequestHandler<?> handler)
Registers the given
HttpAsyncRequestHandler as a handler for URIs
matching the given pattern. |
void |
unregister(String pattern)
Removes registered handler, if exists, for the given pattern.
|
private final UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher
protected UriHttpAsyncRequestHandlerMapper(UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher)
public UriHttpAsyncRequestHandlerMapper()
public void register(String pattern, HttpAsyncRequestHandler<?> handler)
HttpAsyncRequestHandler
as a handler for URIs
matching the given pattern.pattern
- the pattern to register the handler for.handler
- the handler.public void unregister(String pattern)
pattern
- the pattern to unregister the handler for.protected String getRequestPath(HttpRequest request)
HttpRequest
public HttpAsyncRequestHandler<?> lookup(HttpRequest request)
lookup
in interface HttpAsyncRequestHandlerMapper
request
- the requestnull
if no match is found.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses