The Main class

The AkkaQuickstart object in Hello World creates ActorSystem with a guardian. The guardian is the top level actor that bootstraps your application. The guardian is typically defined with Behaviors.setup that contains the initial bootstrap.

package com.lightbend.akka.sample;

import akka.actor.typed.ActorSystem;

import java.io.IOException;
public class AkkaQuickstart {
  public static void main(String[] args) {
    final ActorSystem<GreeterMain.Start> greeterMain = ActorSystem.create(GreeterMain.create(), "helloakka");

    greeterMain.tell(new GreeterMain.Start("Charles"));

    try {
      System.out.println(">>> Press ENTER to exit <<<");
      System.in.read();
    } catch (IOException ignored) {
    } finally {
      greeterMain.terminate();
    }
  }
}