Skip to content

Commit 27de00b

Browse files
committed
Add ServiceProxyRegistrationBehavior to ConsoleHost
1 parent 6c8aafd commit 27de00b

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

InterProcessCommunication/TradingApp/.Notes/PresentationScript.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,19 @@ <h4 id="implement-servicepoxyattribute-and-serviceproxyregistrationbehavior">9.
262262
</li>
263263
</ul>
264264
</li>
265+
</ul>
266+
<h4 id="add-the-serviceproxyregistrationbehavior-to-consolehost-and-host-each-service-in-its-own-process">10. Add the <code>ServiceProxyRegistrationBehavior</code> to <code>ConsoleHost</code> and host each service in its own process</h4>
267+
<ul>
268+
<li>Register the service behavior and load the Proxies dll:
269+
<ul>
270+
<li>in <code>AppBootBootstrapper.cs</code> add:
271+
<ul>
272+
<li><code>.AddRegistrationBehavior(new ServiceProxyRegistrationBehavior());</code></li>
273+
<li><code>|| filename.StartsWith(&quot;Proxies.&quot;)</code></li>
274+
</ul>
275+
</li>
276+
</ul>
277+
</li>
265278
</ul>
266279

267280
</div>

InterProcessCommunication/TradingApp/.Notes/PresentationScript.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,11 @@ class QuotationService : IQuotationService
178178
- demo this with `ConsoleUi`
179179
- if implementations are deployed **everythign** is in one process
180180
- if we delete the implementations from the `\bin\` then we have *inter-process* communication with the Console Host!
181+
182+
183+
#### 10. Add the `ServiceProxyRegistrationBehavior` to `ConsoleHost` and host each service in its own process
184+
185+
- Register the service behavior and load the Proxies dll:
186+
- in `AppBootBootstrapper.cs` add:
187+
- `.AddRegistrationBehavior(new ServiceProxyRegistrationBehavior());`
188+
- `|| filename.StartsWith("Proxies.")`

InterProcessCommunication/TradingApp/ConsoleHost/AppBootBootstrapper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.IO;
33
using System.Linq;
44
using System.Reflection;
5+
using AppBootEx;
56
using iQuarc.AppBoot;
67
using iQuarc.AppBoot.Unity;
78

@@ -14,6 +15,7 @@ public static Bootstrapper Run()
1415
var assemblies = GetApplicationAssemblies().ToArray();
1516
Bootstrapper bootstrapper = new Bootstrapper(assemblies);
1617
bootstrapper.ConfigureWithUnity();
18+
bootstrapper.AddRegistrationBehavior(new ServiceProxyRegistrationBehavior());
1719
bootstrapper.AddRegistrationBehavior(new ServiceRegistrationBehavior());
1820

1921
bootstrapper.Run();
@@ -31,6 +33,7 @@ private static IEnumerable<Assembly> GetApplicationAssemblies()
3133
string filename = Path.GetFileName(dll);
3234
if (filename != null && (filename.StartsWith("Contracts")
3335
|| filename.StartsWith("Infra.")
36+
|| filename.StartsWith("Proxies.")
3437
|| filename.StartsWith("Portfolio.")
3538
|| filename.StartsWith("Quotations.")
3639
|| filename.StartsWith("Sales.")

InterProcessCommunication/TradingApp/ConsoleHost/ConsoleHost.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107
<None Include="packages.config" />
108108
</ItemGroup>
109109
<ItemGroup>
110+
<ProjectReference Include="..\AppBootEx\AppBootEx.csproj">
111+
<Project>{C378E838-1688-484B-A35E-A95E003E28BC}</Project>
112+
<Name>AppBootEx</Name>
113+
</ProjectReference>
110114
<ProjectReference Include="..\Modules\_Contracts\Contracts.csproj">
111115
<Project>{19297424-954D-42F5-AC38-6F22A25EA682}</Project>
112116
<Name>Contracts</Name>

0 commit comments

Comments
 (0)