Class ExitCount

java.lang.Object
com.sun.javatest.util.ExitCount

public class ExitCount extends Object
ExitCount can be used by a family of cooperating objects (windows?) to cause the process to exit when the last object is destroyed.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    dec()
    Decrement the count; if it reaches zero, the process will be forcibly exited.
    static boolean
    dec(boolean autoExitIfZero, int exitCode)
    Decrement the count; if it reaches zero, the process will optionally be exited.
    static void
    inc()
    Increment the count to prevent the process from exiting.

    Methods inherited from class java.lang.Object

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

    • ExitCount

      public ExitCount()
  • Method Details

    • inc

      public static void inc()
      Increment the count to prevent the process from exiting.
    • dec

      public static void dec()
      Decrement the count; if it reaches zero, the process will be forcibly exited.
    • dec

      public static boolean dec(boolean autoExitIfZero, int exitCode)
      Decrement the count; if it reaches zero, the process will optionally be exited.
      Parameters:
      autoExitIfZero - if true, and if the count gets decremented to zero, then the process will be exited
      exitCode - if the process is to be exited, this will be used as the exit code
      Returns:
      true if the process has not been exited, and if the count is now zero