public Router.Continuation apply(final RequestProcessingContext context) {
final RoutingContext rc = context.routingContext();
// Peek at matching information to obtain path to match
String path = rc.getFinalMatchingGroup();
final TracingLogger tracingLogger = TracingLogger.getInstance(context.request());
tracingLogger.log(ServerTraceEvent.MATCH_PATH_FIND, path);
Router.Continuation result = null;
final Iterator<Route<PathPattern>> iterator = acceptedRoutes.iterator();
while (iterator.hasNext()) {
final Route<PathPattern> acceptedRoute = iterator.next();
final PathPattern routePattern = acceptedRoute.routingPattern();
final MatchResult m = routePattern.match(path);
if (m != null) {
// Push match result information and rest of path to match
rc.pushMatchResult(m);
result = Router.Continuation.of(context, acceptedRoute.next());
//tracing
tracingLogger.log(ServerTraceEvent.MATCH_PATH_SELECTED, routePattern.getRegex());
break;
} else {
tracingLogger.log(ServerTraceEvent.MATCH_PATH_NOT_MATCHED, routePattern.getRegex());
}
}
if (tracingLogger.isLogEnabled(ServerTraceEvent.MATCH_PATH_SKIPPED)) {
while (iterator.hasNext()) {
tracingLogger.log(ServerTraceEvent.MATCH_PATH_SKIPPED, iterator.next().routingPattern().getRegex());
}
}
if (result == null) {
// No match