Saturday, 6 April 2013

JNDI




JNDI - Java Naming and Directory Interface

  • The JNDI is a Java API for a directory service that allows Java software clients to discover and lookup data and objects via a name.
  • Like all Java APIs, that interface with host systems, JNDI is independent of the underlying implementation.
  • Aditionally, It specifies a Service Provider Interface (SPI) that allows directory service implementations (like LDAP, DNS, NIS and etc...) to be plugged in to framework. It may make use of a server, a flat file, or a database; the choice upto the vendor.
  • JNDI is defined to be independent of any specific directory service implementation. Thus a variety of directories new, emerging and already deployed can be accessed in a common way.
  • The JNDI API is used by RMI and JEE APIs to lookup objects in a network.
  • JNDI API provides
    • A mechanism to bind an object to a name.
    • A directory lookup interface that allows general queries.

  • To provide Global visibility to Java objects and their references we keep them in registry software.
  • Every Web server/ Application server gives a registry software
    • Weblogic --> Weblogic registry
    • Tomcat --> Tomcat registry
    • Glassfish --> Glassfish registry
    • JBoss --> JNP registry
  • Java Applications use JDBC API (java.sql, javax.sql packages) to interact with Database software.
  • Java Applications use JNDI API (javax.naming and its subpackages) to interact with Registry software.
  • JDBC, JNDI are part of JSE module(JDK s/w).
  • Multiple Java Applications can use an object which was stored in JNDI Registry as shown in above diagram.


References:

No comments:

Post a Comment