uCosminexus Application Server, EJB Container Functionality Guide
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. |
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:
|
Component interface | This is the general name for the following interfaces:
|
Business interface | This is the general name for the following interfaces:
|
Remote interface | This is the general name for the following interfaces:
|
Local interface | This is the general name for the following interfaces:
|
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).
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.
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.
The following functionality can be used even when you use a business interface:
Table 2-8 Applicability of a timeout for Enterprise Bean
Interface | Method | Stateless SessionBean |
Stateful SessionBean |
Singleton Session Bean | Message DrivenBean |
Persistence API |
---|---|---|---|---|---|---|
Business interface | Business method#1 | Y | Y | Y | N/A | N/A |
Home or component interface#2 | create | N | Y | N/A | N/A | N/A |
Business method | Y | Y | N/A | N/A | N/A | |
remove | N | Y | N/A | N/A | N/A | |
javax.ejb.Timed Object | ejbTimeout | Y | N/A | Y | N/A | N/A |
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.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.