Class RequestCountingUtil

java.lang.Object
org.zeroturnaround.javarebel.integration.util.RequestCountingUtil

public class RequestCountingUtil extends Object
Helper methods for counting currently running HTTP requests.
Author:
Rein Raudjärv
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    countRunning(org.zeroturnaround.javarebel.RebelServletContext context)
     
    static void
    register(org.zeroturnaround.javarebel.RebelServletContext context)
     
    static void
    unregister(org.zeroturnaround.javarebel.RebelServletContext context)
     
    static boolean
    waitUntilNoRunning(org.zeroturnaround.javarebel.RebelServletContext context, long timeout)
    Waits until there are no requests currently running.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RequestCountingUtil

      public RequestCountingUtil()
  • Method Details

    • register

      public static void register(org.zeroturnaround.javarebel.RebelServletContext context)
    • unregister

      public static void unregister(org.zeroturnaround.javarebel.RebelServletContext context)
    • countRunning

      public static int countRunning(org.zeroturnaround.javarebel.RebelServletContext context)
    • waitUntilNoRunning

      public static boolean waitUntilNoRunning(org.zeroturnaround.javarebel.RebelServletContext context, long timeout) throws InterruptedException
      Waits until there are no requests currently running.
      Parameters:
      context - Servlet Context of the application.
      timeout - maximum time to wait for.
      Returns:
      true if there are no requests running, false if timeout was reached.
      Throws:
      InterruptedException