Class 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
    • 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 interface HttpHandler
        Parameters:
        exchange - the HTTP request/response exchange
        Throws:
        java.lang.Exception
      • getStuckThreadIds

        public long[] getStuckThreadIds()