Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

diff between JNDI and RMI registry?

Status
Not open for further replies.

henpat123

Programmer
Apr 14, 2005
35
US
Hi,
Can someone tell me the dfference rmiregistry and jndi?

henry
 
JNDI - Java Naming Directory Interface is a protocol based on TCP/IP that aims to be ... well ... what it says.

RMI - Remote Method Invocation is again another protocol, which aims to be a Java *replacement* for RPC - remote method invocation across distriubted servers.

The "rmiregistry" is a server process that RMI object register their "presence" with; it usually listens on port 1099 - and is required for a server to use "RMI" - though a client need not run a rmiregistry process - thats the point - the client looks up the registry on port 1099, to see what servers (JVM sense) are registered.

RMI and JNDI are completely different - its like saying "Whats the difference between a car and a bicycle ?". Answer is - they are both means to an ends.

--------------------------------------------------
Free Database Connection Pooling Software
 
Sedj,
So sounds like both are primarily used for similar purposes..may be JNDI provides more services than just registry and lookups (like rmiregistry)? Did I understand right?

henry
 
no, they are very different. JNDI provides a "naming and directory service" within a JVM, RMI provides the ability to execute procedures in a remote JVM from another [remote] JVM.

--------------------------------------------------
Free Database Connection Pooling Software
 
Sedj,
Here we are not comparing JNDI and RMI. We are comparing JNDI and rmiregistry...so don't they provide a similar service..like the ability to store named-object-instances..!!

Correct me if I am wrong.

Henry
 
The rmiregistry is not comparable to JNDI at all (except on a really abstract level).
JNDI is an API and a protocol. The rmiregistry is a programme.
You cannot compare JNDI and the rmiregistry - its like comparing a car to a recipe - its just not comparable.

Talking about rmiregisty without talking about RMI as a protocol/API is just pointless. The rmiregistry programme is something that facilitates the lookup of RMI based objects between remote JVMs - completely different to the concept of JNDI that is an API that allows the lookup and binding of objects in a local JVM. If there were such a thing as a "jndiregistry" then maybe you could compare the two - but that does not exist - because JNDI is an API - not a programme.

Maybe on a completely abstract level, you could say that JNDI, as a means to looking up an "object" is similar to the rmiregistry programme, because they both, at a certain level "look up" an entry - but then you would have to say that email is the same as rmiregistry, as is the index of a book, or the search functionality in a word processor - because they all provide the ability to "look up something". But then thats just stupid.

Just accept that, while RMI and JNDI have some comparisions, they are in effect, and more importantly practically, very different concepts.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top