|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.util.Housekeeper
public class Housekeeper
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.
Field Summary | |
---|---|
private java.util.Vector |
cleanupClients
|
private static Housekeeper |
me
|
Constructor Summary | |
---|---|
private |
Housekeeper()
This class is implemented as a 'Singleton'. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Housekeeper me
private java.util.Vector cleanupClients
Constructor Detail |
---|
private Housekeeper()
getInstance()
to obtain an instance for use.
Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |