Skip to content
Snippets Groups Projects
Main.java 1.19 KiB
Newer Older
Michael Kmoch's avatar
Michael Kmoch committed
package fucoin;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
Michael Kmoch's avatar
Michael Kmoch committed
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
Michael Kmoch's avatar
Michael Kmoch committed
import fucoin.actions.join.ServerActionJoin;
import fucoin.supervisor.SuperVisorImpl;
import fucoin.wallet.WalletImpl;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

Michael Kmoch's avatar
Michael Kmoch committed

public class Main {
    public static void main(String[] args) throws InterruptedException {
        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);
    }
    private static void startSupervisor() {
Michael Kmoch's avatar
Michael Kmoch committed
}