<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,7 @@ using System.Linq;
 using System.Text;
 
 using IServiceOriented.ServiceBus;
+using IServiceOriented.ServiceBus.Services;
 
 namespace IServiceOriented.ServiceBus.ConsoleUtility
 {</diff>
      <filename>IServiceOriented.ServiceBus.ConsoleUtility/Program.cs</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@
 
       &lt;endpoint name=&quot;ChatClientOut&quot; contract=&quot;IServiceOriented.ServiceBus.Samples.Chat.IChatService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttpWithUserName&quot; address=&quot;http://localhost/chatServer&quot; behaviorConfiguration=&quot;client&quot;&gt;&lt;/endpoint&gt;
 
-      &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.IServiceBusManagementService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttp&quot; address=&quot;http://localhost/serviceBusManagement&quot; behaviorConfiguration=&quot;client&quot; /&gt;
+      &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.Services.IServiceBusManagementService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttp&quot; address=&quot;http://localhost/serviceBusManagement&quot; behaviorConfiguration=&quot;client&quot; /&gt;
     &lt;/client&gt;
     &lt;services&gt;      
       &lt;service name=&quot;ChatServer&quot; behaviorConfiguration=&quot;esbListener&quot; &gt;
@@ -55,8 +55,8 @@
         &lt;endpoint name=&quot;wsHttp&quot; contract=&quot;IServiceOriented.ServiceBus.Samples.Chat.IChatService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttpWithUserName&quot; address=&quot;send&quot; /&gt;
       &lt;/service&gt;
 
-      &lt;service name=&quot;IServiceOriented.ServiceBus.ServiceBusManagementService&quot;&gt;
-        &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.IServiceBusManagementService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttp&quot; address=&quot;http://localhost/serviceBusManagement&quot; /&gt;
+      &lt;service name=&quot;IServiceOriented.ServiceBus.Services.ServiceBusManagementService&quot;&gt;
+        &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.Services.IServiceBusManagementService&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;wsHttp&quot; address=&quot;http://localhost/serviceBusManagement&quot; /&gt;
       &lt;/service&gt;
     &lt;/services&gt;
 </diff>
      <filename>IServiceOriented.ServiceBus.Samples.Chat/App.config</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,10 @@ using System.Linq;
 using System.Text;
 
 using IServiceOriented.ServiceBus.Collections;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Services;
+using IServiceOriented.ServiceBus.Listeners;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.Samples.Chat
 {
@@ -11,7 +15,7 @@ namespace IServiceOriented.ServiceBus.Samples.Chat
     {
         public ChatServer()
         {            
-            _serviceBus = new ServiceBusRuntime(SimpleServiceLocator.With(new QueuedDeliveryCore(new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_deliver&quot;, true), new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_retry&quot;, true), new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_fail&quot;, true)), new WcfManagementService()));
+            _serviceBus = new ServiceBusRuntime(new QueuedDeliveryCore(new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_deliver&quot;, true), new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_retry&quot;, true), new MsmqMessageDeliveryQueue(&quot;.\\private$\\chat_fail&quot;, true)), new WcfManagementService());
             _serviceBus.AddListener(new ListenerEndpoint(Guid.NewGuid(), &quot;Chat Service&quot;, &quot;ChatServer&quot;, &quot;http://localhost/chatServer&quot;, typeof(IChatService), new WcfListener()));
             _serviceBus.Subscribe(new SubscriptionEndpoint(Guid.NewGuid(), &quot;No subscribers&quot;, &quot;ChatClient&quot;, &quot;&quot;, typeof(IChatService), new MethodDispatcher(new UnhandledReplyHandler(_serviceBus)), new UnhandledMessageFilter(typeof(SendMessageRequest))));
             _serviceBus.UnhandledException+= (o, ex) =&gt;</diff>
      <filename>IServiceOriented.ServiceBus.Samples.Chat/ChatServer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.Samples.Chat
 {</diff>
      <filename>IServiceOriented.ServiceBus.Samples.Chat/WcfDispatcherWithUsernameCredentials.cs</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,8 @@ using System.Collections.Generic;
 using NUnit.Framework;
 
 using IServiceOriented.ServiceBus.UnitTests;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.Scripting.UnitTests
 {
@@ -38,7 +40,7 @@ def Execute():
 
             bool success = false;
 
-            ServiceBusRuntime runtime = new ServiceBusRuntime(SimpleServiceLocator.With(new QueuedDeliveryCore( new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue() )));
+            ServiceBusRuntime runtime = new ServiceBusRuntime(new QueuedDeliveryCore( new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue() ));
             runtime.Subscribe(new SubscriptionEndpoint(Guid.NewGuid(), &quot;Tranformation&quot;, null, null, typeof(void), dispatcher, new TypedMessageFilter(typeof(BeforeTransformation))));
             runtime.Subscribe(new SubscriptionEndpoint(Guid.NewGuid(), &quot;AfterTransformation&quot;, null, null, typeof(void), new ActionDispatcher( (subscription, md) =&gt;
             {</diff>
      <filename>IServiceOriented.ServiceBus.Scripting.UnitTests/ScriptTransformationDispatcherTest.cs</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ using System.Text;
 
 using System.Runtime.Serialization;
 using Microsoft.Scripting;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.Scripting
 {</diff>
      <filename>IServiceOriented.ServiceBus.Scripting/ScriptTransformationDispatcher.cs</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@
     &lt;/behaviors&gt;
     &lt;client&gt;
       &lt;endpoint name=&quot;NamedPipeClient&quot; contract=&quot;IServiceOriented.ServiceBus.UnitTests.IContract&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/remotehello&quot; /&gt;
-      &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.IServiceBusManagementService&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/serviceBusManagement&quot; /&gt;
+      &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.Services.IServiceBusManagementService&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/serviceBusManagement&quot; /&gt;
     &lt;/client&gt;
     &lt;services&gt;
       &lt;service name=&quot;NamedPipeListener&quot; behaviorConfiguration=&quot;debug&quot; &gt;
@@ -44,8 +44,8 @@
       &lt;service name=&quot;IServiceOriented.ServiceBus.UnitTests.ContractImplementation&quot; behaviorConfiguration=&quot;debug&quot; &gt;
         &lt;endpoint name=&quot;NamedPipe&quot; contract=&quot;IServiceOriented.ServiceBus.UnitTests.IContract&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/remotehello&quot; /&gt;
       &lt;/service&gt;
-      &lt;service name=&quot;IServiceOriented.ServiceBus.ServiceBusManagementService&quot; behaviorConfiguration=&quot;debug&quot;&gt;
-        &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.IServiceBusManagementService&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/serviceBusManagement&quot; /&gt;
+      &lt;service name=&quot;IServiceOriented.ServiceBus.Services.ServiceBusManagementService&quot; behaviorConfiguration=&quot;debug&quot;&gt;
+        &lt;endpoint contract=&quot;IServiceOriented.ServiceBus.Services.IServiceBusManagementService&quot; binding=&quot;netNamedPipeBinding&quot; bindingConfiguration=&quot;namedPipe&quot; address=&quot;net.pipe://localhost/serviceBusManagement&quot; /&gt;
       &lt;/service&gt;
     &lt;/services&gt;    
     </diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/App.config</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using IServiceOriented.ServiceBus.Delivery;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {
@@ -9,7 +10,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
     {
         public static ServiceBusRuntime MemoryQueueRuntime()
         {
-            ServiceBusRuntime runtime = new ServiceBusRuntime(SimpleServiceLocator.With(new QueuedDeliveryCore(new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue())));
+            ServiceBusRuntime runtime = new ServiceBusRuntime(new QueuedDeliveryCore(new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue()));
             return runtime;
         }
 
@@ -38,7 +39,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
             MsmqMessageDeliveryQueue retryQueue = new MsmqMessageDeliveryQueue(_retryQueuePath);
             MsmqMessageDeliveryQueue failQueue = new MsmqMessageDeliveryQueue(_failQueuePath);
 
-            return new ServiceBusRuntime(SimpleServiceLocator.With(new QueuedDeliveryCore(testQueue, retryQueue, failQueue)));
+            return new ServiceBusRuntime(new QueuedDeliveryCore(testQueue, retryQueue, failQueue));
         }
 
         const string _testQueuePath = &quot;.\\private$\\esb_test_queue&quot;;</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/Create.cs</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using IServiceOriented.ServiceBus.Delivery;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/NonTransactionalMemoryQueue.cs</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using IServiceOriented.ServiceBus.Delivery;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/NullMessageDeliveryQueue.cs</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ using System.Text;
 using System.Collections.Generic;
 using System.Linq;
 using NUnit.Framework;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestMessageFilters.cs</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,8 @@ using IServiceOriented.ServiceBus.Collections;
 
 using System.ServiceModel;
 using IServiceOriented.ServiceBus.Formatters;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestMsmqMessageDeliveryQueue.cs</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,8 @@ using System.Text;
 using System.Collections.Generic;
 using System.Linq;
 using NUnit.Framework;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {
@@ -17,7 +19,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
         [Test]
         public void Echo()
         {
-            using (ServiceBusRuntime runtime = new ServiceBusRuntime(SimpleServiceLocator.With(new QueuedDeliveryCore(new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue()))))
+            using (ServiceBusRuntime runtime = new ServiceBusRuntime(new QueuedDeliveryCore(new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue(), new NonTransactionalMemoryQueue())))
             {
                 CEcho echo = new CEcho();
 </diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestRequestResponse.cs</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,10 @@ using System.Text;
 using System.Collections.Generic;
 using System.Linq;
 using NUnit.Framework;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Services;
+using IServiceOriented.ServiceBus.Listeners;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {
@@ -19,7 +23,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
         [Test]
         public void CanAddAndRemoveSubscription()
         {
-            using(ServiceBusRuntime runtime = new ServiceBusRuntime(SimpleServiceLocator.With(new DirectDeliveryCore(), new WcfManagementService())))
+            using(ServiceBusRuntime runtime = new ServiceBusRuntime(new DirectDeliveryCore(), new WcfManagementService()))
             {
                 ServiceBusTest tester = new ServiceBusTest(runtime);
                 tester.StartAndStop(() =&gt;
@@ -42,7 +46,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
         [Test]
         public void CanAddAndRemoveListener()
         {
-            using (ServiceBusRuntime runtime = new ServiceBusRuntime(SimpleServiceLocator.With(new DirectDeliveryCore(), new WcfManagementService())))
+            using (ServiceBusRuntime runtime = new ServiceBusRuntime(new DirectDeliveryCore(), new WcfManagementService()))
             {
                 MessageDelivery.RegisterKnownType(typeof(PassThroughMessageFilter));
 </diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestServiceBusManagement.cs</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,10 @@ using System.Threading;
 using IServiceOriented.ServiceBus.Threading;
 using System.Collections.ObjectModel;
 
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Listeners;
+using IServiceOriented.ServiceBus.Dispatchers;
+
 namespace IServiceOriented.ServiceBus.UnitTests
 {
     
@@ -122,6 +126,7 @@ namespace IServiceOriented.ServiceBus.UnitTests
     {
         public TestServiceBusRuntime()
         {            
+            
         }
 
         </diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestServiceBusRuntime.cs</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@ using System.Linq;
 using NUnit.Framework;
 
 using IServiceOriented.ServiceBus.Data;
+using IServiceOriented.ServiceBus.Listeners;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestSqlSubscriptionDb.cs</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ using System.Text;
 using System.Collections.Generic;
 using System.Linq;
 using NUnit.Framework;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus.UnitTests
 {
@@ -26,8 +27,8 @@ namespace IServiceOriented.ServiceBus.UnitTests
             
             string message = &quot;blah blah test test&quot;;
 
-            WcfDispatcher contractDispatcher = new WcfDispatcher();
-            contractDispatcher.Dispatch(endpoint, new MessageDelivery(endpoint.Id, typeof(IContract), &quot;PublishThis&quot;, message, 3, new MessageDeliveryContext()));
+            WcfDispatcher contractDispatcher = new WcfDispatcher(endpoint);
+            contractDispatcher.Dispatch(new MessageDelivery(endpoint.Id, typeof(IContract), &quot;PublishThis&quot;, message, 3, new MessageDeliveryContext()));
 
             Assert.AreEqual(1, ci.PublishedCount);
             Assert.AreEqual(message, ci.PublishedMessages[0]);</diff>
      <filename>IServiceOriented.ServiceBus.UnitTests/TestWcfDispatcher.cs</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,8 @@ using System.Text;
 using System.ServiceModel;
 using System.ServiceModel.Dispatcher;
 using System.ServiceModel.Description;
+using IServiceOriented.ServiceBus.Services;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus
 {</diff>
      <filename>IServiceOriented.ServiceBus/AutoSubscribeBehavior.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,13 @@ namespace IServiceOriented.ServiceBus
     [DataContract]
     public abstract class Dispatcher : IDisposable
     {
+        protected Dispatcher()
+        {
+        }
+        protected Dispatcher(SubscriptionEndpoint endpoint)
+        {
+            _endpoint = endpoint;
+        }
         [NonSerialized]
         ServiceBusRuntime _runtime;
         /// &lt;summary&gt;
@@ -35,6 +42,23 @@ namespace IServiceOriented.ServiceBus
             }
         }
 
+        [NonSerialized]
+        SubscriptionEndpoint _endpoint;        
+        /// &lt;summary&gt;
+        /// Gets the subscription endpoint associated with this dispatcher.
+        /// &lt;/summary&gt;
+        public SubscriptionEndpoint Endpoint
+        {
+            get
+            {
+                return _endpoint;
+            }
+            internal set
+            {
+                _endpoint = value;
+            }
+        }
+
         internal void StartInternal()
         {
             OnStart();
@@ -65,7 +89,7 @@ namespace IServiceOriented.ServiceBus
         /// &lt;summary&gt;
         /// Handles sending a message to a subscriber endpoint.
         /// &lt;/summary&gt;
-        public abstract void Dispatch(SubscriptionEndpoint endpoint, MessageDelivery messageDelivery);
+        public abstract void Dispatch(MessageDelivery messageDelivery);
 
         /// &lt;summary&gt;
         /// Dispose any resources held by this dispatcher.</diff>
      <filename>IServiceOriented.ServiceBus/Dispatcher.cs</filename>
    </modified>
    <modified>
      <diff>@@ -85,14 +85,14 @@
     &lt;Reference Include=&quot;System.Xml&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
-    &lt;Compile Include=&quot;ActionDispatcher.cs&quot; /&gt;
-    &lt;Compile Include=&quot;DirectDeliveryCore.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Dispatchers\ActionDispatcher.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\DirectDeliveryCore.cs&quot; /&gt;
     &lt;Compile Include=&quot;Formatters\MessageDeliveryConverter.cs&quot; /&gt;
     &lt;Compile Include=&quot;Formatters\MessageDeliveryMessageContractFormatter.cs&quot; /&gt;
     &lt;Compile Include=&quot;MessageDeliveryContext.cs&quot; /&gt;
     &lt;Compile Include=&quot;AutoSubscribeBehavior.cs&quot; /&gt;
     &lt;Compile Include=&quot;Threading\CountdownLatch.cs&quot; /&gt;
-    &lt;Compile Include=&quot;DeliveryCore.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\DeliveryCore.cs&quot; /&gt;
     &lt;Compile Include=&quot;Dispatcher.cs&quot; /&gt;
     &lt;Compile Include=&quot;DuplicateIdentifierException.cs&quot; /&gt;
     &lt;Compile Include=&quot;Endpoint.cs&quot; /&gt;
@@ -102,29 +102,29 @@
     &lt;Compile Include=&quot;Threading\ILockedObject.cs&quot; /&gt;
     &lt;Compile Include=&quot;InvalidContractException.cs&quot; /&gt;
     &lt;Compile Include=&quot;ListenerEndpoint.cs&quot; /&gt;
-    &lt;Compile Include=&quot;IMessageDeliveryQueue.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\IMessageDeliveryQueue.cs&quot; /&gt;
     &lt;Compile Include=&quot;ListenerEndpointCollection.cs&quot; /&gt;
     &lt;Compile Include=&quot;PublishRequest.cs&quot; /&gt;
-    &lt;Compile Include=&quot;QueuedDeliveryCore.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\QueuedDeliveryCore.cs&quot; /&gt;
     &lt;Compile Include=&quot;Collections\ReadOnlyDictionary.cs&quot; /&gt;
-    &lt;Compile Include=&quot;CorrelationMessageFilter.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\CorrelationMessageFilter.cs&quot; /&gt;
     &lt;Compile Include=&quot;SimpleServiceLocator.cs&quot; /&gt;
     &lt;Compile Include=&quot;Data\SqlSubscriptionDB.cs&quot; /&gt;
-    &lt;Compile Include=&quot;SqlSubscriptionPersistenceService.cs&quot;&gt;
+    &lt;Compile Include=&quot;Services\SqlSubscriptionPersistenceService.cs&quot;&gt;
       &lt;SubType&gt;Code&lt;/SubType&gt;
     &lt;/Compile&gt;
     &lt;Compile Include=&quot;SubscriptionEndpointCollection.cs&quot; /&gt;
-    &lt;Compile Include=&quot;TransformationDispatcher.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Dispatchers\TransformationDispatcher.cs&quot; /&gt;
     &lt;Compile Include=&quot;Threading\ReaderWriterLockedObject.cs&quot; /&gt;
     &lt;Compile Include=&quot;UnhandledMessageFilter.cs&quot; /&gt;
-    &lt;Compile Include=&quot;PerformanceMonitorRuntimeService.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Services\PerformanceMonitorRuntimeService.cs&quot; /&gt;
     &lt;Compile Include=&quot;RuntimeService.cs&quot; /&gt;
     &lt;Compile Include=&quot;ListenerNotFoundException.cs&quot; /&gt;
     &lt;Compile Include=&quot;MessageDelivery.cs&quot; /&gt;
     &lt;Compile Include=&quot;MessageFilter.cs&quot; /&gt;
-    &lt;Compile Include=&quot;MethodDispatcher.cs&quot; /&gt;
-    &lt;Compile Include=&quot;MsmqMessageDeliveryQueue.cs&quot; /&gt;
-    &lt;Compile Include=&quot;PoisonMessageException.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Dispatchers\MethodDispatcher.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\MsmqMessageDeliveryQueue.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Delivery\PoisonMessageException.cs&quot; /&gt;
     &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
     &lt;Compile Include=&quot;Service.cs&quot; /&gt;
     &lt;Compile Include=&quot;ServiceBusRuntime.cs&quot; /&gt;
@@ -132,10 +132,10 @@
     &lt;Compile Include=&quot;SubscriptionNotFoundException.cs&quot; /&gt;
     &lt;Compile Include=&quot;SubscriptionPersistenceService.cs&quot; /&gt;
     &lt;Compile Include=&quot;TypedMessageFilter.cs&quot; /&gt;
-    &lt;Compile Include=&quot;WcfDispatcher.cs&quot; /&gt;
-    &lt;Compile Include=&quot;WcfListener.cs&quot; /&gt;
-    &lt;Compile Include=&quot;WcfServiceHostFactory.cs&quot; /&gt;
-    &lt;Compile Include=&quot;WcfManagementService.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Dispatchers\WcfDispatcher.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Listeners\WcfListener.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Listeners\WcfServiceHostFactory.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Services\WcfManagementService.cs&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;None Include=&quot;ClassDiagram.cd&quot; /&gt;</diff>
      <filename>IServiceOriented.ServiceBus/IServiceOriented.ServiceBus.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ using IServiceOriented.ServiceBus.Threading;
 using IServiceOriented.ServiceBus.Collections;
 using System.Collections.ObjectModel;
 using System.ServiceModel.Channels;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 
 namespace IServiceOriented.ServiceBus
@@ -56,7 +57,7 @@ namespace IServiceOriented.ServiceBus
             }
         }
 
-        static List&lt;Type&gt; _knownTypes = new List&lt;Type&gt;(new Type[] { typeof(UnhandledMessageFilter), typeof(WcfListener), typeof(WcfDispatcher), typeof(TypedMessageFilter), typeof(ReadOnlyCollection&lt;string&gt;), typeof(ReadOnlyCollection&lt;short&gt;), typeof(ReadOnlyCollection&lt;int&gt;), typeof(ReadOnlyCollection&lt;bool&gt;), typeof(ReadOnlyCollection&lt;decimal&gt;), typeof(ReadOnlyCollection&lt;float&gt;), typeof(ReadOnlyCollection&lt;double&gt;), typeof(ReadOnlyCollection&lt;long&gt;), typeof(ReadOnlyCollection&lt;Guid&gt;), typeof(MessageDeliveryContext) });
+        static List&lt;Type&gt; _knownTypes = new List&lt;Type&gt;(new Type[] { typeof(UnhandledMessageFilter), typeof(Listeners.WcfListener), typeof(WcfDispatcher), typeof(TypedMessageFilter), typeof(ReadOnlyCollection&lt;string&gt;), typeof(ReadOnlyCollection&lt;short&gt;), typeof(ReadOnlyCollection&lt;int&gt;), typeof(ReadOnlyCollection&lt;bool&gt;), typeof(ReadOnlyCollection&lt;decimal&gt;), typeof(ReadOnlyCollection&lt;float&gt;), typeof(ReadOnlyCollection&lt;double&gt;), typeof(ReadOnlyCollection&lt;long&gt;), typeof(ReadOnlyCollection&lt;Guid&gt;), typeof(MessageDeliveryContext) });
         /// &lt;summary&gt;
         /// Clears the list of types registered for message delivery.
         /// &lt;/summary&gt;</diff>
      <filename>IServiceOriented.ServiceBus/MessageDelivery.cs</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,8 @@ using System.Globalization;
 using Microsoft.Practices.ServiceLocation;
 using IServiceOriented.ServiceBus.Threading;
 using IServiceOriented.ServiceBus.Collections;
+using IServiceOriented.ServiceBus.Delivery;
+using IServiceOriented.ServiceBus.Dispatchers;
 
 namespace IServiceOriented.ServiceBus
 {
@@ -29,13 +31,17 @@ namespace IServiceOriented.ServiceBus
 
             if (serviceLocator == null)
             {                
-                serviceLocator = SimpleServiceLocator.With(new DirectDeliveryCore()); // default to simple service locator with direct message delivery
+                serviceLocator = SimpleServiceLocator.With(new Delivery.DirectDeliveryCore()); // default to simple service locator with direct message delivery
                 
             }
 
             _serviceLocator = serviceLocator;
         }
-		public ServiceBusRuntime() : this(null)
+
+        public ServiceBusRuntime(params RuntimeService[] runtimeServices) : this(SimpleServiceLocator.With(runtimeServices))
+        {            
+        }
+		public ServiceBusRuntime() : this((IServiceLocator)null)
 		{
             
 		}</diff>
      <filename>IServiceOriented.ServiceBus/ServiceBusRuntime.cs</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ using Microsoft.Practices.ServiceLocation;
 
 namespace IServiceOriented.ServiceBus
 {
-    public class SimpleServiceLocator : IServiceLocator
+    internal class SimpleServiceLocator : IServiceLocator
     {
         public SimpleServiceLocator()
         {</diff>
      <filename>IServiceOriented.ServiceBus/SimpleServiceLocator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,13 +14,6 @@ namespace IServiceOriented.ServiceBus
     [DataContract]
     public sealed class SubscriptionEndpoint : Endpoint
     {
-        public SubscriptionEndpoint(string name, string configurationName, string address, Type contractType, Dispatcher dispatcher, MessageFilter filter)
-            : base(Guid.NewGuid(), name, configurationName, address, contractType)
-        {
-            Filter = filter;
-            Dispatcher = dispatcher;
-        }
-
         public SubscriptionEndpoint(Guid id, string name, string configurationName, string address, Type contractType, Dispatcher dispatcher, MessageFilter filter)
             : base(id, name, configurationName, address, contractType)
         {
@@ -72,8 +65,17 @@ namespace IServiceOriented.ServiceBus
                 return _dispatcher;
             }
             private set
-            {                
-                _dispatcher = value;                
+            {
+                if (value != null &amp;&amp; value.Endpoint != null)
+                {
+                    throw new InvalidOperationException(&quot;Endpoint is attached to another dispatcher&quot;);
+                }
+                if (_dispatcher != null)
+                {
+                    _dispatcher.Endpoint = null;
+                }
+                _dispatcher = value;
+                if (value != null) value.Endpoint = this;
             }
         }
     }	</diff>
      <filename>IServiceOriented.ServiceBus/SubscriptionEndpoint.cs</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>IServiceOriented.ServiceBus/ActionDispatcher.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/CorrelationMessageFilter.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/DeliveryCore.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/DirectDeliveryCore.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/IMessageDeliveryQueue.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/MethodDispatcher.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/MsmqMessageDeliveryQueue.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/PerformanceMonitorRuntimeService.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/PoisonMessageException.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/QueuedDeliveryCore.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/SqlSubscriptionPersistenceService.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/TransformationDispatcher.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/WcfDispatcher.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/WcfListener.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/WcfManagementService.cs</filename>
    </removed>
    <removed>
      <filename>IServiceOriented.ServiceBus/WcfServiceHostFactory.cs</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>18b399562073fba19631f844245ed2a228631f0d</id>
    </parent>
  </parents>
  <author>
    <name>jezell</name>
    <email>jezell@gmail.com</email>
  </author>
  <url>http://github.com/jezell/iserviceoriented/commit/619da2047a742f9dfef2c9320fccd00dad7b6e39</url>
  <id>619da2047a742f9dfef2c9320fccd00dad7b6e39</id>
  <committed-date>2008-10-09T10:14:07-07:00</committed-date>
  <authored-date>2008-10-09T10:14:07-07:00</authored-date>
  <message>API usability/discoverability refactoring</message>
  <tree>3952f70be00cc45995b43116dcfcd4796761f7ed</tree>
  <committer>
    <name>jezell</name>
    <email>jezell@gmail.com</email>
  </committer>
</commit>
