This exercise consists of multiple projects that are integrated into a single JavaEE application; root project, Impl (BOs,DAOs, and BL) project, EJB project, WAR project, EAR project, and RMI Test project.
The root project is the parent to each of the other project and can be used to invoke targets that apply to all children. This project is known as a reactor or "pom" project since it has not artifacts other than a pom.xml (and children).
The Impl project contains implementation code for the business rules (business logic and business objects) and data access tier. This has been the focus of other exercises and could have been broken out into separate projects, however, they were condensed into a single project for this exercise since they are not the focus of the exercise.
The EJB project will host the session beans, define the remote and local interfaces for the application, and host the application within the application server. The EJB container running within the application server will provide a runtime environment, thread management, resource management, transaction management and security (transactions and security not a part of this exercise).
The WAR project will provide an HTML-based web interface for the clients to access the application. It will interface to the application using the local interface.
The EAR project will provide a composite deployment unit to the application server. It will consist of the EJB and WAR modules as well as any dependencies that they define.
The RMI Test project will provide a demonstration of the RMI client actions and a test of the application from the RMI interface.
Your final source tree will look like the following.
javaeeEx |-- javaeeExEAR | `-- pom.xml |-- javaeeExEJB | |-- pom.xml | `-- src | `-- main | |-- java | | `-- myorg | | `-- javaeeex | | |-- dto | | | |-- AddressDTO.java | | | `-- PersonDTO.java | | `-- ejb | | |-- RegistrarEJB.java | | |-- RegistrarLocal.java | | |-- RegistrarRemote.java | | |-- TestUtilEJB.java | | `-- TestUtilRemote.java | `-- resources | `-- META-INF | |-- jboss.xml | `-- persistence.xml |-- javaeeExImpl | |-- pom.xml | `-- src | |-- main | | |-- java | | | `-- myorg | | | `-- javaeeex | | | |-- bl | | | | |-- Registrar.java | | | | |-- RegistrarException.java | | | | `-- TestUtil.java | | | |-- blimpl | | | | |-- RegistrarImpl.java | | | | `-- TestUtilImpl.java | | | |-- bo | | | | |-- Address.java | | | | `-- Person.java | | | |-- dao | | | | |-- PersonDAO.java | | | | `-- PersonDAOException.java | | | `-- jpa | | | |-- DBUtil.java | | | `-- JPAPersonDAO.java | | `-- resources | | `-- META-INF | | |-- orm.xml | | `-- persistence.xml | `-- test | |-- java | | `-- myorg | | `-- javaeeex | | |-- blimpl | | | |-- RegistrarImplTest.java | | | `-- TestUtilTest.java | | |-- bo | | | `-- PersonTest.java | | `-- jpa | | |-- DBUtilTest.java | | |-- DemoBase.java | | `-- JPAPersonDAOTest.java | `-- resources | `-- log4j.xml |-- javaeeExTest | |-- pom.xml | `-- src | `-- test | |-- java | | `-- myorg | | `-- javaeeex | | `-- ejbclient | | `-- RegistrarTest.java | `-- resources | |-- jndi.properties | `-- log4j.xml |-- javaeeExWAR | |-- pom.xml | `-- src | |-- main | | |-- java | | | `-- myorg | | | `-- javaeeex | | | `-- web | | | |-- JPAFilter.java | | | `-- RegistrarHandlerServlet.java | | `-- webapp | | |-- WEB-INF | | | |-- content | | | | |-- DisplayException.jsp | | | | |-- DisplayPeople.jsp | | | | |-- DisplayPerson.jsp | | | | |-- DisplayResult.jsp | | | | |-- ErrorPage.jsp | | | | `-- UnknownCommand.jsp | | | `-- web.xml | | |-- admin | | | `-- admin_menu.jsp | | `-- index.jsp | `-- test | `-- resources | `-- log4j.xml `-- pom.xml
The exercise provides a key starting point to creating and using a multi-pom project to build EJBs, WARs, EARs, and RMI Tests.