|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper
@Contract(threading=SAFE) public class UriHttpAsyncRequestHandlerMapper
Maintains a map of HTTP request handlers keyed by a request URI pattern.
Patterns may have three formats:
*
*<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.
Constructor Summary | |
---|---|
|
UriHttpAsyncRequestHandlerMapper()
|
protected |
UriHttpAsyncRequestHandlerMapper(UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher)
|
Method Summary | |
---|---|
protected String |
getRequestPath(HttpRequest request)
Extracts request path from the given HttpRequest |
UriPatternMatcher<HttpAsyncRequestHandler<?>> |
getUriPatternMatcher()
Gets the pattern matcher. |
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. |
String |
toString()
|
void |
unregister(String pattern)
Removes registered handler, if exists, for the given pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected UriHttpAsyncRequestHandlerMapper(UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher)
public UriHttpAsyncRequestHandlerMapper()
Method Detail |
---|
public UriPatternMatcher<HttpAsyncRequestHandler<?>> getUriPatternMatcher()
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 String toString()
toString
in class Object
public HttpAsyncRequestHandler<?> lookup(HttpRequest request)
lookup
in interface HttpAsyncRequestHandlerMapper
request
- the request
null
if no match is found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |