Beispiel #1
0
  private RequestHandler lookupHandler(String uri, String methodName) {
    // We don't normalize the URI here because it is normalized when
    // the HTTP request comes in.
    if (log.logDebug()) {
      log.debug("Look up handler for URI [" + uri + "] and method [" + methodName + "]");
    }

    RequestHandler handler = null;
    Map patternMap = (Map) this.uriHandlers.get(uri);
    if (patternMap == null) {
      if (log.logDebug()) {
        log.debug("Nothing registered for uri [" + uri + "]");
      }
      return null;
    }
    Iterator patterns = patternMap.entrySet().iterator();
    while (patterns.hasNext()) {
      Map.Entry entry = (Map.Entry) patterns.next();
      Pattern pattern = (Pattern) this.globalPatternMap.get(entry.getKey());
      if (pattern.matcher(methodName).find()) {
        if (log.logDebug()) {
          log.debug("Handler matched on pattern [" + pattern + "]");
        }
        handler = (RequestHandler) entry.getValue();
      }
    }
    return handler;
  }
Beispiel #2
0
 protected void handleTimeout(Socket socket, Exception cause) {
   log.debug("Timeout on " + Utils.toString(socket), cause);
 }