Sun Java System Application Server 

Samples Index

The Custom JNDI Resource Factory Sample Application

This sample application demonstrates:

The JNDI custom factory described here creates samples.jndi.custom.share.CustomBean beans. This sample application also provides an application client component that illustrates how to use the custom factory to obtain a CustomBean.

Relative to install_dir/samples/jndi/apps/custom/, the directory structure of this sample application is:

Building, Deploying, and Running the Application

The general instructions for building, deploying, and running sample applications are provided in Building, Deploying, and Running Sample Applications. In reading this document, use the following application-specific variables for this application:

Follow this general procedure:

  1. Build the Application. The build file, build.xml, is in the app_dir directory, specifically, install_dir/samples/jndi/apps/custom.
  2. Deploy the Application. The EAR file is install_dir/samples/jndi/apps/custom/jndi-custom.ear.

    Note: When you deploy this application, an application server custom resource associated with the Custom JNDI Resource Factory is also created. This custom resource will be looked up by the application components when they need to obtain objects created by the custom JNDI Factory (CustomBean objects). See the create-custom-resource target in the main build.xml file for more details.

  3. Run the application as described below.

Running the Application

To run the application, execute the following commands:

cd  install_dir/samples/jndi/apps/custom
asant run
This command invokes the application client for this sample application. The application client looks up the JNDI name of the resource associated with the custom JNDI resource factory (created during deployment) and displays the values of the bean properties.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.