dev@glassfish.java.net

Re: [V3] Web container not destroyed during domain shutdown

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Tue, 12 Aug 2008 14:05:48 -0700

Jan.Luehe_at_Sun.COM wrote:
> Kedar,
>
> Kedar Mhaswade wrote:
>
>>
>>
>> Jan.Luehe_at_Sun.COM wrote:
>>
>>>
>>> Kedar Mhaswade wrote:
>>>
>>>>
>>>>
>>>> Byron Nevins wrote:
>>>>
>>>>> I noticed this behavior in embedded -- a clean shutdown of GF is
>>>>> impossible, the System.exit() sledgehammer has to be used...
>>>>
>>>>
>>>>
>>>> Why? Who does not "normally" respond to the "stop" call?
>>>
>>>
>>>
>>> Is there any "stop" event?
>>>
>>
>> When asadmin stop-domain is called, here is what happens:
>> - iterate through inhabitants that satisfy the "Startup" Contract
>> and call the Inhabitant.release() method on it. An example of
>> startup service is:
>> "com.sun.enterprise.v3.services.impl.GrizzlyService"
>
>
> Right, this is what I gave as an example in my original message:
>
> > It looks like AppServerStartup.stop() only shuts down those objects
> > in the habitat that implement Startup (e.g., GrizzlyService) or Init,
> neither
> > of which apply to the web container.
>
> Since web container is not a Startup service (because
> it is loaded and initialized only on demand), it is not being
> notified when the domain shuts down.
>
> This is causing some problems.

Can one of the known startup services (for example Grizzly in this case)
stop the associated (e.g. Web container) services while it is stopping?
(This is against the "modular" server idea, I guess).

Alternatively, can WebContainer be a Startup Service that returns immediately
in case there are no web applications?

Can we introduce a "StoppableService" that needs to be a contract that is
looked up while iterating through services? In this case, web container can
implement this contract while all other Startup services today also implement
this contract?

-Kedar

>
> Jan
>
>>
>>
>> Finally, System.exit is called because the "force" option is true
>> by default. I am not sure what we can do to address both embedded
>> and non-embedded case w.r.t. this.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>