Adding resource environment references
The J2EE specification provides a means for J2EE application components to refer to administered objects that are associated with a resource. The reference is done by using "logical" names called resource environment references. You can use the deployment descriptor editors to define resource environment references.
At deployment, the resource environment references are bound to the actual administered objects in the target operational environment.
For each resource environment reference that you define, a resourece-env-ref element is added to the deployment descriptor for that application component. Resource environment references are scoped to the application component where they are defined, so they are not accessible to other application components during run time. Other components can define resource environment references with the same name without causing a name conflict.
Resource environment references are available only for J2EE 1.3 or later, and EJB 2.x.
To define a resource environment reference:
- Open the Add Reference wizard from the deployment descriptor editor for your J2EE module.
- Select Resource environment reference and click Next.
- In the Name field, specify a name for the reference, or accept the default name provided by the wizard (recommended). The value entered in the Name field is used in the resource-env-ref-name entry in the deployment descriptor. The name is the environment entry name that is used in the application's code.
The name of the reference is relative to the java:comp/env context.
- In the Type field, select the expected type of the referenced object. The value entered in this field is used in the resource-env-ref-type entry in the deployment descriptor.
- In the Description text area, enter a description for the reference.
- Click Finish.
Related concepts
Client Deployment Descriptor editor
Related tasks
Defining references in J2EE modules
Adding EJB references
Adding message destination references
Adding resource manager connection factory references
Adding security role references
Adding Web service references