[jboss-as7-dev] Listening for EJBs appearing / JNDI registrations

David Bosschaert david at redhat.com
Mon Jul 18 04:04:26 EDT 2011


Hi,

I have a piece of code that needs to kick into action when a particular 
EJB is registered. What would be the best way to do this? The code is in 
user-space, it's an OSGi bundle that needs to do something once the EJB 
is available...

So I thought about the following:
* register a DeploymentUnitProcessor, however this is a bit heavyweight 
to ask a EJB/OSGi developer to do...
* maybe register an MSC service that waits for an MSC service registered 
by the EJB to appear? this is also a bit heavyweight and I don't think 
the MSC services registered by the EJB are documented/part of the public 
API...
* It would be nice if I could simply listen for the JNDI registration... 
is that possible?

As a workaround, I also thought about this:
* If I deploy my artifacts in a certain order, will the appserver deploy 
them again in the same order on a restart?

Thanks,

David


More information about the jboss-as7-dev mailing list