minor wcf and msmq example improvements
added vs2k8 solution for msmq example
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.MsmqQuickStart.Common.2008", "src\Spring\Spring.MsmqQuickStart.Common\Spring.MsmqQuickStart.Common.2008.csproj", "{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.MsmqQuickStart.Server.2008", "src\Spring\Spring.MsmqQuickStart.Server\Spring.MsmqQuickStart.Server.2008.csproj", "{85E7B947-8153-45E4-B572-BEDB191F1FB2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.MsmqQuickStart.Client.2008", "src\Spring\Spring.MsmqQuickStart.Client\Spring.MsmqQuickStart.Client.2008.csproj", "{87D0B725-A652-4A6B-A95F-197F7155769F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{85E7B947-8153-45E4-B572-BEDB191F1FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{85E7B947-8153-45E4-B572-BEDB191F1FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{85E7B947-8153-45E4-B572-BEDB191F1FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{85E7B947-8153-45E4-B572-BEDB191F1FB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{87D0B725-A652-4A6B-A95F-197F7155769F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{87D0B725-A652-4A6B-A95F-197F7155769F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{87D0B725-A652-4A6B-A95F-197F7155769F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{87D0B725-A652-4A6B-A95F-197F7155769F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,171 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{87D0B725-A652-4A6B-A95F-197F7155769F}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Spring.MsmqQuickStart.Client</RootNamespace>
|
||||
<AssemblyName>Spring.MsmqQuickStart.Client</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\lib\Net\2.0\antlr.runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Aop, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Data, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Messaging, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Messaging" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Gateways\IStockService.cs" />
|
||||
<Compile Include="Gateways\MsmqStockServiceGateway.cs" />
|
||||
<Compile Include="Handlers\StockAppHandler.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\StockForm.resx">
|
||||
<DependentUpon>StockForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="App.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="UI\StockController.cs" />
|
||||
<Compile Include="UI\StockForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\StockForm.designer.cs">
|
||||
<DependentUpon>StockForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Spring.MsmqQuickStart.Common\Spring.MsmqQuickStart.Common.2008.csproj">
|
||||
<Project>{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}</Project>
|
||||
<Name>Spring.MsmqQuickStart.Common.2008</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config\Application.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Config\Messaging.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\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>
|
||||
@@ -0,0 +1,138 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Spring.MsmqQuickStart.Common</RootNamespace>
|
||||
<AssemblyName>Spring.MsmqQuickStart.Common</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\antlr.runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Aop, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Data, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Messaging, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Messaging" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Data\TradeResponse.cs">
|
||||
<DependentUpon>TradeResponse.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Data\TradeRequest.cs">
|
||||
<DependentUpon>TradeRequest.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Data\TradeResponse.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Data\TradeResponse.xsx">
|
||||
<DependentUpon>TradeResponse.xsd</DependentUpon>
|
||||
</None>
|
||||
<None Include="Data\TradeRequest.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Data\TradeRequest.xsx">
|
||||
<DependentUpon>TradeRequest.xsd</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\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>
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using Common.Logging;
|
||||
using Spring.MsmqQuickStart.Common.Data;
|
||||
using Spring.MsmqQuickStart.Server.Services;
|
||||
using Spring.Util;
|
||||
@@ -9,11 +11,11 @@ namespace Spring.MsmqQuickStart.Server.Handlers
|
||||
{
|
||||
public class StockAppHandler
|
||||
{
|
||||
private IExecutionVenueService executionVenueService;
|
||||
private readonly ILog log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
|
||||
private ICreditCheckService creditCheckService;
|
||||
|
||||
private ITradingService tradingService;
|
||||
private readonly IExecutionVenueService executionVenueService;
|
||||
private readonly ICreditCheckService creditCheckService;
|
||||
private readonly ITradingService tradingService;
|
||||
|
||||
public StockAppHandler(IExecutionVenueService executionVenueService, ICreditCheckService creditCheckService, ITradingService tradingService)
|
||||
{
|
||||
@@ -24,6 +26,7 @@ namespace Spring.MsmqQuickStart.Server.Handlers
|
||||
|
||||
public TradeResponse Handle(TradeRequest tradeRequest)
|
||||
{
|
||||
log.Info("received trade request - sleeping 2s to simulate long-running task");
|
||||
TradeResponse tradeResponse;
|
||||
ArrayList errors = new ArrayList();
|
||||
if (creditCheckService.CanExecute(tradeRequest, errors))
|
||||
@@ -38,6 +41,8 @@ namespace Spring.MsmqQuickStart.Server.Handlers
|
||||
|
||||
}
|
||||
tradingService.ProcessTrade(tradeRequest, tradeResponse);
|
||||
|
||||
Thread.Sleep(2000);
|
||||
return tradeResponse;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Spring.Context;
|
||||
using Spring.Context.Support;
|
||||
using Spring.MsmqQuickStart.Server.Gateways;
|
||||
|
||||
@@ -12,15 +13,17 @@ namespace Spring.MsmqQuickStart.Server
|
||||
try
|
||||
{
|
||||
// Using Spring's IoC container
|
||||
ContextRegistry.GetContext(); // Force Spring to load configuration
|
||||
Console.Out.WriteLine("Server listening...");
|
||||
IMarketDataService marketDataService =
|
||||
ContextRegistry.GetContext().GetObject("marketDataGateway") as MarketDataServiceGateway;
|
||||
ThreadStart job = new ThreadStart(marketDataService.SendMarketData);
|
||||
Thread thread = new Thread(job);
|
||||
thread.Start();
|
||||
Console.Out.WriteLine("--- Press <return> to quit ---");
|
||||
Console.ReadLine();
|
||||
using (IApplicationContext appContext = ContextRegistry.GetContext())
|
||||
{
|
||||
Console.Out.WriteLine("Server listening...");
|
||||
IMarketDataService marketDataService = appContext.GetObject("marketDataGateway") as MarketDataServiceGateway;
|
||||
ThreadStart job = new ThreadStart(marketDataService.SendMarketData);
|
||||
Thread thread = new Thread(job);
|
||||
thread.IsBackground = true;
|
||||
thread.Start();
|
||||
Console.Out.WriteLine("--- Press <return> to quit ---");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{85E7B947-8153-45E4-B572-BEDB191F1FB2}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Spring.MsmqQuickStart.Server</RootNamespace>
|
||||
<AssemblyName>Spring.MsmqQuickStart.Server</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\antlr.runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Aop, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Data, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Messaging, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Messaging" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Gateways\IMarketDataService.cs" />
|
||||
<Compile Include="Gateways\MarketDataServiceGateway.cs" />
|
||||
<Compile Include="Handlers\StockAppHandler.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\ICreditCheckService.cs" />
|
||||
<Compile Include="Services\IExecutionVenueService.cs" />
|
||||
<Compile Include="Services\ITradingService.cs" />
|
||||
<Compile Include="Services\Stubs\CreditCheckServiceStub.cs" />
|
||||
<Compile Include="Services\Stubs\ExecutionVenueServiceStub.cs" />
|
||||
<Compile Include="Services\Stubs\TradingServiceStub.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Spring.MsmqQuickStart.Common\Spring.MsmqQuickStart.Common.2008.csproj">
|
||||
<Project>{AC5A3035-75DD-48E5-ABCA-38FBC8193F22}</Project>
|
||||
<Name>Spring.MsmqQuickStart.Common.2008</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config\ServiceStubs.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Config\Messaging.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Config\Handlers.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\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>
|
||||
@@ -6,6 +6,7 @@
|
||||
type="Spring.WcfQuickStart.ICalculator, Spring.WcfQuickStart.ClientApp"
|
||||
factory-object="serverAppCalculatorChannelFactory"
|
||||
factory-method="CreateChannel" />
|
||||
|
||||
<object id="serverAppCalculatorChannelFactory"
|
||||
type="System.ServiceModel.ChannelFactory<Spring.WcfQuickStart.ICalculator>, System.ServiceModel">
|
||||
<constructor-arg name="endpointConfigurationName" value="serverAppCalculatorEndpoint" />
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
type="Spring.WcfQuickStart.ICalculator, Spring.WcfQuickStart.ClientApp"
|
||||
factory-object="serverWebCalculatorChannelFactory"
|
||||
factory-method="CreateChannel" />
|
||||
|
||||
<object id="serverWebCalculatorChannelFactory"
|
||||
type="System.ServiceModel.ChannelFactory<Spring.WcfQuickStart.ICalculator>, System.ServiceModel">
|
||||
<constructor-arg name="endpointConfigurationName" value="serverWebCalculatorEndpoint" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D58B3101-4433-49C5-B41B-51134424FC42}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -39,6 +39,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{27AAD98C-4281-4DD4-9E20-1371C58C5283}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -39,6 +39,7 @@
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
using AopAlliance.Intercept;
|
||||
|
||||
namespace Spring.WcfQuickStart
|
||||
{
|
||||
public class SimplePerformanceInterceptor : IMethodInterceptor
|
||||
{
|
||||
private string prefix = "Invocation took";
|
||||
|
||||
public string Prefix
|
||||
{
|
||||
get { return prefix; }
|
||||
set { prefix = value; }
|
||||
}
|
||||
|
||||
#region IMethodInterceptor Members
|
||||
|
||||
public object Invoke(IMethodInvocation invocation)
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
try
|
||||
{
|
||||
return invocation.Proceed();
|
||||
}
|
||||
finally
|
||||
{
|
||||
DateTime stop = DateTime.Now;
|
||||
TimeSpan time = stop - start;
|
||||
Trace.WriteLine(Prefix + " " + time);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{EEC5B531-104B-44E6-975B-44C0C8973405}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
@@ -17,7 +17,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;NET_3_0</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -30,6 +30,10 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Spring.Aop, Version=1.2.0.20336, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\bin\net\3.0\debug\Spring.Aop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core, Version=1.2.0.20313, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
|
||||
@@ -59,6 +63,7 @@
|
||||
<Compile Include="ICalculator.cs" />
|
||||
<Content Include="Calculator.svc" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SimplePerformanceInterceptor.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
@@ -80,6 +85,9 @@
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
|
||||
@@ -6,22 +6,38 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<!-- Spring Context Configuration -->
|
||||
<spring>
|
||||
|
||||
<context>
|
||||
<resource uri="config://spring/objects"/>
|
||||
</context>
|
||||
|
||||
<objects xmlns="http://www.springframework.net">
|
||||
<objects xmlns="http://www.springframework.net"
|
||||
xmlns:aop="http://www.springframework.net/aop">
|
||||
<!-- Service definition -->
|
||||
<object id="calculator" type="Spring.WcfQuickStart.CalculatorService, Spring.WcfQuickStart.ServerWeb"
|
||||
singleton="false">
|
||||
<property name="SleepInSeconds" value="1"/>
|
||||
</object>
|
||||
|
||||
<object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop">
|
||||
<property name="pattern" value="Spring.WcfQuickStart.*"/>
|
||||
</object>
|
||||
|
||||
<object id="perfAdvice" type="Spring.WcfQuickStart.SimplePerformanceInterceptor, Spring.WcfQuickStart.ServerWeb">
|
||||
<property name="Prefix" value="Service Layer Performance"/>
|
||||
</object>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor pointcut-ref="serviceOperation" advice-ref="perfAdvice"/>
|
||||
</aop:config>
|
||||
|
||||
</objects>
|
||||
|
||||
|
||||
</spring>
|
||||
|
||||
<!-- WCF Service Configuration -->
|
||||
<system.serviceModel>
|
||||
<services>
|
||||
<service name="calculator" behaviorConfiguration="DefaultBehavior">
|
||||
|
||||
Reference in New Issue
Block a user