private ConfigAttributeDefinition findConfigAttribute(final String url) {
initialize();
ConfigAttributeDefinition configAttribute = null;
Object configAttributePattern = null;
for (Map.Entry<Object, ConfigAttributeDefinition> entry : _compiled.entrySet()) {
Object pattern = entry.getKey();
if (_urlMatcher.pathMatchesUrl(pattern, url)) {
// TODO this assumes Ant matching, not valid for regex
if (configAttribute == null || _urlMatcher.pathMatchesUrl(configAttributePattern, (String) pattern)) {
configAttribute = entry.getValue();
configAttributePattern = pattern;
if (_log.isTraceEnabled()) {
_log.trace("new candidate for '" + url + "': '" + pattern
+ "':" + configAttribute.getConfigAttributes());
}
}
}
}
if (_log.isTraceEnabled()) {
if (configAttribute == null) {
_log.trace("no config for '" + url + "'");
} else {
_log.trace("config for '" + url + "' is '" + configAttributePattern
+ "':" + configAttribute.getConfigAttributes());
}
}
return configAttribute;
}