Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Enterprise Java Beans has been one of the corner stones of the J2EE specification. As a J2EE 1.4 certified application server, Apache Geronimo supports EJB's extensively with the help of OpenEJB EJB Container. Although it is possible to use standard Java objects to contain your business logic and business data, using EJBs addresses many of the issues of using simple Java objects, such as scalability, life cycle management and state management. In this article, you will see how an initial database application is extended and used for both local and remotely referred application clients for an Enterprise Java Beans back end. The application uses inbuilt built-in Apache Derby as its database. Use this article to learn how to simplify your enterprise application development process.

Banking application has two types of application clients namely "Banking Remote Application" and "Banking Web Application". Each of these clients demonstrate how to refer Enterprise Java Beans in remote and local interfaces respectively. Both these clients are referring a common business layer which has been implemented with the help of Session and Entity Beans. Stateless Session Beans are acting as the business service interface between business entities and application clients. All the business entities of the application layer are implemented with the CMP & and BMP Entity Beans. Relations between CMP entities are managed as Container Managed Relations.

...

EJB implementation may vary from one vendor to another.Following The following are the main list of features Apache Geronimo supports as a J2EE container.

...

  • org.apache.geronimo.samples.bank.client
    • MainUI - User interface for the Account Balance Modifier.
  • org.apache.geronimo.samples.bank.dto
    • AccountDTO - Use to transfer Account entity related data between different application layers.
    • ExchangeRateDTO - Transfer ExchangeRate entity related data between different application layers.
  • org.apache.geronimo.samples.bank.ejb
    • AccountBean - CMP Entity Bean, represent account entity related data in the DB.
    • BankManagerFacadeBean - Stateless Session Bean, acting as a service class for different application clients.
    • CustomerBean - CMP Entity Bean, represents customer entity related data.
    • ExchangeRateBean - BMP Entity Bean, represents exchange rate relative to a USD.
  • org.apache.geronimo.samples.bank.util
    • PropertyLoader - Loads configuration properties to the Account Balance Modifier Client.
  • org.apache.geronimo.samples.bank.web
    • CustomerServiceServlet - Dispatches web requests of Customer Account Balance Viewer to the service layer.
    • CommonServiceServlet - Dispatches web requests of Exchange Rate viewing scenario.

Finally, the banking application will be deployed as an EAR to the application server. Overview The overview of the structural content of the EAR file is given in the following example.

...

Corresponding openejb-jar.xml defines Geronimo specific features of EJBs. It has both EJB information and their relationships. In addition, it gives a link to the database pool of the application. Entity Beans in the application are dependent on this pool. Also note that the final part of this file defines a 1-N Container Managed Relation (CMR) between Customer and Account Entity Beans.

...

BankPool.xml is a typical database pool configuration file, which will be connected to the BankDB defined in through the inbuilt Derby database. Entity beans of the application refer the defined database via this configuration file.

...