diff --git a/examples/Spring/Spring.MsmqQuickStart/Spring.MsmqQuickStart.2008.sln b/examples/Spring/Spring.MsmqQuickStart/Spring.MsmqQuickStart.2008.sln new file mode 100644 index 00000000..e21d228e --- /dev/null +++ b/examples/Spring/Spring.MsmqQuickStart/Spring.MsmqQuickStart.2008.sln @@ -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 diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.2008.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.2008.csproj new file mode 100644 index 00000000..f9f4d0d4 --- /dev/null +++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.2008.csproj @@ -0,0 +1,171 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {87D0B725-A652-4A6B-A95F-197F7155769F} + WinExe + Properties + Spring.MsmqQuickStart.Client + Spring.MsmqQuickStart.Client + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\..\..\lib\Net\2.0\antlr.runtime.dll + + + False + ..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + StockForm.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + Form + + + StockForm.cs + + + + + {AC5A3035-75DD-48E5-ABCA-38FBC8193F22} + Spring.MsmqQuickStart.Common.2008 + + + + + Always + + + Always + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.2008.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.2008.csproj new file mode 100644 index 00000000..a3048adb --- /dev/null +++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.2008.csproj @@ -0,0 +1,138 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {AC5A3035-75DD-48E5-ABCA-38FBC8193F22} + Library + Properties + Spring.MsmqQuickStart.Common + Spring.MsmqQuickStart.Common + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\antlr.runtime.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Common.Logging.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll + + + + + + + + + TradeResponse.xsd + + + TradeRequest.xsd + + + + + + Designer + + + TradeResponse.xsd + + + Designer + + + TradeRequest.xsd + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Handlers/StockAppHandler.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Handlers/StockAppHandler.cs index 3144c1e5..383b0ec6 100644 --- a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Handlers/StockAppHandler.cs +++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Handlers/StockAppHandler.cs @@ -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; } } diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Program.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Program.cs index d1621d80..ede2567e 100644 --- a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Program.cs +++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Program.cs @@ -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 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 to quit ---"); + Console.ReadLine(); + } } catch (Exception e) { diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.2008.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.2008.csproj new file mode 100644 index 00000000..86b0d1fe --- /dev/null +++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.2008.csproj @@ -0,0 +1,148 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {85E7B947-8153-45E4-B572-BEDB191F1FB2} + Exe + Properties + Spring.MsmqQuickStart.Server + Spring.MsmqQuickStart.Server + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\antlr.runtime.dll + + + False + ..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Data.dll + + + False + ..\..\..\..\..\..\bin\net\2.0\debug\Spring.Messaging.dll + + + + + + + + + + + + + + + + + + + + + + + + + {AC5A3035-75DD-48E5-ABCA-38FBC8193F22} + Spring.MsmqQuickStart.Common.2008 + + + + + Always + + + Always + + + Always + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerApp.xml b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerApp.xml index 67d620d4..97ddbed5 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerApp.xml +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerApp.xml @@ -6,6 +6,7 @@ type="Spring.WcfQuickStart.ICalculator, Spring.WcfQuickStart.ClientApp" factory-object="serverAppCalculatorChannelFactory" factory-method="CreateChannel" /> + diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerWeb.xml b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerWeb.xml index b8e05470..e3870c5a 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerWeb.xml +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Config/ServerWeb.xml @@ -6,6 +6,7 @@ type="Spring.WcfQuickStart.ICalculator, Spring.WcfQuickStart.ClientApp" factory-object="serverWebCalculatorChannelFactory" factory-method="CreateChannel" /> + diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Spring.WcfQuickStart.ClientApp.2008.csproj b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Spring.WcfQuickStart.ClientApp.2008.csproj index 6e4cf2c4..195b4629 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Spring.WcfQuickStart.ClientApp.2008.csproj +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ClientApp/Spring.WcfQuickStart.ClientApp.2008.csproj @@ -2,7 +2,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {D58B3101-4433-49C5-B41B-51134424FC42} Exe @@ -39,6 +39,7 @@ DEBUG;TRACE prompt 4 + false pdbonly diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp/Spring.WcfQuickStart.ServerApp.2008.csproj b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp/Spring.WcfQuickStart.ServerApp.2008.csproj index 04a0077d..034bccac 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp/Spring.WcfQuickStart.ServerApp.2008.csproj +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp/Spring.WcfQuickStart.ServerApp.2008.csproj @@ -2,7 +2,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {27AAD98C-4281-4DD4-9E20-1371C58C5283} Exe @@ -39,6 +39,7 @@ TRACE;DEBUG prompt 4 + false pdbonly diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/SimplePerformanceInterceptor.cs b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/SimplePerformanceInterceptor.cs new file mode 100644 index 00000000..9dc8b2dc --- /dev/null +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/SimplePerformanceInterceptor.cs @@ -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 + } +} diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Spring.WcfQuickStart.ServerWeb.2008.csproj b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Spring.WcfQuickStart.ServerWeb.2008.csproj index a225941a..1088b32d 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Spring.WcfQuickStart.ServerWeb.2008.csproj +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Spring.WcfQuickStart.ServerWeb.2008.csproj @@ -2,7 +2,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {EEC5B531-104B-44E6-975B-44C0C8973405} {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} @@ -17,7 +17,7 @@ full false bin\ - DEBUG;TRACE + TRACE;DEBUG;NET_3_0 prompt 4 @@ -30,6 +30,10 @@ 4 + + False + ..\..\..\..\..\bin\net\3.0\debug\Spring.Aop.dll + False ..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll @@ -59,6 +63,7 @@ + @@ -80,6 +85,9 @@ False + False + + False diff --git a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Web.config b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Web.config index 84ddbdb0..a7e6b770 100644 --- a/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Web.config +++ b/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerWeb/Web.config @@ -6,22 +6,38 @@ + - + + + + + + + + + + + + + + - + +