Example #1
0
        public void Initialize()
        {
            lock (_SyncRoot)
            {
                if (_TaskPersistenceSettings == null)
                {
                    _TaskPersistenceSettings = Supervisor.Configuration.TaskPersistenceSettings;
                    _PersistenceProvider     = _TaskPersistenceSettings.CreateProvider();
                    _PersistenceProvider.Open(_TaskPersistenceSettings.ConnectionString);

                    _AwaitingTaskCollection.Clear();

                    if (_PersistenceProvider is NullTaskPersistenceProvider)
                    {
                        Supervisor.LogEvent("No task persistence provider has been configured. Awaiting tasks will be lost when the service is shut down.", TraceEventType.Information);
                    }
                    else
                    {
                        int recoveredTasks = RecoverTasks();

                        if (recoveredTasks > 0)
                        {
                            Supervisor.LogEvent(string.Format("Recovered {0:#,##0} tasks from storage.", recoveredTasks), TraceEventType.Information);
                        }
                    }
                }
            }
        }
Example #2
0
		public void Initialize()
		{
			lock (_SyncRoot)
			{
				if (_TaskPersistenceSettings == null)
				{
					_TaskPersistenceSettings = Supervisor.Configuration.TaskPersistenceSettings;
					_PersistenceProvider = _TaskPersistenceSettings.CreateProvider();
					_PersistenceProvider.Open(_TaskPersistenceSettings.ConnectionString);

					_AwaitingTaskCollection.Clear();

					if (_PersistenceProvider is NullTaskPersistenceProvider)
					{
						Supervisor.LogEvent("No task persistence provider has been configured. Awaiting tasks will be lost when the service is shut down.", TraceEventType.Information);
					}
					else
					{
						int recoveredTasks = RecoverTasks();

						if (recoveredTasks > 0)
						{
							Supervisor.LogEvent(string.Format("Recovered {0:#,##0} tasks from storage.", recoveredTasks), TraceEventType.Information);
						}
					}
				}
			}
		}
Example #3
0
 public ConfigurationManager()
 {
     _ServiceName             = LoadServiceNameSettings();
     _ListenerPrefixes        = LoadListenerPrefixSettings();
     _RetryIntervals          = LoadRetryIntervalSettings();
     _AuthorizedTargets       = LoadUrlAuthorizationSettings(_ListenerPrefixes);
     _TaskPersistenceSettings = LoadTaskPersistenceSettings();
 }
Example #4
0
		public ConfigurationManager()
		{
			_ServiceName = LoadServiceNameSettings();
			_ListenerPrefixes = LoadListenerPrefixSettings();
			_RetryIntervals = LoadRetryIntervalSettings();
			_AuthorizedTargets = LoadUrlAuthorizationSettings(_ListenerPrefixes);
			_TaskPersistenceSettings = LoadTaskPersistenceSettings();
		}