public String resolveService()

in server/src/main/java/org/apache/asyncweb/server/resolver/PatternMatchResolver.java [110:131]


    public String resolveService(HttpRequest request) {
        if (request.getRequestUri().isAbsolute()) {
            return null;
        }

        String path = request.getRequestUri().getPath();

        // loop around patterns
        for (Entry<Pattern, String> entry : serviceMap.entrySet()) {
            if (entry.getKey().matcher(path).matches()) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Mapped '{}' to service '{}'", path, entry.getValue());
                }
                return entry.getValue();
            }
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("No mapping for path '{}'", path);
        }
        return null;
    }