Exemplo n.º 1
0
 ///<summary>
 ///Initialize: make a dummy cell which holds just a mailbox, then tell our
 ///supervisor that we exist so that he can create the real Cell in
 ///handleSupervise().
 ///Call twice on your own peril!
 ///This is protected so that others can have different initialization.
 /// </summary>
 public void Initialize(bool async)
 {
     var underlying = Underlying;
     if(underlying == null)
     {
         var newCell = new UnstartedCell(_system, this, _props, _supervisor);
         SwapUnderlying(newCell);
         SwapLookup(newCell);
         _supervisor.Tell(new Supervise(this, async));
         if(!async)
             Point();
     }
     else
     {
         throw new IllegalStateException("initialize called more than once!");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize: make a dummy cell which holds just a mailbox, then tell our
        /// supervisor that we exist so that he can create the real Cell in
        /// handleSupervise().
        /// </summary>
        /// <exception cref="IllegalStateException">This exception is thrown if this function is called more than once.</exception>
        public RepointableActorRef Initialize(bool async)
        {
            var underlying = Underlying;
            if (underlying == null)
            {
                var newCell = new UnstartedCell(System, this, Props, Supervisor);
                SwapUnderlying(newCell);
                SwapLookup(newCell);
                Supervisor.SendSystemMessage(new Supervise(this, async));
                if (!async)
                    Point();

                return this;
            }
            else
            {
                throw new IllegalStateException("initialize called more than once!");
            }
        }
Exemplo n.º 3
0
        ///<summary>
        ///Initialize: make a dummy cell which holds just a mailbox, then tell our
        ///supervisor that we exist so that he can create the real Cell in
        ///handleSupervise().
        ///Call twice on your own peril!
        ///This is protected so that others can have different initialization.
        /// </summary>
        public void Initialize(bool async)
        {
            var underlying = Underlying;

            if (underlying == null)
            {
                var newCell = new UnstartedCell(_system, this, _props, _supervisor);
                SwapUnderlying(newCell);
                SwapLookup(newCell);
                _supervisor.Tell(new Supervise(this, async));
                if (!async)
                {
                    Point();
                }
            }
            else
            {
                throw new IllegalStateException("initialize called more than once!");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize: make a dummy cell which holds just a mailbox, then tell our
        /// supervisor that we exist so that he can create the real Cell in
        /// handleSupervise().
        /// </summary>
        /// <param name="async">TBD</param>
        /// <exception cref="IllegalStateException">This exception is thrown if this function is called more than once.</exception>
        /// <returns>TBD</returns>
        public RepointableActorRef Initialize(bool async)
        {
            var underlying = Underlying;

            if (underlying == null)
            {
                var newCell = new UnstartedCell(System, this, Props, Supervisor);
                SwapUnderlying(newCell);
                SwapLookup(newCell);
                Supervisor.SendSystemMessage(new Supervise(this, async));
                if (!async)
                {
                    Point();
                }

                return(this);
            }
            else
            {
                throw new IllegalStateException("initialize called more than once!");
            }
        }