public class Housekeeper
extends java.lang.Object
Housekeeper per Java runtime, therefore this class is implemented as a
'Singleton'. 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.| Modifier and Type | Field and Description |
|---|---|
private java.util.Vector |
cleanupClients |
private static Housekeeper |
me |
| Modifier | Constructor and Description |
|---|---|
private |
Housekeeper()
This class is implemented as a 'Singleton'.
|
| Modifier and Type | Method and Description |
|---|---|
static Housekeeper |
getInstance()
Returns an instance of
Housekeeper to use. |
void |
registerForCleanup(CleanupClient client)
Use to register objects that need to perform cleanup operations before the application shuts
down.
|
void |
shutDown(int exitCode)
This methods shuts the application down.
|
private static Housekeeper me
private java.util.Vector cleanupClients
private Housekeeper()
getInstance() to obtain an instance for use.
public static Housekeeper getInstance()
Housekeeper to use.Housekeeper.public void registerForCleanup(CleanupClient client)
client - reference of to an object that needs to perform cleanup operations.public void shutDown(int exitCode)
exitCode - the exit code that should be returned to the calling process.