users@glassfish.java.net

Re: Embedded GlassFish clean shutdown and restart

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 27 Sep 2012 09:57:04 -0700

If your app uses/needs ORB, it's not possible - ORB is not designed to
be restarted.

-marina

Harald Wellmann wrote:
> Is it possible to cleanly shutdown and restart Embedded GlassFish
> within the same VM?
>
> This is what I'm doing:
>
> GlassFish glassFish = GlassFishRuntime.bootstrap().newGlassFish(gfProps);
> glassFish.start();
> glassFish.stop();
>
> Now after calling glassFish.stop(), I still see a number of threads
> running, e.g. with name "deployment-jar-scanner",
> "transaction-manager" and some others.
>
> What's the proper way to stop these threads and free all resources
> allocated by GlassFish?
>
> (Tested with GlassFish 3.1.2.)
>
> Best regards,
> Harald