示例#1
0
 /// <summary>
 /// Answers the <typeparamref name="T"/> protocol for the child <c>Actor</c> to be created by this parent <c>Actor</c>.
 /// </summary>
 /// <typeparam name="T">The protocol type</typeparam>
 /// <param name="definition">The <c>Definition</c> of the child <c>Actor</c> to be created by this parent <c>Actor</c></param>
 /// <returns>A child <c>Actor</c> of type <typeparamref name="T"/> created by this parent <c>Actor</c>.</returns>
 protected internal virtual T ChildActorFor <T>(Definition definition)
 {
     if (definition.Supervisor != null)
     {
         return(LifeCycle.Environment.Stage.ActorFor <T>(
                    definition,
                    this,
                    definition.Supervisor,
                    Logger));
     }
     else
     {
         if (this is ISupervisor)
         {
             return(LifeCycle.Environment.Stage.ActorFor <T>(
                        definition,
                        this,
                        LifeCycle.LookUpProxy <ISupervisor>(),
                        Logger));
         }
         else
         {
             return(LifeCycle.Environment.Stage.ActorFor <T>(definition, this, null, Logger));
         }
     }
 }
示例#2
0
        /// <summary>
        /// Answers the <code>Protocols</code> for the child <code>Actor</code> to be created by this parent <code>Actor</code>.
        /// </summary>
        /// <param name="protocols">The protocols for the child <code>Actor</code>.</param>
        /// <param name="definition">The <code>Definition</code> of the child <code>Actor</code> to be created by this parent <code>Actor</code>.</param>
        /// <returns><code>Protocols</code></returns>
        protected internal Protocols ChildActorFor(Type[] protocols, Definition definition)
        {
            if (definition.Supervisor != null)
            {
                return(LifeCycle.Environment.Stage.ActorFor(protocols, definition, this, definition.Supervisor, Logger));
            }

            if (this is ISupervisor)
            {
                return(LifeCycle.Environment.Stage.ActorFor(protocols, definition, this, LifeCycle.LookUpProxy <ISupervisor>(), Logger));
            }

            return(LifeCycle.Environment.Stage.ActorFor(protocols, definition, this, null, Logger));
        }