View Javadoc

1   package se.citerus.dddsample.application;
2   
3   import se.citerus.dddsample.domain.model.cargo.Cargo;
4   import se.citerus.dddsample.domain.model.handling.HandlingEvent;
5   import se.citerus.dddsample.interfaces.handling.HandlingEventRegistrationAttempt;
6   
7   /**
8    * This interface provides a way to let other parts
9    * of the system know about events that have occurred.
10   * <p/>
11   * It may be implemented synchronously or asynchronously, using
12   * for example JMS.
13   */
14  public interface ApplicationEvents {
15  
16    /**
17     * A cargo has been handled.
18     *
19     * @param event handling event
20     */
21    void cargoWasHandled(HandlingEvent event);
22  
23    /**
24     * A cargo has been misdirected.
25     *
26     * @param cargo cargo
27     */
28    void cargoWasMisdirected(Cargo cargo);
29  
30    /**
31     * A cargo has arrived at its final destination.
32     *
33     * @param cargo cargo
34     */
35    void cargoHasArrived(Cargo cargo);
36  
37    /**
38     * A handling event regitration attempt is received.
39     *
40     * @param attempt handling event registration attempt
41     */
42    void receivedHandlingEventRegistrationAttempt(HandlingEventRegistrationAttempt attempt);
43  
44  }