Pattern p = Pattern.compile(pattern);
this.patterns.put(p,type);
}
public Target resolve(Request request) {
RequestContext context = (RequestContext) request;
String uri = context.getTargetPath();
for (Pattern pattern : patterns.keySet()) {
Matcher matcher = pattern.matcher(uri);
if (matcher.matches()) {
TargetType type = patterns.get(pattern);
return getTarget(type, context, matcher);