• 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

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,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic