1 Reply Latest reply on Oct 15, 2008 8:41 AM by francis17101970

    How to add custom code to JBoss shutdown hook

    bugsbunnyca

      I need to execute some Java code before shutting down jBoss.
      How is this possible?

        • 1. Re: How to add custom code to JBoss shutdown hook

          As far as I know you can add a shutdown hook to the JVM, so if you don't find other solutions you might consider starting jBoss from a Java process...

          Runtime.getRuntime().addShutdownHook(new Thread() {
           public void run() {
           System.out.println("Going to shutdown.....");
           while(true);
           }
           };
          


          Hope it helps
          regards