|
|
@@ -0,0 +1,115 @@
|
|
|
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:tx="http://www.springframework.org/schema/tx"
|
|
|
7
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
8
|
+ xsi:schemaLocation="
|
|
|
9
|
+ 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
|
|
|
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">
|
|
|
13
|
+
|
|
|
14
|
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
|
|
15
|
+ <property name="location" value="classpath:jdbc.properties"/>
|
|
|
16
|
+ </bean>
|
|
|
17
|
+
|
|
|
18
|
+
|
|
|
19
|
+ <!-- JMS messaging -->
|
|
|
20
|
+
|
|
|
21
|
+ <amq:connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost?broker.persistent=false&broker.useJmx=false"/>
|
|
|
22
|
+
|
|
|
23
|
+ <amq:topic id="cargoHandledTopic" name="CargoHandledTopic" physicalName="CargoHandledTopic"/>
|
|
|
24
|
+ <amq:topic id="misdirectedCargoTopic" name="MisdirectedCargoTopic" physicalName="MisdirectedCargoTopic"/>
|
|
|
25
|
+ <amq:topic id="deliveredCargoTopic" name="DeliveredCargoTopic" physicalName="DeliveredCargoTopic"/>
|
|
|
26
|
+ <amq:queue id="handlingEventRegistrationAttemptQueue" name="HandlingEventRegistrationAttemptQueue" physicalName="HandlingEventRegistrationAttemptQueue"/>
|
|
|
27
|
+ <amq:queue id="rejectedRegistrationAttemptsQueue" name="RejectedRegistrationAttemptsQueue" physicalName="RejectedRegistrationAttemptsQueue"/>
|
|
|
28
|
+
|
|
|
29
|
+ <jms:listener-container connection-factory="jmsConnectionFactory">
|
|
|
30
|
+ <jms:listener destination="CargoHandledTopic" ref="cargoHandledConsumer" />
|
|
|
31
|
+ <jms:listener destination="HandlingEventRegistrationAttemptQueue" ref="handlingEventRegistrationAttemptConsumer" />
|
|
|
32
|
+ <jms:listener destination="MisdirectedCargoTopic" ref="simpleLoggingConsumer"/>
|
|
|
33
|
+ <jms:listener destination="DeliveredCargoTopic" ref="simpleLoggingConsumer"/>
|
|
|
34
|
+ <jms:listener destination="RejectedRegistrationAttemptsQueue" ref="simpleLoggingConsumer"/>
|
|
|
35
|
+ </jms:listener-container>
|
|
|
36
|
+
|
|
|
37
|
+ <bean id="jmsOperations" class="org.springframework.jms.core.JmsTemplate">
|
|
|
38
|
+ <property name="connectionFactory" ref="jmsConnectionFactory"/>
|
|
|
39
|
+ </bean>
|
|
|
40
|
+
|
|
|
41
|
+ <bean id="applicationEvents" class="se.citerus.dddsample.infrastructure.messaging.jms.JmsApplicationEventsImpl">
|
|
|
42
|
+ <property name="jmsOperations" ref="jmsOperations"/>
|
|
|
43
|
+ <property name="cargoHandledTopic" ref="cargoHandledTopic"/>
|
|
|
44
|
+ <property name="misdirectedCargoTopic" ref="misdirectedCargoTopic"/>
|
|
|
45
|
+ <property name="deliveredCargoTopic" ref="deliveredCargoTopic"/>
|
|
|
46
|
+ <property name="rejectedRegistrationAttemptsQueue" ref="rejectedRegistrationAttemptsQueue"/>
|
|
|
47
|
+ <property name="handlingEventQueue" ref="handlingEventRegistrationAttemptQueue"/>
|
|
|
48
|
+ </bean>
|
|
|
49
|
+
|
|
|
50
|
+ <bean id="cargoHandledConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.CargoHandledConsumer">
|
|
|
51
|
+ <property name="trackingService" ref="trackingService"/>
|
|
|
52
|
+ </bean>
|
|
|
53
|
+
|
|
|
54
|
+ <bean id="handlingEventRegistrationAttemptConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.HandlingEventRegistrationAttemptConsumer">
|
|
|
55
|
+ <property name="handlingEventService" ref="handlingEventService"/>
|
|
|
56
|
+ </bean>
|
|
|
57
|
+
|
|
|
58
|
+ <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
|
|
|
59
|
+
|
|
|
60
|
+
|
|
|
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 -->
|
|
|
102
|
+
|
|
|
103
|
+ <bean id="routingService" class="se.citerus.dddsample.infrastructure.routing.ExternalRoutingService">
|
|
|
104
|
+ <property name="graphTraversalService" ref="graphTraversalService"/>
|
|
|
105
|
+ <property name="locationRepository" ref="locationRepository"/>
|
|
|
106
|
+ <property name="voyageRepository" ref="voyageRepository"/>
|
|
|
107
|
+ </bean>
|
|
|
108
|
+
|
|
|
109
|
+ <bean id="graphTraversalService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
|
|
|
110
|
+ <property name="serviceUrl" value="rmi://localhost:1099/PathFinder"/>
|
|
|
111
|
+ <property name="serviceInterface" value="com.partner.pathfinder.api.GraphTraversalService"/>
|
|
|
112
|
+ <property name="lookupStubOnStartup" value="false"/>
|
|
|
113
|
+ </bean>
|
|
|
114
|
+
|
|
|
115
|
+</beans>
|