by, 07-07-2012 at 04:02 PM (1377 Views)
JNDI architecture and JDBC architecture is somewhat similar. Both of them are involved in providing standardized API which is protocol independent created at the protocol specific driverís top or the provider implementations. Data source in use will be insulating the application, for example, this doesnít really matter whether LDAP or NDS directory services will be accessed by the application.
Both SPI as well as API are included in JNDI architecture as it has been given in figure. JNDI API is used by the java application so that directory or naming services could be accessed primarily via DirContextinterfaces and the Context. JNDI API is being defined in javax.naming.directory and javax.naming packages.
The JNDI architecture
For interaction of an application with directory or naming service there shall be some JNDI provider, for that particular service. This is the place where would JNDI SPI come. Service provider is basically the set of classes that would be implementing different interfaces of JNDI for a particular directory or naming service, just the way different JDBC interfaces would be implemented by the JDBC driver, for specified database system.