aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJB3 injection with the logical name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJB3 injection with the logical name" Watch "EJB3 injection with the logical name" New topic
Author

EJB3 injection with the logical name

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

Could somebody please explain me how this things work?



In the above code what the ejb annotation says?

Inject the reference to the TestSLAnnotationRemote and then bind the variable to the name TestSLAnnotationBean insteadof com.client.Client/client?

Please let me know if my understanding is correct.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Siva Masilamani wrote:In the above code what the ejb annotation says?

From JEE-API: The name element from javax.ejb.EJB defines "The logical name of the ejb reference within the declaring component's (e.g., java:comp/env) environment."

Thus, in your example, the app client deploy tool creates an entry in the app client's ENC with name "java:comp/env/TestSLAnnotationBean". During runtime the app client container performs dependency injection before it calls the app client's main method (see, for instance, JEE 6 spec, section EE.10.4).

SCJP 5 (98%) - SCBCD 5 (98%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB3 injection with the logical name
 
It's not a secret anymore!