protected override void OnStart(string[] args)
        {
            this.DependencyContainer = this.GetDependencyContainer();

            this.Logger = this.DependencyContainer.GetInstance <ILogger>();

            this.hubService = this.DependencyContainer.GetInstance <IOjsHubService>();

            try
            {
                this.Logger.Information("{Service} is starting...", Constants.LocalWorkerServiceName);

                this.hubService.Start();

                this.BeforeStartingThreads();

                this.StartThreads();

                this.Logger.Information("{Service} started", Constants.LocalWorkerServiceName);
            }
            catch (Exception e)
            {
                this.Logger.Error("Exception during {Service} start!", Constants.LocalWorkerServiceName, e);
            }
        }
示例#2
0
        public SubmissionProcessor(
            string name,
            IDependencyContainer dependencyContainer,
            ConcurrentQueue <TSubmission> submissionsForProcessing,
            int portNumber,
            object sharedLockObject)
        {
            this.Name = name;

            this.logger = dependencyContainer.GetInstance <ILogger>();
            this.logger.Information("{SubmissionProcessor} initializing.", this.Name);

            this.stopping = false;

            this.dependencyContainer      = dependencyContainer;
            this.submissionsForProcessing = submissionsForProcessing;
            this.portNumber       = portNumber;
            this.sharedLockObject = sharedLockObject;

            this.hubService = dependencyContainer.GetInstance <IOjsHubService>();

            this.logger.Information("{SubmissionProcessor} initialized.", this.Name);
        }