Exemplo n.º 1
0
		public static void DumpToConsole()
		{
			var taskList = new SortedList<RevaleeTask, RevaleeTask>();
			TaskPersistenceSettings persistenceSettings;

			var config = new ConfigurationManager();
			persistenceSettings = config.TaskPersistenceSettings;

			// Load persisted tasks from the persistence provider
			ITaskPersistenceProvider persistenceProvider = persistenceSettings.CreateProvider();

			if (persistenceProvider is NullTaskPersistenceProvider)
			{
				Console.WriteLine("WARNING: Exporting tasks is not available, because there is no configured task persistence provider.");
				return;
			}

			try
			{
				persistenceProvider.Open(persistenceSettings.ConnectionString);

				foreach (RevaleeTask task in persistenceProvider.ListAllTasks())
				{
					taskList.Add(task, task);
				}
			}
			finally
			{
				persistenceProvider.Close();
			}

			// Write to the console
			foreach (RevaleeTask task in taskList.Values)
			{
				Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0:s}Z {1}", task.CallbackTime, task.CallbackUrl.OriginalString));
			}
		}
Exemplo n.º 2
0
		private Supervisor()
		{
			try
			{
				_LoggingProvider = new TraceListenerLoggingProvider();
				try
				{
					_ConfigurationManager = new ConfigurationManager();
					_TelemetryManager = new TelemetryManager();
					_StateManager = new StateManager();
					_TimeManager = new TimeManager();
					_RequestManager = new RequestManager();
					_WorkManager = new WorkManager();
				}
				catch (Exception ex2)
				{
					try
					{
						_LoggingProvider.WriteEntry(string.Format("{0} [Critical startup error.]", ex2.Message), TraceEventType.Critical);
					}
					catch (Exception ex3)
					{
						Console.WriteLine("Could not write to the error log.");
						Console.WriteLine("*  {0}", ex3.Message);
					}

					throw;
				}
			}
			catch (Exception ex1)
			{
				Console.WriteLine("Could not initialize logging subsystem.");
				Console.WriteLine("*  {0}", ex1.Message);
				throw;
			}
		}