@@ -0,0 +1,2227 @@
+package actor;%0A%0Aimport java.util.function.Consumer;%0A%0Aimport org.requirementsascode.AbstractActor;%0Aimport org.requirementsascode.Model;%0A%0Apublic class ActorExample %7B%0A  public static void main(String%5B%5D args) %7B%0A    GreetingService greetingService = new GreetingService(new SayHello());%0A    new MessageSender(greetingService).sendMessages();%0A  %7D%0A%7D%0A%0A/**%0A * Actor that owns and runs the use case model, and reacts to messages by%0A * dispatching them to message handlers.%0A */%0Aclass GreetingService extends AbstractActor %7B%0A%09private static final Class%3CRequestHello%3E requestsHello = RequestHello.class;%0A%09private Consumer%3CRequestHello%3E saysHello;%0A%0A%09public GreetingService(Consumer%3CRequestHello%3E saysHello) %7B%0A%09%09this.saysHello = saysHello;%0A%09%7D%0A%0A%09@Override%0A%09public Model behavior() %7B%0A%09%09Model model = Model.builder()%0A%09%09%09.user(requestsHello).system(saysHello)%0A%09%09%09%09.build();%0A%09%09return model;%0A%09%7D%0A%7D%0A%0A/**%0A * Sender of the message, external to the boundary%0A */%0Aclass MessageSender %7B%0A  private GreetingService greetingService;%0A%0A  public MessageSender(GreetingService greetingService) %7B%0A    this.greetingService = greetingService;%0A  %7D%0A%0A  /**%0A   * Send messages to the service actor. In this example, we don't care %0A   * about the return value of the call, because we don't send a query%0A   * or publish events.%0A   */%0A  public void sendMessages() %7B%0A    greetingService.reactTo(new RequestHello(%22Joe%22));%0A  %7D%0A%7D%0A%0A/**%0A * Command class%0A */%0Aclass RequestHello %7B%0A  private String userName;%0A%0A  public RequestHello(String userName) %7B%0A    this.userName = userName;%0A  %7D%0A%0A  public String getUserName() %7B%0A    return userName;%0A  %7D%0A%7D%0A%0A/**%0A * Message handlers%0A */%0Aclass SayHello implements Consumer%3CRequestHello%3E %7B%0A  private OutputAdapter outputAdapter;%0A%0A  public SayHello() %7B%0A    this.outputAdapter = new OutputAdapter();%0A  %7D%0A  %0A  public void accept(RequestHello requestHello) %7B%0A    String greeting = Greeting.forUser(requestHello.getUserName());%0A    outputAdapter.showMessage(greeting);%0A  %7D%0A%7D%0A%0A/**%0A * Infrastructure classes%0A */%0Aclass OutputAdapter%7B%0A  public void showMessage(String message) %7B%0A    System.out.println(message);%0A  %7D%0A%7D%0A%0A/**%0A * Domain classes%0A */%0Aclass Greeting%7B%0A  public static String forUser(String userName) %7B%0A    return %22Hello, %22 + userName + %22.%22;%0A  %7D%0A%7D%0A

Add actor example