5.1 Container Artifacts

Recall from Section 2.4.1, Container Artifacts, on page 45 that when a session bean is deployed in an EJB container, the tools provided by the container vendor generate additional classes, called container artifacts. The container uses container artifacts to manage the session bean at runtime and to support the distributed object protocol between the client program and the EJB container.

For session beans having a local interface and a local home interface, such as EnrollmentEJB in the previous chapter, the container generates the classes EnrollmentLocalObject and EnrollmentLocalHome these names are illustrative for a typical container which implement the Enrollment and EnrollmentHome interfaces, respectively.

For session beans having a remote interface and a remote home interface, the container tools generate the PayrollRMI and PayrollHomeRMI distributed object types (Figure 5.1).

Figure 5.1. Enrollment Class Diagram

graphics/05fig01.gif

PayrollRMI and PayrollHomeRMI are typically RMI-IIOP object types. Their instances are distributed CORBA objects that implement the communication between the client and the container. The PayrollRMI type provides the implementation of the session bean's remote interface, Payroll. The PayrollHomeRMI type provides the implementation of the session bean's home interface, PayrollHome.

We refer to the instances of the PayrollRMI object type as session objects, and we refer to the instances of the PayrollHomeRMI object type as session bean home objects. Most containers create a single session bean home object that is shared among all clients, but some containers may use multiple instances of the session bean home object.

The implementation of each RMI-IIOP type consists of multiple Java classes. Although you do not need to know RMI-IIOP details to write an enterprise bean, you may be interested to see the RMI-IIOP specification, which details how to implement RMI-IIOP objects; see the section Other Sources of Information in the preface on page xviii to locate the specification.



Applying Enterprise Javabeans
Applying Enterprise JavaBeans(TM): Component-Based Development for the J2EE(TM) Platform
ISBN: 0201702673
EAN: 2147483647
Year: 2003
Pages: 110

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net