public async void Execute(IJobExecutionContext context) { this.logger.Info("Starting database synchronization"); this.InitializePrerequisites(context.JobDetail.JobDataMap); await SynchronizationExecutor.ExecuteSynchronization(this.queryExecutor, this.queryBuilder, this.processingStrategyFactory); }
public override void UnInit() { synchronizationExecutor.UnInit(); synchronizationExecutor = null; sendSynchroValueRepList.Clear(); receiveSynchroValueRsp.Clear(); executeSystemUnit = null; }
public override void Init() { synchronizationExecutor = new SynchronizationExecutor(); synchronizationExecutor.Init(); sendIdDistributionChunk = new IdDistributionChunk(); sendIdDistributionChunk.Init(); sendIdDistributionChunk.SetInterval(2); sendSynchroValueRepList = new List <SynchroValueRep>(); receiveSynchroValueRsp = new List <SynchroValueRsp>(); executeSystemUnit = GlobalUnion.GetUnit <ExecuteSystemUnit>(); }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { kernel = new StandardKernel(); kernel.Load(Assembly.GetExecutingAssembly()); var strategyFactory = kernel.Get <IProcessingStrategyFactory>(); var queryBuilder = kernel.Get <IQueryBuilder>(); var queryExecutor = kernel.Get <IQueryExecutor>(); if (!Environment.UserInteractive) { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new SynchronizationService(queryExecutor, strategyFactory, queryBuilder) }; ServiceBase.Run(ServicesToRun); } else { SynchronizationExecutor.ExecuteSynchronization(queryExecutor, queryBuilder, strategyFactory).Wait(); } }