コード例 #1
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 internal T LookupOrStart <T>(Definition definition, IAddress address)
 => ActorAs <T>(ActorLookupOrStart(definition, address));
コード例 #2
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 internal T LookupOrStartThunk <T>(Definition definition, IAddress?address) => ActorAs <T>(ActorLookupOrStartThunk(definition, address) !);
コード例 #3
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
        /// <summary>
        /// Answers the <typeparamref name="T"/> protocol for the newly created <c>Actor</c> instance. (INTERNAL ONLY)
        /// </summary>
        /// <typeparam name="T">The protocol of the <c>Actor</c>.</typeparam>
        /// <param name="definition">The definition of the <c>Actor</c>.</param>
        /// <param name="parent">The <c>Actor</c> parent of this <c>Actor</c>.</param>
        /// <param name="maybeSupervisor">The possible supervisor of this <c>Actor</c>.</param>
        /// <param name="logger">The logger for this <c>Actor</c>.</param>
        /// <returns></returns>
        internal T ActorFor <T>(Definition definition, Actor?parent, ISupervisor?maybeSupervisor, ILogger logger)
        {
            var actor = ActorProtocolFor <T>(definition, parent, null, null, maybeSupervisor, logger);

            return(actor !.ProtocolActor);
        }
コード例 #4
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 internal T ActorFor <T>(Expression <Func <T> > factory, Actor?parent, ISupervisor?maybeSupervisor, ILogger logger)
 => ActorFor <T>(Definition.Has(factory), parent, maybeSupervisor, logger);
コード例 #5
0
ファイル: Stage.cs プロジェクト: zpbappi/vlingo-net-actors
 /// <summary>
 /// Start the directory scan process in search for a given Actor instance. (INTERNAL ONLY)
 /// </summary>
 internal void StartDirectoryScanner()
 {
     directoryScanner = ActorFor <IDirectoryScanner>(
         Definition.Has <DirectoryScannerActor>(
             Definition.Parameters(directory)));
 }
コード例 #6
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public TestActor <T>?TestActorFor <T>(Type actorType, params object[] parameters)
 => TestActorFor <T>(Definition.Has(actorType, parameters.ToList()));
コード例 #7
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public T ActorFor <T>(Expression <Func <T> > factory, string mailboxName, string actorName, IAddress address, ILogger logger)
 => ActorFor <T>(Definition.Has(factory, mailboxName, actorName), address, logger);
コード例 #8
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public T ActorFor <T>(Expression <Func <T> > factory)
 => ActorFor <T>(Definition.Has(factory));
コード例 #9
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public T ActorFor <T>(Expression <Func <T> > factory, ILogger logger)
 => ActorFor <T>(Definition.Has(factory), logger);
コード例 #10
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public T ActorFor <T>(Expression <Func <T> > factory, IAddress address)
 => ActorFor <T>(Definition.Has(factory), address);
コード例 #11
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 /// <summary>
 /// Answers the <typeparamref name="T"/> protocol of the newly created <c>Actor</c> that implements the protocol and
 /// that will be assigned the specific <paramref name="logger"/>.
 /// </summary>
 /// <typeparam name="T">The protocol.</typeparam>
 /// <param name="definition">The <c>Definition</c> used to initialize the newly created <c>Actor</c>.</param>
 /// <param name="logger">The <c>ILogger</c> to assign to the newly created <c>Actor</c>.</param>
 /// <returns>The <c>Actor</c> as <typeparamref name="T"/>.</returns>
 public T ActorFor <T>(Definition definition, ILogger logger)
 => ActorFor <T>(
     definition,
     definition.ParentOr(World.DefaultParent),
     definition.Supervisor,
     logger);
コード例 #12
0
ファイル: Stage.cs プロジェクト: zpbappi/vlingo-net-actors
 /// <summary>
 /// Answers a Mailbox for an Actor. If maybeMailbox is allocated answer it; otherwise
 /// answer a newly allocated Mailbox. (INTERNAL ONLY)
 /// </summary>
 /// <param name="definition">the Definition of the newly created Actor</param>
 /// <param name="address">the Address allocated to the Actor</param>
 /// <param name="maybeMailbox">the possible Mailbox</param>
 /// <returns></returns>
 private IMailbox AllocateMailbox(Definition definition, IAddress address, IMailbox maybeMailbox)
 => maybeMailbox ?? ActorFactory.ActorMailbox(this, address, definition);
コード例 #13
0
ファイル: Stage.cs プロジェクト: zpbappi/vlingo-net-actors
 /// <summary>
 /// Answers an Address for an Actor. If maybeAddress is allocated answer it; otherwise
 /// answer a newly allocated Address. (INTERNAL ONLY)
 /// </summary>
 /// <param name="definition">The Definition of the newly created Actor</param>
 /// <param name="maybeAddress">The possible address</param>
 /// <returns></returns>
 private IAddress AllocateAddress(Definition definition, IAddress maybeAddress)
 => maybeAddress ?? World.AddressFactory.UniqueWith(definition.ActorName);
コード例 #14
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 /// <summary>
 /// Answers the <code>T</code> protocol of the newly created <code>Actor</code> that implements the <code>protocol</code>.
 /// </summary>
 /// <typeparam name="T">The protocol type</typeparam>
 /// <param name="type">The type of <code>Actor</code> to create</param>
 /// <param name="parameters">Constructor parameters for the <code>Actor</code></param>
 /// <returns></returns>
 public T ActorFor <T>(Type type, params object[] parameters)
 => ActorFor <T>(Definition.Has(type, parameters.ToList()));
コード例 #15
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
        /// <summary>
        /// Answers a <code>Protocols</code> that provides one or more supported <paramref name="protocols"/> for the
        /// newly created <code>Actor</code> according to <paramref name="definition"/>.
        /// </summary>
        /// <param name="protocols">Array of protocols that the <code>Actor</code> supports.</param>
        /// <param name="definition">The definition providing parameters to the <code>Actor</code>.</param>
        /// <param name="parent">The actor that is this actor's parent.</param>
        /// <param name="maybeSupervisor">The possible supervisor of this actor.</param>
        /// <param name="logger">The logger of this actor.</param>
        /// <returns></returns>
        public Protocols ActorFor(Type[] protocols, Definition definition, Actor parent, ISupervisor?maybeSupervisor, ILogger logger)
        {
            var all = ActorProtocolFor(protocols, definition, parent, maybeSupervisor, logger);

            return(new Protocols(ActorProtocolActor <object> .ToActors(all)));
        }
コード例 #16
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 /// <summary>
 /// Answers the <typeparamref name="T"/> protocol of the newly created <c>Actor</c> that implements the protocol.
 /// </summary>
 /// <typeparam name="T">The protocol type.</typeparam>
 /// <param name="definition">The <c>Definition</c> used to initialize the newly created <c>Actor</c>.</param>
 /// <returns>The <c>Actor</c> as <typeparamref name="T"/>.</returns>
 public T ActorFor <T>(Definition definition)
 => ActorFor <T>(
     definition,
     definition.ParentOr(World.DefaultParent),
     definition.Supervisor,
     definition.LoggerOr(World.DefaultLogger));
コード例 #17
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 /// <summary>
 /// Answers a <c>Protocols</c> that provides one or more supported <paramref name="protocols"/> for the
 /// newly created <c>Actor</c> with the provided <paramref name="parameters"/>.
 /// </summary>
 /// <param name="protocols">The array of protocol that the <c>Actor</c> supports.</param>
 /// <param name="type">The type of the <c>Actor</c> to create.</param>
 /// <param name="parameters">The constructor parameters.</param>
 /// <returns>A <see cref="Protocols"/> instance.</returns>
 public Protocols ActorFor(Type[] protocols, Type type, params object[] parameters)
 => ActorFor(protocols, Definition.Has(type, parameters.ToList()));
コード例 #18
0
ファイル: Stage.cs プロジェクト: lanicon/vlingo-net-actors
 public T ActorFor <T>(Expression <Func <T> > factory, string actorName)
 => ActorFor <T>(Definition.Has(factory, actorName));
コード例 #19
0
ファイル: Stage.cs プロジェクト: zpbappi/vlingo-net-actors
 /// <summary>
 /// Answers the <c>ActorProtocolActor&lt;object&gt;[]</c> for the newly created Actor instance. (INTERNAL ONLY)
 /// </summary>
 /// <param name="protocols">The protocols of the <c>Actor</c>.</param>
 /// <param name="definition">The <c>Definition</c> of the <c>Actor</c>.</param>
 /// <param name="parent">The <c>Actor</c> parent of this <c>Actor</c>.</param>
 /// <param name="maybeSupervisor">The possible supervisor of this <c>Actor</c>.</param>
 /// <param name="logger">Teh logger for this <c>Actor</c>.</param>
 /// <returns></returns>
 internal ActorProtocolActor <object>[] ActorProtocolFor(Type[] protocols, Definition definition, Actor parent, ISupervisor maybeSupervisor, ILogger logger)
 {
     AssertProtocolCompliance(protocols);
     return(ActorProtocolFor(protocols, definition, parent, null, null, maybeSupervisor, logger));
 }