This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Use of JNDI

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to use JNDI. I want to know, that how do we bound our object to a particular 'name', and what do we mean by that. Also, if binding to a name and then looking up using the name to obtain a reference to this object, does this mean that I can access to any object running on any JVM on the internet? Or it means that looking up and obtaining the reference is only meant for the same JVM on which JBoss/any server providing the JNDI service is running.

Regards,
Amol Lekurwale
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,
I am new to use JNDI. I want to know, that how do we bound our object to a particular 'name', and what do we mean by that. Also, if binding to a name and then looking up using the name to obtain a reference to this object, does this mean that I can access to any object running on any JVM on the internet? Or it means that looking up and obtaining the reference is only meant for the same JVM on which JBoss/any server providing the JNDI service is running.



We can bind the object to a name by using the InitialContext's bind API.
bind(name,object);

You can lookup the object by using lookup(name) and this returns you the object that mapped to the name.

I think lookup only works for the same JVM.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each application server will usually provide a Naming Service, which listens for connections on a well-known port. The connection properties you create include the URL/Port of this service, such that you can connect to any service running anywhere on the Internet.

Best Regards,
 
I am Arthur, King of the Britons. And this is a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic