JBoss Community

Re: EJB reference resolvers in AS7

created by Guillaume Grossetie in JBoss AS 7 Development - View the full discussion

I found a way to programmatically resolve EJB at runtime by listing all the bindings:

 

InitialContext ic = new InitialContext();
final NamingEnumeration<Binding> bindingNamingEnumeration = ic.listBindings("java:module");

 

Then I search through the list to pick the first binding corresponding to my interface name.

 

Is there a better/faster/cleaner way to achieve this ?

 

Thanks,

Guillaume.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community