JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Administration Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering GlassFish Server

Part I Runtime Administration

2.  General Administration

3.  Administering Domains

4.  Administering the Virtual Machine for the Java Platform

5.  Administering Thread Pools

6.  Administering Web Applications

7.  Administering the Logging Service

8.  Administering the Monitoring Service

9.  Writing and Running JavaScript Clients to Monitor GlassFish Server

10.  Administering Life Cycle Modules

11.  Extending and Updating GlassFish Server

Part II Resources and Services Administration

12.  Administering Database Connectivity

13.  Administering EIS Connectivity

14.  Administering Internet Connectivity

15.  Administering the Object Request Broker (ORB)

16.  Administering the JavaMail Service

17.  Administering the Java Message Service (JMS)

18.  Administering the Java Naming and Directory Interface (JNDI) Service

About JNDI

Java EE Naming Environment

How the Naming Environment and the Container Work Together

Naming References and Binding Information

Administering JNDI Resources

Administering Custom JNDI Resources

To Create a Custom JNDI Resource

To List Custom JNDI Resources

To Update a Custom JNDI Resource

To Delete a Custom JNDI Resource

Administering External JNDI Resources

To Register an External JNDI Resource

To List External JNDI Resources

To List External JNDI Entries

To Update an External JNDI Resource

To Delete an External JNDI Resource

Example of Using an External JNDI Resource

To Disable GlassFish Server v2 Vendor-Specific JNDI Names

19.  Administering Transactions

Part III Appendixes

A.  Subcommands for the asadmin Utility

Index

About JNDI

By making calls to the JNDI API, applications locate resources and other program objects. A resource is a program object that provides connections to systems, such as database servers and messaging systems. A JDBC resource is sometimes referred to as a data source. Each resource object is identified by a unique, people-friendly name, called the JNDI name. A resource object and its JNDI name are bound together by the naming and directory service, which is included with the GlassFish Server.

When a new name-object binding is entered into the JNDI, a new resource is created.

The following topics are addressed here:

Java EE Naming Environment

JNDI names are bound to their objects by the naming and directory service that is provided by a Java EE server. Because Java EE components access this service through the JNDI API, the object usually uses its JNDI name. For example, the JNDI name of the PointBase database is jdbc/Pointbase. At startup, the GlassFish Server reads information from the configuration file and automatically adds JNDI database names to the name space, one of which is jdbc/Pointbase.

Java EE application clients, enterprise beans, and web components must have access to a JNDI naming environment.

The application component's naming environment is the mechanism that allows customization of the application component's business logic during deployment or assembly. This environment allows you to customize the application component without needing to access or change the source code off the component. A Java EE container implements the provides the environment to the application component instance as a JNDI naming context.

How the Naming Environment and the Container Work Together

The application component's environment is used as follows:

Each application component defines its own set of environment entries. All instances of an application component within the same container share the same environment entries. Application component instances are not allowed to modify the environment at runtime.

Naming References and Binding Information

A resource reference is an element in a deployment descriptor that identifies the component’s coded name for the resource. For example, jdbc/SavingsAccountDB. More specifically, the coded name references a connection factory for the resource.

The JNDI name of a resource and the resource reference name are not the same. This approach to naming requires that you map the two names before deployment, but it also decouples components from resources. Because of this decoupling, if at a later time the component needs to access a different resource, the name does not need to change. This flexibility makes it easier for you to assemble Java EE applications from preexisting components.

The following table lists JNDI lookups and their associated resource references for the Java EE resources used by the GlassFish Server.

Table 18-1 JNDI Lookup Names and Their Associated References

JNDI Lookup Name
Associated Resource Reference
java:comp/env
Application environment entries
java:comp/env/jdbc
JDBC DataSource resource manager connection factories
java:comp/env/ejb
EJB References
java:comp/UserTransaction
UserTransaction references
java:comp/env/mail
JavaMail Session Connection Factories
java:comp/env/url
URL Connection Factories
java:comp/env/jms
JMS Connection Factories and Destinations
java:comp/ORB
ORB instance shared across application components