On Fri, 05 Jul 2013 12:46:35 +0200, Anthony Petrov <anthony.pet...@oracle.com> wrote:

Hi Fabrizio,

Cmd-Q (or, rather the implicit exit machinery) does not call System.exit(). All it does when it detects that there's no FX windows open, it terminates the FX Event Thread. This is clearly stated in the javadoc [1].

Ok, I missed the link between Cmd-Q and the rest.

The rest depends on the JVM. As long as there are active non-daemon threads running, the JVM won't exit. I suspect that the services you're running create non-daemon threads and they prevent the JVM from exiting. So the solution you came up with (calling applicationContext.close()) looks correct: you tell the background services to shut down, and then the application can terminate as expected.

Hope this helps.

It makes perfectly sense. Thanks.

--
Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
"We make Java work. Everywhere."
http://tidalwave.it/fabrizio/blog - fabrizio.giud...@tidalwave.it

Reply via email to