Exit Print View

Sun GlassFish Enterprise Server v3 Administration Guide

  This Document Entire Library
Print View

Document Information

Preface

1.  Overview of Enterprise Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering Enterprise 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.  Administering Life Cycle Modules

10.  Extending Enterprise Server

Part II Security Administration

11.  Administering System Security

12.  Administering User Security

13.  Administering Message Security

Part III Resources and Services Administration

14.  Administering Database Connectivity

15.  Administering EIS Connectivity

16.  Administering Internet Connectivity

17.  Administering the Object Request Broker (ORB)

18.  Administering the JavaMail Service

19.  Administering the Java Message Service (JMS)

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

About JNDI

J2EE 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

21.  Administering Transactions

Part IV 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 Enterprise Server.

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

The following topics are addressed here:

J2EE Naming Environment

JNDI names are bound to their objects by the naming and directory service that is provided by a J2EE server. Because J2EE 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 Enterprise 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 J2EE applications from preexisting components.

The following table lists JNDI lookups and their associated resource references for the J2EE resources used by the Enterprise Server.

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