FileDocCategorySizeDatePackage
ShutdownWatchdog.javaAPI DocAndroid 1.5 API2343Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.wtk

ShutdownWatchdog

public final class ShutdownWatchdog extends Object
Shutdown Watchdog

Fields Summary
private boolean
nativeQueueEmpty
private boolean
awtQueueEmpty
private boolean
windowListEmpty
private boolean
forcedShutdown
private ShutdownThread
thread
Constructors Summary
Methods Summary
private booleancanShutdown()

        return (nativeQueueEmpty && awtQueueEmpty && windowListEmpty) ||
                forcedShutdown;
    
private voidcheckShutdown()

        if (canShutdown()) {
            shutdown();
        } else {
            keepAlive();
        }
    
public synchronized voidforceShutdown()

        forcedShutdown = true;
        shutdown();
    
private voidkeepAlive()

        if (thread == null) {
            thread = new ShutdownThread();
            thread.start();
        }
    
public synchronized voidsetAwtQueueEmpty(boolean empty)

        awtQueueEmpty = empty;
        checkShutdown();
    
public synchronized voidsetNativeQueueEmpty(boolean empty)


         
        nativeQueueEmpty = empty;
        checkShutdown();
    
public synchronized voidsetWindowListEmpty(boolean empty)

        windowListEmpty = empty;
        checkShutdown();
    
private voidshutdown()

        if (thread != null) {
            thread.shutdown();
            thread = null;
        }
    
public synchronized voidstart()

        keepAlive();