org.apache.http.protocol
Class HttpRequestHandlerRegistry

java.lang.Object
  extended by org.apache.http.protocol.HttpRequestHandlerRegistry
All Implemented Interfaces:
HttpRequestHandlerResolver

public class HttpRequestHandlerRegistry
extends Object
implements HttpRequestHandlerResolver

Maintains a map of HTTP request handlers keyed by a request URI pattern.
Patterns may have three formats:


This class can be used to resolve an instance of HttpRequestHandler matching a particular request URI. Usually the resolved request handler will be used to process the request with the specified request URI.

Since:
4.0

Constructor Summary
HttpRequestHandlerRegistry()
           
 
Method Summary
 HttpRequestHandler lookup(String requestURI)
          Looks up a handler matching the given request URI.
protected  boolean matchUriRequestPattern(String pattern, String requestUri)
          Deprecated.  
 void register(String pattern, HttpRequestHandler handler)
          Registers the given HttpRequestHandler as a handler for URIs matching the given pattern.
 void setHandlers(Map map)
          Sets handlers from the given map.
 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, toString, wait, wait, wait
 

Constructor Detail

HttpRequestHandlerRegistry

public HttpRequestHandlerRegistry()
Method Detail

register

public void register(String pattern,
                     HttpRequestHandler handler)
Registers the given HttpRequestHandler as a handler for URIs matching the given pattern.

Parameters:
pattern - the pattern to register the handler for.
handler - the handler.

unregister

public void unregister(String pattern)
Removes registered handler, if exists, for the given pattern.

Parameters:
pattern - the pattern to unregister the handler for.

setHandlers

public void setHandlers(Map map)
Sets handlers from the given map.

Parameters:
map - the map containing handlers keyed by their URI patterns.

lookup

public HttpRequestHandler lookup(String requestURI)
Description copied from interface: HttpRequestHandlerResolver
Looks up a handler matching the given request URI.

Specified by:
lookup in interface HttpRequestHandlerResolver
Parameters:
requestURI - the request URI
Returns:
HTTP request handler or null if no match is found.

matchUriRequestPattern

protected boolean matchUriRequestPattern(String pattern,
                                         String requestUri)
Deprecated. 



Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.