users@glassfish.java.net

Re: An object that runs for the lifetime of the application server???

From: <glassfish_at_javadesktop.org>
Date: Sat, 24 Nov 2007 12:48:17 PST

Well, I guess a key issue is what kind of access to other EJB components to things like MBeans have?

MBeans are a container artifact, but not necessarily an EJB artifact. Do MBeans have the same access to the global JNDI tree that a regular EJB app does? And how are MBeans notified that the JNDI tree has stabilized, that is that everything that's going to deploy is deployed.

Specifically, if an MBean is looking for a DataSource, or wants to talk to an EJB (and I assume it can only talk to a Remote EJB), do you need to put in retry logic in case the MBean is initialized before the resource it is looking for is initialized (that whole part of the GF startup is certainly not clear to, what starts up when and it what order).

For example, I know that EJB Timer facilities start and run before WARs are deployed, but I don't know if that's by design or a fluke of my observations.

Regard the OPs issue, I think more detail is warranted as to what he wants.

Does his service need to specifically be initialized at server start, or can it be lazily started? Does he intend to block the server during startup (i.e. should the server wait for him to finish)?

How about a JCR connector? Their lifecycle, as I recall, is tied the lifecycle of the server. And they have a documented mechanism for at least being available to applicatons deployed within the server, but it's not clear whether they can leverage the applications themselves (i.e. EJBs can call the connector, dunno if the connector can call EJBs).
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=247015