Esempio n. 1
0
 /// <summary>
 ///     Resolves the actor reference.
 /// </summary>
 /// <param name="actorPath">The actor path.</param>
 /// <returns>ActorRef.</returns>
 /// <exception cref="System.NotSupportedException">The provided actor path is not valid in the LocalActorRefProvider</exception>
 public override ActorRef ResolveActorRef(ActorPath actorPath)
 {
     if (Address.Equals(actorPath.Address))
     {
         if (actorPath.Elements.Head() == "temp")
         {
             //skip ""/"temp",
             string[] parts = actorPath.Elements.Drop(1).ToArray();
             return(TempContainer.GetChild(parts));
         }
         //standard
         ActorCell currentContext = RootCell;
         foreach (string part in actorPath.Elements)
         {
             currentContext = ((LocalActorRef)currentContext.Child(part)).Cell;
         }
         return(currentContext.Self);
     }
     throw new NotSupportedException("The provided actor path is not valid in the LocalActorRefProvider");
 }