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()); }
public void AddSegmentRunner(ISegmentRunner segmentRunner) { if (segmentRunner == null) { throw new ArgumentNullException("segmentRunner"); } segmentRunners.Add(segmentRunner); }