コード例 #1
0
ファイル: Runner.cs プロジェクト: Synnduit/Synnduit
        private void RunSegment(
            int segmentIndex,
            int segmentCount,
            SegmentConfiguration segmentConfiguration,
            IBootstrapper bootstrapper,
            ISafeRepository safeRepository)
        {
            this.SetupConfigurationProvider(segmentConfiguration, bootstrapper);
            IContext context = this.SetupContext(
                segmentConfiguration,
                segmentIndex,
                segmentCount,
                bootstrapper,
                safeRepository);
            IBridge bridge = this.bridgeFactory.CreateBridge(
                segmentConfiguration.Type,
                context.EntityType.Type,
                bootstrapper);
            IInvocableInitializer invocableInitializer =
                bootstrapper.Get <IInvocableInitializer>();

            bridge.ContextValidator.Validate(context);
            ISegmentRunner segmentRunner = bridge.CreateSegmentRunner();

            bridge.EventDispatcher.SegmentExecuting(new SegmentExecutingArgs());
            invocableInitializer.Initialize(bridge.EventDispatcher);
            segmentRunner.Run();
            bridge.EventDispatcher.SegmentExecuted(new SegmentExecutedArgs());
        }
コード例 #2
0
ファイル: Runner.cs プロジェクト: Synnduit/Synnduit
        private void SetupConfigurationProvider(
            SegmentConfiguration segmentConfiguration,
            IBootstrapper bootstrapper)
        {
            IWritableConfigurationProvider writableConfigurationProvider
                = bootstrapper.Get <IWritableConfigurationProvider>();

            writableConfigurationProvider
            .SetConfigurationProvider(new ConfigurationProvider(
                                          this.configuration.Value, segmentConfiguration));
        }
コード例 #3
0
ファイル: Runner.cs プロジェクト: Synnduit/Synnduit
            private IReadOnlyDictionary <string, string> AssembleParameters(
                IBootstrapper bootstrapper,
                IEntityType entityType,
                IExternalSystem sourceSystem)
            {
                IParametersAssembler parametersAssembler
                    = bootstrapper.Get <IParametersAssembler>();

                return(parametersAssembler.AssembleParameters(
                           entityType.DestinationSystem.Id,
                           entityType.Id,
                           sourceSystem != null ? (Guid?)sourceSystem.Id : null));
            }
コード例 #4
0
 private void CreateOrUpdateAssets(
     IBootstrapper bootstrapper, DeploymentContext context)
 {
     using (ISafeRepository safeRepository = bootstrapper.Get <ISafeRepository>())
     {
         using (var scope = new TransactionScope())
         {
             this.CreateOrUpdateExternalSystems(
                 context.ExternalSystems, safeRepository);
             this.CreateOrUpdateEntityTypes(
                 context.EntityTypes, safeRepository);
             this.CreateSharedSourceSystemIdentifierGroups(
                 context.SharedSourceSystemIdentifierGroups, safeRepository);
             this.CreateOrUpdateFeeds(
                 context.Feeds, safeRepository);
             this.CreateOrUpdateParameters(context, safeRepository);
             scope.Complete();
         }
     }
 }
コード例 #5
0
ファイル: Runner.cs プロジェクト: Synnduit/Synnduit
 private void RunSegment(
     int segmentIndex,
     int segmentCount,
     SegmentConfiguration segmentConfiguration)
 {
     using (IBootstrapper bootstrapper =
                this.bootstrapperFactory.CreateBootstrapper())
     {
         using (ISafeRepository safeRepository =
                    bootstrapper.Get <ISafeRepository>())
         {
             this.RunSegment(
                 segmentIndex,
                 segmentCount,
                 segmentConfiguration,
                 bootstrapper,
                 safeRepository);
         }
     }
 }
コード例 #6
0
ファイル: Runner.cs プロジェクト: Synnduit/Synnduit
        private IContext SetupContext(
            SegmentConfiguration segmentConfiguration,
            int segmentIndex,
            int segmentCount,
            IBootstrapper bootstrapper,
            ISafeRepository safeRepository)
        {
            IContext context =
                this
                .GetContextFactory(safeRepository)
                .CreateContext(
                    bootstrapper,
                    segmentConfiguration,
                    segmentIndex,
                    segmentCount,
                    this.runData);
            IWritableContext writableContext = bootstrapper.Get <IWritableContext>();

            writableContext.SetContext(context);
            return(context);
        }