[jboss-cvs] JBossAS SVN: r105158 - in projects/snowdrop/examples/branches: sportsclub-experimental/docs/guide/en-US and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 24 14:32:09 EDT 2010
Author: marius.bogoevici
Date: 2010-05-24 14:32:08 -0400 (Mon, 24 May 2010)
New Revision: 105158
Added:
projects/snowdrop/examples/branches/sportsclub-experimental/
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/account-person.png
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/application-modules.png
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/domain-entities.png
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml
Removed:
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml
projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml
projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml
Log:
Creating experimental branch
Copied: projects/snowdrop/examples/branches/sportsclub-experimental (from rev 104914, projects/snowdrop/examples/trunk/sportsclub)
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Introduction.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
-%BOOK_ENTITIES;
-]>
-<chapter id="chap-guide-Test_Chapter">
- <title>Introduction</title>
-
- <para>This chapter describes the purpose of the example, as well as the
- general structure of the documentation.</para>
-
- <section>
- <title>Making sure you have all you need</title>
-
- <para>Running the example requires the following setup:</para>
-
- <itemizedlist>
- <listitem>
- <para>Java 6 JDK</para>
- </listitem>
-
- <listitem>
- <para>JBoss AS 5.1.0 GA or JBoss EAP 5 or higher</para>
- </listitem>
-
- <listitem>
- <para>Maven 2.0.8 or higher</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>How to run the examples</title>
-
- <para>Running the application consists of the following
- steps:<itemizedlist>
- <listitem>
- <para>Building the application</para>
- </listitem>
-
- <listitem>
- <para>Initializing the database</para>
- </listitem>
-
- <listitem>
- <para>Preparing JBoss</para>
- </listitem>
-
- <listitem>
- <para>Deploying the application</para>
- </listitem>
- </itemizedlist></para>
-
- <simplesect>
- <title>Building the application</title>
-
- <para>In this step we are building the application. The Sportsclub
- example uses maven, so it can be built by simply running:</para>
-
- <informalexample>
- <para><programlisting>mvn clean package</programlisting>This will
- produce two EAR files, both named sportsclub.ear, located under
- sportsclub-ear/target and sportsclub-jpa-ear/target. They have the
- same functionality, but the underlying implementation of the
- persistence layer is different (one is using Hibernate, and another
- one uses JPA).</para>
-
- <para>The application has two main profiles:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>spring-2.5 which builds a Spring 2.5 variant of the
- application</para>
- </listitem>
-
- <listitem>
- <para>spring-3 which build a Spring 3.0 variant of the
- application</para>
- </listitem>
- </itemizedlist></para>
- </informalexample>
- </simplesect>
-
- <simplesect>
- <title>Initializing the database</title>
-
- <para>The application uses a standalone HSQLDB database, which needs to
- be initialized and started before the application is deployed. In what
- follows, we will show you how to initialize (or reset) the database, and
- we will show how to start when we discuss deployment.</para>
-
- <para>The database is initialised by using maven:</para>
-
- <informalexample>
- <programlisting>cd database
-mvn -Pdb-setup</programlisting>
- </informalexample>
-
- <para>Once this step has been completed, it does not need to be repeated
- again before running the application, but it can be repeated if the
- database needs to be reset.</para>
- </simplesect>
-
- <simplesect>
- <title>Preparing JBoss</title>
-
- <para>Besides building the application and initializing the database,
- you need to set up JBoss for running your application. This step
- involves:</para>
-
- <itemizedlist>
- <listitem>
- <para>setting up the Spring Deployer</para>
- </listitem>
-
- <listitem>
- <para>creating a managed DataSource for accessing the
- database</para>
- </listitem>
-
- <listitem>
- <para>creating a Destination for JMS-related features</para>
- </listitem>
- </itemizedlist>
-
- <para>The Spring Deployer will be setup by extracting it into the
- <JBoss-Home>/servers/<server-instance>/deployers folder.
- Please refer to the Spring Deployer documentation for details.</para>
-
- <para>For creating the DataSource and the Destination, you need to use
- the facilities provided in the jbossconf folder. Just execute;</para>
-
- <para><informalexample>
- <programlisting>cd jbossconf
-mvn -Pinstall</programlisting>
- </informalexample>This will copy the datasource and JMS destination
- definitions into the JBoss server. Like the previous one, this step
- needs to be executed only once.</para>
- </simplesect>
-
- <simplesect>
- <title>Deploying</title>
-
- <para>Deploying the application is as easy as copying one of the EARs
- produced by the application into the $JBOSS_HOME/servers/default/deploy
- folder. You can do that either before starting the application server,
- or after it has started. Before you deploy the application</para>
- </simplesect>
- </section>
-</chapter>
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Introduction.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Introduction.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,318 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
+%BOOK_ENTITIES;
+]>
+<chapter id="chap-guide-Test_Chapter">
+ <title>Introduction</title>
+
+ <para>The Sportsclub application provides a real-world inspired example on
+ integrating Spring with Java EE 5 and JBoss. It consists of three web
+ applications packaged together which illustrate various use cases and
+ combinations of components and technologies. It also illustrates how to use
+ the Snowdrop library in order to provide JBoss-specific integration
+ features, such as standalone deployment of an ApplicationContext, and
+ injection of beans provided from that application context in non-Spring
+ components such as EJBs.</para>
+
+ <para>The main goal is to illustrate the mechanics of using Spring with
+ different Java EE 5 components, in the specific context of JBoss, explaining
+ why a certain approach is preferable to another, when the Spring Framework
+ provides two or more options to achieving the same goal. For example, it
+ will explain why we gave preference to JCA-based JMS integration over the
+ DefaultMessageListenerContainer, or why we prefer to use an
+ application-server deployed persistence context versus having Spring create
+ one.</para>
+
+ <para>The example is not intended to be a guide on creating a domain model,
+ breaking down the various layers of the application or on UI design. While
+ the domain model has attempted to follow the general priciples of
+ object-oriented and domain-driven design, which are commonly associated with
+ Spring application, there are many other options and ways of doing it, which
+ are discussed in far more detail elsewhere. For example, the application
+ uses DAOs (or Repositories in DDD terms), but this shouldn't be viewed as
+ advocacy for using them in absolute terms. A significant number of Spring
+ applications use this particular design, and we have employed it to
+ illustrate the technical integration use cases.</para>
+
+ <para>Also, the application uses RichFaces as a component library for JSF.
+ We strongly encourage you to consult the Richfaces documentation and
+ examples for Richfaces-specific information.</para>
+
+ <section>
+ <title>Prerequisites: making sure you have all you need</title>
+
+ <para>Running the example requires the following setup:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Java 6 JDK;</para>
+ </listitem>
+
+ <listitem>
+ <para>JBoss AS 5.1.0 GA or later;</para>
+ </listitem>
+
+ <listitem>
+ <para>Maven 2.0.9 or later, with properly set up repositories;</para>
+ </listitem>
+
+ <listitem>
+ <para>The Spring Deployer.</para>
+ </listitem>
+ </itemizedlist>
+
+ <simplesect>
+ <title>Setting up Maven repositories</title>
+
+ <para>The Maven project setup does not make any assumptions where the
+ artifacts used in the project are coming from (which repository), as
+ users may have different settings for their Maven repositories (direct
+ access to community repositories, proxies, enterprise repository with
+ approved artifacts). Therefore, the setup of the repositories is left to
+ the user of the application.</para>
+
+ <para>In the most simple case, this example can be built out of the box
+ if the settings.xml file for the local Maven installation enables the
+ repositories from Maven Central and JBoss Releases. Instructions for
+ setting up the latter can be found at:
+ http://community.jboss.org/wiki/MavenGettingStarted-Users.</para>
+
+ <para>The pom.xml can be modified to include references to other
+ repositories, or equivalent artifact versions (if the build environment
+ uses an enterprise-wide repository in which the artifacts have different
+ version numbers).</para>
+ </simplesect>
+
+ <simplesect>
+ <title>Installing the Spring Deployer in JBoss AS</title>
+
+ <para>For running the application, the Spring Deployer must be installed
+ in JBoss AS. Please refer to the Snowdrop documentation for
+ details.</para>
+ </simplesect>
+ </section>
+
+ <section>
+ <title>How to build and run the examples</title>
+
+ <para>The documentation will provide a more detailed account of the
+ application structure and use cases covered, but sometimes it is easier to
+ just run the application.</para>
+
+ <para>Running the application consists of the following
+ steps:<itemizedlist>
+ <listitem>
+ <para>Building the application</para>
+ </listitem>
+
+ <listitem>
+ <para>Initializing the database</para>
+ </listitem>
+
+ <listitem>
+ <para>Preparing JBoss</para>
+ </listitem>
+
+ <listitem>
+ <para>Deploying the application</para>
+ </listitem>
+
+ <listitem>
+ <para>Starting the database</para>
+ </listitem>
+
+ <listitem>
+ <para>Starting the application server</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>Below are some details on how to perform some of these steps.</para>
+
+ <simplesect>
+ <title>Building the application</title>
+
+ <para>In this step we are building the application. The Sportsclub
+ example uses maven, so it can be built by simply running:</para>
+
+ <informalexample>
+ <para><programlisting>mvn clean package</programlisting>This will
+ produce two EAR files, both named sportsclub.ear, located under
+ sportsclub-ear/target and sportsclub-jpa-ear/target. They have the
+ same functionality, but the underlying implementation of the
+ persistence layer is different (one is using Hibernate, and another
+ one uses JPA).</para>
+
+ <para>The application has two main profiles:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>spring-2.5 which builds a Spring 2.5 variant of the
+ application</para>
+ </listitem>
+
+ <listitem>
+ <para>spring-3 which build a Spring 3.0 variant of the
+ application</para>
+ </listitem>
+ </itemizedlist></para>
+ </informalexample>
+ </simplesect>
+
+ <simplesect>
+ <title>Initializing the database</title>
+
+ <para>The application uses a standalone HSQLDB database, which needs to
+ be initialized and started before the application is deployed. In what
+ follows, we will show you how to initialize (or reset) the database, and
+ we will show how to start when we discuss deployment.</para>
+
+ <para>The database is initialised by using maven:</para>
+
+ <informalexample>
+ <programlisting>cd database
+mvn -Pdb-setup</programlisting>
+ </informalexample>
+
+ <para>Once this step has been completed, it does not need to be repeated
+ again before running the application, but it can be repeated if the
+ database needs to be reset.</para>
+ </simplesect>
+
+ <simplesect>
+ <title>Preparing JBoss</title>
+
+ <para>Besides building the application and initializing the database,
+ you need to set up JBoss for running your application. This step
+ involves:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>setting up the Spring Deployer</para>
+ </listitem>
+
+ <listitem>
+ <para>creating a managed DataSource for accessing the
+ database</para>
+ </listitem>
+
+ <listitem>
+ <para>creating a Destination for JMS-related features</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>As explained in the prerequisites, the Spring Deployer will be
+ setup by extracting it into the
+ <JBoss-Home>/servers/<server-instance>/deployers folder.
+ Please refer to the Spring Deployer documentation for details.</para>
+
+ <para>For creating the DataSource and the Destination, you need to use
+ the facilities provided in the jbossconf folder.</para>
+
+ <para><informalexample>
+ <programlisting>cd jbossconf
+</programlisting>
+ </informalexample><informalexample>
+ <para>Modify the jbossconf/jbossas.properties file to indicate the
+ correct location of the JBoss AS installation. A commented example
+ is provided.</para>
+
+ <programlisting>mvn -Pinstall</programlisting>
+ </informalexample>This will copy the datasource and JMS destination
+ definitions into the JBoss server. Like the previous one, this step
+ needs to be executed only once.</para>
+ </simplesect>
+
+ <simplesect>
+ <title>Deploying the application</title>
+
+ <para>Copy one of the two ears produced by the build to the deploy
+ folder of JBoss AS.ou </para>
+
+ <para>The deployment folder is: JBOSS_HOME/server/default/deploy, and
+ the two (alternative) build files are:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>sportsclub-ear/target/sportsclub.ear (Hibernate-based
+ implementation);</para>
+ </listitem>
+
+ <listitem>
+ <para>sportsclub-jpa-ear/target/sportsclub.ear (JPA-based
+ implementation, using Hibernate as the underlying provider).</para>
+ </listitem>
+ </itemizedlist>
+ </simplesect>
+
+ <simplesect>
+ <title>Starting the database</title>
+
+ <para>From the database folder:</para>
+
+ <para><informalexample>
+ <programlisting>cd database
+</programlisting>
+ </informalexample>Execute one of the two startup scripts:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>On Linux and other *nix-like systems:</para>
+
+ <informalexample>
+ <programlisting>./startdb.sh</programlisting>
+ </informalexample>
+ </listitem>
+
+ <listitem>
+ <para>On Windows:</para>
+
+ <informalexample>
+ <programlisting>startdb.bat</programlisting>
+ </informalexample>
+ </listitem>
+ </itemizedlist>
+
+ <para>The database must be always started before the application server
+ is started and the application is deployed. The application can also be
+ deployed in a running application server (for example after making
+ changes to it), but this should always happen while the database is
+ started).</para>
+ </simplesect>
+
+ <simplesect>
+ <title>Special configuration for distinct profiles</title>
+
+ <para>The Sportsclub application can be deployed in different JBoss
+ Application Server profiles. Some of these profiles, like for example
+ the Web profile, do not include a message broker, therefore JMS
+ integration features (see dedicated section) must be disabled. In order
+ to disable JMS integration in the Sportsclub application, the file
+ <code>sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/spring-business-context.xml</code>
+ must be modified by commenting out the following line:<programlisting><import resource="spring-messaging-context.xml"/></programlisting></para>
+
+ <para>Uncommenting the line will re-enable the JMS integration
+ features.</para>
+ </simplesect>
+ </section>
+
+ <section>
+ <title>Sportsclub and JBoss Developer Studio</title>
+
+ <para>The easiest way to understand how the application works is by
+ looking at its sources. This guide will show you how you can import the
+ application in JBoss Developer Studio.</para>
+
+ <para>Sportsclub is Maven-based, therefore you will need to create the
+ Eclipse project structure for it. You can do by using the Maven Eclipse
+ plugin:</para>
+
+ <informalexample>
+ <programlisting>mvn eclipse:eclipse -Dwtpversion=2.0</programlisting>
+
+ <para>Alternately, you can install the m2eclipse Maven Eclipse plugin,
+ and use it to import the application.</para>
+ </informalexample>
+ </section>
+</chapter>
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Modules.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,1047 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
-%BOOK_ENTITIES;
-]>
-<chapter id="chap-guide-modules">
- <title>Using JBoss and Spring together</title>
-
- <para>This chapter will describe the various Spring and JBoss integration
- use cases covered by the application and will describe how are they
- implemented in the various application modules.</para>
-
- <para>As a Spring application that consists of multiple modules, our
- strategy is to provide fragments of Spring configuration in each artifact
- produced by a module, leaving to the upper layer components to aggregate
- them. This strategy has multiple benefits: for one, it allows to separate
- concerns between components - the Spring wiring of certain components is
- left at the level where the components are defined, so that it can be
- changed easily if the implementations change.</para>
-
- <section>
- <title>A look at the JBoss/Spring integration use cases</title>
-
- <para>The Sportsclub application covers a number of JBoss and Spring
- integration use cases. The scenarios selected for this example are
- focusing on using the Java EE 5 services provided by JBoss AS in Spring
- applications.</para>
-
- <para>The use cases can be grouped in categories as follows:<table>
- <title>Use case list overview</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry align="center">Category</entry>
-
- <entry align="center">Use case</entry>
-
- <entry align="center">How does this involve JBoss AS</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>Persistence</entry>
-
- <entry>Spring/Hibernate integration</entry>
-
- <entry>The application is using a Spring-configured Hibernate
- SessionFactory using JTA transaction management and bound to
- JTA. The Hibernate library being used is the one provided by
- JBoss AS.</entry>
- </row>
-
- <row>
- <entry></entry>
-
- <entry>Spring/JPA integration</entry>
-
- <entry>The Persistence Unit is deployed by JBoss and retrieved
- from JNDI to be injected into Spring beans. PersistenceContext
- is shared with surrounding EJBs (if any)</entry>
- </row>
-
- <row>
- <entry>Testing</entry>
-
- <entry>Unit-testing components that have managed infrastructure
- dependencies</entry>
-
- <entry>The DataSource and EntityManager are managed by JBoss and
- acquired from JNDI by Spring when the application is running. In
- the case of JBoss, developers can test their code in isolation
- using Spring-specific replacements that 'simulate' the JBoss
- environment.</entry>
- </row>
-
- <row>
- <entry>Business Logic</entry>
-
- <entry>Spring-based service beans</entry>
-
- <entry>The business services are Spring-managed and wrapped into
- transactions managed by Spring's interceptors. The
- TransactionManager in use is the JTATransactionManager using
- JBoss Transactions provided in JBoss AS.</entry>
- </row>
-
- <row>
- <entry></entry>
-
- <entry>EJBs injected with Spring Beans</entry>
-
- <entry>The application uses JBoss-deployed EJBs which are
- injected with Spring beans acquired from an application context
- bootstrapped by the Spring Deployer. Transactions are managed by
- EJBs.</entry>
- </row>
-
- <row>
- <entry>User Interface</entry>
-
- <entry>JSF/Richfaces and Spring integration</entry>
-
- <entry>The application uses the JBoss AS-provided JSF support,
- and Richfaces components. The business services and UI-backing
- instances are Spring beans.</entry>
- </row>
-
- <row>
- <entry></entry>
-
- <entry>Spring MVC and EJB integration</entry>
-
- <entry>The application uses Spring MVC and the business logic is
- implemented using JBoss-deployed EJBs, which are injected into
- the Spring controllers.</entry>
- </row>
-
- <row>
- <entry>JMS/JCA integration</entry>
-
- <entry>JMS/Spring integration using JCA</entry>
-
- <entry>Spring-configured message listeners are used for
- processing JMS messages from JBoss AS-managed destinations. The
- application uses the Spring /JCA integration for receiving
- messages.</entry>
- </row>
-
- <row>
- <entry>Aspect-oriented programming</entry>
-
- <entry>Spring-based weaving of POJO aspects</entry>
-
- <entry>This use case does not have any JBoss AS-specific
- functionality.</entry>
- </row>
-
- <row>
- <entry>JMX</entry>
-
- <entry>Spring beans are exposed as JMX beans</entry>
-
- <entry>The JBoss AS MBean Server is used for registering the
- Spring-exported JMX beans. Consequently, the Spring beans can be
- managed from the JBoss AS Administration Console.</entry>
- </row>
-
- <row>
- <entry>Web Services</entry>
-
- <entry>JAX-WS defined web-services are injected with Spring
- beans</entry>
-
- <entry>The application uses JBoss AS' support for JAX-WS through
- JBoss WS, but also Spring to define the underlying business
- logic, which is injected into the JBoss WS-deployed
- services.</entry>
- </row>
- </tbody>
- </tgroup>
- </table></para>
- </section>
-
- <section>
- <title>The domain model</title>
-
- <para>The sportsclub-domain module is the only module of the application
- that does not integrate with Spring directly. However, it is used further
- in the application as it provides:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>the entities that the application will interact with;</para>
- </listitem>
-
- <listitem>
- <para>the repository interfaces that provide persistence services
- for the application</para>
- </listitem>
- </itemizedlist>A relevant note regarding the domain module is the use of
- the term "repository" for the components that are used for retrieving
- objects from persistence and saving them. The intent behind that is to
- indicate that the design of the application is emulating the concepts
- behind Domain-Driven Design, where the objects that are used for providing
- the persistence and entity lookup functions are part of the domain, rather
- than simple persistence implementation strategies (as it is the case with
- the fairly similar Data Access Objects).</para>
- </section>
-
- <section>
- <title>Persistence implementation: JPA and Hibernate</title>
-
- <para>The persistence modules: sportsclub-hibernate-dao and
- sportsclub-jpa-dao are alternative implementations of the application's
- persistence strategy. This means that each module will provide:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>implementations for the repository interfaces defined in the
- sportsclub-domain module;</para>
- </listitem>
-
- <listitem>
- <para>Spring context definition fragments that can be reused
- elsewhere in the application</para>
- </listitem>
- </itemizedlist>Effectively, the Spring configuration fragments will
- expose a bean implementation for each repository interface defined in the
- model. This means that the implementations can be swapped at build-time
- without any change in the business layer. This is the basis for the build
- process creating two different builds, each based on a different
- persistence implementation - including a different repository
- implementation jar and leaving everyting else in the component stack
- unchanged.</para>
-
- <para>Each module produces a set of beans that can be injected further
- into the business services of the application.</para>
-
- <section>
- <title>The Hibernate implementation</title>
-
- <para>The Hibernate-based repository implementation defines a generic
- superclass defining all the common repository operations that that
- repository implementations will parametrize by specifying the entity
- type and primary key type.<informalexample>
- <para><programlisting lang="JAVA" language="JAVA">public abstract class HibernateRepository<T, I extends Serializable> implements Repository<T, I>
-{
- protected SessionFactory sessionFactory;
-
- Class<T> clazz;
-
- public HibernateRepository(Class<T> clazz)
- {
- this.clazz = clazz;
- }
-
- public void setSessionFactory(SessionFactory sessionFactory)
- {
- this.sessionFactory = sessionFactory;
- }
-
- protected Session getCurrentSession()
- {
- return this.sessionFactory.getCurrentSession();
- }
-
- public T findById(I id)
- {
- return (T)getCurrentSession().get(clazz, id);
- }
-
- public void save(T object)
- {
- getCurrentSession().saveOrUpdate(object);
- }
-
- public void delete(T object)
- {
- getCurrentSession().delete(object);
- }
-
- public List<T> findAll()
- {
- return getCurrentSession().createCriteria(clazz).list();
- }
-
-
- public long countAll()
- {
- return (Integer)getCurrentSession().createCriteria(clazz).setProjection(Projections.count("id")).uniqueResult();
- }
-
- public Criteria applyRange(Criteria criteria, Range range)
- {
- return criteria.setFirstResult(range.getMinIndex()).setMaxResults(range.length());
- }
-}</programlisting>It is important to notice that this implementation and its
- subclasses are not Spring-based.</para>
- </informalexample></para>
-
- <para><informalexample>
- <para>The only Spring-related component of this module is the
- configuration which consists of two files:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>spring-hibernate-dao/src/main/resources/dao-context.xml
- - which contains the Spring bean definitions for the
- repository implementations, the Spring-based SessionFactory
- definition (a LocalSessionFactoryBean) and the wiring of
- SessionFactories into Spring beans</para>
- </listitem>
-
- <listitem>
- <para>spring-hibernate-dao/src/main/resources/infrastructure.xml
- - which contains the definitions for the
- infrastructure-related Spring beans, namely: the data source
- to be used for the Hibernate SessionFactory and the
- transaction manager</para>
- </listitem>
- </itemizedlist>Separating the infrastructure context definition
- file from the rest of the bean definitions allows to swap the
- infrastructure definition for unit testing. For example, the
- Hibernate SessionFactory is configured to use JTA transactions, and
- allows the Session to shared with a layer of EJBs that delegate to
- it.</para>
- </informalexample></para>
- </section>
-
- <section>
- <title>The JPA implementation</title>
-
- <para>The JPA implementation is, in many respects, very similar to the
- Hibernate implementation, in that it provides a parametrized superclass
- that is Spring-agnostic. Besides the fact that it is using the JPA API -
- for example an EntityManager instead of the SessionFactory, the JPA
- Persistence Unit (and subsequent EntityManager) are created by the
- application server and not created by Spring (the EntityManager is
- injected by Spring, but acquired from JNDI). The persistence unit is
- deployed from within the JPA repository jar, in order to allow the
- spring-domain jar to be deployed in non-JPA scenarios (e.g. Hibernate)
- without triggering a persistence unit deployment.</para>
-
- <para>The Spring application context configuration fragments are very
- similar to the ones encountered in the Hibernate module:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>spring-jpa-dao/src/main/resources/dao-context.xml - contains
- the Spring bean definitions for the repository implementations,
- assuming an EntityManager bean to be defined in the global
- application context definition</para>
- </listitem>
-
- <listitem>
- <para>spring-jpa-dao/src/main/resources/infrastructure.xml - which
- contains the definitions for the infrastructure-related Spring
- beans, namely: the data source to be used for the Hibernate
- SessionFactory, and the transaction manager</para>
- </listitem>
- </itemizedlist></para>
- </section>
-
- <section>
- <title>Unit testing the repositories</title>
-
- <para>With the infrastructure so tied to the Application Server, how can
- we test the repositories in isolation, making sure that they work
- properly, before we even consider integrating them with the rest of the
- application?</para>
-
- <para>If at deployment time we will use the JBoss Application Server
- provided services, for testing we are going to use an embedded database,
- and Spring's ability to create LocalSessionFactories,
- LocalEntityManagerFactories and its local transaction management
- abilities.</para>
-
- <para>For this, we are going to use the spring-test-infrastructure
- module, which is a test-scoped dependency. This module contains the
- modules used for setting up an embedded database (producing a DataSource
- that can be injected into the LocalSessionFactoryBean and
- LocalContainerEntityManagerFactoryBean, respectively). The localized
- SessionFactory and EntityManager definitions are located in the
- spring-hibernate-dao and spring-jpa-dao modules, respectively.</para>
-
- <para>The unit tests that are located in the respective modules will use
- the local infrastructure files and the dao-context.xml files, as in the
- following example:</para>
-
- <informalexample>
- <para><programlisting lang="JAVA">@ContextConfiguration(locations = {"classpath:test-db-infrastructure.xml",
- "classpath:TEST-jpa-infrastructure.xml",
- "classpath:dao-context.xml"})
- at RunWith(SpringJUnit4ClassRunner.class)
-public class TestJpaAccountRepository
-{
- /* */
-}
-</programlisting>This configuration reuses the 'application-specific' context
- configuration fragment, as well as two specific context configuration
- fragments to create an Spring context in isolation. Thus, the
- functionality provided by the repositories can be tested outside the
- running application.</para>
- </informalexample>
- </section>
- </section>
-
- <section>
- <title>Service Layer</title>
-
- <para>On top of the domain and persistence layer sits the service layer of
- the application. Its role is to co-ordinate the domain objects and
- repositories in order to perform higher level operations. This is also the
- layer which provides transaction demarcation.</para>
-
- <para>In the Sportsclub application, there are two variants of
- implementing the service layer:</para>
-
- <itemizedlist>
- <listitem>
- <para>using Spring (Reservations, parts of Invoicing)</para>
- </listitem>
-
- <listitem>
- <para>using EJB (Subscriptions, Invoicing)</para>
- </listitem>
- </itemizedlist>
-
- <para><note>
- <para>It is possible to define transactions at the repository level,
- thus avoiding another indirection to the persistence layer for simple
- persistence operations (finding an object, persisting an
- object).</para>
- </note></para>
-
- <section>
- <title>The Spring-based service layer</title>
-
- <para>The Spring-based service layer exposes a number of service beans
- that can be consumed by the UI. The service beans are injected with the
- beans defined in the persistence layer.</para>
- </section>
-
- <section>
- <title>The EJB service layer</title>
-
- <para>A common scenario in Spring/EJB integration is the wrapping of
- Spring Beans in EJBs. This is very often done in order to get advantage
- of the services provided by the EJB container (security, declarative
- transaction management), while keeping some of the objects they
- collaborate with as simple POJOs. In this scenario, the EJBs form the
- outermost layer of the business logic, the one that is exposed to the
- rest of the application (UI). In this scenario, the EJB services are
- injected with the Spring-based repositories.</para>
-
- <para>JBoss has its own native support for Spring/EJB integration, in
- the form of the Spring Deployer and special annotations for injection of
- Spring beans into EJBs.</para>
-
- <simplesect>
- <title>The Spring Deployer</title>
-
- <para>The Spring Deployer is a JBoss-specific deployer that can be
- used to bootstrap a Spring ApplicationContext and register it into
- JNDI. The configuration files for bootstrapping the application
- context are defined at the EAR level, and the Spring
- ApplicationContext is shared to all the components. The definition
- file is simple, and just imports the contexts defined in the JPA
- jars.</para>
-
- <informalexample>
- <para><programlisting><beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <description>BeanFactory=(SpringDao)</description>
-
- <import resource="classpath*:dao-context.xml"/>
- <import resource="classpath*:infrastructure.xml"/>
-
-
-</beans></programlisting></para>
- </informalexample>
- </simplesect>
-
- <simplesect>
- <title>Injection into EJBs</title>
-
- <para>Once the ApplicationContext is created, the beans defined there
- can be injected into EJBs. So, in this case, the Spring repositories
- will be injected into EJBs as follows:</para>
-
- <para><informalexample>
- <para><programlisting>@Stateless
- at Interceptors(SpringLifecycleInterceptor.class)
- at LocalBinding(jndiBinding="sportsclub/BillingService")
-public class BillingServiceImpl implements BillingService
-{
- @Spring(bean = "invoiceRepository", jndiName = "SpringDao")
- private InvoiceRepository invoiceRepository;
-
- /* rest of the class definition ommitted */
-}</programlisting></para>
- </informalexample>The injection task is undertaken by the
- SpringLifecycleInterceptor. Once it encounters a field or setter
- annotated with @Spring, it will look for the JNDI-bound application
- context and inject the corresponding Spring bean.</para>
- </simplesect>
- </section>
- </section>
-
- <section>
- <title>Presentation Layer</title>
-
- <para>The three web applications which compose the Sportsclub package
- illustrate different ways of integrating Spring and Java EE technologies
- in the presentation layer:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>JSF/EJB with an underlying Spring layer (Subscriptions)</para>
- </listitem>
-
- <listitem>
- <para>JSF/Spring (Reservations)</para>
- </listitem>
-
- <listitem>
- <para>Spring MVC/EJB (Invoicing)</para>
- </listitem>
- </itemizedlist></para>
-
- <section>
- <title>Subscriptions: JSF and Spring</title>
-
- <para>The Subscriptions application uses Richfaces and JSF for the
- presentation layer and EJB for the business layer, so this part of the
- application is not Spring-related. The only Spring-related feature at
- this level is the fact that the repositories used by the EJBs are Spring
- beans.</para>
-
- <para>Although this is somewhat out of the Spring topic, it is worth
- mentioning for the benefit of the reader that we recommend using Seam
- for building applications that integrate JSF and EJB in Java EE 5. This
- type of integration is, however, beyond the scope of the current demo
- application, so we are mentioning it here, although this example is not
- demonstrating it.</para>
- </section>
-
- <section>
- <title>Reservations: JSF/Spring integration</title>
-
- <para>The Reservations application is an example of using Spring in an
- application that uses Richfaces and JSF. Here, Spring beans are used as
- business services for the application, as well as backing beans for the
- JSF pages. In the latter case, Spring beans replace the managed beans
- and other web artifacts used by JSF.</para>
-
- <para>The Spring application context is bootstrapped by the
- ContextLoaderListener defined in /WEB-INF/web.xml. The Spring
- configuration file in use is /WEB-INF/spring-beans.xml, which:</para>
-
- <itemizedlist>
- <listitem>
- <para>imports the context definition fragments included in the other
- JARs of the application (i.e. the JARs that contain the business
- logic, defined at 4.1)</para>
- </listitem>
-
- <listitem>
- <para>defines a number of Spring beans that are used directly in the
- web tier by the JSF pages or by the Richfaces components;</para>
- </listitem>
- </itemizedlist>
-
- <para>The Spring configuration file imports the Spring business beans
- and infrastructure definitions as follows:</para>
-
- <informalexample>
- <para><programlisting><import resource="classpath*:reservations-service.xml"/>
-
-<import resource="classpath*:infrastructure.xml"/></programlisting></para>
-
- <para>The following bean is used for backing JSF pages. Please note
- that Spring beans defined in the web layer may use scopes, and a
- significant number of the Spring beans used in Reservations
- application are session-scoped (like the one in the following
- example). Spring provides a request scope as well, but it is not used
- in this example.</para>
-
- <programlisting><bean id="reservationCreate" class="org.jboss.snowdrop.samples.sportsclub.jsf.beans.ReservationCreate" scope="session" init-method="init">
- <property name="reservationService" ref="reservationService"/>
- <property name="accountService" ref="accountService"/>
- <property name="accountFilter" ref="accountFilterCreate"/>
- <property name="equipmentFilter" ref="equipmentFilterCreate"/>
-</bean></programlisting>
-
- <informalexample>
- <para>In order to be make the Spring beans visible to JSF pages, a
- special VariableResolver has to be defined in
- /WEB-INF/faces-config.xml.</para>
-
- <informalexample>
- <para><programlisting><application>
- <!-- other definitions -->
- <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
-</application></programlisting>Now, we can use the Spring bean defined
- above directly in a JSF page, as in the following excerpt from
- createReservation.xhtml:</para>
-
- <informalexample>
- <para><programlisting><rich:panel>
- <f:facet name="header">Select Account</f:facet>
- <h:form id="AccountSelectForm">
- <rich:extendedDataTable id="accountsTable" value="#{accountFilterCreate}" var="account"
- selectionMode="single"
- selection="#{accountFilterCreate.selection}"
- enableContextMenu="true"
- height="250px"
- rows="5">
- <a4j:support event="onselectionchange"
- action="#{reservationCreate.updateSelectedAccount}"
- reRender="reservationDetails"/>
-
- <rich:column label="Id" width="7%">
- <f:facet name="header">
- <h:outputText value="Id"/>
- </f:facet>
- <h:outputText value="#{account.id}"/>
- </rich:column>
-
- <rich:column label="First Name">
- <f:facet name="header">
- <h:outputText value="First Name"/>
- </f:facet>
- <h:outputText value="#{account.subscriber.name.firstName}"/>
- </rich:column>
-
- <rich:column label="Last Name">
- <f:facet name="header">
- <h:outputText value="Last Name"/>
- </f:facet>
- <h:outputText value="#{account.subscriber.name.lastName}"/>
- </rich:column>
-
- <rich:column label="City">
- <f:facet name="header">
- <h:outputText value="City"/>
- </f:facet>
- <h:outputText value="#{account.subscriber.address.city}"/>
- </rich:column>
-
- <rich:column label="Country">
- <f:facet name="header">
- <h:outputText value="Country"/>
- </f:facet>
- <h:outputText value="#{account.subscriber.address.country}"/>
- </rich:column>
-
- <f:facet name="footer">
- <rich:datascroller id="scrollerAccount" for="accountsTable" maxPages="5"
- page="#{accountFilterCreate.currentPage}"/>
- </f:facet>
- </rich:extendedDataTable>
- </h:form>
- </rich:panel></programlisting>All the EL variables
- that are used in the previous example, including the ones
- referenced in the Richfaces elements are, in fact, Spring beans.
- They can be used either as backing beans for retrieving and
- setting values, as well as for invoking methods corresponding to
- JSF events.</para>
- </informalexample>
- </informalexample>
- </informalexample>
- </informalexample>
- </section>
-
- <section>
- <title>Invoicing: Spring MVC and EJB</title>
-
- <para>The Invoicing application provides another example of
- interoperability between Spring and the Java EE services provided by
- JBoss. If in the previous example, the business tier was implemented
- using Spring and the web tier was using JSF, in this example the roles
- are reversed: the business tier is using EJB and the web tier is using
- Spring.</para>
-
- <para>The Spring MVC beans are defined in the
- /WEB-INF/spring-servlet-context.xml file, referenced by the Spring MVC
- DispatcherServlet definition that is described WEB-INF/web.xml. For this
- implementation, we have chosen the Spring 2.5 annotation-based
- configuration, and the AccountController class that implements the
- controller part of the configuration is injected with EJBs defined in
- section 3.2:</para>
-
- <para><informalexample>
- <para><programlisting>@Controller
-public class AccountController
-{
-
- @EJB(mappedName = "sportsclub/BillingService")
- BillingService billingService;
-
- @EJB(mappedName = "sportsclub/SubscriptionService")
- SubscriptionService subscriptionService;
-
- /* some code ommitted */
-
- @RequestMapping(value = "/accountDetail.do", method = RequestMethod.GET)
- ModelMap getAccountDetail(@RequestParam("id") String id)
- {
- Account account = subscriptionService.findAccountById(Long.parseLong(id));
-
- List<Invoice> invoices = billingService.getInvoices(account);
-
- boolean hasCurrentInvoice = false;
- Date currentDate = new Date();
-
- for (Invoice invoice: invoices)
- {
- if (invoice.getBillingPeriod().contains(currentDate))
- {
- hasCurrentInvoice = true;
- break;
- }
- }
-
- List<Payment> payments = billingService.getPayments(account);
-
- ModelMap model = new ModelMap();
- model.addAttribute(account);
- model.addAttribute("invoices", invoices);
- model.addAttribute("payments", payments);
- model.addAttribute("hasCurrentInvoice",hasCurrentInvoice);
- return model;
- }
-
-
- @RequestMapping(value = "/generateInvoice.do", method = RequestMethod.POST)
- ModelMap generateInvoice(@RequestParam("id") String id)
- {
- Account account = subscriptionService.findAccountById(Long.parseLong(id));
- Invoice invoice = billingService.generateInvoice(account);
-
- ModelMap model = new ModelMap();
- model.addAttribute("id",id);
- model.addAttribute(invoice);
- return model;
- }
-
-}
-</programlisting>The @Controller annotation will be detected by Spring, as it
- does a scanning of the classpath which is prompted by including the
- following line into /WEB-INF/spring-servlet-context.xml.</para>
-
- <informalexample>
- <para><programlisting><context:component-scan base-package="org.jboss.snowdrop.samples.sportsclub.springmvc"/>
-</programlisting></para>
- </informalexample>
- </informalexample></para>
-
- <para>As a Spring-managed object, the bean is injected with the EJBs
- BillingService and SubscriptionService, as required by annotated the
- respective fields with the @EJB annotation.</para>
-
- <para>The @RequestMapping-annotated methods will be executed when the
- user is accessing the specified URL and HTTP method. The request
- parameters will be bound to method arguments. In the example above,
- invoking the URL
- http://localhost:8080/sportsclub/invoicing/accountDetail.do?id=1 will
- cause the invocation accountController.getAccountDetail(1). The method
- will invoke the appropriate business services (in this case, exposed as
- EJBs) and will return a map of business object collections, indexed by
- their names. Spring MVC will take care of setting them on the request,
- so that they can be used for rendering the response.</para>
-
- <para>By default, Spring MVC will try to find a view whose name is
- 'accountDetail', and based on the view resolver definition from
- /WEB-INF/spring-servlet-context.xml, it will use the JSP file at
- /WEB-INF/jsp/accountDetail.jsp. This JSP uses the Spring tag libraries
- for form processing, so that the collections previously returned will be
- accessible using JSTL expressions, and furthermore, we will find the
- following declaration:</para>
-
- <informalexample>
- <programlisting><form:form action="generateInvoice.do">
- This account does not have an invoice for the current billing period.<p/>
- You can create one now:
- <input type="hidden" name="id" value="<c:out value="${account.id}"/>">
- <input type="submit" value="Create invoice"/><br/>
- </form:form></programlisting>
- </informalexample>
-
- <para>Clicking the 'Create Invoice' button will result in a POST
- submission to
- http://localhost:8080/sportsclub/invoicing/generateInvoice.do?id=1 and
- the subsequent invocation of the generateInvoice method.</para>
-
- <para>A small note here: in order to be able to demonstrate a few
- Spring/JBoss integration features, the Invoicing application also
- contains a number of business services that are using Spring. They do
- not play any role in the Spring MVC/EJB integration, and we will discuss
- more about them in section 6.</para>
- </section>
-
- <section>
- <title>A problem of reusing content</title>
-
- <para>Having three different web applications to be included in the same
- package raises the problem of reusing some content. Surely, the images
- and stylesheets that are part of the application design can be copied in
- each individual project, but this raises the problem of maintainability.
- Therefore, most of the static content used by the Sportsclub application
- is defined in a separate web module, sportsclub-staticwebcontent, which
- is then included by Maven at build time as follows:</para>
-
- <para><informalexample>
- <para><programlisting><dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-staticwebcontent</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <scope>runtime</scope>
-</dependency></programlisting><note>
- <para>When working in an IDE this might produce an undesirable
- side-effect. If the IDE does not know how to apply Maven
- overlays correctly, the static content may not be available when
- building and deploying the application through the IDE, without
- Maven. This does not affect the general functionality of the
- application but may affect the look and feel in that particular
- situation. However, if the application is build using Maven,
- this will not be a problem.</para>
- </note></para>
- </informalexample></para>
- </section>
- </section>
-
- <section>
- <title>Enterprise Integration Features</title>
-
- <para>Apart from the Spring/JSF/EJB integration, which you have seen in
- the previous sections, the Sportsclub application suite provides a few
- other examples of integrating Spring and JBoss. Since all the features are
- Spring-based, they have been included as business services of the
- Invoicing web application. All the definitions for the following examples
- can be found in the /WEB-INF/spring-business-context.xml file defined in
- the spring-invoicing-webmvc module.</para>
-
- <section>
- <title>Payment processing: JMS integration through JCA</title>
-
- <para>Besides displaying the current status of invoices and payments for
- a given account and generating invoices through the web interface, the
- Sportsclub application can also process payments for various accounts.
- The assumption of this scenario is that the system can receive payment
- notifications asynchronously, through a JMS queue. Once such a payment
- has been received, it can be processed by a message-driven component,
- which in our case is a Spring bean. In order to take full advantage of
- the managed environment provided by the application server, the Spring
- bean will be invoked in a JCA context.</para>
-
- <para>The component that processes JMS messages is a POJO:</para>
-
- <para><informalexample>
- <para><programlisting>@Component
-public class PaymentNotificationProcessor
-{
-
- @Autowired
- private PaymentProcessor paymentProcessor;
-
- public void processPaymentNotification(PaymentNotification paymentNotification)
- {
- paymentProcessor.processPayment(paymentNotification.getAccountNumber(), paymentNotification.getAmount());
- }
-
-}</programlisting></para>
- </informalexample></para>
-
- <para>It delegates the actual processing of a PaymentNotification to a
- different component, the PaymentProcessor, which is injected in the
- PaymentNotificationProcessor. This is done in order to maintain a degree
- of separation between the way data may be represented when exchanged
- over the messaging system (i.e. encapsulated in a PaymentNotification
- object), and the contract of the internal component which actually does
- the processing. The PaymentProcessor instance injected into the
- PaymentNotificationProcessor is, in fact, reused by the
- PaymentNotificationService web service implementation (whose contract
- does not depend on the PaymentNotification entity). </para>
-
- <para>Spring will instantiate a bean named
- "paymentNotificationProcessor" which will be registered as a processor
- for JMS message as follows:</para>
- </section>
-
- <section>
- <title>Aspects and auditing</title>
-
- <para>Payments must be audited. Besides keeping a record of payments
- associated with an account, we may want to set up an auditing service
- that will audit every attempt of making a payment. In the simplest case
- we can just log that information, although in a real life scenario
- things may be more sophisticated. In order to do so, we set up a
- PaymentAuditor aspect that intercepts every call made to the
- PaymentProcessor.</para>
-
- <para>The aspect is a simple POJO:</para>
-
- <para><informalexample>
- <para><programlisting>public class PaymentAuditor
-{
- /* code ommitted */
-
- public void auditPayment(Long accountId, BigDecimal amount)
- {
- System.out.println("AUDIT ENABLED! A payment has been made to account "
- + accountId + " for the amount of " + amount);
- }
-}</programlisting></para>
- </informalexample>The aspect is applied through the following
- definitions:</para>
-
- <informalexample>
- <para><programlisting> <aop:config>
- <aop:aspect ref="paymentAuditor">
- <aop:pointcut id="processingPayment"
- expression="execution(* *..PaymentProcessor+.*(..)) &amp;&amp; args(accountId, amount)"/>
- <aop:before arg-names="accountId, amount" pointcut-ref="processingPayment" method="auditPayment"/>
- </aop:aspect>
- </aop:config>
-
- <bean id="paymentAuditor" class="org.jboss.snowdrop.samples.sportsclub.audit.PaymentAuditor"/>
-
-</programlisting>As you can see, the aspect is defined as a bean and applied
- as an aspect through the Spring aop namespace. The pointcut definition
- is an AspectJ expression.</para>
- </informalexample>
- </section>
-
- <section>
- <title>Configuring Spring beans through JMX</title>
-
- <para>JMX is a very important tool for monitoring and configuring Java
- applications. Collecting information about the system and the ability of
- making configuration at runtime are important administration features.
- For this example, the requirement is to be able to turn auditing on and
- off, at runtime, whenever required. Removing an aspect once it has been
- applied by Spring is not possible, so the solution in this case is to
- define a flag property on the aspect, which controls whether the
- auditing functionality will be invoked or not.</para>
-
- <para>In order to be able to make changes at runtime, the Spring bean
- which implements the aspect will be configured as a JMX bean and
- registered in the MBean server of JBoss. In this example, we are using
- annotations to define Spring-specific JMX metadata. The complete
- definition for the PaymentAuditor is:</para>
-
- <para><informalexample>
- <para><programlisting>@ManagedResource(objectName = "sportsclub:name=paymentAuditor", description = "Payment Auditor", logFile = "log-sportsclub-auditor-jmx.log")
- at Component
-public class PaymentAuditor
-{
- private boolean enabled = true;
-
- @ManagedAttribute
- public void setEnabled(boolean enabled)
- {
- this.enabled = enabled;
- }
-
- @ManagedAttribute
- public boolean getEnabled()
- {
- return this.enabled;
- }
-
- public void auditPayment(Long accountId, BigDecimal amount)
- {
- if (this.enabled)
- {
- System.out.println("AUDIT ENABLED! A payment has been made to account " + accountId + " for the amount of " + amount);
- }
- else
- {
- System.out.println("AUDIT DISABLED!");
- }
- }
-}</programlisting>The annotations ManagedResource and ManagedAttribute are
- using to indicate what classes and properties are JMX-managed. In
- order to expose the bean through JMX, it must be exported using
- Spring's MBean Exporter.</para>
-
- <para><programlisting><bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>
-
- <bean class="org.springframework.jmx.export.MBeanExporter">
- <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER"/>
- <property name="ensureUniqueRuntimeObjectNames" value="true"/>
- <property name="namingStrategy">
- <bean class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
- <property name="attributeSource" ref="attributeSource"/>
- </bean>
- </property>
- <property name="assembler">
- <bean class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
- <property name="attributeSource" ref="attributeSource"/>
- </bean>
- </property>
- </bean></programlisting></para>
- </informalexample></para>
-
- <para>As a result, you can turn this functionality on and off directly
- from the JBoss AS JMX administration console.</para>
- </section>
-
- <section>
- <title>Payment processing: exposing a JAX-WS web service</title>
-
- <para>Another way of interacting with external applications, is by
- exposing a web service. In this scenario, payment notifications may not
- arrive only as asynchronous events on a message queue, but also as
- synchronous web service invocations. For this purpose, the application
- will expose a Spring bean with JAX-WS annotations as a web
- service.</para>
-
- <para>To that end, a JAX-WS annotated class is provided by the
- application:</para>
-
- <informalexample>
- <para><programlisting>@WebService
-public class PaymentNotificationService extends SpringBeanAutowiringSupport
-{
-
- @Autowired
- private PaymentProcessor paymentProcessor;
-
- @WebMethod
- public Long notifyPayment(Long accountNumber, BigDecimal amount)
- {
- return paymentProcessor.processPayment(accountNumber, amount);
- }
-
-}</programlisting>By extending SpringBeanAutowiringSupport, the class
- PaymentNotificationService will be injected automatically with the
- same PaymentProcessor instance that is used by the JMS notification
- processor, and defined in the application context created from
- WEB-INF/spring-business-context.xml. This is necessary, because no
- bean of the type PaymentNotificationService is defined in the
- application context. Instead, the web service is defined and mapped as
- a servlet in /WEB-INF/web.xml:</para>
-
- <para><programlisting><servlet>
- <servlet-name>PaymentNotificationService</servlet-name>
- <servlet-class>org.jboss.snowdrop.samples.sportsclub.ws.PaymentNotificationService</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>PaymentNotificationService</servlet-name>
- <url-pattern>/ws/payment</url-pattern>
- </servlet-mapping></programlisting>As a result, the a JAX-WS web
- service can be accessed at http://localhost:8080/ws/payment.</para>
- </informalexample>
- </section>
- </section>
-</chapter>
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Modules.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/Modules.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,1137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
+%BOOK_ENTITIES;
+]>
+<chapter id="chap-guide-modules">
+ <title>Using JBoss and Spring together</title>
+
+ <para>This chapter will describe the various Spring and JBoss integration
+ use cases covered by the application and how are they implemented in the
+ various application modules.</para>
+
+ <para>As a Spring application that consists of multiple modules, the main
+ strategy of constructing the global Spring configuration is to provide
+ Spring bean definition fragments in each artifact produced by a module,
+ leaving to the upper layer components to aggregate them by importing. This
+ strategy has multiple benefits: for one, it allows to separate concerns
+ between components - the Spring wiring of certain components is left at the
+ level where the components are defined, so that it can be changed easily if
+ the implementations change.</para>
+
+ <section>
+ <title>A look at the JBoss/Spring integration use cases</title>
+
+ <para>The Sportsclub application covers a number of JBoss and Spring
+ integration use cases. The scenarios selected for this example are
+ focusing on using the Java EE 5 services provided by JBoss AS in Spring
+ applications.</para>
+
+ <para>The use cases can be grouped in categories as follows:<table>
+ <title>Use case list overview</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry align="center">Category</entry>
+
+ <entry align="center">Use case</entry>
+
+ <entry align="center">How does this involve JBoss AS</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Persistence</entry>
+
+ <entry>Spring/Hibernate integration</entry>
+
+ <entry>The application is using a Spring-configured Hibernate
+ SessionFactory using JTA transaction management and bound to
+ JTA. The Hibernate library being used is the one provided by
+ JBoss AS.</entry>
+ </row>
+
+ <row>
+ <entry></entry>
+
+ <entry>Spring/JPA integration</entry>
+
+ <entry>The Persistence Unit is deployed by JBoss and retrieved
+ from JNDI to be injected into Spring beans. PersistenceContext
+ is shared with surrounding EJBs (if any)</entry>
+ </row>
+
+ <row>
+ <entry>Testing</entry>
+
+ <entry>Unit-testing components that have managed infrastructure
+ dependencies</entry>
+
+ <entry>The DataSource and EntityManager are managed by JBoss and
+ acquired from JNDI by Spring when the application is running. In
+ the case of JBoss, developers can test their code in isolation
+ using Spring-specific replacements that 'simulate' the JBoss
+ environment.</entry>
+ </row>
+
+ <row>
+ <entry>Business Logic</entry>
+
+ <entry>Spring-based service beans</entry>
+
+ <entry>The business services are Spring-managed and wrapped into
+ transactions managed by Spring's interceptors. The
+ TransactionManager in use is the JTATransactionManager using
+ JBoss Transactions provided in JBoss AS.</entry>
+ </row>
+
+ <row>
+ <entry></entry>
+
+ <entry>EJBs injected with Spring Beans</entry>
+
+ <entry>The application uses JBoss-deployed EJBs which are
+ injected with Spring beans acquired from an application context
+ bootstrapped by the Spring Deployer. Transactions are managed by
+ EJBs.</entry>
+ </row>
+
+ <row>
+ <entry>User Interface</entry>
+
+ <entry>JSF/Richfaces and Spring integration</entry>
+
+ <entry>The application uses the JBoss AS-provided JSF support,
+ and Richfaces components. The business services and UI-backing
+ instances are Spring beans.</entry>
+ </row>
+
+ <row>
+ <entry></entry>
+
+ <entry>Spring MVC and EJB integration</entry>
+
+ <entry>The application uses Spring MVC and the business logic is
+ implemented using JBoss-deployed EJBs, which are injected into
+ the Spring controllers.</entry>
+ </row>
+
+ <row>
+ <entry>JMS/JCA integration</entry>
+
+ <entry>JMS/Spring integration using JCA</entry>
+
+ <entry>Spring-configured message listeners are used for
+ processing JMS messages from JBoss AS-managed destinations. The
+ application uses the Spring /JCA integration for receiving
+ messages.</entry>
+ </row>
+
+ <row>
+ <entry>Aspect-oriented programming</entry>
+
+ <entry>Spring-based weaving of POJO aspects</entry>
+
+ <entry>This use case does not have any JBoss AS-specific
+ functionality.</entry>
+ </row>
+
+ <row>
+ <entry>JMX</entry>
+
+ <entry>Spring beans are exposed as JMX beans</entry>
+
+ <entry>The JBoss AS MBean Server is used for registering the
+ Spring-exported JMX beans. Consequently, the Spring beans can be
+ managed from the JBoss AS Administration Console.</entry>
+ </row>
+
+ <row>
+ <entry>Web Services</entry>
+
+ <entry>JAX-WS defined web-services are injected with Spring
+ beans</entry>
+
+ <entry>The application uses JBoss AS' support for JAX-WS through
+ JBoss WS, but also Spring to define the underlying business
+ logic, which is injected into the JBoss WS-deployed
+ services.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+ </section>
+
+ <section>
+ <title>The domain model</title>
+
+ <para>The sportsclub-domain module is the only module of the application
+ that does not integrate with Spring directly. However, it is used further
+ in the application as it provides:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>the entities that the application will interact with;</para>
+ </listitem>
+
+ <listitem>
+ <para>the repository interfaces that provide persistence services
+ for the application;</para>
+ </listitem>
+ </itemizedlist>A relevant note regarding the domain module is the use of
+ the term "repository" for the components that are used for retrieving
+ objects from persistence and saving them. The intent behind that is to
+ indicate that the design of the application is emulating the concepts
+ behind Domain-Driven Design, where the objects that are used for providing
+ the persistence and entity lookup functions are part of the domain, rather
+ than simple persistence implementation strategies (as it is the case with
+ the fairly similar Data Access Objects).</para>
+
+ <figure>
+ <title>Domain entities of the application and their connections</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/domain-entities.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Figure 3.1 shows the domain entities of the application. A few
+ non-entity domain objects have been ommitted from the diagram. Figure 3.2
+ shows a more detailed overview of the entities involved in the
+ Account/Person relationshiop, including the non-entity domain
+ objects.</para>
+
+ <para><figure>
+ <title>The Account and Person entities</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/account-person.png" />
+ </imageobject>
+ </mediaobject>
+ </figure></para>
+ </section>
+
+ <section>
+ <title>Persistence implementation: JPA and Hibernate</title>
+
+ <para>The persistence modules: sportsclub-hibernate-dao and
+ sportsclub-jpa-dao are alternative implementations of the application's
+ persistence strategy. This means that each module will provide:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>implementations for the repository interfaces defined in the
+ sportsclub-domain module;</para>
+ </listitem>
+
+ <listitem>
+ <para>Spring context definition fragments that can be reused
+ elsewhere in the application</para>
+ </listitem>
+ </itemizedlist>Effectively, the Spring configuration fragments will
+ expose a bean implementation for each repository interface defined in the
+ model. This means that the implementations can be swapped at build-time
+ without any change in the business layer. This is the basis for the build
+ process creating two different builds, each based on a different
+ persistence implementation - including a different repository
+ implementation jar and leaving everyting else in the component stack
+ unchanged.</para>
+
+ <para>Each module produces a set of beans that can be injected further
+ into the business services of the application.</para>
+
+ <section>
+ <title>The Hibernate implementation</title>
+
+ <para>The Hibernate-based repository implementation defines a generic
+ superclass defining all the common repository operations that that
+ repository implementations will parametrize by specifying the entity
+ type and primary key type.<informalexample>
+ <para><programlisting lang="JAVA" language="JAVA">public abstract class HibernateRepository<T, I extends Serializable> implements Repository<T, I>
+{
+ protected SessionFactory sessionFactory;
+
+ Class<T> clazz;
+
+ public HibernateRepository(Class<T> clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory)
+ {
+ this.sessionFactory = sessionFactory;
+ }
+
+ protected Session getCurrentSession()
+ {
+ return this.sessionFactory.getCurrentSession();
+ }
+
+ public T findById(I id)
+ {
+ return (T)getCurrentSession().get(clazz, id);
+ }
+
+ public void save(T object)
+ {
+ getCurrentSession().saveOrUpdate(object);
+ }
+
+ public void delete(T object)
+ {
+ getCurrentSession().delete(object);
+ }
+
+ public List<T> findAll()
+ {
+ return getCurrentSession().createCriteria(clazz).list();
+ }
+
+
+ public long countAll()
+ {
+ return (Integer)getCurrentSession().createCriteria(clazz).setProjection(Projections.count("id")).uniqueResult();
+ }
+
+ public Criteria applyRange(Criteria criteria, Range range)
+ {
+ return criteria.setFirstResult(range.getMinIndex()).setMaxResults(range.length());
+ }
+}</programlisting>It is important to notice that this implementation and its
+ subclasses are not Spring-based.</para>
+ </informalexample></para>
+
+ <para><informalexample>
+ <para>The only Spring-related component of this module is the
+ configuration which consists of two files:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>spring-hibernate-dao/src/main/resources/dao-context.xml
+ - which contains the Spring bean definitions for the
+ repository implementations, the Spring-based SessionFactory
+ definition (a LocalSessionFactoryBean) and the wiring of
+ SessionFactories into Spring beans</para>
+ </listitem>
+
+ <listitem>
+ <para>spring-hibernate-dao/src/main/resources/infrastructure.xml
+ - which contains the definitions for the
+ infrastructure-related Spring beans, namely: the data source
+ to be used for the Hibernate SessionFactory and the
+ transaction manager</para>
+ </listitem>
+ </itemizedlist>Separating the infrastructure context definition
+ file from the rest of the bean definitions allows to swap the
+ infrastructure definition for unit testing. For example, the
+ Hibernate SessionFactory is configured to use JTA transactions, and
+ allows the Session to shared with a layer of EJBs that delegate to
+ it.</para>
+ </informalexample></para>
+ </section>
+
+ <section>
+ <title>The JPA implementation</title>
+
+ <para>The JPA implementation is, in many respects, very similar to the
+ Hibernate implementation (therefore we won't provide a code example for
+ it). It provides a parametrized superclass that is Spring-agnostic as
+ well (except for the usage of the autowiring annotation - which can be
+ replaced by a simple setter if any reference to Spring needs to be
+ removed). Besides the fact that it is using the JPA API - for example an
+ EntityManager instead of the SessionFactory, the JPA Persistence Unit
+ (and subsequent EntityManager) are created by the application server and
+ not created by Spring (the EntityManager is injected by Spring, but
+ acquired from JNDI). The persistence unit is deployed from within the
+ JPA repository jar, in order to allow the spring-domain jar to be
+ deployed in non-JPA scenarios (e.g. Hibernate) without triggering a
+ persistence unit deployment.</para>
+
+ <para>The Spring application context configuration fragments are very
+ similar to the ones encountered in the Hibernate module:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>spring-jpa-dao/src/main/resources/dao-context.xml - contains
+ the Spring bean definitions for the repository implementations,
+ assuming an EntityManager bean to be defined in the global
+ application context definition</para>
+ </listitem>
+
+ <listitem>
+ <para>spring-jpa-dao/src/main/resources/infrastructure.xml - which
+ contains the definitions for the infrastructure-related Spring
+ beans, namely: the data source to be used for the Hibernate
+ SessionFactory, and the transaction manager</para>
+ </listitem>
+ </itemizedlist></para>
+ </section>
+
+ <section>
+ <title>Unit testing the repositories</title>
+
+ <para>With the infrastructure so tied to the Application Server, how can
+ we test the repositories in isolation, making sure that they work
+ properly, before we even consider integrating them with the rest of the
+ application?</para>
+
+ <para>If at deployment time we will use the JBoss Application Server
+ provided services, for testing we are going to use an embedded database,
+ and Spring's ability to create LocalSessionFactories,
+ LocalEntityManagerFactories and its local transaction management
+ abilities.</para>
+
+ <para>For this, we are going to use the spring-test-infrastructure
+ module, which is a test-scoped dependency. This module contains the
+ modules used for setting up an embedded database (producing a DataSource
+ that can be injected into the LocalSessionFactoryBean and
+ LocalContainerEntityManagerFactoryBean, respectively). The localized
+ SessionFactory and EntityManager definitions are located in the
+ spring-hibernate-dao and spring-jpa-dao modules, respectively.</para>
+
+ <para>The unit tests that are located in the respective modules will use
+ the local infrastructure files and the dao-context.xml files, as in the
+ following example:</para>
+
+ <informalexample>
+ <para><programlisting lang="JAVA">@ContextConfiguration(locations = {"classpath:test-db-infrastructure.xml",
+ "classpath:TEST-jpa-infrastructure.xml",
+ "classpath:dao-context.xml"})
+ at RunWith(SpringJUnit4ClassRunner.class)
+public class TestJpaAccountRepository
+{
+ /* */
+}
+</programlisting>This configuration reuses the 'application-specific' context
+ configuration fragment, as well as two test-specific (or otherwise
+ said local) context configuration fragments in order tos to create a
+ Spring context in isolation. Thus, the functionality provided by the
+ repositories can be tested outside the running application.</para>
+ </informalexample>
+ </section>
+ </section>
+
+ <section>
+ <title>Service Layer</title>
+
+ <para>On top of the domain and persistence layer sits the service layer of
+ the application. Its role is to co-ordinate the domain objects and
+ repositories in order to perform higher level operations. This is also the
+ layer which provides transaction demarcation. One consideration for which
+ transaction demarcation should be done at service level is to ensure that
+ the changes made by service operations are atomic. Otherwise, concurrent
+ operations may leave the application data in an inconsistent state.
+ Demarcating transactions at the repository/DAO level should be done
+ carefully, taking into consideration that multiple repository/DAO
+ invocations that are not surrounded by a wrapping transactions will
+ execute in separate transactional contexts.</para>
+
+ <para>In the Sportsclub application, there are two variants of
+ implementing the service layer:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>using Spring (Reservations, parts of Invoicing)</para>
+ </listitem>
+
+ <listitem>
+ <para>using EJB (Subscriptions, Invoicing)</para>
+ </listitem>
+ </itemizedlist>
+
+ <para><note>
+ <para>It is possible to define transactions at the repository level,
+ thus avoiding another indirection to the persistence layer for simple
+ persistence operations (finding an object, persisting an
+ object).</para>
+ </note></para>
+
+ <section>
+ <title>The Spring-based service layer</title>
+
+ <para>The Spring-based service layer exposes a number of service beans
+ that can be consumed by the UI, which are injected with the beans
+ defined in the persistence layer. Given how this is a fairly
+ straightforward Spring configuration, we will non insist any more on
+ this topic, except for outlining that this is the level where
+ transaction demarcation is provided by the use of the appropriate Spring
+ annotations. </para>
+ </section>
+
+ <section>
+ <title>The EJB service layer</title>
+
+ <para>A common scenario in Spring/EJB integration is the wrapping of
+ Spring Beans in EJBs. This is very often done in order to get advantage
+ of the services provided by the EJB container (security, declarative
+ transaction management), while keeping some of the objects they
+ collaborate with as simple POJOs. In this scenario, the EJBs form the
+ outermost layer of the business logic, the one that is exposed to the
+ rest of the application (UI). In this scenario, the EJB services are
+ injected with the Spring-based repositories.</para>
+
+ <para>JBoss has its own native support for Spring/EJB integration, in
+ the form of the Spring Deployer and special annotations for injection of
+ Spring beans into EJBs.</para>
+
+ <simplesect>
+ <title>The Spring Deployer</title>
+
+ <para>The Spring Deployer is a JBoss-specific deployer that can be
+ used to bootstrap a Spring ApplicationContext and register it into
+ JNDI. The configuration files for bootstrapping the application
+ context are defined at the EAR level, and the Spring
+ ApplicationContext is shared to all the components. The definition
+ file is simple, and just imports the contexts defined in the JPA
+ jars.</para>
+
+ <informalexample>
+ <para><programlisting><beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <description>BeanFactory=(SpringDao)</description>
+
+ <import resource="classpath*:dao-context.xml"/>
+ <import resource="classpath*:infrastructure.xml"/>
+
+
+</beans></programlisting></para>
+ </informalexample>
+ </simplesect>
+
+ <simplesect>
+ <title>Injection into EJBs</title>
+
+ <para>Once the ApplicationContext is created, the beans defined there
+ can be injected into EJBs. So, in this case, the Spring repositories
+ will be injected into EJBs as follows:</para>
+
+ <para><informalexample>
+ <para><programlisting>@Stateless
+ at Interceptors(SpringLifecycleInterceptor.class)
+ at LocalBinding(jndiBinding="sportsclub/BillingService")
+public class BillingServiceImpl implements BillingService
+{
+ @Spring(bean = "invoiceRepository", jndiName = "SpringDao")
+ private InvoiceRepository invoiceRepository;
+
+ /* rest of the class definition ommitted */
+}</programlisting></para>
+ </informalexample>The injection task is undertaken by the
+ SpringLifecycleInterceptor. Once it encounters a field or setter
+ annotated with @Spring, it will look for the JNDI-bound application
+ context and inject the corresponding Spring bean.</para>
+ </simplesect>
+ </section>
+ </section>
+
+ <section>
+ <title>Presentation Layer</title>
+
+ <para>The three web applications which compose the Sportsclub package
+ illustrate different ways of integrating Spring and Java EE technologies
+ in the presentation layer:</para>
+
+ <para><itemizedlist>
+ <listitem>
+ <para>JSF/EJB with an underlying Spring layer (Subscriptions)</para>
+ </listitem>
+
+ <listitem>
+ <para>JSF/Spring (Reservations)</para>
+ </listitem>
+
+ <listitem>
+ <para>Spring MVC/EJB (Invoicing)</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <section>
+ <title>Subscriptions: JSF and Spring</title>
+
+ <para>The Subscriptions application uses Richfaces and JSF for the
+ presentation layer and EJB for the business layer, so this part of the
+ application is not Spring-related. </para>
+
+ <para>Although this is somewhat out of the Spring topic, it is worth
+ mentioning for the benefit of the reader that we recommend using Seam
+ for building applications that integrate JSF and EJB in Java EE 5. This
+ type of integration is, however, beyond the scope of the current demo
+ application, so this example is not demonstrating it. Please consult the
+ Seam documentation for detai.</para>
+ </section>
+
+ <section>
+ <title>Reservations: JSF/Spring integration</title>
+
+ <para>The Reservations application is an example of using Spring in an
+ application that uses Richfaces and JSF. Here, Spring beans are used as
+ business services for the application, as well as backing beans for the
+ JSF pages. In the latter case, Spring beans replace the managed beans
+ and other web artifacts used by JSF.</para>
+
+ <para>The Spring application context is bootstrapped by the
+ ContextLoaderListener defined in /WEB-INF/web.xml. The Spring
+ configuration file in use is /WEB-INF/spring-beans.xml, which:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>imports the context definition fragments included in the other
+ JARs of the application (i.e. the JARs that contain the business
+ logic, defined at 4.1)</para>
+ </listitem>
+
+ <listitem>
+ <para>defines a number of Spring beans that are used directly in the
+ web tier by the JSF pages or by the Richfaces components;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The Spring configuration file imports the Spring business beans
+ and infrastructure definitions as follows:</para>
+
+ <informalexample>
+ <para><programlisting><import resource="classpath*:reservations-service.xml"/>
+
+<import resource="classpath*:infrastructure.xml"/></programlisting></para>
+
+ <para>The following bean is used for backing JSF pages. Please note
+ that Spring beans defined in the web layer may use scopes, and a
+ significant number of the Spring beans used in Reservations
+ application are session-scoped (like the one in the following
+ example). Spring provides a request scope as well, but it is not used
+ in this example.</para>
+
+ <programlisting><bean id="reservationCreate" class="org.jboss.snowdrop.samples.sportsclub.jsf.beans.ReservationCreate" scope="session" init-method="init">
+ <property name="reservationService" ref="reservationService"/>
+ <property name="accountService" ref="accountService"/>
+ <property name="accountFilter" ref="accountFilterCreate"/>
+ <property name="equipmentFilter" ref="equipmentFilterCreate"/>
+</bean></programlisting>
+
+ <informalexample>
+ <para>In order to be make the Spring beans visible to JSF pages, a
+ special VariableResolver has to be defined in
+ /WEB-INF/faces-config.xml.</para>
+
+ <informalexample>
+ <para><programlisting><application>
+ <!-- other definitions -->
+ <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
+</application></programlisting>Now, we can use the Spring bean defined
+ above directly in a JSF page, as in the following excerpt from
+ createReservation.xhtml:</para>
+
+ <informalexample>
+ <para><programlisting><rich:panel>
+ <f:facet name="header">Select Account</f:facet>
+ <h:form id="AccountSelectForm">
+ <rich:extendedDataTable id="accountsTable" value="#{accountFilterCreate}" var="account"
+ selectionMode="single"
+ selection="#{accountFilterCreate.selection}"
+ enableContextMenu="true"
+ height="250px"
+ rows="5">
+ <a4j:support event="onselectionchange"
+ action="#{reservationCreate.updateSelectedAccount}"
+ reRender="reservationDetails"/>
+
+ <rich:column label="Id" width="7%">
+ <f:facet name="header">
+ <h:outputText value="Id"/>
+ </f:facet>
+ <h:outputText value="#{account.id}"/>
+ </rich:column>
+
+ <rich:column label="First Name">
+ <f:facet name="header">
+ <h:outputText value="First Name"/>
+ </f:facet>
+ <h:outputText value="#{account.subscriber.name.firstName}"/>
+ </rich:column>
+
+ <rich:column label="Last Name">
+ <f:facet name="header">
+ <h:outputText value="Last Name"/>
+ </f:facet>
+ <h:outputText value="#{account.subscriber.name.lastName}"/>
+ </rich:column>
+
+ <rich:column label="City">
+ <f:facet name="header">
+ <h:outputText value="City"/>
+ </f:facet>
+ <h:outputText value="#{account.subscriber.address.city}"/>
+ </rich:column>
+
+ <rich:column label="Country">
+ <f:facet name="header">
+ <h:outputText value="Country"/>
+ </f:facet>
+ <h:outputText value="#{account.subscriber.address.country}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:datascroller id="scrollerAccount" for="accountsTable" maxPages="5"
+ page="#{accountFilterCreate.currentPage}"/>
+ </f:facet>
+ </rich:extendedDataTable>
+ </h:form>
+ </rich:panel></programlisting>All the EL variables
+ that are used in the previous example, including the ones
+ referenced in the Richfaces elements are, in fact, Spring beans.
+ They can be used either as backing beans for retrieving and
+ setting values, as well as for invoking methods corresponding to
+ JSF events.</para>
+ </informalexample>
+ </informalexample>
+ </informalexample>
+ </informalexample>
+ </section>
+
+ <section>
+ <title>Invoicing: Spring MVC and EJB</title>
+
+ <para>The Invoicing application provides another example of
+ interoperability between Spring and the Java EE services provided by
+ JBoss. If in the previous example, the business tier was implemented
+ using Spring and the web tier was using JSF, in this example the roles
+ are reversed: the business tier is using EJB and the web tier is using
+ Spring.</para>
+
+ <para>The Spring MVC beans are defined in the
+ /WEB-INF/spring-servlet-context.xml file, referenced by the Spring MVC
+ DispatcherServlet definition that is described WEB-INF/web.xml. For this
+ implementation, we have chosen the Spring 2.5 annotation-based
+ configuration, and the AccountController class that implements the
+ controller part of the configuration is injected with EJBs defined in
+ section 3.2:</para>
+
+ <para><informalexample>
+ <para><programlisting>@Controller
+public class AccountController
+{
+
+ @EJB(mappedName = "sportsclub/BillingService")
+ BillingService billingService;
+
+ @EJB(mappedName = "sportsclub/SubscriptionService")
+ SubscriptionService subscriptionService;
+
+ /* some code ommitted */
+
+ @RequestMapping(value = "/accountDetail.do", method = RequestMethod.GET)
+ ModelMap getAccountDetail(@RequestParam("id") String id)
+ {
+ Account account = subscriptionService.findAccountById(Long.parseLong(id));
+
+ List<Invoice> invoices = billingService.getInvoices(account);
+
+ boolean hasCurrentInvoice = false;
+ Date currentDate = new Date();
+
+ for (Invoice invoice: invoices)
+ {
+ if (invoice.getBillingPeriod().contains(currentDate))
+ {
+ hasCurrentInvoice = true;
+ break;
+ }
+ }
+
+ List<Payment> payments = billingService.getPayments(account);
+
+ ModelMap model = new ModelMap();
+ model.addAttribute(account);
+ model.addAttribute("invoices", invoices);
+ model.addAttribute("payments", payments);
+ model.addAttribute("hasCurrentInvoice",hasCurrentInvoice);
+ return model;
+ }
+
+
+ @RequestMapping(value = "/generateInvoice.do", method = RequestMethod.POST)
+ ModelMap generateInvoice(@RequestParam("id") String id)
+ {
+ Account account = subscriptionService.findAccountById(Long.parseLong(id));
+ Invoice invoice = billingService.generateInvoice(account);
+
+ ModelMap model = new ModelMap();
+ model.addAttribute("id",id);
+ model.addAttribute(invoice);
+ return model;
+ }
+
+}
+</programlisting>The @Controller annotation will be detected by Spring, as it
+ does a scanning of the classpath which is prompted by including the
+ following line into /WEB-INF/spring-servlet-context.xml.</para>
+
+ <informalexample>
+ <para><programlisting><context:component-scan base-package="org.jboss.snowdrop.samples.sportsclub.springmvc"/>
+</programlisting></para>
+ </informalexample>
+ </informalexample></para>
+
+ <para>As a Spring-managed object, the bean is injected with the EJBs
+ BillingService and SubscriptionService, as required by annotated the
+ respective fields with the @EJB annotation.</para>
+
+ <para>The @RequestMapping-annotated methods will be executed when the
+ user is accessing the specified URL and HTTP method. The request
+ parameters will be bound to method arguments. In the example above,
+ invoking the URL
+ http://localhost:8080/sportsclub/invoicing/accountDetail.do?id=1 will
+ cause the invocation accountController.getAccountDetail(1). The method
+ will invoke the appropriate business services (in this case, exposed as
+ EJBs) and will return a map of business object collections, indexed by
+ their names. Spring MVC will take care of setting them on the request,
+ so that they can be used for rendering the response.</para>
+
+ <para>By default, Spring MVC will try to find a view whose name is
+ 'accountDetail', and based on the view resolver definition from
+ /WEB-INF/spring-servlet-context.xml, it will use the JSP file at
+ /WEB-INF/jsp/accountDetail.jsp. This JSP uses the Spring tag libraries
+ for form processing, so that the collections previously returned will be
+ accessible using JSTL expressions, and furthermore, we will find the
+ following declaration:</para>
+
+ <informalexample>
+ <programlisting><form:form action="generateInvoice.do">
+ This account does not have an invoice for the current billing period.<p/>
+ You can create one now:
+ <input type="hidden" name="id" value="<c:out value="${account.id}"/>">
+ <input type="submit" value="Create invoice"/><br/>
+ </form:form></programlisting>
+ </informalexample>
+
+ <para>Clicking the 'Create Invoice' button will result in a POST
+ submission to
+ http://localhost:8080/sportsclub/invoicing/generateInvoice.do?id=1 and
+ the subsequent invocation of the generateInvoice method.</para>
+
+ <para>A small note here: in order to be able to demonstrate a few
+ Spring/JBoss integration features, the Invoicing application also
+ contains a number of business services that are using Spring. They do
+ not play any role in the Spring MVC/EJB integration, and we will discuss
+ more about them in section 6.</para>
+ </section>
+
+ <section>
+ <title>A problem of reusing content</title>
+
+ <para>Having three different web applications to be included in the same
+ package raises the problem of reusing some content. Surely, the images
+ and stylesheets that are part of the application design can be copied in
+ each individual project, but this raises the problem of maintainability.
+ Therefore, most of the static content used by the Sportsclub application
+ is defined in a separate web module, sportsclub-staticwebcontent, which
+ is then included by Maven at build time as follows:</para>
+
+ <para><informalexample>
+ <para><programlisting><dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-staticwebcontent</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>runtime</scope>
+</dependency></programlisting><note>
+ <para>When working in an IDE this might produce an undesirable
+ side-effect. If the IDE does not know how to apply Maven
+ overlays correctly, the static content may not be available when
+ building and deploying the application through the IDE, without
+ Maven. This does not affect the general functionality of the
+ application but may affect the look and feel in that particular
+ situation. However, if the application is build using Maven,
+ this will not be a problem.</para>
+ </note></para>
+ </informalexample></para>
+ </section>
+ </section>
+
+ <section>
+ <title>Enterprise Integration Features</title>
+
+ <para>Apart from the Spring/JSF/EJB integration, which you have seen in
+ the previous sections, the Sportsclub application suite provides a few
+ other examples of integrating Spring and JBoss. Since all the features are
+ Spring-based, they have been included as business services of the
+ Invoicing web application. All the definitions for the following examples
+ can be found in the /WEB-INF/spring-business-context.xml file defined in
+ the spring-invoicing-webmvc module.</para>
+
+ <section>
+ <title>Payment processing: JMS integration through JCA</title>
+
+ <para>JMS integration can be enabled or disabled in the application, in
+ order to allow it to run in environments that dot have a message broker,
+ like for example the Web Profile of JBoss Application Server. For
+ details on how to do that, please consult section 1.1 of the current
+ guide. </para>
+
+ <para>Besides displaying the current status of invoices and payments for
+ a given account and generating invoices through the web interface, the
+ Sportsclub application can also process payments for various accounts.
+ The assumption of this scenario is that the system can receive payment
+ notifications asynchronously, through a JMS queue. Once such a payment
+ has been received, it can be processed by a message-driven component,
+ which in our case is a Spring bean. In order to take full advantage of
+ the managed environment provided by the application server, the Spring
+ bean will be invoked in a JCA context.</para>
+
+ <para>The component that processes JMS messages is a POJO:</para>
+
+ <para><informalexample>
+ <para><programlisting>public class PaymentNotificationProcessor
+{
+ private static final Log LOG = LogFactory.getLog(PaymentNotificationProcessor.class);
+
+ @Autowired
+ private PaymentProcessor paymentProcessor;
+
+ public void processPaymentNotification(PaymentNotification paymentNotification)
+ {
+ LOG.info(paymentNotification + " received");
+ paymentProcessor.processPayment(paymentNotification.getAccountNumber(), paymentNotification.getAmount());
+ LOG.info(paymentNotification + " processed");
+ }
+
+}</programlisting></para>
+ </informalexample></para>
+
+ <para>It delegates the actual processing of a PaymentNotification to a
+ different component, the PaymentProcessor, which is injected in the
+ PaymentNotificationProcessor. This is done in order to maintain a degree
+ of separation between the way data may be represented when exchanged
+ over the messaging system (i.e. encapsulated in a PaymentNotification
+ object), and the contract of the internal component which actually does
+ the processing. The PaymentProcessor instance injected into the
+ PaymentNotificationProcessor is, in fact, reused by the
+ PaymentNotificationService web service implementation (whose contract
+ does not depend on the PaymentNotification entity). </para>
+
+ <para>The arrival of messages and their processing can be traced by
+ examining the application log.</para>
+
+ <para>Spring will instantiate a bean named
+ "paymentNotificationProcessor" which will be registered as a processor
+ for JMS message as follows:</para>
+
+ <para><informalexample>
+ <para><programlisting><jms:jca-listener-container resource-adapter="resourceAdapter" acknowledge="auto"
+ activation-spec-factory="activationSpecFactory">
+ <jms:listener destination="/queue/sportsclub" ref="paymentNotificationProcessor"
+ method="processPaymentNotification"/>
+</jms:jca-listener-container></programlisting></para>
+ </informalexample>This type of configuration uses the JCA
+ infrastructure to deliver messages to the listener, as opposed to the
+ DefaultMessageListenerContainer which is effectively polling the
+ destination for incoming messages. Using JCA will ensure better
+ performance, as well as the ability to integrate with the JTA
+ transaction manager out of the box.</para>
+
+ <para>In order to be able to test this feature, messages have to be sent
+ to the message queue. This can be done by using a special MBean defined
+ by the application, accessible from the JBoss AS JMX console. The name
+ of the bean is "sportsclub:name=paymentNotificationTrigger" and has an
+ operation called 'sendPaymentNotification' with two arguments:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>a long valuem which is the accountId for making the
+ payment;</para>
+ </listitem>
+
+ <listitem>
+ <para>a double value, which represents the amount to be paid;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Once the JMX operation is invoked, a message is sent to the queue
+ and a confirmation message will be displayed in the JBoss log.</para>
+ </section>
+
+ <section>
+ <title>Aspects and auditing</title>
+
+ <para>Payments must be audited. Besides keeping a record of payments
+ associated with an account, we may want to set up an auditing service
+ that will audit every attempt of making a payment. In the simplest case
+ we can just log that information, although in a real life scenario
+ things may be more sophisticated. In order to do so, we set up a
+ PaymentAuditor aspect that intercepts every call made to the
+ PaymentProcessor.</para>
+
+ <para>The aspect is a simple POJO:</para>
+
+ <para><informalexample>
+ <para><programlisting>public class PaymentAuditor
+{
+ /* code ommitted */
+
+ public void auditPayment(Long accountId, BigDecimal amount)
+ {
+ System.out.println("AUDIT ENABLED! A payment has been made to account "
+ + accountId + " for the amount of " + amount);
+ }
+}</programlisting></para>
+ </informalexample>The aspect is applied through the following
+ definitions:</para>
+
+ <informalexample>
+ <para><programlisting> <aop:config>
+ <aop:aspect ref="paymentAuditor">
+ <aop:pointcut id="processingPayment"
+ expression="execution(* *..PaymentProcessor+.*(..)) &amp;&amp; args(accountId, amount)"/>
+ <aop:before arg-names="accountId, amount" pointcut-ref="processingPayment" method="auditPayment"/>
+ </aop:aspect>
+ </aop:config>
+
+ <bean id="paymentAuditor" class="org.jboss.snowdrop.samples.sportsclub.audit.PaymentAuditor"/>
+
+</programlisting>As you can see, the aspect is defined as a bean and applied
+ as an aspect through the Spring aop namespace. The pointcut definition
+ is an AspectJ expression.</para>
+ </informalexample>
+ </section>
+
+ <section>
+ <title>Configuring Spring beans through JMX</title>
+
+ <para>JMX is a very important tool for monitoring and configuring Java
+ applications. Collecting information about the system and the ability of
+ making configuration at runtime are important administration features.
+ For this example, the requirement is to be able to turn auditing on and
+ off, at runtime, whenever required. Removing an aspect once it has been
+ applied by Spring is not possible, so the solution in this case is to
+ define a flag property on the aspect, which controls whether the
+ auditing functionality will be invoked or not.</para>
+
+ <para>In order to be able to make changes at runtime, the Spring bean
+ which implements the aspect will be configured as a JMX bean and
+ registered in the MBean server of JBoss. In this example, we are using
+ annotations to define Spring-specific JMX metadata. The complete
+ definition for the PaymentAuditor is:</para>
+
+ <para><informalexample>
+ <para><programlisting>@ManagedResource(objectName = "sportsclub:name=paymentAuditor", description = "Payment Auditor")
+ at Component
+public class PaymentAuditor
+{
+
+ private static final Log LOG = LogFactory.getLog(PaymentAuditor.class);
+
+ private boolean enabled = true;
+
+ @ManagedAttribute(description = "Audit enabled")
+ public void setEnabled(boolean enabled)
+ {
+ LOG.info("Audit " + (enabled ? "enabled":"disabled"));
+ this.enabled = enabled;
+ }
+
+ @ManagedAttribute(description = "Audit enabled")
+ public boolean getEnabled()
+ {
+ return this.enabled;
+ }
+
+ public void auditPayment(Long accountId, BigDecimal amount)
+ {
+ if (this.enabled)
+ {
+ LOG.info("A payment has been made to account " + accountId + " for the amount of " + amount);
+ }
+ }
+}</programlisting>The annotations ManagedResource and ManagedAttribute are
+ using to indicate what classes and properties are JMX-managed. In
+ order to expose the bean through JMX, it must be exported using
+ Spring's MBean Exporter.</para>
+
+ <para><programlisting><bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>
+
+ <bean class="org.springframework.jmx.export.MBeanExporter">
+ <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER"/>
+ <property name="ensureUniqueRuntimeObjectNames" value="true"/>
+ <property name="namingStrategy">
+ <bean class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
+ <property name="attributeSource" ref="attributeSource"/>
+ </bean>
+ </property>
+ <property name="assembler">
+ <bean class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
+ <property name="attributeSource" ref="attributeSource"/>
+ </bean>
+ </property>
+ </bean></programlisting></para>
+ </informalexample></para>
+
+ <para>As a result, you can turn this functionality on and off directly
+ from the JBoss AS JMX administration console, using the
+ "sportsclub:name=paymentAuditor" bean to interact with the payment
+ auditor.</para>
+
+ <para>As explained in the JMS section, a separate MBean is set up for
+ setting messages to the payment notifications message queue. </para>
+ </section>
+
+ <section>
+ <title>Payment processing: exposing a JAX-WS web service</title>
+
+ <para>Another way of interacting with external applications, is by
+ exposing a web service. In this scenario, payment notifications may not
+ arrive only as asynchronous events on a message queue, but also as
+ synchronous web service invocations. For this purpose, the application
+ will expose a Spring bean with JAX-WS annotations as a web
+ service.</para>
+
+ <para>To that end, a JAX-WS annotated class is provided by the
+ application:</para>
+
+ <informalexample>
+ <para><programlisting>@WebService
+public class PaymentNotificationService extends SpringBeanAutowiringSupport
+{
+
+ @Autowired
+ private PaymentProcessor paymentProcessor;
+
+ @WebMethod
+ public Long notifyPayment(Long accountNumber, BigDecimal amount)
+ {
+ return paymentProcessor.processPayment(accountNumber, amount);
+ }
+
+}</programlisting>By extending SpringBeanAutowiringSupport, the class
+ PaymentNotificationService will be injected automatically with the
+ same PaymentProcessor instance that is used by the JMS notification
+ processor, and defined in the application context created from
+ WEB-INF/spring-business-context.xml. This is necessary, because no
+ bean of the type PaymentNotificationService is defined in the
+ application context. Instead, the web service is defined and mapped as
+ a servlet in /WEB-INF/web.xml:</para>
+
+ <para><programlisting><servlet>
+ <servlet-name>PaymentNotificationService</servlet-name>
+ <servlet-class>org.jboss.snowdrop.samples.sportsclub.ws.PaymentNotificationService</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>PaymentNotificationService</servlet-name>
+ <url-pattern>/ws/payment</url-pattern>
+ </servlet-mapping></programlisting>As a result, the a JAX-WS web
+ service can be accessed at http://localhost:8080/ws/payment. The
+ service can be tested using a free SOAP testing tool such as SOAP
+ UI.</para>
+ </informalexample>
+ </section>
+ </section>
+</chapter>
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/UseCases.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
-%BOOK_ENTITIES;
-]>
-<chapter id="chap-guide-usecases">
- <title>A general overview of the application</title>
-
- <para>This chapter describes the business use cases covered by the
- application, and how is the functionality distributed across the
- modules.</para>
-
- <section>
- <title>The Business Domain of the example application</title>
-
- <para>The goal of the Sportsclub application is to provide a few examples
- of real-world applications based on the Spring Framework that integrate
- with Java EE 5 and JBoss. It consists of not one, but three different
- applications sharing the same domain model, packaged and deployed
- together. The latter is done for simplicity reasons, but also for
- demonstrating a few different technologies working side by side. In the
- following sections, we will discuss the technologies used in the
- applications.</para>
-
- <para>The business domain of the application is a Sports Club. The
- employees of the club need to be able to perform the following
- scenarios:</para>
-
- <para><itemizedlist>
- <listitem>
- <para>maintaining informations about the subscribers, creating new
- subcriptions and closing existing accounts;</para>
- </listitem>
-
- <listitem>
- <para>creating, modifying and removing equipment reservations for
- subscribers;</para>
- </listitem>
-
- <listitem>
- <para>viewing the current balance of an account, issuing invoices
- for accounts that do not have a current invoice and updating the
- account whenever a payment has been received.</para>
- </listitem>
- </itemizedlist>As the concerns are different, we have three different
- applications, each covering one piece of functionality.</para>
- </section>
-
- <section>
- <title>The Technologies</title>
-
- <para>The Reservations application is using the following
- stack:<itemizedlist>
- <listitem>
- <para>UI layer implemented using Richfaces</para>
- </listitem>
-
- <listitem>
- <para>Business layer implemented using EJB</para>
- </listitem>
-
- <listitem>
- <para>Persistence layer using Spring-based DAOs
- (Hibernate/JPA)</para>
- </listitem>
- </itemizedlist>The Subscriptions application is using the following
- stack:</para>
-
- <itemizedlist>
- <listitem>
- <para>UI layer implemented using Richfaces</para>
- </listitem>
-
- <listitem>
- <para>Business layer implemented using Spring</para>
- </listitem>
-
- <listitem>
- <para>Persistence layer implemented using Spring-based DAOs
- (Hibernate/JPA)</para>
- </listitem>
- </itemizedlist>
-
- <para>The Invoicing application is using the following stack:<itemizedlist>
- <listitem>
- <para>UI layer implemented using Spring MVC and JSP</para>
- </listitem>
-
- <listitem>
- <para>Business layer implemented using EJB</para>
- </listitem>
-
- <listitem>
- <para>Persistence layer implemented using Spring-based DAOs
- (Hibernate/JPA)</para>
- </listitem>
- </itemizedlist></para>
-
- <para>In all three cases, the persistence layer is implemented using
- Spring. In fact there are two alternative implementations: one using
- Hibernate directly and one using JPA (and Hibernate as the provider).
- Building the application creates two different EAR files, one using the
- JPA-based DAOs and one using the Hibernate-based DAOs.</para>
- </section>
-
- <section>
- <title>The project modules</title>
-
- <para>The modules (Maven artifacts) of the project are outlined in the
- following table:<table>
- <title>Modules of the Sportsclub project</title>
-
- <tgroup cols="3">
- <colspec colname="module-name" />
-
- <colspec colname="module-description" />
-
- <colspec align="center" colname="module-type" />
-
- <thead>
- <row>
- <entry align="center">Maven Module</entry>
-
- <entry align="center">Functionality</entry>
-
- <entry>Module Type</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>snowdrop-domain</entry>
-
- <entry>Domain classes and interfaces for repositories.</entry>
-
- <entry>jar</entry>
- </row>
-
- <row>
- <entry>sportsclub-hibernate-dao</entry>
-
- <entry>Hibernate implementations for repositories and Spring
- bean definitions using them.</entry>
-
- <entry>jar</entry>
- </row>
-
- <row>
- <entry>sportsclub-jpa-dao</entry>
-
- <entry>JPA implementations for repositories and Spring bean
- definitions using them.</entry>
-
- <entry>jar</entry>
- </row>
-
- <row>
- <entry>sportsclub-invoicing-ejb</entry>
-
- <entry>Business logic for the Invoicing application</entry>
-
- <entrytbl cols="1">
- <tbody>
- <row>
- <entry>ejb</entry>
- </row>
- </tbody>
- </entrytbl>
- </row>
-
- <row>
- <entry>sportsclub-reservations-spring</entry>
-
- <entry>Business logic for the Reservations application</entry>
-
- <entry>jar</entry>
- </row>
-
- <row>
- <entry>sportsclub-subscriptions-ejb</entry>
-
- <entry>Business logic for the Subscriptions application</entry>
-
- <entry>ejb</entry>
- </row>
-
- <row>
- <entry>sportsclub-invoicing-webmvc</entry>
-
- <entry>UI layer for the Invoicing application. Includes
- processing of JMS messages via Spring (for payment
- notifications)</entry>
-
- <entry>war</entry>
- </row>
-
- <row>
- <entry>sportsclub-reservations-web</entry>
-
- <entry>UI layer for the Reservations application.</entry>
-
- <entry>war</entry>
- </row>
-
- <row>
- <entry>sportsclub-subscriptions-web</entry>
-
- <entry>UI layer for the Subscriptions application</entry>
-
- <entry>war</entry>
- </row>
-
- <row>
- <entry>sportsclub-ear</entry>
-
- <entry>EAR aggregator module using the Hibernate-based
- implementation</entry>
-
- <entry>ear</entry>
- </row>
-
- <row>
- <entry>sportsclub-jpa-ear</entry>
-
- <entry>EAR aggregator module using the JPA-based
- implementation</entry>
-
- <entry>ear</entry>
- </row>
-
- <row>
- <entry>sportsclub-staticwebcontent</entry>
-
- <entry>Static web content for the application (not deployed
- separately, but included at build-time in the web
- layers)</entry>
-
- <entry>war</entry>
- </row>
-
- <row>
- <entry>sportsclub-test-infrastructure</entry>
-
- <entry>Infrastructure module for unit testing</entry>
-
- <entry>jar</entry>
- </row>
- </tbody>
- </tgroup>
- </table></para>
-
- <section>
- <para />
- </section>
- </section>
-</chapter>
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/UseCases.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/UseCases.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
+%BOOK_ENTITIES;
+]>
+<chapter id="chap-guide-usecases">
+ <title>Understanding the application structure</title>
+
+ <para>This chapter describes the business use cases covered by the
+ application, and how is the functionality distributed across the
+ modules.</para>
+
+ <section>
+ <title>The application structure and its use cases</title>
+
+ <para>The Sportsclub example consists of three different applications
+ sharing the same domain model, packaged and deployed together. This is
+ done for simplicity reasons, but also for demonstrating a few different
+ technologies and configuration options working side by side. </para>
+
+ <para>The application supports the following scenarios:<itemizedlist>
+ <listitem>
+ <para>maintaining informations about the subscribers, creating new
+ subcriptions and closing existing accounts;</para>
+ </listitem>
+
+ <listitem>
+ <para>creating, modifying and removing equipment reservations for
+ subscribers;</para>
+ </listitem>
+
+ <listitem>
+ <para>viewing the current balance of an account, issuing invoices
+ for accounts that do not have a current invoice and updating the
+ account whenever a payment has been received.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>Each of these scenarios is covered by a separate web application,
+ and all three applications are packaged in a single EAR file.</para>
+
+ <para>Figure 2.1 shows how the application is structured:</para>
+
+ <figure>
+ <title>Structure of the Sportsclub application</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/application-modules.png" scale="80%" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>All three applications share a common domain model and a common
+ DAO/repository layer, implemented using Spring. The application includes
+ both Hibernate and JPA implementations for the repository layer (using the
+ Hibernate and JPA support provided by JBoss AS, respectively). The
+ application is built in two different variants, each using one of the two
+ DAO implementation alternatives. </para>
+
+ <para>Apart from that, each web application uses a different combination
+ of technologies, illustrating one or more integration use cases.</para>
+
+ <para>The Subscriptions application uses an EJB-based service layer and a
+ JSF-based front-end, using Richfaces components. </para>
+
+ <para>The Reservations application uses a Spring-based business layer and
+ a JSF-based front-end, also using Richfaces components.</para>
+
+ <para>The Invoicing application uses an EJB service layer and a Spring
+ MVC-based front-end (using JSP and Spring form tags). Apart from that, it
+ demonstrates the creation of JAX-WS based web services injected with
+ Spring beans, JCA-based Spring JMS integration, auditing by using the
+ Spring AOP configuration and Spring JMX integration.</para>
+ </section>
+
+ <section>
+ <title>A comparative look of the project modules</title>
+
+ <para>All the modules (Maven artifacts) of the project, as well as the
+ functionality that they cover are outlined in the following table:<table>
+ <title>Modules of the Sportsclub project</title>
+
+ <tgroup cols="3">
+ <colspec colname="module-name" />
+
+ <colspec colname="module-description" />
+
+ <colspec align="center" colname="module-type" />
+
+ <thead>
+ <row>
+ <entry align="center">Maven Module</entry>
+
+ <entry align="center">Functionality</entry>
+
+ <entry>Module Type</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>snowdrop-domain</entry>
+
+ <entry>Domain classes and repository interfaces.</entry>
+
+ <entry>jar</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-hibernate-dao</entry>
+
+ <entry>Hibernate implementations for repositories and Spring
+ bean definitions using them.</entry>
+
+ <entry>jar</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-jpa-dao</entry>
+
+ <entry>JPA implementations for repositories and Spring bean
+ definitions using them.</entry>
+
+ <entry>jar</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-invoicing-ejb</entry>
+
+ <entry>Business logic for the Invoicing application</entry>
+
+ <entrytbl cols="1">
+ <tbody>
+ <row>
+ <entry>ejb</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row>
+ <entry>sportsclub-reservations-spring</entry>
+
+ <entry>Business logic for the Reservations application</entry>
+
+ <entry>jar</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-subscriptions-ejb</entry>
+
+ <entry>Business logic for the Subscriptions application</entry>
+
+ <entry>ejb</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-invoicing-webmvc</entry>
+
+ <entry>UI layer for the Invoicing application. Includes
+ processing of JMS messages via Spring (for payment
+ notifications)</entry>
+
+ <entry>war</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-reservations-web</entry>
+
+ <entry>UI layer for the Reservations application.</entry>
+
+ <entry>war</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-subscriptions-web</entry>
+
+ <entry>UI layer for the Subscriptions application</entry>
+
+ <entry>war</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-ear</entry>
+
+ <entry>EAR aggregator module using the Hibernate-based
+ implementation</entry>
+
+ <entry>ear</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-jpa-ear</entry>
+
+ <entry>EAR aggregator module using the JPA-based
+ implementation</entry>
+
+ <entry>ear</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-staticwebcontent</entry>
+
+ <entry>Static web content for the application (not deployed
+ separately, but included at build-time in the web
+ layers)</entry>
+
+ <entry>war</entry>
+ </row>
+
+ <row>
+ <entry>sportsclub-test-infrastructure</entry>
+
+ <entry>Infrastructure module for unit testing</entry>
+
+ <entry>jar</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+
+ <section>
+ <para />
+ </section>
+ </section>
+</chapter>
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/account-person.png (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/images/account-person.png)
===================================================================
(Binary files differ)
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/application-modules.png (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/images/application-modules.png)
===================================================================
(Binary files differ)
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/docs/guide/en-US/images/domain-entities.png (from rev 104969, projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/images/domain-entities.png)
===================================================================
(Binary files differ)
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-ear/pom.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>sportsclub-parent</artifactId>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-ear</artifactId>
- <packaging>ear</packaging>
- <name>Sports Club EAR builder</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-ejb</artifactId>
- <type>ejb</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-ejb</artifactId>
- <type>ejb</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-web</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-domain</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-hibernate-dao</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-spring</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-web</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-webmvc</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.3</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.3</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-ear-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <displayName>Sports Club Sample Application</displayName>
- <defaultLibBundleDir>/lib/</defaultLibBundleDir>
- <generateApplicationXml>true</generateApplicationXml>
- <workDirectory>${project.build.directory}/${project.build.finalName}-exploded.ear</workDirectory>
- <modules>
- <ejbModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-ejb</artifactId>
- </ejbModule>
- <ejbModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-ejb</artifactId>
- </ejbModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-web</artifactId>
- <contextRoot>/sportsclub/subscriptions</contextRoot>
- </webModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-domain</artifactId>
- </jarModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-hibernate-dao</artifactId>
- </jarModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-spring</artifactId>
- </jarModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-web</artifactId>
- <contextRoot>/sportsclub/reservations</contextRoot>
- </webModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-webmvc</artifactId>
- <contextRoot>/sportsclub/invoicing</contextRoot>
- </webModule>
- </modules>
- </configuration>
- </plugin>
- </plugins>
- <finalName>sportsclub</finalName>
- </build>
-</project>
\ No newline at end of file
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml (from rev 105106, projects/snowdrop/examples/trunk/sportsclub/sportsclub-ear/pom.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-ear/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>sportsclub-parent</artifactId>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Sports Club EAR builder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-ejb</artifactId>
+ <type>ejb</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-ejb</artifactId>
+ <type>ejb</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-web</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-domain</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-hibernate-dao</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-spring</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-web</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-webmvc</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <displayName>Sports Club Sample Application</displayName>
+ <defaultLibBundleDir>/lib/</defaultLibBundleDir>
+ <generateApplicationXml>true</generateApplicationXml>
+ <workDirectory>${project.build.directory}/${project.build.finalName}-exploded.ear</workDirectory>
+ <modules>
+ <ejbModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-ejb</artifactId>
+ </ejbModule>
+ <ejbModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-ejb</artifactId>
+ </ejbModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-web</artifactId>
+ <contextRoot>/sportsclub/subscriptions</contextRoot>
+ </webModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-domain</artifactId>
+ </jarModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-hibernate-dao</artifactId>
+ </jarModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-spring</artifactId>
+ </jarModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-web</artifactId>
+ <contextRoot>/sportsclub/reservations</contextRoot>
+ </webModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-webmvc</artifactId>
+ <contextRoot>/sportsclub/invoicing</contextRoot>
+ </webModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ <finalName>sportsclub</finalName>
+ </build>
+</project>
\ No newline at end of file
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,148 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>sportsclub-parent</artifactId>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-webmvc</artifactId>
- <packaging>war</packaging>
- <name>Sports Club Invoicing Spring MVC Front-End</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- <scope>provided</scope>
- </dependency>
-
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop</groupId>
- <artifactId>snowdrop-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-ejb-api</artifactId>
- </dependency>
- <!-- included to help the IDE validate the configuration -->
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-connector</artifactId>
- <version>5.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-ejb</artifactId>
- <version>${project.version}</version>
- <type>ejb</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-ejb</artifactId>
- <version>${project.version}</version>
- <type>ejb</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-staticwebcontent</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>1.1.2</version>
- </dependency>
- <dependency>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.3</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.3</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <finalName>sportsclub-invoicing-webmvc</finalName>
- </build>
-</project>
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml (from rev 105106, projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-invoicing-webmvc/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,147 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>sportsclub-parent</artifactId>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-webmvc</artifactId>
+ <packaging>war</packaging>
+ <name>Sports Club Invoicing Spring MVC Front-End</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop</groupId>
+ <artifactId>snowdrop-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-ejb-api</artifactId>
+ </dependency>
+ <!-- included to help the IDE validate the configuration -->
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-connector</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-staticwebcontent</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>sportsclub-invoicing-webmvc</finalName>
+ </build>
+</project>
Deleted: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-ear/pom.xml 2010-05-18 07:10:55 UTC (rev 104914)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>sportsclub-parent</artifactId>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-jpa-ear</artifactId>
- <packaging>ear</packaging>
- <name>Sports Club JPA EAR builder</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-ejb</artifactId>
- <type>ejb</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-ejb</artifactId>
- <type>ejb</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-web</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-domain</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-jpa-dao</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-spring</artifactId>
- <type>jar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-web</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-webmvc</artifactId>
- <type>war</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency> <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.3</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.3</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-ear-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <displayName>Sports Club Sample Application</displayName>
- <defaultLibBundleDir>/lib/</defaultLibBundleDir>
- <generateApplicationXml>true</generateApplicationXml>
- <workDirectory>${project.build.directory}/${project.build.finalName}-exploded.ear</workDirectory>
- <modules>
- <ejbModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-ejb</artifactId>
- </ejbModule>
- <ejbModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-ejb</artifactId>
- </ejbModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-subscriptions-web</artifactId>
- <contextRoot>/sportsclub/subscriptions</contextRoot>
- </webModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-domain</artifactId>
- </jarModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-jpa-dao</artifactId>
- </jarModule>
- <jarModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-spring</artifactId>
- </jarModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-reservations-web</artifactId>
- <contextRoot>/sportsclub/reservations</contextRoot>
- </webModule>
- <webModule>
- <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
- <artifactId>sportsclub-invoicing-webmvc</artifactId>
- <contextRoot>/sportsclub/invoicing</contextRoot>
- </webModule>
- </modules>
- </configuration>
- </plugin>
- </plugins>
- <finalName>sportsclub</finalName>
- </build>
-</project>
\ No newline at end of file
Copied: projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml (from rev 105106, projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-ear/pom.xml)
===================================================================
--- projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml (rev 0)
+++ projects/snowdrop/examples/branches/sportsclub-experimental/sportsclub-jpa-ear/pom.xml 2010-05-24 18:32:08 UTC (rev 105158)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>sportsclub-parent</artifactId>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-jpa-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Sports Club JPA EAR builder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-ejb</artifactId>
+ <type>ejb</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-ejb</artifactId>
+ <type>ejb</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-web</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-domain</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-jpa-dao</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-spring</artifactId>
+ <type>jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-web</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-webmvc</artifactId>
+ <type>war</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <displayName>Sports Club Sample Application</displayName>
+ <defaultLibBundleDir>/lib/</defaultLibBundleDir>
+ <generateApplicationXml>true</generateApplicationXml>
+ <workDirectory>${project.build.directory}/${project.build.finalName}-exploded.ear</workDirectory>
+ <modules>
+ <ejbModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-ejb</artifactId>
+ </ejbModule>
+ <ejbModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-ejb</artifactId>
+ </ejbModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-subscriptions-web</artifactId>
+ <contextRoot>/sportsclub/subscriptions</contextRoot>
+ </webModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-domain</artifactId>
+ </jarModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-jpa-dao</artifactId>
+ </jarModule>
+ <jarModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-spring</artifactId>
+ </jarModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-reservations-web</artifactId>
+ <contextRoot>/sportsclub/reservations</contextRoot>
+ </webModule>
+ <webModule>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <artifactId>sportsclub-invoicing-webmvc</artifactId>
+ <contextRoot>/sportsclub/invoicing</contextRoot>
+ </webModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ <finalName>sportsclub</finalName>
+ </build>
+</project>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list