tags:

views:

52

answers:

2
+1  Q: 

Java EJB interface

Hello,

I have been working through this tutorial. Halfway though it creates an interface and facades for an EJB. Can anyone tell me when I reference the interface using the @EJB annotation, where does it actually make the link between the interface and the actual enterprise java bean itself.

Thanks for the help. ~ Kyle.

A: 

It will be done inside the EJB container.

When you add this annotation, you'll actually be telling the IoC container of your application server which implementation of the given EJB you want.

Kico Lobo
+1  A: 

It is AFAIK not mandated by the J2EE specification how this is actually solved or implemented by the application server. The most common solution is that the app server uses its own mapping between bean class names and JNDI names, so that depending on the bean class name, it is bound to a specific JNDI path when deploying the application and the same class name -> JNDI path conversion is used for injecting the EJB reference on the "client side".

jarnbjo