bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Programming WebLogic JNDI

Introduction to WebLogic JNDI

The following sections present an overview of the JNDI implementation in WebLogic Server including:

- Implementation of Java Specifications

- Overview of JNDI in WebLogic Server

Implementation of Java Specifications

WebLogic Server is compliant with the following Java specifications.

J2EE Specification

WebLogic Server 7.0 is compliant with Sun Microsystems' J2EE 1.3 specification.

JNDI Specification

WebLogic Server 7.0 is fully compliant with the JNDI Specification - version 1.2.1 and can be used in production.

Overview of JNDI in WebLogic Server

In an enterprise, naming services provide a means for your application to locate objects on the network. A naming service associates names with objects and finds objects based on their given names. (The RMI registry is a good example of a naming service.)

The Java Naming and Directory Interface (JNDI) is an application programming interface (API) that provides naming services to Java applications. JNDI is an integral component of Sun Microsystems' J2EE technology.

JNDI is defined to be independent of any specific naming or directory service implementation. It supports the use of a single method for accessing various new and existing services. This support allows any service-provider implementation to be plugged into the JNDI framework using the standard service provider interface (SPI) conventions. In addition, JNDI allows Java applications in WebLogic Server to access external directory services such as LDAP in a standardized fashion, by plugging in the appropriate service provider.

The WebLogic Server implementation of JNDI supplies methods that:

- Give clients access to the WebLogic name services

- Make objects available in the WebLogic namespace

- Retrieve objects from the WebLogic namespace

Each WebLogic Server cluster is supported by a replicated cluster-wide JNDI tree that provides access to both replicated and pinned RMI and EJB objects. While the JNDI tree representing the cluster appears to the client as a single global tree, the tree containing the cluster-wide services is actually replicated across each WebLogic Server in the cluster. For more information, see Using WebLogic JNDI in a Clustered Environment.

The integrated naming service provided by WebLogic Server JNDI may be used by many other WebLogic services. For example, WebLogic RMI can bind and access remote objects by both standard RMI methods and JNDI methods.

In addition to the standard Java interfaces for JNDI, WebLogic Server provides its own implementation, weblogic.jndi.WLInitialContextFactory, that uses the standard JNDI interfaces.

In your application code, you need not instantiate this class directly. Instead, you can use the standard javax.naming.InitialContext class and set the appropriate hash table properties, as documented in the section Setting Up JNDI Environment Properties for the InitialContext. All interaction is done through the javax.naming.Context interface, as described in the JNDI Javadoc.

For instructions on using the WebLogic JNDI API for client connections, see Programming with WebLogic JNDI.