@Override public HttpHandler wrap(HttpHandler handler) { return new RequestLimitingHandler(requests, handler); } }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param maxRequest The maximum number of requests * @param queueSize The maximum number of queued requests * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final int maxRequest, final int queueSize, HttpHandler next) { return new RequestLimitingHandler(maxRequest, queueSize, next); }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param requestLimit The request limit object that can be shared between handlers, to apply the same limits across multiple handlers * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final RequestLimit requestLimit, HttpHandler next) { return new RequestLimitingHandler(requestLimit, next); }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param maxRequest The maximum number of requests * @param queueSize The maximum number of queued requests * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final int maxRequest, final int queueSize, HttpHandler next) { return new RequestLimitingHandler(maxRequest, queueSize, next); }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param requestLimit The request limit object that can be shared between handlers, to apply the same limits across multiple handlers * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final RequestLimit requestLimit, HttpHandler next) { return new RequestLimitingHandler(requestLimit, next); }
@Override public HttpHandler wrap(HttpHandler handler) { return new RequestLimitingHandler(requests, handler); } }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param requestLimit The request limit object that can be shared between handlers, to apply the same limits across multiple handlers * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final RequestLimit requestLimit, HttpHandler next) { return new RequestLimitingHandler(requestLimit, next); }
@Override public HttpHandler wrap(HttpHandler handler) { return new RequestLimitingHandler(requests, handler); } }
/** * Returns a handler that limits the maximum number of requests that can run at a time. * * @param maxRequest The maximum number of requests * @param queueSize The maximum number of queued requests * @param next The next handler * @return The handler */ public static RequestLimitingHandler requestLimitingHandler(final int maxRequest, final int queueSize, HttpHandler next) { return new RequestLimitingHandler(maxRequest, queueSize, next); }
/** * buildGracefulShutdownHandler * * @param paths * @return */ private static GracefulShutdownHandler buildGracefulShutdownHandler(PathHandler paths) { return new GracefulShutdownHandler( new RequestLimitingHandler(new RequestLimit(configuration.getRequestLimit()), new AllowedMethodsHandler( new BlockingHandler( new GzipEncodingHandler( new ErrorHandler( new HttpContinueAcceptingHandler(paths) ), configuration.isForceGzipEncoding() ) ), // allowed methods HttpString.tryFromString(RequestContext.METHOD.GET.name()), HttpString.tryFromString(RequestContext.METHOD.POST.name()), HttpString.tryFromString(RequestContext.METHOD.PUT.name()), HttpString.tryFromString(RequestContext.METHOD.DELETE.name()), HttpString.tryFromString(RequestContext.METHOD.PATCH.name()), HttpString.tryFromString(RequestContext.METHOD.OPTIONS.name()) ) ) ); }