| Author |
Is Shutdown Hook Guaranteed to be called?
|
Robert Paris
Ranch Hand
Joined: Jul 28, 2002
Posts: 585
|
|
If I add a shutdown hook, is it guaranteed to be called on all OS's? And what is the execution rule for this? Say for example, that I created an app that can run other aps inside it. It needs a shutdown hook to capture any time that an app calls System.exit(). However, what if another app (or even that app) added a shutdown hook? Which gets called first? Is there a rule? Is there a way to ensure one is the "master" hook, or rather, the last called? What about permissions? Are there permissions for adding the shutdown hook? Is it possible to trap what happens in another shutdown hook?
|
 |
Vijayakumar Arya
Ranch Hand
Joined: Jan 27, 2003
Posts: 76
|
|
Hi, Answers for all your questions and more is available in the Java documentation, Please refer to the Javadocs for Runtime.addShutdownHook(Thread hook) for details.
|
Thanks,<p>Vijay<p>The Hand that gives, Gathers.
|
 |
 |
|
|
subject: Is Shutdown Hook Guaranteed to be called?
|
|
|