Made all domain model classes inherit common pattern base classes, removing lots of boilerplate code.
Made all immutable fields final, setting to null in package local no-args ctor (Hibernate will stil be able to set fields in runtime).
Added javadoc on Cargo.
Removed "empty itinerary" null pattern object, since a cargo is not always supposed to have an itinerary. More work left here though.
Huuuuge commit: restructured into project hierarchy, no other code changes. Everything compiles, tests run, but deployment is broken and will be remodeled.
Using "notifyOf..." naming convention in ApplicationEvents.
HandlingEvents now have a unique sequence number, and CargoUpdater looks events based on that to update the cargo in question.
First version of pessimistic locking of cargo during rerouting.
Cargo is now a facade for aggregate-internal classes Delivery and Projections.
Delivery calculates current voyage, last known location and transport status on the fly.
Introduced a tracking id generator domain service for getting next tracking id, instead of doing it in the cargo repository.
Extracted a Projections value object in the Cargo aggregate, which handles predictions about the future of the cargo (next expected activity, ETA).
Migrating to a much cleaner way to propagate handling updates to the cargo aggregate: Cargo.handled(HandlingActivity).
Moved some logic into *Status enums, making them richer.
Improvements to a number of toString()s
Expanded voyage rescheduling scenario test to include the case where a voyage is rescheduled so that the old itinerary is no longer maintainable, and modified the domain model to handle that case.
HandlingEvent now has a HandlingActivity field internally. HaAct is moved to shared package, as it's being used persistently by both Cargo and HandlingEvent.
Also improved a few toString() methods and added a CargoFactoryTest.
Added loadCargoForRouting application service call, which will put a pessimistic lock on a cargo during (re-)routing in order to show benefits of aggregate separation explicitly. Not implemented yet though.
Collected all event-driven application services under the dddsample.application.event package and renamed CargoInspectionService to CargoDeliveryUpdater.
Made cargo delivery update cause an event to be published and subscribed to (and acted upon), instead of performing checks at the same time the delivery is updated.
Removed unused events from ApplicationEvents.
Removed programmatic JMS adapters in favor of Spring adadpters.