com.sun.javatest.util
Class ExitCount

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

public class ExitCount
extends java.lang.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
ExitCount()
           
 
Method Summary
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 Detail

ExitCount

public ExitCount()
Method Detail

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


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.