| java.lang.Object com.izforge.izpack.util.Housekeeper
Housekeeper | public class Housekeeper (Code) | | This class performs housekeeping and cleanup tasks. There can only be one instance of
Housekeeper per Java runtime, therefore this class is implemented as a
'Singleton'.
It is VERY important to perform pre-shutdown cleanup operations through this class. Do NOT rely
on operations like deleteOnExit() shutdown hooks or finalize() for
cleanup. Because shutDown() uses System.exit() to terminate, these
methods will not work at all or will not work reliably.
version: 0.0.1 / 2/9/02 author: Elmar Grom |
Method Summary | |
public static Housekeeper | getInstance() Returns an instance of Housekeeper to use. | public void | registerForCleanup(CleanupClient client) Use to register objects that need to perform cleanup operations before the application shuts
down. | public void | shutDown(int exitCode) This methods shuts the application down. |
getInstance | public static Housekeeper getInstance()(Code) | | Returns an instance of Housekeeper to use.
an instance of Housekeeper . |
registerForCleanup | public void registerForCleanup(CleanupClient client)(Code) | | Use to register objects that need to perform cleanup operations before the application shuts
down.
Parameters: client - reference of to an object that needs to perform cleanup operations. |
shutDown | public void shutDown(int exitCode)(Code) | | This methods shuts the application down. First, it will call all clients that have registered
for cleanup operations. Once this has been accomplished, the application will be forceably
terminated.
THIS METHOD DOES NOT RETURN!
Parameters: exitCode - the exit code that should be returned to the calling process. |
|
|