Commit 88e6920

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-03-27 03:57:28
registered teh command processor.
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@116 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent b1d9d1c
Changed files (5)
trunk/product/MyMoney/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -1,6 +1,7 @@
 using MoMoney.Infrastructure.Container;
 using MoMoney.Infrastructure.Logging;
 using MoMoney.Infrastructure.Logging.Log4NetLogging;
+using MoMoney.Infrastructure.Threading;
 using MoMoney.Utility.Core;
 
 namespace MoMoney.boot.container.registration
@@ -18,6 +19,7 @@ namespace MoMoney.boot.container.registration
         {
             registration.singleton<IDependencyRegistration>(() => registration);
             registration.singleton<ILogFactory, Log4NetLogFactory>();
+            registration.singleton<ICommandProcessor, AsynchronousCommandProcessor>();
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Infrastructure/eventing/EventAggregator.cs
@@ -54,10 +54,7 @@ namespace MoMoney.Infrastructure.eventing
 
         void within_lock(Action action)
         {
-            lock (mutex)
-            {
-                action();
-            }
+            lock (mutex) action();
         }
 
         void process(Action action)
trunk/product/MyMoney/Infrastructure/Threading/AsynchronousCommandProcessor.cs
@@ -15,11 +15,11 @@ namespace MoMoney.Infrastructure.Threading
             manual_reset = new ManualResetEvent(false);
         }
 
-        public void add(ICommand command_to_add_to_queue)
+        public void add(ICommand command_to_process)
         {
             lock (queued_commands)
             {
-                queued_commands.Enqueue(command_to_add_to_queue);
+                queued_commands.Enqueue(command_to_process);
                 reset_thread();
             }
         }
@@ -54,14 +54,8 @@ namespace MoMoney.Infrastructure.Threading
         {
             lock (queued_commands)
             {
-                if (queued_commands.Count > 0)
-                {
-                    manual_reset.Set();
-                }
-                else
-                {
-                    manual_reset.Reset();
-                }
+                if (queued_commands.Count > 0) manual_reset.Set();
+                else manual_reset.Reset();
             }
         }
     }
trunk/product/MyMoney/Infrastructure/Threading/CommandProcessor.cs
@@ -12,9 +12,9 @@ namespace MoMoney.Infrastructure.Threading
             queued_commands = new Queue<ICommand>();
         }
 
-        public void add(ICommand command_to_add_to_queue)
+        public void add(ICommand command_to_process)
         {
-            queued_commands.Enqueue(command_to_add_to_queue);
+            queued_commands.Enqueue(command_to_process);
         }
 
         public void run()
trunk/product/MyMoney/Infrastructure/Threading/ICommandProcessor.cs
@@ -4,6 +4,6 @@ namespace MoMoney.Infrastructure.Threading
 {
     public interface ICommandProcessor : ICommand
     {
-        void add(ICommand command_to_add_to_queue);
+        void add(ICommand command_to_process);
     }
 }
\ No newline at end of file