|
|
@@ -1,25 +0,0 @@
|
|
1
|
|
-package se.citerus.dddsample.application.messaging;
|
|
2
|
|
-
|
|
3
|
|
-import se.citerus.dddsample.domain.model.handling.HandlingEvent;
|
|
4
|
|
-import se.citerus.dddsample.domain.service.DomainEventNotifier;
|
|
5
|
|
-import se.citerus.dddsample.domain.service.TrackingService;
|
|
6
|
|
-
|
|
7
|
|
-/**
|
|
8
|
|
- * Thread based implementation.
|
|
9
|
|
- */
|
|
10
|
|
-public class ThreadBasedDomainEventNotifierImpl implements DomainEventNotifier {
|
|
11
|
|
-
|
|
12
|
|
- private TrackingService trackingService;
|
|
13
|
|
-
|
|
14
|
|
- public void cargoWasHandled(final HandlingEvent event) {
|
|
15
|
|
- new Thread(new Runnable() {
|
|
16
|
|
- public void run() {
|
|
17
|
|
- trackingService.inspectCargo(event.cargo().trackingId());
|
|
18
|
|
- }
|
|
19
|
|
- }).start();
|
|
20
|
|
- }
|
|
21
|
|
-
|
|
22
|
|
- public void setTrackingService(TrackingService trackingService) {
|
|
23
|
|
- this.trackingService = trackingService;
|
|
24
|
|
- }
|
|
25
|
|
-}
|