Package io.undertow.server.handlers
Class StuckThreadDetectionHandler
- java.lang.Object
-
- io.undertow.server.handlers.StuckThreadDetectionHandler
-
- All Implemented Interfaces:
HttpHandler
public class StuckThreadDetectionHandler extends java.lang.Object implements HttpHandler
This valve allows to detect requests that take a long time to process, which might indicate that the thread that is processing it is stuck. Based on code proposed by TomLu in Bugzilla entry #50306- Author:
- slaurent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StuckThreadDetectionHandler.Builder
static class
StuckThreadDetectionHandler.Wrapper
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_THRESHOLD
-
Constructor Summary
Constructors Constructor Description StuckThreadDetectionHandler(int threshold, HttpHandler next)
StuckThreadDetectionHandler(HttpHandler next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]
getStuckThreadIds()
int
getThreshold()
void
handleRequest(HttpServerExchange exchange)
Handle the request.java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_THRESHOLD
public static final int DEFAULT_THRESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StuckThreadDetectionHandler
public StuckThreadDetectionHandler(HttpHandler next)
-
StuckThreadDetectionHandler
public StuckThreadDetectionHandler(int threshold, HttpHandler next)
-
-
Method Detail
-
getThreshold
public int getThreshold()
- Returns:
- The current threshold in seconds
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws java.lang.Exception
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
java.lang.Exception
-
getStuckThreadIds
public long[] getStuckThreadIds()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-