moved flow engine into webapp bundle

This commit is contained in:
Scott Andrews
2008-06-30 13:41:52 +00:00
parent 360a709acf
commit 5f801e631b
5 changed files with 21 additions and 73 deletions

View File

@@ -4,19 +4,15 @@ Bundle-Name: Spring Travel Hotel Module
Bundle-SymbolicName: org.springframework.samples.springtravel.hotel
Bundle-Vendor: SpringSource
Export-Package:
org.springframework.samples.springtravel.hotel
org.springframework.samples.springtravel.hotel,
org.springframework.samples.springtravel.hotel.booking,
org.springframework.samples.springtravel.hotel.search
Import-Package:
javax.sql
Import-Bundle:
org.springframework.webflow;version="[2.0.3,3.0.0)",
org.springframework.binding;version="[2.0.3,3.0.0)",
org.springframework.faces;version="[2.0.3,3.0.0)",
org.springframework.js;version="[2.0.3,3.0.0)",
com.springsource.org.jboss.el;version="[2.0.0,2.1.0)",
org.springframework.security;version="[2.0.0,2.1.0)",
com.springsource.org.hsqldb;version="[1.8.0, 2.0.0)",
com.springsource.javax.servlet;version="2.4.0",
com.springsource.org.apache.myfaces.javax.faces;version="[1.2.0,2.0.0)"
com.springsource.org.apache.myfaces.javax.faces="[1.2.0,2.0.0)"
Import-Library:
org.springframework.spring;version="[2.5.4,3.0.0)",
org.hibernate.ejb;version="[3.3.1.ga, 3.3.1.ga]"

View File

@@ -15,48 +15,16 @@
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.0.xsd">
<!-- Maps request URIs to controllers -->
<bean id="hotelHandlerMappings" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/hotel/search=flowController
/hotel/booking=flowController
</value>
</property>
<property name="order" value="0"/>
</bean>
<!-- Handles requests mapped to the Spring Web Flow system -->
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor"/>
<property name="flowHandlerAdapter">
<bean class="org.springframework.samples.springtravel.hotel.HotelFlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
</property>
</bean>
<!-- Executes flows: the central entry point into the Spring Web Flow system -->
<webflow:flow-executor id="flowExecutor">
<webflow:flow-execution-listeners>
<webflow:listener ref="jpaFlowExecutionListener" />
<webflow:listener ref="securityFlowExecutionListener" />
</webflow:flow-execution-listeners>
</webflow:flow-executor>
<!-- The registry of executable flow definitions in this module -->
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
<webflow:flow-location path="org/springframework/samples/springtravel/hotel/search/search.xml" />
<webflow:flow-location path="org/springframework/samples/springtravel/hotel/booking/booking.xml" />
</webflow:flow-registry>
<!-- Service encapsulating hotel search and booking logic -->
<bean id="bookingAgent" class="org.springframework.samples.springtravel.hotel.JpaBookingAgent" />
<!-- Enables annotation based configuration for @Transactional, @Repository, and @PersistenceContext -->
<context:component-scan base-package="org.springframework.samples.springtravel.hotel"/>
<!-- Instructs Spring to perfrom declarative transaction managemenet on annotated classes -->
<tx:annotation-driven />
<!-- Service encapsulating hotel search and booking logic -->
<bean id="bookingAgent" class="org.springframework.samples.springtravel.hotel.JpaBookingAgent" />
<!-- Drives local transactions using the JPA API -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
@@ -69,20 +37,5 @@
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</property>
</bean>
<!-- Enables annotation based configuration for @Transactional, @Repository, and @PersistenceContext -->
<context:component-scan base-package="org.springframework.samples.springtravel.hotel"/>
<!-- Enables the flow JSF integration -->
<faces:flow-builder-services id="facesFlowBuilderServices" />
<!-- Installs a listener that manages JPA persistence contexts for flows that require them -->
<bean id="jpaFlowExecutionListener" class="org.springframework.webflow.persistence.JpaFlowExecutionListener">
<constructor-arg ref="entityManagerFactory" />
<constructor-arg ref="transactionManager" />
</bean>
<!-- Installs a listener to apply Spring Security authorities -->
<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
</beans>

View File

@@ -10,11 +10,8 @@
<reference id="dataSource" interface="javax.sql.DataSource" />
<service ref="hotelHandlerMappings">
<interfaces>
<beans:value>org.springframework.web.servlet.HandlerMapping</beans:value>
<beans:value>org.springframework.core.Ordered</beans:value>
</interfaces>
</service>
<service ref="bookingAgent" interface="org.springframework.samples.springtravel.hotel.BookingAgent" />
<service ref="transactionManager" interface="org.springframework.orm.jpa.JpaTransactionManager" />
<service ref="entityManagerFactory" interface="javax.persistence.EntityManagerFactory" />
</beans:beans>

View File

@@ -2,6 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.springframework.samples.springtravel.webapp
Bundle-Name: Spring Travel Web Application Module
Import-Package:
org.springframework.samples.springtravel.hotel,
org.springframework.samples.springtravel.hotel.booking,
org.springframework.samples.springtravel.hotel.search
Import-Bundle:
org.springframework.webflow;version="[2.0.3,3.0.0)",
org.springframework.js;version="[2.0.3,3.0)",
@@ -9,7 +13,8 @@ Import-Bundle:
com.springsource.org.apache.myfaces;version="[1.2.0,2.0.0)",
com.springsource.org.apache.myfaces.javax.faces;version="[1.2.0,2.0.0)",
com.springsource.com.sun.facelets;version="[1.1.14,1.2.0)",
org.springframework.security;version="[2.0.0,2.1.0)"
org.springframework.security;version="[2.0.0,2.1.0)",
com.springsource.org.jboss.el;version="[2.0.0,3.0.0)"
Import-Library:
org.springframework.spring;version="[2.5.4,3.0.0)",
org.hibernate.ejb;version="[3.3.1.ga, 3.3.1.ga]"

View File

@@ -8,11 +8,8 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<reference id="hotelHandlerMappings">
<interfaces>
<beans:value>org.springframework.web.servlet.HandlerMapping</beans:value>
<beans:value>org.springframework.core.Ordered</beans:value>
</interfaces>
</reference>
<reference id="bookingAgent" interface="org.springframework.samples.springtravel.hotel.BookingAgent" />
<reference id="transactionManager" interface="org.springframework.orm.jpa.JpaTransactionManager" />
<reference id="entityManagerFactory" interface="javax.persistence.EntityManagerFactory" />
</beans:beans>