| 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: 8212
|
|
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]
|
 |
 |
|
|
subject: Help needed understanding Ejb and Jndi
|
|
|