Kyle
Kyle

Reputation: 763

Java EJB interface

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.

Upvotes: 1

Views: 253

Answers (2)

jarnbjo
jarnbjo

Reputation: 34323

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".

Upvotes: 1

Kico Lobo
Kico Lobo

Reputation: 4404

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.

Upvotes: 0

Related Questions