Kaynağa Gözat

Restructured contexts slightly.

peter_backlund 17 yıl önce
ebeveyn
işleme
03bc69c8b2

+ 1
- 0
dddsample/src/main/resources/context-application.xml Dosyayı Görüntüle

13
   <bean id="trackingService" class="se.citerus.dddsample.application.impl.TrackingServiceImpl">
13
   <bean id="trackingService" class="se.citerus.dddsample.application.impl.TrackingServiceImpl">
14
     <constructor-arg ref="cargoRepository"/>
14
     <constructor-arg ref="cargoRepository"/>
15
     <constructor-arg ref="applicationEvents"/>
15
     <constructor-arg ref="applicationEvents"/>
16
+    <constructor-arg ref="handlingEventRepository"/>
16
   </bean>
17
   </bean>
17
 
18
 
18
   <bean id="handlingEventService" class="se.citerus.dddsample.application.impl.HandlingEventServiceImpl">
19
   <bean id="handlingEventService" class="se.citerus.dddsample.application.impl.HandlingEventServiceImpl">

+ 55
- 0
dddsample/src/main/resources/context-infrastructure-persistence.xml Dosyayı Görüntüle

1
+<?xml version="1.0"?>
2
+
3
+<beans xmlns="http://www.springframework.org/schema/beans"
4
+       xmlns:tx="http://www.springframework.org/schema/tx"
5
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+       xsi:schemaLocation="
7
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
8
+        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
9
+
10
+  <!-- Persistence - database, Hibernate, transactions, repository implementations -->
11
+
12
+  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
13
+    <property name="location" value="classpath:/jdbc.properties"/>
14
+  </bean>
15
+
16
+  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
17
+    <property name="url" value="${hibernate.connection.url}"/>
18
+    <property name="driverClassName" value="${hibernate.connection.driver_class}"/>
19
+    <property name="username" value="${hibernate.connection.username}"/>
20
+    <property name="password" value="${hibernate.connection.password}"/>
21
+    <property name="initialSize" value="4"/>
22
+    <property name="defaultAutoCommit" value="false"/>
23
+  </bean>
24
+
25
+  <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
26
+    <property name="dataSource" ref="dataSource"/>
27
+    <property name="configLocation" value="classpath:/hibernate.cfg.xml"/>
28
+  </bean>
29
+
30
+  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
31
+    <property name="sessionFactory" ref="sessionFactory"/>
32
+  </bean>
33
+
34
+  <tx:annotation-driven transaction-manager="transactionManager"/>
35
+
36
+  <bean id="cargoRepository" class="se.citerus.dddsample.infrastructure.persistence.hibernate.CargoRepositoryHibernate">
37
+    <property name="sessionFactory" ref="sessionFactory"/>
38
+  </bean>
39
+
40
+  <bean id="handlingEventRepository"
41
+        class="se.citerus.dddsample.infrastructure.persistence.hibernate.HandlingEventRepositoryHibernate">
42
+    <property name="sessionFactory" ref="sessionFactory"/>
43
+  </bean>
44
+
45
+  <bean id="voyageRepository"
46
+        class="se.citerus.dddsample.infrastructure.persistence.hibernate.VoyageRepositoryHibernate">
47
+    <property name="sessionFactory" ref="sessionFactory"/>
48
+  </bean>
49
+
50
+  <bean id="locationRepository"
51
+        class="se.citerus.dddsample.infrastructure.persistence.hibernate.LocationRepositoryHibernate">
52
+    <property name="sessionFactory" ref="sessionFactory"/>
53
+  </bean>
54
+
55
+</beans>

+ 2
- 48
dddsample/src/main/resources/context-infrastructure.xml Dosyayı Görüntüle

3
 <beans xmlns="http://www.springframework.org/schema/beans"
3
 <beans xmlns="http://www.springframework.org/schema/beans"
4
        xmlns:jms="http://www.springframework.org/schema/jms"
4
        xmlns:jms="http://www.springframework.org/schema/jms"
5
        xmlns:amq="http://activemq.apache.org/schema/core"
5
        xmlns:amq="http://activemq.apache.org/schema/core"
6
-       xmlns:tx="http://www.springframework.org/schema/tx"
7
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
        xsi:schemaLocation="
7
        xsi:schemaLocation="
9
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
8
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
10
         http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
9
         http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
11
-        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
12
         http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
10
         http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
13
 
11
 
14
-  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
15
-    <property name="location" value="classpath:jdbc.properties"/>
16
-  </bean>
17
-
12
+  <import resource="context-infrastructure-persistence.xml" />
18
 
13
 
19
   <!-- JMS messaging -->
14
   <!-- JMS messaging -->
20
 
15
 
58
   <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
53
   <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
59
 
54
 
60
   
55
   
61
-  <!-- Persistence - database, Hibernate, repository implementations -->
62
-
63
-  
64
-  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
65
-    <property name="url" value="${hibernate.connection.url}"/>
66
-    <property name="driverClassName" value="${hibernate.connection.driver_class}"/>
67
-    <property name="username" value="${hibernate.connection.username}"/>
68
-    <property name="password" value="${hibernate.connection.password}"/>
69
-    <property name="initialSize" value="4"/>
70
-    <property name="defaultAutoCommit" value="false"/>
71
-  </bean>
72
-
73
-  <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
74
-    <property name="dataSource" ref="dataSource"/>
75
-    <property name="configLocation" value="classpath:hibernate.cfg.xml"/>
76
-  </bean>
77
-
78
-  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
79
-    <property name="sessionFactory" ref="sessionFactory"/>
80
-  </bean>
81
-
82
-  <bean id="cargoRepository" class="se.citerus.dddsample.infrastructure.persistence.hibernate.CargoRepositoryHibernate">
83
-    <property name="sessionFactory" ref="sessionFactory"/>
84
-  </bean>
85
-
86
-  <bean id="handlingEventRepository" class="se.citerus.dddsample.infrastructure.persistence.hibernate.HandlingEventRepositoryHibernate">
87
-    <property name="sessionFactory" ref="sessionFactory"/>
88
-  </bean>
89
-
90
-  <bean id="voyageRepository" class="se.citerus.dddsample.infrastructure.persistence.hibernate.VoyageRepositoryHibernate">
91
-    <property name="sessionFactory" ref="sessionFactory"/>
92
-  </bean>
93
-
94
-  <bean id="locationRepository" class="se.citerus.dddsample.infrastructure.persistence.hibernate.LocationRepositoryHibernate">
95
-    <property name="sessionFactory" ref="sessionFactory"/>
96
-  </bean>
97
-
98
-  <tx:annotation-driven transaction-manager="transactionManager"/>
99
-
100
-
101
   <!-- External graph traversal routing service  -->
56
   <!-- External graph traversal routing service  -->
102
 
57
 
103
   <bean id="routingService" class="se.citerus.dddsample.infrastructure.routing.ExternalRoutingService">
58
   <bean id="routingService" class="se.citerus.dddsample.infrastructure.routing.ExternalRoutingService">
104
-    <property name="graphTraversalService" ref="graphTraversalService"/>
59
+    <property name="graphTraversalService" ref="internalGraphTraversalService"/>
105
     <property name="locationRepository" ref="locationRepository"/>
60
     <property name="locationRepository" ref="locationRepository"/>
106
     <property name="voyageRepository" ref="voyageRepository"/>
61
     <property name="voyageRepository" ref="voyageRepository"/>
107
   </bean>
62
   </bean>
109
   <bean id="graphTraversalService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
64
   <bean id="graphTraversalService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
110
     <property name="serviceUrl" value="rmi://localhost:1099/PathFinder"/>
65
     <property name="serviceUrl" value="rmi://localhost:1099/PathFinder"/>
111
     <property name="serviceInterface" value="com.partner.pathfinder.api.GraphTraversalService"/>
66
     <property name="serviceInterface" value="com.partner.pathfinder.api.GraphTraversalService"/>
112
-    <property name="lookupStubOnStartup" value="false"/>
113
   </bean>
67
   </bean>
114
 
68
 
115
 </beans>
69
 </beans>

+ 0
- 51
dddsample/src/main/resources/context-messaging-jms.xml Dosyayı Görüntüle

1
-<?xml version="1.0"?>
2
-
3
-<beans xmlns="http://www.springframework.org/schema/beans"
4
-       xmlns:jms="http://www.springframework.org/schema/jms"
5
-       xmlns:amq="http://activemq.apache.org/schema/core"
6
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7
-       xsi:schemaLocation="
8
-        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
9
-        http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
10
-        http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
11
-
12
-  <amq:connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
13
-
14
-  <amq:topic id="cargoHandledTopic" name="CargoHandledTopic" physicalName="CargoHandledTopic"/>
15
-  <amq:topic id="misdirectedCargoTopic" name="MisdirectedCargoTopic" physicalName="MisdirectedCargoTopic"/>
16
-  <amq:topic id="deliveredCargoTopic" name="DeliveredCargoTopic" physicalName="DeliveredCargoTopic"/>
17
-  <amq:queue id="handlingEventRegistrationAttemptQueue" name="HandlingEventRegistrationAttemptQueue" physicalName="HandlingEventRegistrationAttemptQueue"/>
18
-  <amq:queue id="rejectedRegistrationAttemptsQueue" name="RejectedRegistrationAttemptsQueue" physicalName="RejectedRegistrationAttemptsQueue"/>
19
-
20
-  <jms:listener-container connection-factory="jmsConnectionFactory">
21
-    <jms:listener destination="CargoHandledTopic" ref="cargoHandledConsumer" />
22
-    <jms:listener destination="HandlingEventRegistrationAttemptQueue" ref="handlingEventRegistrationAttemptConsumer" />
23
-    <jms:listener destination="MisdirectedCargoTopic" ref="simpleLoggingConsumer"/>
24
-    <jms:listener destination="DeliveredCargoTopic" ref="simpleLoggingConsumer"/>
25
-    <jms:listener destination="RejectedRegistrationAttemptsQueue" ref="simpleLoggingConsumer"/>
26
-  </jms:listener-container>
27
-
28
-  <bean id="jmsOperations" class="org.springframework.jms.core.JmsTemplate">
29
-    <property name="connectionFactory" ref="jmsConnectionFactory"/>
30
-  </bean>
31
-
32
-  <bean id="applicationEvents" class="se.citerus.dddsample.infrastructure.messaging.jms.JmsApplicationEventsImpl">
33
-    <property name="jmsOperations" ref="jmsOperations"/>
34
-    <property name="cargoHandledTopic" ref="cargoHandledTopic"/>
35
-    <property name="misdirectedCargoTopic" ref="misdirectedCargoTopic"/>
36
-    <property name="deliveredCargoTopic" ref="deliveredCargoTopic"/>
37
-    <property name="rejectedRegistrationAttemptsQueue" ref="rejectedRegistrationAttemptsQueue"/>
38
-    <property name="handlingEventQueue" ref="handlingEventRegistrationAttemptQueue"/>
39
-  </bean>
40
-
41
-  <bean id="cargoHandledConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.CargoHandledConsumer">
42
-    <property name="trackingService" ref="trackingService"/>
43
-  </bean>
44
-
45
-  <bean id="handlingEventRegistrationAttemptConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.HandlingEventRegistrationAttemptConsumer">
46
-    <property name="handlingEventService" ref="handlingEventService"/>
47
-  </bean>
48
-
49
-  <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
50
-  
51
-</beans>

+ 0
- 73
dddsample/src/main/resources/context-remote.xml Dosyayı Görüntüle

1
-<?xml version="1.0"?>
2
-
3
-<beans xmlns="http://www.springframework.org/schema/beans"
4
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
-	     xmlns:jaxws="http://cxf.apache.org/jaxws"
6
-       xsi:schemaLocation="http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
7
-                           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
8
-
9
-  <import resource="classpath:META-INF/cxf/cxf.xml"/>
10
-  <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
11
-  <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
12
-
13
-  <!-- Handling event registration web service -->
14
-
15
-  <jaxws:endpoint id="jax-ws.http" implementor="#handlingReportService" address="/ws/RegisterEvent"/>
16
-
17
-  <bean id="handlingReportService" class="se.citerus.dddsample.interfaces.handling.ws.impl.HandlingReportServiceImpl">
18
-    <property name="applicationEvents" ref="applicationEvents"/>
19
-  </bean>
20
-
21
-  <!-- File upload directory scanner -->
22
-
23
-  <bean id="scheduledTask" class="org.springframework.scheduling.timer.ScheduledTimerTask">
24
-    <property name="period" value="5000"/>
25
-    <property name="delay" value="5000"/>
26
-    <property name="timerTask" ref="uploadDirectoryScanner"/>
27
-  </bean>
28
-
29
-  <bean id="uploadDirectoryScanner" class="se.citerus.dddsample.interfaces.handling.file.UploadDirectoryScanner">
30
-    <property name="uploadDirectory" value="/tmp/upload"/>
31
-    <property name="parseFailureDirectory" value="/tmp/failed"/>
32
-    <property name="applicationEvents" ref="applicationEvents"/>
33
-  </bean>
34
-
35
-  <bean id="handlingReportConsumptionSupport" class="se.citerus.dddsample.interfaces.handling.HandlingReportParser"/>
36
-
37
-  <bean id="timerFactory" class="org.springframework.scheduling.timer.TimerFactoryBean">
38
-    <property name="scheduledTimerTasks">
39
-      <list>
40
-        <ref bean="scheduledTask"/>
41
-      </list>
42
-    </property>
43
-  </bean>
44
-  
45
-  <!-- RMI exposed booking service facade, which operates in an open Hibernate session -->
46
-
47
-  <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
48
-    <property name="sessionFactory" ref="sessionFactory"/>
49
-  </bean>
50
-
51
-  <bean id="bookingServiceFacade" class="org.springframework.aop.framework.ProxyFactoryBean">
52
-    <property name="target" ref="bookingServiceFacadeTarget"/>
53
-    <property name="interceptorNames">
54
-      <list>
55
-        <value>hibernateInterceptor</value>
56
-      </list>
57
-    </property>
58
-  </bean>
59
-
60
-  <bean id="bookingServiceFacadeTarget" class="se.citerus.dddsample.interfaces.booking.facade.BookingServiceFacadeImpl">
61
-    <property name="bookingService" ref="bookingService"/>
62
-    <property name="cargoRepository" ref="cargoRepository"/>
63
-    <property name="locationRepository" ref="locationRepository"/>
64
-    <property name="voyageRepository" ref="voyageRepository"/>
65
-  </bean>
66
-  
67
-  <bean id="rmiBookingServiceFacade" class="org.springframework.remoting.rmi.RmiServiceExporter">
68
-    <property name="serviceInterface" value="se.citerus.dddsample.interfaces.booking.facade.BookingServiceFacade"/>
69
-    <property name="service" ref="bookingServiceFacade"/>
70
-    <property name="serviceName" value="BookingService"/>
71
-  </bean>
72
-
73
-</beans>

+ 0
- 16
dddsample/src/main/resources/context-routingteam.xml Dosyayı Görüntüle

1
-<?xml version="1.0"?>
2
-
3
-<beans xmlns="http://www.springframework.org/schema/beans"
4
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
6
-
7
-  <!-- TODO start an RMI server on boot and wire this across the network -->
8
-  <bean id="graphTraversalService" class="com.partner.pathfinder.internal.GraphTraversalServiceImpl">
9
-    <constructor-arg ref="graphDAO"/>
10
-  </bean>
11
-
12
-  <bean id="graphDAO" class="com.partner.pathfinder.internal.GraphDAO">
13
-    <constructor-arg ref="dataSource"/>
14
-  </bean>
15
-
16
-</beans>