Package io.undertow.server.handlers
Class RequestLimitingHandler
java.lang.Object
io.undertow.server.handlers.RequestLimitingHandler
- All Implemented Interfaces:
HttpHandler
A handler which limits the maximum number of concurrent requests. Requests beyond the limit will
block until the previous request is complete.
- Author:
- David M. Lloyd
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRequestLimitingHandler
(int maximumConcurrentRequests, int queueSize, HttpHandler nextHandler) Construct a new instance.RequestLimitingHandler
(int maximumConcurrentRequests, HttpHandler nextHandler) Construct a new instance.RequestLimitingHandler
(RequestLimit requestLimit, HttpHandler nextHandler) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleRequest
(HttpServerExchange exchange) Handle the request.toString()
-
Constructor Details
-
RequestLimitingHandler
Construct a new instance. The maximum number of concurrent requests must be at least one. The next handler must not benull
.- Parameters:
maximumConcurrentRequests
- the maximum concurrent requestsnextHandler
- the next handler
-
RequestLimitingHandler
public RequestLimitingHandler(int maximumConcurrentRequests, int queueSize, HttpHandler nextHandler) Construct a new instance. The maximum number of concurrent requests must be at least one. The next handler must not benull
.- Parameters:
maximumConcurrentRequests
- the maximum concurrent requestsqueueSize
- the maximum number of requests to queuenextHandler
- the next handler
-
RequestLimitingHandler
Construct a new instance. This version takes aRequestLimit
directly which may be shared with other handlers.- Parameters:
requestLimit
- the request limit information.nextHandler
- the next handler
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
getRequestLimit
-
toString
-