InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.0: About user assistance >
6.6.0.5: Using the Application Assembly Tool interface >
6.6.0.5.5: Specifying JNDI bindings and resolving references
6.6.0.5.5: Specifying JNDI bindings and resolving references
Binding information is used by a container to locate external resources
such as enterprise beans and resource connection factories required by an
application. You can specify the JNDI names of resources when you
install an application by using the administrative console.
Alternatively, you can specify the JNDI names in the Application Assembly
Tool. Binding properties specified in the tool can be changed in the
administrative console prior to installing an application. You can
specify binding information for the following:
- Enterprise beans.
- Data sources to be used by entity beans.
- References to enterprise beans and resource manager connection
factories. For example, an application client, enterprise bean, or
servlet can be a client to another enterprise bean. The referencing
bean or servlet declares an EJB reference and optionally binds the
reference.
- Virtual host names for Web applications.
If you are using the Application Assembly Tool to create application client
modules, you must also use the Application Client Resource Configuration Tool
if you have local resources. This tool allows you to define references
to local resources (other than enterprise beans) on the machine where the
application client resides.
References to enterprise beans, resource manager connection factories, and
environment entries are made available in the JNDI naming context
java:comp/env. References are relative to this context.
The references can then be bound to the actual JNDI name in the target
operational environment.
To specify binding information for an enterprise bean:
- In the navigation pane, click the icon representing the enterprise bean
instance. The properties for the enterprise bean are automatically
displayed in the property pane.
- In the property pane, click the Bindings tab.
- Enter the JNDI name. This is the name to which the bean's home
interface is bound in the global JNDI namespace. As a convention, use
the fully qualified JNDI name. For example,
com/ibm/ejb/samples/ClaimHome. You use this name when you
bind EJB references to the bean from the referencing client.
- Click Apply.
- Save the archive.
To declare a reference and optionally bind the reference:
- In the navigation pane, locate the property icon representing the
reference (EJB reference, resource reference, or environment entry).
- Right-click the icon and click New. The property dialog
box is displayed. (If property values already exist for the item, the
property dialog box is automatically displayed in the property pane.)
- On the General tab, enter required properties. For
example, for EJB references, enter a name, home interface, remote interface,
and enterprise bean type. If you enter the name
ejb/ClaimHome, the client looks up the bean's home interface
by using the JNDI name java:comp/env/ejb/ClaimHome.
View the help for 6.6.43.0.1: Assembly properties for EJB references, 6.6.43.0.2 Assembly properties for resource references, and 6.6.34.0.a: Assembly properties for environment entries.
If a referenced enterprise bean resides in the current module, or in the
encompassing application, use the Link property to select the name of the
bean. The binding information can be omitted.
- Click the Bindings tab.
- Enter the global JNDI name of the item being referenced. As a
convention, use the fully qualified JNDI name. For the example
reference ejb/ClaimHome, enter
com/ibm/ejb/samples/ClaimHome. This name must match the JNDI
name specified for the ClaimHome bean on its Bindings property
dialog box.
- Click Apply.
- Save the archive.
Some additional notes on binding:
- For CMP entity beans, you can optionally specify the JNDI name of the data
source of the bean.
- Optionally, you can specify a default data source and default
authorization information to be used by all entity beans in an EJB
module. To do this, click the EJB Modules folder to display its
property dialog box. Select the Bindings tab. Enter
the appropriate values.
|
|