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

import java.io.File;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Address;

import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
Michael Kmoch's avatar
Michael Kmoch committed

public class MainRemote {
	public static ActorRef remoteSuperVisorActor;

	public static void main(String[] args) throws InterruptedException {

		//Load configuration from current directory or from resources directory of jar
Michael Kmoch's avatar
Michael Kmoch committed
		File file = new File("application.conf");
		Config config = ConfigFactory.parseFile(file);
		if (!file.exists()) {
			System.out.println("Load default application.conf");
			config = ConfigFactory.parseResources("application.conf");
		} else {
			System.out.println("Load local application.conf");
		}

		//Init System Actor System
Michael Kmoch's avatar
Michael Kmoch committed
		ActorSystem system = ActorSystem.create("Test", config);
		
		Address address = new Address("akka.tcp", "Core", "127.0.0.1", 1234);
		System.out.println(address);
		String path = "akka.tcp://Core@127.0.0.1:1234/user/Main";
		//System.out.println(system.actorSelection(ActorPath.fromString(path)));
Michael Kmoch's avatar
Michael Kmoch committed
		
		//System.out.println(ActorPath.isValidPathElement(""+address+"/user/Main"));
		ActorRef a1 = system.actorOf(WalletImpl.props(null,"","Remote1",remoteSuperVisorActor),"Remote1");