litesoft
@ 922
litesoft / trunk / DeviceDesktopTest / src / org / litesoft / ddt / Shutdown.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
package org.litesoft.ddt; public interface Shutdown { void request(int pExitCode); static class Instance { private static Shutdown SHUTDOWN; public static synchronized Shutdown get() { Shutdown zInstance = SHUTDOWN; if (zInstance != null) { return zInstance; } throw new IllegalStateException("Shutdown.Instance not initialized YET!"); } public static synchronized void set(Shutdown pShutdown) { if (pShutdown == null) { throw new IllegalArgumentException("Shutdown.Instance may NOT be set to null!"); } SHUTDOWN = pShutdown; } } } |