EJBs

EJBs that support the EJB 2.0 specification can have both remote and local interfaces.

EJB references

When servlets and JSP pages reference remote EJBs, the EJB reference in the deployment descriptor is used to instantiate proxies for EJB home interfaces. EJB references must be catalogued in the deployment descriptor so that the Web application does not depend on a specific naming configuration. When deploying the Web application, a site administrator can specify site-specific EJB home names.

Table 12-13: EJB reference properties for a JSP target

Setting

Value

Name (New button)

Click New to create a new remote reference to an enterprise bean. Specifies the JNDI name used to refer to this EJB.

Type

Choose Session for session beans or Entity for entity beans.

Home Interface

The Java class name of the EJB home interface, specified in dot notation. For example, com.sybase.myBeanHome.

Remote Interface

The Java class name of the EJB remote interface, specified in dot notation. For example, com.sybase.myBeanRemote.

Description

(Optional) A comment to describe the EJB reference.

Link

The JNDI name of an instance of the specified EJB that is installed in the server where the Web application is to be deployed.

Local references

Servlets and JSP pages can reference EJBs running in the same Java VM using local interfaces. The settings for EJB local references are analogous to the settings for EJB references, which are used when the EJB is not running in the same Java VM.

Table 12-14: Local EJB reference properties for a JSP target

Setting

Value

Name (New button)

Click New to create a new local reference to an enterprise bean. Specifies the JNDI name used to refer to this EJB.

Type

Choose Session for session beans or Entity for entity beans.

Local Home

The Java class name of the EJB local home interface, specified in dot notation. For example, com.sybase.shopping.LocalCartHome.

Local Interface

The Java class name of the EJB local interface, specified in dot notation. For example, com.sybase.shopping.LocalCart.

Description

(Optional) A comment to describe the local EJB reference.

Link

The JNDI name of an instance of the specified EJB that is installed in the server where the Web application is to be deployed.