Explorar el Código

Moved pathfinder to directly under com.

Split out messagning infrastructure context to separate file.
peter_backlund hace 17 años
padre
commit
4593076cf3

dddsample/src/main/java/com/partner/pathfinder/api/GraphTraversalService.java → dddsample/src/main/java/com/pathfinder/api/GraphTraversalService.java Ver fichero

1
-package com.partner.pathfinder.api;
1
+package com.pathfinder.api;
2
 
2
 
3
 import java.rmi.Remote;
3
 import java.rmi.Remote;
4
 import java.rmi.RemoteException;
4
 import java.rmi.RemoteException;

dddsample/src/main/java/com/partner/pathfinder/api/TransitEdge.java → dddsample/src/main/java/com/pathfinder/api/TransitEdge.java Ver fichero

1
-package com.partner.pathfinder.api;
1
+package com.pathfinder.api;
2
 
2
 
3
 import java.io.Serializable;
3
 import java.io.Serializable;
4
 import java.util.Date;
4
 import java.util.Date;

dddsample/src/main/java/com/partner/pathfinder/api/TransitPath.java → dddsample/src/main/java/com/pathfinder/api/TransitPath.java Ver fichero

1
-package com.partner.pathfinder.api;
1
+package com.pathfinder.api;
2
 
2
 
3
 import java.io.Serializable;
3
 import java.io.Serializable;
4
 import java.util.Collections;
4
 import java.util.Collections;

dddsample/src/main/java/com/partner/pathfinder/api/package.html → dddsample/src/main/java/com/pathfinder/api/package.html Ver fichero


dddsample/src/main/java/com/partner/pathfinder/internal/GraphDAO.java → dddsample/src/main/java/com/pathfinder/internal/GraphDAO.java Ver fichero

1
-package com.partner.pathfinder.internal;
1
+package com.pathfinder.internal;
2
 
2
 
3
 import java.util.ArrayList;
3
 import java.util.ArrayList;
4
 import java.util.Arrays;
4
 import java.util.Arrays;

dddsample/src/main/java/com/partner/pathfinder/internal/GraphTraversalServiceImpl.java → dddsample/src/main/java/com/pathfinder/internal/GraphTraversalServiceImpl.java Ver fichero

1
-package com.partner.pathfinder.internal;
1
+package com.pathfinder.internal;
2
 
2
 
3
-import com.partner.pathfinder.api.GraphTraversalService;
4
-import com.partner.pathfinder.api.TransitEdge;
5
-import com.partner.pathfinder.api.TransitPath;
3
+import com.pathfinder.api.GraphTraversalService;
4
+import com.pathfinder.api.TransitEdge;
5
+import com.pathfinder.api.TransitPath;
6
 
6
 
7
 import java.util.*;
7
 import java.util.*;
8
 
8
 

dddsample/src/main/resources/com/partner/pathfinder/internal/applicationContext.xml → dddsample/src/main/java/com/pathfinder/internal/applicationContext.xml Ver fichero

4
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
5
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
6
 
6
 
7
-  <bean id="internalGraphTraversalService" class="com.partner.pathfinder.internal.GraphTraversalServiceImpl">
7
+  <bean id="internalGraphTraversalService" class="com.pathfinder.internal.GraphTraversalServiceImpl">
8
     <constructor-arg ref="graphDAO"/>
8
     <constructor-arg ref="graphDAO"/>
9
   </bean>
9
   </bean>
10
 
10
 
11
-  <bean id="graphDAO" class="com.partner.pathfinder.internal.GraphDAO"/>
11
+  <bean id="graphDAO" class="com.pathfinder.internal.GraphDAO"/>
12
 
12
 
13
   <bean id="rmiGraphTraversalService" class="org.springframework.remoting.rmi.RmiServiceExporter">
13
   <bean id="rmiGraphTraversalService" class="org.springframework.remoting.rmi.RmiServiceExporter">
14
-    <property name="serviceInterface" value="com.partner.pathfinder.api.GraphTraversalService"/>
14
+    <property name="serviceInterface" value="com.pathfinder.api.GraphTraversalService"/>
15
     <property name="service" ref="internalGraphTraversalService"/>
15
     <property name="service" ref="internalGraphTraversalService"/>
16
     <property name="serviceName" value="PathFinder"/>
16
     <property name="serviceName" value="PathFinder"/>
17
   </bean>
17
   </bean>

dddsample/src/main/java/com/partner/pathfinder/internal/package.html → dddsample/src/main/java/com/pathfinder/internal/package.html Ver fichero


dddsample/src/main/java/com/partner/pathfinder/package.html → dddsample/src/main/java/com/pathfinder/package.html Ver fichero


+ 3
- 3
dddsample/src/main/java/se/citerus/dddsample/infrastructure/routing/ExternalRoutingService.java Ver fichero

1
 package se.citerus.dddsample.infrastructure.routing;
1
 package se.citerus.dddsample.infrastructure.routing;
2
 
2
 
3
-import com.partner.pathfinder.api.GraphTraversalService;
4
-import com.partner.pathfinder.api.TransitEdge;
5
-import com.partner.pathfinder.api.TransitPath;
3
+import com.pathfinder.api.GraphTraversalService;
4
+import com.pathfinder.api.TransitEdge;
5
+import com.pathfinder.api.TransitPath;
6
 import org.apache.commons.logging.Log;
6
 import org.apache.commons.logging.Log;
7
 import org.apache.commons.logging.LogFactory;
7
 import org.apache.commons.logging.LogFactory;
8
 import se.citerus.dddsample.domain.model.cargo.Itinerary;
8
 import se.citerus.dddsample.domain.model.cargo.Itinerary;

+ 53
- 0
dddsample/src/main/resources/context-infrastructure-messaging.xml Ver fichero

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
+  <!-- JMS messaging -->
13
+
14
+  <amq:connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
15
+
16
+  <amq:queue id="cargoHandledQueue" name="CargoHandledQueue" physicalName="CargoHandledQueue"/>
17
+  <amq:queue id="misdirectedCargoQueue" name="MisdirectedCargoQueue" physicalName="MisdirectedCargoQueue"/>
18
+  <amq:queue id="deliveredCargoQueue" name="DeliveredCargoQueue" physicalName="DeliveredCargoQueue"/>
19
+  <amq:queue id="handlingEventRegistrationAttemptQueue" name="HandlingEventRegistrationAttemptQueue" physicalName="HandlingEventRegistrationAttemptQueue"/>
20
+  <amq:queue id="rejectedRegistrationAttemptsQueue" name="RejectedRegistrationAttemptsQueue" physicalName="RejectedRegistrationAttemptsQueue"/>
21
+
22
+  <jms:listener-container connection-factory="jmsConnectionFactory">
23
+    <jms:listener destination="CargoHandledQueue" ref="cargoHandledConsumer" />
24
+    <jms:listener destination="HandlingEventRegistrationAttemptQueue" ref="handlingEventRegistrationAttemptConsumer" />
25
+    <jms:listener destination="MisdirectedCargoQueue" ref="simpleLoggingConsumer"/>
26
+    <jms:listener destination="DeliveredCargoQueue" ref="simpleLoggingConsumer"/>
27
+    <jms:listener destination="RejectedRegistrationAttemptsQueue" ref="simpleLoggingConsumer"/>
28
+  </jms:listener-container>
29
+
30
+  <bean id="jmsOperations" class="org.springframework.jms.core.JmsTemplate">
31
+    <property name="connectionFactory" ref="jmsConnectionFactory"/>
32
+  </bean>
33
+
34
+  <bean id="applicationEvents" class="se.citerus.dddsample.infrastructure.messaging.jms.JmsApplicationEventsImpl">
35
+    <property name="jmsOperations" ref="jmsOperations"/>
36
+    <property name="cargoHandledQueue" ref="cargoHandledQueue"/>
37
+    <property name="misdirectedCargoQueue" ref="misdirectedCargoQueue"/>
38
+    <property name="deliveredCargoQueue" ref="deliveredCargoQueue"/>
39
+    <property name="rejectedRegistrationAttemptsQueue" ref="rejectedRegistrationAttemptsQueue"/>
40
+    <property name="handlingEventQueue" ref="handlingEventRegistrationAttemptQueue"/>
41
+  </bean>
42
+
43
+  <bean id="cargoHandledConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.CargoHandledConsumer">
44
+    <property name="cargoInspectionService" ref="cargoInspectionService"/>
45
+  </bean>
46
+
47
+  <bean id="handlingEventRegistrationAttemptConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.HandlingEventRegistrationAttemptConsumer">
48
+    <property name="handlingEventService" ref="handlingEventService"/>
49
+  </bean>
50
+
51
+  <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
52
+
53
+</beans>

+ 4
- 50
dddsample/src/main/resources/context-infrastructure.xml Ver fichero

1
 <?xml version="1.0"?>
1
 <?xml version="1.0"?>
2
 
2
 
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"
5
-       xmlns:amq="http://activemq.apache.org/schema/core"
6
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
        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">
5
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
11
 
6
 
12
-  <import resource="context-infrastructure-persistence.xml" />
7
+  <import resource="context-infrastructure-persistence.xml"/>
8
+  <import resource="context-infrastructure-messaging.xml"/>
13
 
9
 
14
-  <!-- JMS messaging -->
15
-
16
-  <amq:connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
17
-
18
-  <amq:queue id="cargoHandledQueue" name="CargoHandledQueue" physicalName="CargoHandledQueue"/>
19
-  <amq:queue id="misdirectedCargoQueue" name="MisdirectedCargoQueue" physicalName="MisdirectedCargoQueue"/>
20
-  <amq:queue id="deliveredCargoQueue" name="DeliveredCargoQueue" physicalName="DeliveredCargoQueue"/>
21
-  <amq:queue id="handlingEventRegistrationAttemptQueue" name="HandlingEventRegistrationAttemptQueue" physicalName="HandlingEventRegistrationAttemptQueue"/>
22
-  <amq:queue id="rejectedRegistrationAttemptsQueue" name="RejectedRegistrationAttemptsQueue" physicalName="RejectedRegistrationAttemptsQueue"/>
23
-
24
-  <jms:listener-container connection-factory="jmsConnectionFactory">
25
-    <jms:listener destination="CargoHandledQueue" ref="cargoHandledConsumer" />
26
-    <jms:listener destination="HandlingEventRegistrationAttemptQueue" ref="handlingEventRegistrationAttemptConsumer" />
27
-    <jms:listener destination="MisdirectedCargoQueue" ref="simpleLoggingConsumer"/>
28
-    <jms:listener destination="DeliveredCargoQueue" ref="simpleLoggingConsumer"/>
29
-    <jms:listener destination="RejectedRegistrationAttemptsQueue" ref="simpleLoggingConsumer"/>
30
-  </jms:listener-container>
31
-
32
-  <bean id="jmsOperations" class="org.springframework.jms.core.JmsTemplate">
33
-    <property name="connectionFactory" ref="jmsConnectionFactory"/>
34
-  </bean>
35
-
36
-  <bean id="applicationEvents" class="se.citerus.dddsample.infrastructure.messaging.jms.JmsApplicationEventsImpl">
37
-    <property name="jmsOperations" ref="jmsOperations"/>
38
-    <property name="cargoHandledQueue" ref="cargoHandledQueue"/>
39
-    <property name="misdirectedCargoQueue" ref="misdirectedCargoQueue"/>
40
-    <property name="deliveredCargoQueue" ref="deliveredCargoQueue"/>
41
-    <property name="rejectedRegistrationAttemptsQueue" ref="rejectedRegistrationAttemptsQueue"/>
42
-    <property name="handlingEventQueue" ref="handlingEventRegistrationAttemptQueue"/>
43
-  </bean>
44
-
45
-  <bean id="cargoHandledConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.CargoHandledConsumer">
46
-    <property name="cargoInspectionService" ref="cargoInspectionService"/>
47
-  </bean>
48
-
49
-  <bean id="handlingEventRegistrationAttemptConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.HandlingEventRegistrationAttemptConsumer">
50
-    <property name="handlingEventService" ref="handlingEventService"/>
51
-  </bean>
52
-
53
-  <bean id="simpleLoggingConsumer" class="se.citerus.dddsample.infrastructure.messaging.jms.SimpleLoggingConsumer"/>
54
-
55
-  
56
   <!-- External graph traversal routing service  -->
10
   <!-- External graph traversal routing service  -->
57
 
11
 
58
   <bean id="routingService" class="se.citerus.dddsample.infrastructure.routing.ExternalRoutingService">
12
   <bean id="routingService" class="se.citerus.dddsample.infrastructure.routing.ExternalRoutingService">
63
 
17
 
64
   <bean id="graphTraversalService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
18
   <bean id="graphTraversalService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
65
     <property name="serviceUrl" value="rmi://localhost:1099/PathFinder"/>
19
     <property name="serviceUrl" value="rmi://localhost:1099/PathFinder"/>
66
-    <property name="serviceInterface" value="com.partner.pathfinder.api.GraphTraversalService"/>
20
+    <property name="serviceInterface" value="com.pathfinder.api.GraphTraversalService"/>
67
   </bean>
21
   </bean>
68
 
22
 
69
 </beans>
23
 </beans>

+ 1
- 0
dddsample/src/main/resources/log4j.properties Ver fichero

7
 log4j.logger.net.sf.ehcache.config.ConfigurationFactory=error
7
 log4j.logger.net.sf.ehcache.config.ConfigurationFactory=error
8
 
8
 
9
 log4j.logger.org.hibernate.SQL=debug
9
 log4j.logger.org.hibernate.SQL=debug
10
+log4j.logger.org.hibernate.hbm2ddl=debug

+ 4
- 4
dddsample/src/test/java/se/citerus/dddsample/infrastructure/routing/ExternalRoutingServiceTest.java Ver fichero

1
 package se.citerus.dddsample.infrastructure.routing;
1
 package se.citerus.dddsample.infrastructure.routing;
2
 
2
 
3
-import com.partner.pathfinder.api.GraphTraversalService;
4
-import com.partner.pathfinder.internal.GraphDAO;
5
-import com.partner.pathfinder.internal.GraphTraversalServiceImpl;
3
+import com.pathfinder.api.GraphTraversalService;
4
+import com.pathfinder.internal.GraphDAO;
5
+import com.pathfinder.internal.GraphTraversalServiceImpl;
6
 import junit.framework.TestCase;
6
 import junit.framework.TestCase;
7
 import static org.easymock.EasyMock.*;
7
 import static org.easymock.EasyMock.*;
8
 import se.citerus.dddsample.domain.model.cargo.*;
8
 import se.citerus.dddsample.domain.model.cargo.*;
42
     externalRoutingService.setGraphTraversalService(graphTraversalService);
42
     externalRoutingService.setGraphTraversalService(graphTraversalService);
43
   }
43
   }
44
 
44
 
45
-  // TODO this test belongs in com.partner.pathfinder
45
+  // TODO this test belongs in com.pathfinder
46
 
46
 
47
   public void testCalculatePossibleRoutes() {
47
   public void testCalculatePossibleRoutes() {
48
     TrackingId trackingId = new TrackingId("ABC");
48
     TrackingId trackingId = new TrackingId("ABC");