uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.2.2 Interface for Enterprise Bean

This subsection describes the interfaces that you can use for implementing an Enterprise Bean. The following table describes the list of usable interfaces:

Table 2-6 List of usable interfaces

Interface name Description
Remote home interface#1 This interface that is specified in EJB specifications 1.1 or later versions inherits javax.ejb.EJBHome and is used for a remote client. This interface is mainly used for acquiring Enterprise Bean instances.
Remote component interface#2 This interface that is specified in EJB specifications 1.1 or later versions inherits javax.ejb.EJBObject and is used for a remote client. This interface mainly defines the business methods.
Remote business interface This interface is used to define the business methods for invoking the Enterprise Beans from a remote client. The defined interface need not be inherited.
Local home interface This interface that is specified in EJB specifications 2.0 or later versions inherits javax.ejb.EJBLocalHome and is used for a local client. This interface is mainly used for acquiring Enterprise Bean instances.
Local component interface This interface that is specified in EJB specifications 2.0 or later versions inherits javax.ejb.EJBLocalObject and is used for a local client. This interface mainly defines the business methods.
Local business interface This interface is used to define the business methods for invoking the Enterprise Beans from a local client. The defined interface need not be inherited.

#1
This interface is called a home interface in EJB specifications 1.1.

#2
This interface is called a remote interface in EJB specifications 1.1.

In this manual, multiple interfaces are grouped together and are given a general name. The following table describes the general names for the interfaces that are used in the descriptions of this manual:

Table 2-7 General names of interfaces

General name of the interface Description
Home interface This is the general name for the following interfaces:
  • Remote home interface
  • Local home interface
Component interface This is the general name for the following interfaces:
  • Remote component interface
  • Local component interface
Business interface This is the general name for the following interfaces:
  • Remote business interface
  • Local business interface
Remote interface This is the general name for the following interfaces:
  • Remote home interface
  • Remote component interface
  • Remote business interface
This name may, however, indicate only the remote component interface and the remote business interface.
Local interface This is the general name for the following interfaces:
  • Local home interface
  • Local component interface
  • Local business interface
This name may, however, indicate only the local component interface and the local business interface.

These interfaces are implemented for a Session Bean or an Entity Bean. A Message-driven Bean does not have these interfaces.

With a Session Bean, you can use the No-Interface view to invoke from the local interface. In such cases, you can omit the implementation of the interface. For details on the No-Interface view, see 2.16 Omitting local business interfaces (Using No-Interface view).

Organization of this subsection
(1) Remote interface
(2) Local interface
(3) Functionality supporting a business interface
(4) Invoking the Enterprise Bean of a business interface

(1) Remote interface

In a remote interface, the Enterprise Beans are invoked by RMI-IIOP communication, based on the provisions in the Java RMI interface. The Enterprise Beans existing in a JavaVM of another client can be invoked, but that causes a communication overhead at run time. The arguments and the return values during execution of the method are passed by value.

(2) Local interface

In a local interface, the Enterprise Beans are invoked by invoking the Java methods and communication does not occur. This interface can be used only when the clients exist in the same J2EE application. Furthermore, when using a local interface, unlike a remote interface, the arguments and the return values during execution of the method are passed by reference.

(3) Functionality supporting a business interface

The following functionality can be used even when you use a business interface:

(4) Invoking the Enterprise Bean of a business interface

The case of invoking a business interface running in another J2EE application on the same J2EE server and that of invoking a business interface running in another J2EE server are explained below:

In either case, the invoking EJB-JAR file or the WAR file contains the business interface of the invoked Enterprise Bean as well as the user-created classes used in the interface. Furthermore, lookup is performed by using either the name that is bound automatically to the JNDI name space (Portable Global JNDI name or a name starting with HITACHI_EJB) or the optional name set up in the user-specified name space functionality. For details on the names used for lookup, see 2.5 Look up by the name starting with HITACHI_EJB in the uCosminexus Application Server Common Container Functionality Guide.