public class

HttpRequestHandlerRegistry

extends Object
implements HttpRequestHandlerResolver
java.lang.Object
   ↳ org.apache.http.protocol.HttpRequestHandlerRegistry

Class Overview

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

  • *
  • *<uri>
  • <uri>*

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.

Summary

Public Constructors
HttpRequestHandlerRegistry()
Public Methods
HttpRequestHandler lookup(String requestURI)
Looks up a handler matching the given request URI.
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.
Protected Methods
boolean matchUriRequestPattern(String pattern, String requestUri)
This method is deprecated. No replacement.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.protocol.HttpRequestHandlerResolver

Public Constructors

public HttpRequestHandlerRegistry ()

Public Methods

public HttpRequestHandler lookup (String requestURI)

Looks up a handler matching the given request URI.

Parameters
requestURI the request URI
Returns
  • HTTP request handler or null if no match is found.

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.

public void setHandlers (Map map)

Sets handlers from the given map.

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

public void unregister (String pattern)

Removes registered handler, if exists, for the given pattern.

Parameters
pattern the pattern to unregister the handler for.

Protected Methods

protected boolean matchUriRequestPattern (String pattern, String requestUri)

This method is deprecated.
No replacement.