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();
}
}