Skip to content
Snippets Groups Projects
Main.java 1.11 KiB
Newer Older
Michael Kmoch's avatar
Michael Kmoch committed
package fucoin;
Michael Kmoch's avatar
Michael Kmoch committed
import java.io.File;
import java.util.ArrayList;
import java.util.List;
Michael Kmoch's avatar
Michael Kmoch committed

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;
Michael Kmoch's avatar
Michael Kmoch committed


public class Main {
Michael Kmoch's avatar
Michael Kmoch committed

	public static void main(String[] args) throws InterruptedException {
Michael Kmoch's avatar
Michael Kmoch 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");
Michael Kmoch's avatar
Michael Kmoch committed
		superVisorActor.tell(new ServerActionJoin("Main"), a1);
		superVisorActor.tell(new ServerActionJoin("Main2"), a2);