Commit 91a73b3
Changed files (9)
code/client/Client.cs
@@ -1,79 +1,75 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Net;
-using Autofac.Builder;
-using common;
-using Rhino.Queues;
-
-namespace client
-{
- class Client
- {
- static void Main(string[] args)
- {
- //var server_path = Path.Combine(Environment.CurrentDirectory, "../server/bin/Debug/server.exe");
- //Process.Start(@"D:\development\mokhan\git\mo.money\product\presentation.windows.server\bin\Debug\presentation.windows.server.exe");
- //Process.Start(server_path);
-
- try
- {
- AppDomain.CurrentDomain.UnhandledException += (o, e) =>
- {
- (e.ExceptionObject as Exception).add_to_log();
- };
- AppDomain.CurrentDomain.ProcessExit += (o, e) =>
- {
- "shutting down".log();
- try
- {
- Resolve.the<CommandProcessor>().stop();
- Resolve.the<IQueueManager>().Dispose();
- }
- catch {}
- Environment.Exit(Environment.ExitCode);
- };
- run();
- Console.ReadLine();
- }
- catch (Exception e)
- {
- e.add_to_log();
- Console.Out.WriteLine(e);
- Console.ReadLine();
- }
- }
-
- static void run()
- {
- var builder = new ContainerBuilder();
- var registry = new AutofacDependencyRegistryBuilder(builder).build();
- Resolve.initialize_with(registry);
- builder.Register(x => registry).As<DependencyRegistry>().SingletonScoped();
-
- //needs startups
- builder.Register<StartServiceBus>().As<NeedStartup>();
-
- // infrastructure
-
- var manager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 2201), "client.esent");
- manager.CreateQueues("client");
- builder.Register(x => new RhinoPublisher("server", 2200, manager)).As<ServiceBus>().SingletonScoped();
- builder.Register(x => new RhinoReceiver(manager.GetQueue("client"), x.Resolve<CommandProcessor>())).As<RhinoReceiver>().As<Receiver>().SingletonScoped();
-
- // presentation infrastructure
-
- // presenters
-
- // commanding
- builder.Register<AsynchronousCommandProcessor>().As<CommandProcessor>().SingletonScoped();
-
- // queries
-
- Resolve.the<IEnumerable<NeedStartup>>().each(x => x.run());
- Resolve.the<CommandProcessor>().run();
- "started".log();
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Net;
+using Autofac.Builder;
+using common;
+using Rhino.Queues;
+
+namespace client
+{
+ class Client
+ {
+ static void Main(string[] args)
+ {
+ Process.Start(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\server\bin\Debug\server.exe")));
+
+ try
+ {
+ AppDomain.CurrentDomain.UnhandledException += (o, e) =>
+ {
+ (e.ExceptionObject as Exception).add_to_log();
+ };
+ AppDomain.CurrentDomain.ProcessExit += (o, e) =>
+ {
+ "shutting down".log();
+ try
+ {
+ Resolve.the<CommandProcessor>().stop();
+ Resolve.the<IQueueManager>().Dispose();
+ }
+ catch {}
+ Environment.Exit(Environment.ExitCode);
+ };
+ run();
+ Console.ReadLine();
+ }
+ catch (Exception e)
+ {
+ e.add_to_log();
+ Console.Out.WriteLine(e);
+ Console.ReadLine();
+ }
+ }
+
+ static void run()
+ {
+ var builder = new ContainerBuilder();
+ var registry = new AutofacDependencyRegistryBuilder(builder).build();
+ Resolve.initialize_with(registry);
+ builder.Register(x => registry).As<DependencyRegistry>().SingletonScoped();
+
+ //needs startups
+ builder.Register<StartServiceBus>().As<NeedStartup>();
+
+ // infrastructure
+
+ var manager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 2201), "client.esent");
+ manager.CreateQueues("client");
+ builder.Register(x => new RhinoPublisher("server", 2200, manager)).As<ServiceBus>().SingletonScoped();
+ builder.Register(x => new RhinoReceiver(manager.GetQueue("client"), x.Resolve<CommandProcessor>())).As<RhinoReceiver>().As<Receiver>().SingletonScoped();
+
+
+ // commanding
+ builder.Register<AsynchronousCommandProcessor>().As<CommandProcessor>().SingletonScoped();
+
+
+ builder.Register<StartedApplicationHandler>().As<Handler>();
+
+ Resolve.the<IEnumerable<NeedStartup>>().each(x => x.run());
+ Resolve.the<CommandProcessor>().run();
+ "started".log();
+ }
+ }
}
\ No newline at end of file
code/client/client.csproj
@@ -1,76 +1,77 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{92EFD2E5-B1F9-4894-8054-CE10A6ABB74A}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>client</RootNamespace>
- <AssemblyName>client</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Autofac, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\external\auto.fac\Autofac.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Queues, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\external\rhino.queues\Rhino.Queues.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Client.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="StartServiceBus.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\common\common.csproj">
- <Project>{B34D543A-B443-4344-BD0E-2CFC6283D643}</Project>
- <Name>common</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{92EFD2E5-B1F9-4894-8054-CE10A6ABB74A}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>client</RootNamespace>
+ <AssemblyName>client</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Autofac, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\auto.fac\Autofac.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Queues, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\external\rhino.queues\Rhino.Queues.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Client.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="StartedApplicationHandler.cs" />
+ <Compile Include="StartServiceBus.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\common\common.csproj">
+ <Project>{B34D543A-B443-4344-BD0E-2CFC6283D643}</Project>
+ <Name>common</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
\ No newline at end of file
code/client/StartedApplicationHandler.cs
@@ -0,0 +1,13 @@
+using common;
+using common.messages;
+
+namespace client
+{
+ public class StartedApplicationHandler : AbstractHandler<StartedApplication>
+ {
+ public override void handle(StartedApplication item)
+ {
+ "received {0}".log(item.message);
+ }
+ }
+}
\ No newline at end of file
code/client/StartServiceBus.cs
@@ -1,20 +1,20 @@
-using common;
-
-namespace client
-{
- public class StartServiceBus : NeedStartup
- {
- public void run()
- {
- var receiver = Resolve.the<RhinoReceiver>();
- var handler = new MessageHandler(Resolve.the<DependencyRegistry>());
- receiver.register(x =>
- {
- // synchronize with ui thread?
- handler.handler(x);
- });
- Resolve.the<CommandProcessor>().add(receiver);
- //Resolve.the<ServiceBus>().publish<StartedApplication>(x => x.message = "client");
- }
- }
+using common;
+using common.messages;
+
+namespace client
+{
+ public class StartServiceBus : NeedStartup
+ {
+ public void run()
+ {
+ var receiver = Resolve.the<RhinoReceiver>();
+ var handler = new MessageHandler(Resolve.the<DependencyRegistry>());
+ receiver.register(x =>
+ {
+ handler.handler(x);
+ });
+ Resolve.the<CommandProcessor>().add(receiver);
+ Resolve.the<ServiceBus>().publish<StartedApplication>(x => x.message = "client");
+ }
+ }
}
\ No newline at end of file
code/common/Logging.cs
@@ -1,44 +1,44 @@
-using System;
-using System.IO;
-using System.Reflection;
-
-namespace common
-{
- static public class Logging
- {
- static public Logger log<T>(this T item)
- {
- return new TextLogger(Console.Out);
- }
-
- static public void log(this string item)
- {
- new TextLogger(Console.Out).debug(item);
- }
-
- static public void add_to_log(this Exception item)
- {
- new TextLogger(Console.Out).debug(item.Message);
- }
- }
-
- public class TextLogger : Logger
- {
- readonly TextWriter writer;
-
- public TextLogger(TextWriter writer)
- {
- this.writer = writer;
- }
-
- public void debug(string message, params object[] arguments)
- {
- writer.WriteLine("{0} {1}".format(Assembly.GetEntryAssembly().FullName, message.format(arguments)));
- }
- }
-
- public interface Logger
- {
- void debug(string message, params object[] arguments);
- }
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace common
+{
+ static public class Logging
+ {
+ static public Logger log<T>(this T item)
+ {
+ return new TextLogger(Console.Out);
+ }
+
+ static public void log(this string item, params object[] arguments)
+ {
+ new TextLogger(Console.Out).debug(item, arguments);
+ }
+
+ static public void add_to_log(this Exception item)
+ {
+ new TextLogger(Console.Out).debug(item.Message);
+ }
+ }
+
+ public class TextLogger : Logger
+ {
+ readonly TextWriter writer;
+
+ public TextLogger(TextWriter writer)
+ {
+ this.writer = writer;
+ }
+
+ public void debug(string message, params object[] arguments)
+ {
+ writer.WriteLine("{0}: {1}".format(Assembly.GetEntryAssembly().GetName().Name, message.format(arguments)));
+ }
+ }
+
+ public interface Logger
+ {
+ void debug(string message, params object[] arguments);
+ }
}
\ No newline at end of file
code/server/Server.cs
@@ -1,76 +1,74 @@
-using System;
-using System.Collections.Generic;
-using System.Net;
-using Autofac.Builder;
-using common;
-using Rhino.Queues;
-
-namespace server
-{
- class Server
- {
- static void Main(string[] args)
- {
- try
- {
- AppDomain.CurrentDomain.UnhandledException += (o, e) =>
- {
- (e.ExceptionObject as Exception).add_to_log();
- };
- AppDomain.CurrentDomain.ProcessExit += (o, e) =>
- {
- "shutting down".log();
- try
- {
- Resolve.the<CommandProcessor>().stop();
- Resolve.the<IQueueManager>().Dispose();
- }
- catch {}
- Environment.Exit(Environment.ExitCode);
- };
- run();
- Console.ReadLine();
- }
- catch (Exception e)
- {
- e.add_to_log();
- Console.Out.WriteLine(e);
- Console.ReadLine();
- }
- }
-
- static void run()
- {
- var builder = new ContainerBuilder();
- var registry = new AutofacDependencyRegistryBuilder(builder).build();
- Resolve.initialize_with(registry);
-
- builder.Register(x => registry).As<DependencyRegistry>().SingletonScoped();
- //needs startups
- builder.Register<StartServiceBus>().As<NeedStartup>();
-
- // infrastructure
-
- var manager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 2200), "server.esent");
- manager.CreateQueues("server");
- builder.Register(x => new RhinoPublisher("client", 2201, manager)).As<ServiceBus>().SingletonScoped();
- builder.Register(x => new RhinoReceiver(manager.GetQueue("server"), x.Resolve<CommandProcessor>())).As<RhinoReceiver>().As<Receiver>().SingletonScoped();
-
- // commanding
- //builder.Register<ContainerCommandBuilder>().As<CommandBuilder>().SingletonScoped();
- builder.Register<AsynchronousCommandProcessor>().As<CommandProcessor>().SingletonScoped();
- //builder.Register<AddNewFamilyMemberHandler>().As<Handler>();
- //builder.Register<FindAllFamilyHandler>().As<Handler>();
- //builder.Register<SaveNewAccountCommand>().As<Handler>();
-
- // queries
-
- // repositories
- //builder.Register<NHibernatePersonRepository>().As<PersonRepository>().FactoryScoped();
- //builder.Register<NHibernateAccountRepository>().As<AccountRepository>().FactoryScoped();
-
- Resolve.the<IEnumerable<NeedStartup>>().each(x => x.run());
- Resolve.the<CommandProcessor>().run();
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Net;
+using Autofac.Builder;
+using common;
+using Rhino.Queues;
+
+namespace server
+{
+ class Server
+ {
+ static void Main(string[] args)
+ {
+ try
+ {
+ AppDomain.CurrentDomain.UnhandledException += (o, e) =>
+ {
+ (e.ExceptionObject as Exception).add_to_log();
+ };
+ AppDomain.CurrentDomain.ProcessExit += (o, e) =>
+ {
+ "shutting down".log();
+ try
+ {
+ Resolve.the<CommandProcessor>().stop();
+ Resolve.the<IQueueManager>().Dispose();
+ }
+ catch {}
+ Environment.Exit(Environment.ExitCode);
+ };
+ run();
+ Console.ReadLine();
+ }
+ catch (Exception e)
+ {
+ e.add_to_log();
+ Console.Out.WriteLine(e);
+ Console.ReadLine();
+ }
+ }
+
+ static void run()
+ {
+ var builder = new ContainerBuilder();
+ var registry = new AutofacDependencyRegistryBuilder(builder).build();
+ Resolve.initialize_with(registry);
+
+ builder.Register(x => registry).As<DependencyRegistry>().SingletonScoped();
+ //needs startups
+ builder.Register<StartServiceBus>().As<NeedStartup>();
+
+ // infrastructure
+
+ var manager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 2200), "server.esent");
+ manager.CreateQueues("server");
+ builder.Register(x => new RhinoPublisher("client", 2201, manager)).As<ServiceBus>().SingletonScoped();
+ builder.Register(x => new RhinoReceiver(manager.GetQueue("server"), x.Resolve<CommandProcessor>())).As<RhinoReceiver>().As<Receiver>().SingletonScoped();
+
+ // commanding
+ builder.Register<AsynchronousCommandProcessor>().As<CommandProcessor>().SingletonScoped();
+ builder.Register<StartedApplicationHandler>().As<Handler>();
+
+ // queries
+
+ // repositories
+ //builder.Register<NHibernatePersonRepository>().As<PersonRepository>().FactoryScoped();
+ //builder.Register<NHibernateAccountRepository>().As<AccountRepository>().FactoryScoped();
+
+
+ Resolve.the<IEnumerable<NeedStartup>>().each(x => x.run());
+ Resolve.the<CommandProcessor>().run();
+ }
+ }
}
\ No newline at end of file
code/server/server.csproj
@@ -1,74 +1,75 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{20670392-6850-48C9-9052-6906A5D9DD0A}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>server</RootNamespace>
- <AssemblyName>server</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Autofac">
- <HintPath>..\..\external\auto.fac\Autofac.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Queues">
- <HintPath>..\..\external\rhino.queues\Rhino.Queues.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Server.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="StartServiceBus.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\common\common.csproj">
- <Project>{B34D543A-B443-4344-BD0E-2CFC6283D643}</Project>
- <Name>common</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{20670392-6850-48C9-9052-6906A5D9DD0A}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>server</RootNamespace>
+ <AssemblyName>server</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Autofac">
+ <HintPath>..\..\external\auto.fac\Autofac.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Queues">
+ <HintPath>..\..\external\rhino.queues\Rhino.Queues.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Server.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="StartedApplicationHandler.cs" />
+ <Compile Include="StartServiceBus.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\common\common.csproj">
+ <Project>{B34D543A-B443-4344-BD0E-2CFC6283D643}</Project>
+ <Name>common</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
\ No newline at end of file
code/server/StartedApplicationHandler.cs
@@ -0,0 +1,13 @@
+using common;
+using common.messages;
+
+namespace server
+{
+ public class StartedApplicationHandler : AbstractHandler<StartedApplication>
+ {
+ public override void handle(StartedApplication item)
+ {
+ "received {0}".log(item.message);
+ }
+ }
+}
\ No newline at end of file
code/server/StartServiceBus.cs
@@ -1,25 +1,25 @@
-using common;
-using common.messages;
-
-namespace server
-{
- public class StartServiceBus : NeedStartup
- {
- public void run()
- {
- var receiver = Resolve.the<RhinoReceiver>();
- var handler = new MessageHandler(Resolve.the<DependencyRegistry>());
- receiver.register(x =>
- {
- //using (var unit_of_work = Resolve.the<IUnitOfWorkFactory>().create())
- //{
- handler.handler(x);
- //unit_of_work.commit();
- //}
- });
- Resolve.the<CommandProcessor>().add(receiver);
- //ThreadPool.QueueUserWorkItem(x => receiver.run());
- Resolve.the<ServiceBus>().publish<StartedApplication>(x => x.message = "server");
- }
- }
+using common;
+using common.messages;
+
+namespace server
+{
+ public class StartServiceBus : NeedStartup
+ {
+ public void run()
+ {
+ var receiver = Resolve.the<RhinoReceiver>();
+ var handler = new MessageHandler(Resolve.the<DependencyRegistry>());
+ receiver.register(x =>
+ {
+ //using (var unit_of_work = Resolve.the<IUnitOfWorkFactory>().create())
+ //{
+ handler.handler(x);
+ //unit_of_work.commit();
+ //}
+ });
+ Resolve.the<CommandProcessor>().add(receiver);
+ //ThreadPool.QueueUserWorkItem(x => receiver.run());
+ Resolve.the<ServiceBus>().publish<StartedApplication>(x => x.message = "server");
+ }
+ }
}
\ No newline at end of file