• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help needed understanding Ejb and Jndi

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and when do i create an environment object? I am not sure when that is done, i just call initial context in the beginning.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bring out your dead! Or a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic