private HttpStatus tryGenericHandlers(Channel channel, boolean isKeepAlive, ReqImpl req) { for (HttpHandler handler : routes.genericHandlers()) { HttpStatus status = handleIfFound(channel, isKeepAlive, handler, req); if (status != HttpStatus.NOT_FOUND) { return status; } } return HttpStatus.NOT_FOUND; }
public void notFound(Channel ctx, boolean isKeepAlive, MediaType contentType, HttpHandler fromHandler, Req req) { HttpStatus status = HttpStatus.NOT_FOUND; List<HttpHandler> genericHandlers = routes.genericHandlers(); int count = genericHandlers.size(); for (int i = 0; i < count; i++) { HttpHandler handler = genericHandlers.get(i); if (handler == fromHandler) { // a generic handler returned "not found" -> go to the next one if (i < count - 1) { HttpHandler nextHandler = genericHandlers.get(i + 1); status = handleIfFound(ctx, isKeepAlive, nextHandler, req); break; } } } if (status == HttpStatus.NOT_FOUND) { handleNotFound(ctx, isKeepAlive, req); } }
private HttpStatus tryGenericHandlers(Channel channel, boolean isKeepAlive, ReqImpl req) { for (HttpHandler handler : routes.genericHandlers()) { HttpStatus status = handleIfFound(channel, isKeepAlive, handler, req); if (status != HttpStatus.NOT_FOUND) { return status; } } return HttpStatus.NOT_FOUND; }
public void notFound(Channel ctx, boolean isKeepAlive, MediaType contentType, HttpHandler fromHandler, Req req) { HttpStatus status = HttpStatus.NOT_FOUND; List<HttpHandler> genericHandlers = routes.genericHandlers(); int count = genericHandlers.size(); for (int i = 0; i < count; i++) { HttpHandler handler = genericHandlers.get(i); if (handler == fromHandler) { // a generic handler returned "not found" -> go to the next one if (i < count - 1) { HttpHandler nextHandler = genericHandlers.get(i + 1); status = handleIfFound(ctx, isKeepAlive, nextHandler, req); break; } } } if (status == HttpStatus.NOT_FOUND) { handleNotFound(ctx, isKeepAlive, req); } }