Ejemplo n.º 1
0
        public FeatureDefinitionTaskActor(
            IEventAggregator eventAggregator,
            IFeatureRepository repository,
            IDataService dataService,
            Guid taskId)
            : base(eventAggregator, taskId)
        {
            this.eventAggregator.Subscribe(this);

            this.repository  = repository;
            this.dataService = dataService;

            subTaskActor = Context.ActorOf(
                FeatureTaskActor.Props(
                    eventAggregator,
                    repository,
                    dataService,
                    Id,
                    true),
                "FeatureTaskActor-" + Id);

            featureDefinitionActor = Context.ActorOf(
                FeatureDefinitionActor.Props(dataService), "FeatureDefinitionActor-" + Id);

            FeatureDeactivations = new List <ActivatedFeatureSpecial>();

            Receive <Confirmation>(message => HandleConfirmation(message));
            Receive <DeinstallationRequest>(message => HandleDeinstallationRequest(message));
            Receive <DeinstallationCompleted>(message => HandleDeinstallationCompleted(message));
            Receive <ProgressMessage>(message => HandleActivatedFeatureDeactivationCompleted(message));
        }
Ejemplo n.º 2
0
        public LoadTaskActor(
            IEventAggregator eventAggregator,
            IFeatureRepository repository,
            IDataService dataService,
            Guid id)
            : base(eventAggregator, id)
        {
            locationActors   = new Dictionary <string, IActorRef>();
            this.repository  = repository;
            this.dataService = dataService;

            featureDefinitionActor = Context.ActorOf(
                FeatureDefinitionActor.Props(dataService), "FeatureDefinitionActor");

            farmLoadActor = Context.ActorOf(
                LocationActor.Props(dataService), "FarmLoadActor");

            ActivatedFeaturesLoaded = 0;

            FarmFeatureDefinitions =
                new ProgressModule(5d / 100, 0d, 1);

            Farm = new ProgressModule(5d / 100,
                                      FarmFeatureDefinitions.MaxCumulatedQuota, 1);

            WebApps = new ProgressModule(10d / 100,
                                         Farm.MaxCumulatedQuota);

            SitesAndWebs = new ProgressModule(
                1d - WebApps.MaxCumulatedQuota,
                WebApps.MaxCumulatedQuota);

            Receive <LoadTask>(message => InitiateLoadTask(message));
            Receive <LoadedDto>(message => ReceiveLocationsLoaded(message));
            Receive <FarmFeatureDefinitionsLoaded>(message => FarmFeatureDefinitionsLoaded(message));
        }