/// <summary>
        /// Activates this instance.
        /// </summary>
        /// <returns>A <see cref="Task"/> representing the work performed.</returns>
        public override async Task OnActivateAsync()
        {
            this.IsBeingReplayed = false;
            this.evaluatingEvent = false;
            this.resetting       = false;

            this.Logger = this.GetLogger(string.Format("{0}/{1}", this.GetKind(), this.GetPrimaryKey().ToString("N")));
            await base.OnActivateAsync();

            // Create the journal.
            this.journal = await JournalProvider.Create(this);

            // Read & apply all unapplied events.
            await this.ReplayUnappliedEvents();

            // Create the event producer with the journal.
            this.eventProducer = EventProducerGenerator.Create <TActorInterface>(this.journal, this.State.LastAppliedEventId + 1);
        }
 public string GetProducer(string kind)
 {
     return(EventProducerGenerator.GetSource(InvocationController.Actors.Value[kind]));
 }