aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Help needed understanding Ejb and Jndi 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 "Help needed understanding Ejb and Jndi" Watch "Help needed understanding Ejb and Jndi" New topic
Author

Help needed understanding Ejb and Jndi

Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
Hi, I'm quite new to ejb and jndi. I have read the tutorial and so far am ok in grasping the concept but the big thing i fail to understand is that how can an ejb binded at my machine be referenced from other machine without me telling them? How will a machine in my network or on the internet know i've got this ejb binded on this machine? will they write some fully qualified ip address or dns name before the ejb reference to access it? How? i'm confused.


Cheers,
Murad.
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
Yes, the machine information is specified in the environment object when you create a InitialContext from it. (including provider url)
However sometime you want to get the a local jndi name, whereas you can new InitialContext() directly, by default, it looks up the localhost.
Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
and when do i create an environment object? I am not sure when that is done, i just call initial context in the beginning.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10046
    
163

The Javadoc of InitialContext has a very good explanation about this. Also, InitialContext has 3 constructors, one of them being the Default Constructor (which is used often) and one more being:



You can pass environment information through this constructor


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed understanding Ejb and Jndi