2.5 Looking up with names beginning with HITACHI_EJB

This section describes the names beginning with HITACHI_EJB. When you deploy a J2EE application, a name beginning with HITACHI_EJB is automatically bound to the JNDI name of the EJB home object reference and business interface reference. The bound name is used for lookup.

For details on the mapping mechanism and usage of the JNDI name space, see 2.3.2 Mapping and looking up the JNDI name space.

Note
The names beginning with HITACHI_EJB are not bound when a local interface is used. Use another method for lookup.
Organization of this section
(1) Name that automatically binds the EJB home object reference
(2) Name that automatically binds the business interface reference

(1) Name that automatically binds the EJB home object reference

When you start (deploy) a J2EE application, the EJB home object reference of the Enterprise Bean is bound to the JNDI name with the following name:

HITACHI_EJB/SERVERS/server-name/EJB/J2EE-application-name/Enterprise-Bean-name

server-name
Name of the J2EE server
J2EE-application-name
Lookup name of the J2EE application
Enterprise-Bean-name
Lookup name of the Enterprise Bean

When Enterprise Beans are invoked between the J2EE applications, or Enterprise Beans are invoked from the EJB client application, the client looks up the EJB home object reference with the bound JNDI name.

The following figure shows that when a J2EE application is started with the below-mentioned conditions, an EJB home object implementing the "CartHome" interface is generated, and that reference is bound to the JNDI name "HITACHI_EJB/SERVERS/MyServer/EJB/CartApp/CartEB".

Conditions
  • Enterprise Bean: "CartBean"
  • Remote interface name: "Cart"
  • Home interface: "CartHome"
  • Server name: "MyServer"
  • Lookup name of the J2EE application: "CartApp"
  • Lookup name of the Enterprise Bean: "CartEB"

    Figure 2-5 Binding the EJB home object reference to the JNDI name space

    [Figure]

The following figure shows the procedure of lookup and obtaining of objects when the EJB home object reference is looked up using a name beginning with HITACHI_EJB.

Figure 2-6 Procedure of lookup and obtaining of objects using a name beginning with HITACHI_EJB

[Figure]

(2) Name that automatically binds the business interface reference

When you start (deploy) a J2EE application, the business interface reference is bound to the JNDI name with the following name:

HITACHI_EJB/SERVERS/server-name/EJBBI/J2EE-application-name/Enterprise-Bean-name

server-name
Name of the J2EE server
J2EE-application-name
Lookup name of the J2EE application
Enterprise-Bean-name
Lookup name of the Enterprise Bean

When Enterprise Beans are invoked between the J2EE applications, or Enterprise Beans are invoked from the EJB client application, the client looks up the business interface reference with the bound JNDI name.