public ActorRef ResolveActorRef(ActorPath actorPath) { if (HasAddress(actorPath.Address)) { if (actorPath.Elements.Head() == "remote") { if (actorPath.ToStringWithoutAddress() == "/remote") { return(RemoteDaemon); } //skip ""/"remote", string[] parts = actorPath.Elements.Drop(1).ToArray(); return(RemoteDaemon.GetChild(parts)); } if (actorPath.Elements.Head() == "temp") { //skip ""/"temp", string[] parts = actorPath.Elements.Drop(1).ToArray(); return(TempContainer.GetChild(parts)); } //standard var rootGuardian = RootGuardian; if (actorPath.ToStringWithoutAddress() == "/") { return(rootGuardian); } return(rootGuardian.GetChild(actorPath.Elements)); } return(new RemoteActorRef(Transport, Transport.LocalAddressForRemote(actorPath.Address), actorPath, ActorRef.Nobody, Props.None, Deploy.None)); }
public override void Init() { //TODO: this should not be here Address = new Address("akka", System.Name); //TODO: this should not work this way... Deployer = new RemoteDeployer(System.Settings); base.Init(); var daemonMsgCreateSerializer = new DaemonMsgCreateSerializer(System); var messageContainerSerializer = new MessageContainerSerializer(System); System.Serialization.AddSerializer(daemonMsgCreateSerializer); System.Serialization.AddSerializationMap(typeof (DaemonMsgCreate), daemonMsgCreateSerializer); System.Serialization.AddSerializer(messageContainerSerializer); System.Serialization.AddSerializationMap(typeof (ActorSelectionMessage), messageContainerSerializer); RemoteDaemon = new RemoteDaemon(System, RootPath/"remote", null); Transport = new Remoting(System, this); RemoteSettings = new RemoteSettings(System.Settings.Config); Transport.Start(); // RemoteHost.StartHost(System, port); }
public override ActorRef ResolveActorRef(ActorPath actorPath) { if (HasAddress(actorPath.Address)) { if (actorPath.Elements.Head() == "remote") { if (actorPath.ToStringWithoutAddress() == "/remote") { return(RemoteDaemon); } //skip ""/"remote", string[] parts = actorPath.Elements.Drop(1).ToArray(); return(RemoteDaemon.GetChild(parts)); } if (actorPath.Elements.Head() == "temp") { //skip ""/"temp", string[] parts = actorPath.Elements.Drop(1).ToArray(); return(TempContainer.GetChild(parts)); } //standard ActorCell currentContext = RootCell; if (actorPath.ToStringWithoutAddress() == "/") { return(currentContext.Self); } foreach (string part in actorPath.Elements) { currentContext = ((LocalActorRef)currentContext.Child(part)).Cell; } return(currentContext.Self); } return(new RemoteActorRef(Transport, Transport.LocalAddressForRemote(actorPath.Address), actorPath, ActorRef.Nobody, Props.None, Deploy.None)); }