예제 #1
0
 /// <summary>
 /// Initializes timer manager.
 /// </summary>
 public TimerManager(NodeAgentSfUtility nodeAgentSfUtility, SettingsManager settingsManager, WindowsUpdateManager windowsUpdateManager, CancellationToken cancellationToken)
 {
     this._settingsManager      = settingsManager;
     this._serviceSettings      = settingsManager.GetSettings();
     this._cancellationToken    = cancellationToken;
     this._helper               = new Helper();
     this._windowsUpdateManager = windowsUpdateManager;
     this._nodeAgentSfUtility   = nodeAgentSfUtility;
 }
 /// <summary>
 /// Initializes the update manager.
 /// </summary>
 public WindowsUpdateManager(OperationResultFormatter operationResultFormatter, NodeAgentSfUtility nodeAgentSfUtility, SettingsManager settingsManager, CancellationToken cancellationToken)
 {
     this._uSession = new UpdateSession();
     this._operationResultFormatter = operationResultFormatter;
     this._helper             = new Helper();
     this._settingsManager    = settingsManager;
     this._task               = null;
     this._cancellationToken  = cancellationToken;
     this._nodeAgentSfUtility = nodeAgentSfUtility;
     this.ResetManager();
 }
예제 #3
0
        /// <summary>
        /// Initializes Windows Service.
        /// </summary>
        public POAService(string nodeName, string applicationName)
        {
            _eventSource.InfoMessage("POSNodeSvc initalizing for Node {0}, Application {1}", nodeName, applicationName);
            this.ServiceName = "POSNodeSvc";
            Uri applicationUri = new Uri(applicationName);

            this._tokenSource = new CancellationTokenSource();
            SettingsManager settingsManager    = new SettingsManager();
            var             nodeAgentSfUtility = new NodeAgentSfUtility(nodeName, applicationUri, settingsManager,
                                                                        this._tokenSource.Token);
            OperationResultFormatter operationResultFormatter =
                new OperationResultFormatter(nodeName, settingsManager.GetSettings());

            WindowsUpdateManager windowsUpdateManager = new WindowsUpdateManager(operationResultFormatter,
                                                                                 nodeAgentSfUtility, settingsManager, this._tokenSource.Token);

            // timer manager will take care of stopping and disposing windows update manager also.
            this._timerManager = new TimerManager(nodeAgentSfUtility, settingsManager, windowsUpdateManager,
                                                  this._tokenSource.Token);
        }