Results 1 to 1 of 1

Thread: How to stop Spring container mid-way in its start programmatically

Threaded View

  1. #1

    Default How to stop Spring container mid-way in its start programmatically

    I may want to programmatically shut down the spring container e.g. mid-way, if a certain condition is raised. I do not want code as System.exit(1) as it will terminate the entire JVM and more than 1 applivation is running in the JVM. My goal is to shut down only one application (among more than one) that is running in the same shared JVM.

    I was thinking that throwing a RuntimeException will stop the Spring based application from starting. But that is not true. The runtime exception was thrown, but that did not stop the application from starting.

    Is there a way to stop the application from starting, if a certain condition is raised?

    Again, not coding as System.exit(1) that would trigger shutdownhook.

    Would like to find a solution for both stand-alone and web-based application.

    I am using WebSphere 6.1 as application server.
    Last edited by sunfun; Dec 4th, 2009 at 04:51 PM. Reason: more info

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •