Newer
Older
package fucoin;
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;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
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);
ActorRef superVisorActor = system.actorOf(SuperVisorImpl.props(), "SuperVisorImpl");
List<ActorRef> activeActors = new ArrayList<>();
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() {
Simon Könnecke
committed