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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB3 injection with the logical name
 
Similar Threads
How EJB3 logical name mapped to real JNDI name
problem with stateless session bean
Trouble in using @EJB in Servlet
EJB 3.0 Problems
class casting with ejb