This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Explination needed ..what's happening behind the IDE. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Explination needed ..what Watch "Explination needed ..what New topic
Author

Explination needed ..what's happening behind the IDE.

Srinivas Karthik
Greenhorn

Joined: Sep 17, 2011
Posts: 28

Hello guys,
Anyone here, Please explain me each line of code and its purpose..This is a client which tries to access the ejb bean.


Thanks in advance..
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

When you make a remote call to an EJB, you need to do so from a JNDI/initial context. Each app server provides certain properties for doing this lookup which is the first half of your code.


Then you have the context go into the JNDI (directory) and get the remote object. In EJB 2.1, there is an extra step where you have to get the home interface first and lookup the bean from it. In EJB 3 - which your sample is using - it looks like you get the bean directly. (I didn't know you could do this.)


Then you make your call.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Explination needed ..what's happening behind the IDE.
 
jQuery in Action, 3rd edition