Newer
Older
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
Simon Könnecke
committed
import fucoin.supervisor.SuperVisorImpl;
import fucoin.wallet.WalletImpl;
public static void main(String[] args) throws InterruptedException {
Simon Könnecke
committed
File file = new File("application.conf");
System.out.println("config found? " + file.exists());
Config config = ConfigFactory.parseFile(file);
ActorSystem system = ActorSystem.create("Core", config);
Simon Könnecke
committed
ActorRef superVisorActor = system.actorOf(SuperVisorImpl.props(),"SuperVisorImpl");
List<ActorRef> activeActors = new ArrayList<>();
Simon Könnecke
committed
ActorRef a1 = system.actorOf(WalletImpl.props(null,"","Main",superVisorActor),"Main");
ActorRef a2 = system.actorOf(WalletImpl.props(a1,"Main","Main2",superVisorActor),"Main2");
superVisorActor.tell(new ServerActionJoin("Main"), a1);
superVisorActor.tell(new ServerActionJoin("Main2"), a2);
Simon Könnecke
committed
}
private static void startSupervisor() {