Bamboo.Prevalence.PrevalenceEngine.RecoverCommands C# (CSharp) Метод

RecoverCommands() приватный Метод

private RecoverCommands ( Bamboo.Prevalence.Implementation.CommandLogReader reader, ExceptionDuringRecoveryHandler handler ) : void
reader Bamboo.Prevalence.Implementation.CommandLogReader
handler ExceptionDuringRecoveryHandler
Результат void
		private void RecoverCommands(CommandLogReader reader, ExceptionDuringRecoveryHandler handler)
		{
			ShareCurrentObject();

			try
			{
				Clock.Pause();
				try
				{
					foreach (ContextRecoveryCommand contextRecoveryCommand in reader)
					{
						Clock.Recover(contextRecoveryCommand.DateTime);
						
						ICommand command = contextRecoveryCommand.Command;
						try
						{							
							command.Execute(_system);
						}
						catch (System.Exception x)
						{
							// commands are allowed to throw exceptions
							// it is up to the client to decide what to
							// do with them
							OnExceptionDuringRecovery(handler, command, x);
						}
					}
				}
				finally
				{
					Clock.Resume();
				}
			}
			finally
			{				
				UnshareCurrentObject();
			}
		}