Hi!

(Don't know where to put this in, so I'll do it here)

Jay Walters wrote:
> Sounds like we're thinking of different things.  If you consider the startup
> case, either the service is there or it isn't and that code should all be in
> one place and should use a boolean.  Almost like a precondition in the start
> or init method of a MBean.  If you're in the middle of processing some
> entity bean request and you need the logging service and it's not there,
> that should be an exception.  I believe you are addressing the second case
> rather than the first, and I was addressing the first.

You're all wrong IMHO. The requirements are preconditions for having a
service in "started" mode. When the requirements are met the "start"
method should be called, and when they are no longer met the "stop"
method is called. How the service handles this internally is
implementation dependent.

So, for example, what I did in XS was to have a service "service
control" that everyone depended on, and if that was started everything
was started (given that the other requirements were met), and if it was
stopped, the entire server got stopped.

I think that is how we should do this. There is one problem here with
the messages being asynchronous though: during "stop" one wants to first
send the notification that the service is stopping *before* it is
actually stopped, to allow any services to gracefully stop using it. For
example, if I want to stop the logging facility the other services that
uses it would want to stop first so that their "I have now stopped ok"
messages are shown.

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com

Reply via email to