tags:

views:

50

answers:

1

I'm using GlassFish. This is what I want to do. I have different ejb modules which can be deployed independently from each other. But I want to have one central ejb module where all the deployed modules have to register. This is because not all modules have to be deployed.

I thought the best way is if each ejb module contains a session bean (or what ever) with a specific method which will be immediately called after the module was deployed. But I found no such functionality. The whole process should happen after deployment because then a client can ask a session bean of the central ejb module which modules are registered at the moment.

I already tried the lifecycle functionality but there I have to create an own jar file which has to be placed in the lib directory of the application server which isn't really what I want. Furthermore if I call the register method of the central ejb module an exception will be thrown that this action is not allowed.

Does anybody know how I can manage this? Thanks for any help.

A: 

Can't you accomplish this by attempting to look them up in JNDI? They won't be there if they are not deployed. This is a registration and lookup mechanism, it just binds resources to names, but you can assume that if the name is not found it isn't deployed.

Robin
Thank you for your answer. But the problem is that I don't know the names of modules. Only the modules know the name of the one central module. By the way I noticed if this should work there also has to be a starting order which ensures that the central or basic module will be load as first one.
Martin