protected AtmosphereHandlerWrapper map(String path) { AtmosphereHandlerWrapper atmosphereHandlerWrapper = config.handlers().get(path); if (atmosphereHandlerWrapper == null) { final Map<String, String> m = new HashMap<String, String>(); for (Map.Entry<String, AtmosphereHandlerWrapper> e : config.handlers().entrySet()) { UriTemplate t = new UriTemplate(e.getKey()); logger.trace("Trying to map {} to {}", t, path); if (t.match(path, m)) { atmosphereHandlerWrapper = e.getValue(); logger.trace("Mapped {} to {}", t, e.getValue()); break; } } } return atmosphereHandlerWrapper; }
protected U match(String path, Map<String, U> handlers) { U handler = handlers.get(path); if (handler == null) { final Map<String, String> m = new HashMap<String, String>(); for (Map.Entry<String, U> e : handlers.entrySet()) { UriTemplate t = new UriTemplate(e.getKey()); logger.trace("Trying to map {} to {}", t, path); if (t.match(path, m)) { handler = e.getValue(); logger.trace("Mapped {} to {}", t, e.getValue()); break; } } } return handler; }