Hi!

Aaron Mulder wrote:
>         Rickard, clearly the database pools depend on the transaction
> manager.  However, in the particular set of hashtables in use for my demo,
> the pools are started before the transaction manager, so they still blow
> up due to no transaction manager in JNDI.  I could axe that check, but
> that would just push the error from start time to runtime if the TM really
> *isn't* initialized.
>         There are two ways to approach this.  One is to make certain
> services start at the beginning - so there's a two-phase startup to
> accomodate simple dependencies.  The better way is to allow each service
> to list its dependencies and make sure they're loaded in a suitable order.

The Right Way is to list dependencies. I have done this in my last app
server XS, and it's no big deal. I could add this to the
ServiceMBeanSupport class, but would rather wait for JMX 1.0 to be
released (any day now), since it *should* include this kind of stuff.

For now I'll change the tx mgr to startup in init() instead, which will
give predictive startup order.

Regarding your followup question on shutdown, when we get the dependcy
checking, what will happen is that just before a service shuts down a
notification about this is sent out so that any other service which
relies on it may shut down first. 

Again, to compare with how I did in XS: when "Server" was started
everything else was started as a consequence and in the order of the
dependencies. When "Server" was stopped all the leaf nodes were actually
"stop()"'ed first because of the dependency chain. Also, if a node in
the tree which has children is stopped, let's say the tx-mgr, only the
children of that node are stopped. Very easy to work with.

Let's hope that JMX 1.0 allows this style of coding.

/Rickard

-- 
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com

Reply via email to