Package com.sun.javatest.util
Class ExitCount
java.lang.Object
com.sun.javatest.util.ExitCount
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 exitedexitCode
- 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
-