Example #1
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="root">TBD</param>
 /// <param name="provider">TBD</param>
 /// <param name="terminationPromise">TBD</param>
 /// <param name="log">TBD</param>
 public RootGuardianSupervisor(RootActorPath root, IActorRefProvider provider, TaskCompletionSource <Status> terminationPromise, ILoggingAdapter log)
 {
     _log = log;
     _terminationPromise = terminationPromise;
     _provider           = provider;
     _path = root / "_Root-guardian-supervisor";   //In akka this is root / "bubble-walker"
 }
        /// <summary>
        ///     Initializes this instance.
        /// </summary>
        public virtual void Init()
        {
            RootPath = new RootActorPath(Address);
            TempNode = RootPath / "temp";

            RootCell       = new ActorCell(System, "", new ConcurrentQueueMailbox());
            DeadLetters    = new DeadLetterActorRef(this, RootPath / "deadLetters", System.EventStream);
            Guardian       = (LocalActorRef)RootCell.ActorOf <GuardianActor>("user");
            SystemGuardian = (LocalActorRef)RootCell.ActorOf <GuardianActor>("system");
            TempContainer  = new VirtualPathContainer(this, TempNode, null);
        }
Example #3
0
        /// <summary>
        /// Tries to parse the uri, which should be a full uri, i.e containing protocol.
        /// For example "akka://System/user/my-actor"
        /// </summary>
        public static bool TryParse(string path, out ActorPath actorPath)
        {
            actorPath = null;


            Address address;
            Uri     uri;

            if (!TryParseAddress(path, out address, out uri))
            {
                return(false);
            }
            var pathElements = uri.AbsolutePath.Split('/');

            actorPath = new RootActorPath(address) / pathElements.Skip(1);
            return(true);
        }
Example #4
0
        public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream, Deployer deployer, Func <ActorPath, InternalActorRef> deadLettersFactory)
        {
            _settings    = settings;
            _eventStream = eventStream;
            _deployer    = deployer ?? new Deployer(settings);
            _rootPath    = new RootActorPath(new Address("akka", systemName));
            _log         = Logging.GetLogger(eventStream, "LocalActorRefProvider(" + _rootPath.Address + ")");
            if (deadLettersFactory == null)
            {
                deadLettersFactory = p => new DeadLetterActorRef(this, p, _eventStream);
            }
            _deadLetters = deadLettersFactory(_rootPath / "deadLetters");
            _tempNumber  = new AtomicCounterLong(1);
            _tempNode    = _rootPath / "temp";

            //TODO: _guardianSupervisorStrategyConfigurator = dynamicAccess.createInstanceFor[SupervisorStrategyConfigurator](settings.SupervisorStrategyClass, EmptyImmutableSeq).get
            _systemGuardianStrategy = SupervisorStrategy.DefaultStrategy;
        }
Example #5
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="systemName">TBD</param>
        /// <param name="settings">TBD</param>
        /// <param name="eventStream">TBD</param>
        /// <param name="deployer">TBD</param>
        /// <param name="deadLettersFactory">TBD</param>
        public LocalActorRefProvider(string systemName, Settings settings, EventStream eventStream, Deployer deployer, Func <ActorPath, IInternalActorRef> deadLettersFactory)
        {
            _settings    = settings;
            _eventStream = eventStream;
            _deployer    = deployer ?? new Deployer(settings);
            _rootPath    = new RootActorPath(new Address("akka", systemName));
            _log         = Logging.GetLogger(eventStream, "LocalActorRefProvider(" + _rootPath.Address + ")");
            if (deadLettersFactory == null)
            {
                deadLettersFactory = p => new DeadLetterActorRef(this, p, _eventStream);
            }
            _deadLetters = deadLettersFactory(_rootPath / "deadLetters");
            IgnoreRef    = new IgnoreActorRef(this);

            _tempNumber = new AtomicCounterLong(1);
            _tempNode   = _rootPath / "temp";

            _systemGuardianStrategy           = SupervisorStrategy.DefaultStrategy;
            _userGuardianStrategyConfigurator = SupervisorStrategyConfigurator.CreateConfigurator(Settings.SupervisorStrategyClass);
        }
        /// <summary>
        /// Tries to parse the uri, which should be a full uri, i.e containing protocol.
        /// For example "akka://System/user/my-actor"
        /// </summary>
        /// <param name="path">TBD</param>
        /// <param name="actorPath">TBD</param>
        /// <returns>TBD</returns>
        public static bool TryParse(string path, out ActorPath actorPath)
        {
            actorPath = null;


            Address address;
            Uri     uri;

            if (!TryParseAddress(path, out address, out uri))
            {
                return(false);
            }
            var pathElements = uri.AbsolutePath.Split('/');

            actorPath = new RootActorPath(address) / pathElements.Skip(1);
            if (uri.Fragment.StartsWith("#"))
            {
                var uid = int.Parse(uri.Fragment.Substring(1));
                actorPath = actorPath.WithUid(uid);
            }
            return(true);
        }