users@glassfish.java.net

Re: Nice way to get a collection of deployed EJBs

From: <forums_at_java.net>
Date: Mon, 8 Aug 2011 14:40:37 -0500 (CDT)

Okay, thanks for the suggestions.  I did write a lifecycle module but I can
only get it to capture server events (startup, shutdown).  Any insite on how
to capture container events would be much appreciated.

I did come up with a solution though.  I created an interface that defines
a method to return the mappedName of the implemeting EJB.  Then I used
InitialContext.listBindings, which returns a Binding collection, then through
some casting and taking advantage of the NamingManger.getObjectInstance I am
able to get an instance to the EJB and call the appropriate method.  From
there its just simple logic to determine if I already 'discovered' the EJB.


--
[Message sent by forum member 'mat_hoff']
View Post: http://forums.java.net/node/830610