1 Reply Latest reply on Jun 20, 2008 3:51 AM by Frank Henry

    JBoss Shutdown hook

    Babu Natarajan Newbie

      What is the advantage of invoking JBoss shutdown hook compared with calling system.exit.

      How can we invoke JBoss shutdown hook.


      Thanks in advance
      Babu

        • 1. Re: JBoss Shutdown hook
          Frank Henry Novice

          You have your concepts mixed up.

          A shutdown hook is a (or multiple) task you can add to the system that will then be executed when the system recieves a shutdown from the OS.

          So, lets say you have a connection somewhere and you want it to be closed gracefully when the system shuts down. You would create a task that does exactly this and register it with the shutdown hook.

          System.exit() tells the application to abort and (I'm only guessing now) would then call the shutdown hook.

          Someone correct me if I am wrong.