On Tuesday 18 May 2004 02:24, Justin Permar wrote:
> Every application knows when and how it should exit. Are you
> saying that a shutdown request should only come from an entity
> external to the system? That doesn't make much sense to me.

I am not saying you are wrong. From your viewpoint I am sure it looks like the 
only sensible thing "Every Application knows when and how it should exit."
But, that is not entirely true, since we anticipate that components are 
generally not going to be really trusted, especially not with fooling around 
with the running status of a server. It is also part of the whole IoC 
concept, that components are not initiative takers, they are given what they 
need...

> The only approach for now is just to kill the process?
> How can components, if not the whole system, be shut down on
> demand? 

That said, I would like to give some comments;

1. An official shutdown hook via a facility is probably a good thing and 
should be scheduled soon. (Can someone engage themself to add that to the 
Jira bug tracking?)


2. Stephen tried to explain that if you have a Main class that initializes the 
whole of Merlin (about 10-15 lines of code), that object now have a reference 
to the entire Merlin Kernel, and can find the shutdown method, namely the 
DefaultKernel.shutdown() .


3. Also, I think that if you create a ShutdownFacility that upon 'shutdown()' 
gets hold of the Model and calls decommission() on it, and if Merlin is 
started with the -execute switch, a clean shutdown should occur.


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to