diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/App.config b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/App.config
new file mode 100644
index 00000000..c1474dd5
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/App.config
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Application.xml b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Application.xml
new file mode 100644
index 00000000..0919eb66
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Application.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Messaging.xml b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Messaging.xml
new file mode 100644
index 00000000..8b9c5d7b
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Config/Messaging.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/IStockService.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/IStockService.cs
new file mode 100644
index 00000000..1ced2e8d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/IStockService.cs
@@ -0,0 +1,31 @@
+
+
+#region License
+
+/*
+ * Copyright 2002-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Client.Gateways
+{
+ public interface IStockService
+ {
+ void Send(TradeRequest tradeRequest);
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/MsmqStockServiceGateway.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/MsmqStockServiceGateway.cs
new file mode 100644
index 00000000..f97fca34
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Gateways/MsmqStockServiceGateway.cs
@@ -0,0 +1,40 @@
+
+
+
+using System;
+using System.Messaging;
+using Spring.Messaging.Core;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Client.Gateways
+{
+ public class MsmqStockServiceGateway : MessageQueueGatewaySupport, IStockService
+ {
+ private Random random = new Random();
+ private string defaultResponseQueueObjectName;
+
+ public string DefaultResponseQueueObjectName
+ {
+ set { defaultResponseQueueObjectName = value; }
+ }
+
+ public void Send(TradeRequest tradeRequest)
+ {
+ // post process message from conversion before sending
+ MessageQueueTemplate.ConvertAndSend(tradeRequest, delegate(Message message)
+ {
+ message.ResponseQueue = GetResponseQueue();
+ message.AppSpecific = random.Next();
+ return message;
+ });
+ }
+
+
+ private MessageQueue GetResponseQueue()
+ {
+ return MessageQueueFactory.CreateMessageQueue(defaultResponseQueueObjectName);
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Handlers/StockAppHandler.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Handlers/StockAppHandler.cs
new file mode 100644
index 00000000..d758d33d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Handlers/StockAppHandler.cs
@@ -0,0 +1,48 @@
+
+
+using System.Collections;
+using Common.Logging;
+using Spring.MsmqQuickStart.Client.UI;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Client.Handlers
+{
+ public class StockAppHandler
+ {
+ #region Logging Definition
+
+ private readonly ILog log = LogManager.GetLogger(typeof(StockAppHandler));
+
+ #endregion
+
+ private StockController stockController;
+
+
+ public StockController StockController
+ {
+ get { return stockController; }
+ set { stockController = value; }
+ }
+
+ public void Handle(string data)
+ {
+ log.Info(string.Format("Received market data. " + data));
+
+ // forward to controller to update view
+ stockController.UpdateMarketData(data);
+
+ }
+
+
+ public void Handle(TradeResponse tradeResponse)
+ {
+ log.Info(string.Format("Received trade resonse. Ticker = {0}, Price = {1}", tradeResponse.Ticker, tradeResponse.Price));
+ stockController.UpdateTrade(tradeResponse);
+ }
+
+ public void Handle(object catchAllObject)
+ {
+ log.Error("could not handle object of type = " + catchAllObject.GetType());
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Program.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Program.cs
new file mode 100644
index 00000000..902503c2
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Program.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Threading;
+using System.Windows.Forms;
+using Common.Logging;
+using Spring.Context;
+using Spring.Context.Support;
+using Spring.MsmqQuickStart.Client.UI;
+
+
+namespace Spring.MsmqQuickStart.Client
+{
+ static class Program
+ {
+
+ private static readonly ILog log = LogManager.GetLogger(typeof(Program));
+
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ try
+ {
+ log.Info("Running....");
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ using (IApplicationContext ctx = ContextRegistry.GetContext())
+ {
+ StockForm stockForm = new StockForm();
+ Application.ThreadException += ThreadException;
+ Application.Run(stockForm);
+ }
+ }
+ catch (Exception e)
+ {
+ log.Error("Spring.MsmqQuickStart.Client is broken.", e);
+ }
+ }
+
+ private static void ThreadException(object sender, ThreadExceptionEventArgs e)
+ {
+ log.Error("Uncaught application exception.", e.Exception);
+ Application.Exit();
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/AssemblyInfo.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..2224a9a6
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Spring.MsmqQuickStart.Client")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Spring.MsmqQuickStart.Client")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("aff1d9ab-7818-4748-8234-8a78e5631899")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.Designer.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..4c572fcc
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.1433
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Spring.MsmqQuickStart.Client.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Spring.MsmqQuickStart.Client.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.resx b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.resx
new file mode 100644
index 00000000..ffecec85
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.Designer.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..93f5f1af
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.1433
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Spring.MsmqQuickStart.Client.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.settings b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.settings
new file mode 100644
index 00000000..abf36c5d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.csproj
new file mode 100644
index 00000000..2871b722
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/Spring.MsmqQuickStart.Client.csproj
@@ -0,0 +1,119 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {87D0B725-A652-4A6B-A95F-197F7155769F}
+ WinExe
+ Properties
+ Spring.MsmqQuickStart.Client
+ Spring.MsmqQuickStart.Client
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ StockForm.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+ Form
+
+
+ StockForm.cs
+
+
+
+
+ {3A3A4E65-45A6-4B20-B460-0BEDC302C02C}
+ Spring.Aop.2005
+
+
+ {710961A3-0DF4-49E4-A26E-F5B9C044AC84}
+ Spring.Core.2005
+
+
+ {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}
+ Spring.Data.2005
+
+
+ {0E23AE41-D8D8-41C2-84A2-D35564049F0D}
+ Spring.Messaging.2005
+
+
+ {AC5A3035-75DD-48E5-ABCA-38FBC8193F22}
+ Spring.MsmqQuickStart.Common
+
+
+
+
+ Always
+
+
+ Always
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockController.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockController.cs
new file mode 100644
index 00000000..c6994814
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockController.cs
@@ -0,0 +1,55 @@
+
+
+using System.Collections;
+using Spring.MsmqQuickStart.Client.Gateways;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Client.UI
+{
+ public class StockController
+ {
+ private StockForm stockForm;
+
+ private IStockService stockService;
+
+
+
+ public StockForm StockForm
+ {
+ get { return stockForm; }
+ set { stockForm = value; }
+ }
+
+ public IStockService StockService
+ {
+ get { return stockService; }
+ set { stockService = value; }
+ }
+
+ public void SendTradeRequest()
+ {
+ TradeRequest tradeRequest = new TradeRequest();
+ tradeRequest.AccountName = "ACCT-123";
+ tradeRequest.BuyRequest = true;
+ tradeRequest.OrderType = "MARKET";
+ tradeRequest.Quantity = 314000000;
+ tradeRequest.RequestID = "REQ-1";
+ tradeRequest.Ticker = "CSCO";
+ tradeRequest.UserName = "Joe Trader";
+
+ stockService.Send(tradeRequest);
+ }
+
+
+ public void UpdateMarketData(string marketDataString)
+ {
+ stockForm.UpdateMarketData(marketDataString);
+ }
+
+ public void UpdateTrade(TradeResponse tradeResponse)
+ {
+ stockForm.UpdateTrade(tradeResponse);
+ }
+
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.cs
new file mode 100644
index 00000000..5e151616
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections;
+using System.Windows.Forms;
+using Common.Logging;
+using Spring.Context.Support;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Client.UI
+{
+ public partial class StockForm : Form
+ {
+ #region Logging Definition
+
+ private static readonly ILog log = LogManager.GetLogger(typeof (StockForm));
+
+ #endregion
+
+ private StockController stockController;
+
+ public StockForm()
+ {
+ InitializeComponent();
+ stockController = ContextRegistry.GetContext()["stockController"] as StockController;
+ stockController.StockForm = this;
+ }
+
+ public StockController Controller
+ {
+ set { stockController = value; }
+ }
+
+ private void OnSendTradeRequest(object sender, EventArgs e)
+ {
+ //In this simple example no data is collected from the view.
+ //Instead a hardcoded trade request is created in the controller.
+ tradeRequestStatusTextBox.Text = "Request Pending...";
+ stockController.SendTradeRequest();
+ log.Info("Sent trade request.");
+ }
+
+ public void UpdateTrade(TradeResponse trade)
+ {
+ Invoke(new MethodInvoker(
+ delegate
+ {
+ tradeRequestStatusTextBox.Text = "Confirmed. " + trade.Ticker + " " + trade.Price;
+ }));
+ }
+
+ public void UpdateMarketData(string marketDataString)
+ {
+ Invoke(new MethodInvoker(
+ delegate
+ {
+ marketDataListBox.Items.Add(marketDataString);
+ }));
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.designer.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.designer.cs
new file mode 100644
index 00000000..07588070
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.designer.cs
@@ -0,0 +1,126 @@
+namespace Spring.MsmqQuickStart.Client.UI
+{
+ partial class StockForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.tradeRequestButton = new System.Windows.Forms.Button();
+ this.tradeRequestStatusTextBox = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.portfolioListBox = new System.Windows.Forms.ListBox();
+ this.marketDataListBox = new System.Windows.Forms.ListBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // tradeRequestButton
+ //
+ this.tradeRequestButton.Location = new System.Drawing.Point(12, 12);
+ this.tradeRequestButton.Name = "tradeRequestButton";
+ this.tradeRequestButton.Size = new System.Drawing.Size(135, 23);
+ this.tradeRequestButton.TabIndex = 0;
+ this.tradeRequestButton.Text = "Send Trade Request";
+ this.tradeRequestButton.UseVisualStyleBackColor = true;
+ this.tradeRequestButton.Click += new System.EventHandler(this.OnSendTradeRequest);
+ //
+ // tradeRequestStatusTextBox
+ //
+ this.tradeRequestStatusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.tradeRequestStatusTextBox.Location = new System.Drawing.Point(154, 13);
+ this.tradeRequestStatusTextBox.Name = "tradeRequestStatusTextBox";
+ this.tradeRequestStatusTextBox.Size = new System.Drawing.Size(340, 20);
+ this.tradeRequestStatusTextBox.TabIndex = 1;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(12, 41);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(135, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Get Portfolio";
+ this.button1.UseVisualStyleBackColor = true;
+ //
+ // portfolioListBox
+ //
+ this.portfolioListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.portfolioListBox.FormattingEnabled = true;
+ this.portfolioListBox.Location = new System.Drawing.Point(154, 41);
+ this.portfolioListBox.Name = "portfolioListBox";
+ this.portfolioListBox.Size = new System.Drawing.Size(340, 108);
+ this.portfolioListBox.TabIndex = 3;
+ //
+ // marketDataListBox
+ //
+ this.marketDataListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.marketDataListBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
+ this.marketDataListBox.FormattingEnabled = true;
+ this.marketDataListBox.ItemHeight = 14;
+ this.marketDataListBox.Location = new System.Drawing.Point(90, 155);
+ this.marketDataListBox.Name = "marketDataListBox";
+ this.marketDataListBox.Size = new System.Drawing.Size(404, 102);
+ this.marketDataListBox.TabIndex = 4;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 155);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(72, 13);
+ this.label1.TabIndex = 5;
+ this.label1.Text = "Market Data :";
+ //
+ // StockForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(506, 269);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.marketDataListBox);
+ this.Controls.Add(this.portfolioListBox);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.tradeRequestStatusTextBox);
+ this.Controls.Add(this.tradeRequestButton);
+ this.Name = "StockForm";
+ this.Text = "TradeForm";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button tradeRequestButton;
+ private System.Windows.Forms.TextBox tradeRequestStatusTextBox;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.ListBox portfolioListBox;
+ private System.Windows.Forms.ListBox marketDataListBox;
+ private System.Windows.Forms.Label label1;
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.resx b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.resx
new file mode 100644
index 00000000..ff31a6db
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Client/UI/StockForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.cs
new file mode 100644
index 00000000..c4f7543b
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.cs
@@ -0,0 +1,123 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.1433
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+//
+// This source code was auto-generated by xsd, Version=2.0.50727.42.
+//
+namespace Spring.MsmqQuickStart.Common.Data {
+ using System.Xml.Serialization;
+
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.springframework.net/nms/common/2008-08-05")]
+ [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.springframework.net/nms/common/2008-08-05", IsNullable=false)]
+ public partial class TradeRequest {
+
+ private string tickerField;
+
+ private long quantityField;
+
+ private decimal priceField;
+
+ private string orderTypeField;
+
+ private string accountNameField;
+
+ private bool buyRequestField;
+
+ private string userNameField;
+
+ private string requestIDField;
+
+ ///
+ public string Ticker {
+ get {
+ return this.tickerField;
+ }
+ set {
+ this.tickerField = value;
+ }
+ }
+
+ ///
+ public long Quantity {
+ get {
+ return this.quantityField;
+ }
+ set {
+ this.quantityField = value;
+ }
+ }
+
+ ///
+ public decimal Price {
+ get {
+ return this.priceField;
+ }
+ set {
+ this.priceField = value;
+ }
+ }
+
+ ///
+ public string OrderType {
+ get {
+ return this.orderTypeField;
+ }
+ set {
+ this.orderTypeField = value;
+ }
+ }
+
+ ///
+ public string AccountName {
+ get {
+ return this.accountNameField;
+ }
+ set {
+ this.accountNameField = value;
+ }
+ }
+
+ ///
+ public bool BuyRequest {
+ get {
+ return this.buyRequestField;
+ }
+ set {
+ this.buyRequestField = value;
+ }
+ }
+
+ ///
+ public string UserName {
+ get {
+ return this.userNameField;
+ }
+ set {
+ this.userNameField = value;
+ }
+ }
+
+ ///
+ public string RequestID {
+ get {
+ return this.requestIDField;
+ }
+ set {
+ this.requestIDField = value;
+ }
+ }
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsd b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsd
new file mode 100644
index 00000000..c5e5573a
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsd
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsx b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsx
new file mode 100644
index 00000000..ff71343b
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeRequest.xsx
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.cs
new file mode 100644
index 00000000..ec816059
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.cs
@@ -0,0 +1,111 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.1433
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+//
+// This source code was auto-generated by xsd, Version=2.0.50727.42.
+//
+namespace Spring.MsmqQuickStart.Common.Data {
+ using System.Xml.Serialization;
+
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.springframework.net/nms/common/2008-08-05")]
+ [System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.springframework.net/nms/common/2008-08-05", IsNullable=false)]
+ public partial class TradeResponse {
+
+ private string tickerField;
+
+ private long quantityField;
+
+ private decimal priceField;
+
+ private string orderTypeField;
+
+ private string confirmationNumberField;
+
+ private bool errorField;
+
+ private string errorMessageField;
+
+ ///
+ public string Ticker {
+ get {
+ return this.tickerField;
+ }
+ set {
+ this.tickerField = value;
+ }
+ }
+
+ ///
+ public long Quantity {
+ get {
+ return this.quantityField;
+ }
+ set {
+ this.quantityField = value;
+ }
+ }
+
+ ///
+ public decimal Price {
+ get {
+ return this.priceField;
+ }
+ set {
+ this.priceField = value;
+ }
+ }
+
+ ///
+ public string OrderType {
+ get {
+ return this.orderTypeField;
+ }
+ set {
+ this.orderTypeField = value;
+ }
+ }
+
+ ///
+ public string ConfirmationNumber {
+ get {
+ return this.confirmationNumberField;
+ }
+ set {
+ this.confirmationNumberField = value;
+ }
+ }
+
+ ///
+ public bool Error {
+ get {
+ return this.errorField;
+ }
+ set {
+ this.errorField = value;
+ }
+ }
+
+ ///
+ public string ErrorMessage {
+ get {
+ return this.errorMessageField;
+ }
+ set {
+ this.errorMessageField = value;
+ }
+ }
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsd b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsd
new file mode 100644
index 00000000..d930e79d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsx b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsx
new file mode 100644
index 00000000..ff71343b
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Data/TradeResponse.xsx
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Properties/AssemblyInfo.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..5f5b310b
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Spring.MsmqQuickStart.Common")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Spring.MsmqQuickStart.Common")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0d2c3d0f-af2f-47aa-9441-c3bd966f94f7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.csproj
new file mode 100644
index 00000000..ec076282
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Common/Spring.MsmqQuickStart.Common.csproj
@@ -0,0 +1,85 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {AC5A3035-75DD-48E5-ABCA-38FBC8193F22}
+ Library
+ Properties
+ Spring.MsmqQuickStart.Common
+ Spring.MsmqQuickStart.Common
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+ TradeResponse.xsd
+
+
+ TradeRequest.xsd
+
+
+
+
+
+ {3A3A4E65-45A6-4B20-B460-0BEDC302C02C}
+ Spring.Aop.2005
+
+
+ {710961A3-0DF4-49E4-A26E-F5B9C044AC84}
+ Spring.Core.2005
+
+
+ {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}
+ Spring.Data.2005
+
+
+ {0E23AE41-D8D8-41C2-84A2-D35564049F0D}
+ Spring.Messaging.2005
+
+
+
+
+ Designer
+
+
+ TradeResponse.xsd
+
+
+ Designer
+
+
+ TradeRequest.xsd
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/App.config b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/App.config
new file mode 100644
index 00000000..2f89a5f0
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/App.config
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Handlers.xml b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Handlers.xml
new file mode 100644
index 00000000..a377840e
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Handlers.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Messaging.xml b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Messaging.xml
new file mode 100644
index 00000000..6c6273dd
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/Messaging.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/ServiceStubs.xml b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/ServiceStubs.xml
new file mode 100644
index 00000000..97e9d9b8
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Config/ServiceStubs.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/IMarketDataService.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/IMarketDataService.cs
new file mode 100644
index 00000000..cbdbf775
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/IMarketDataService.cs
@@ -0,0 +1,7 @@
+namespace Spring.MsmqQuickStart.Server.Gateways
+{
+ public interface IMarketDataService
+ {
+ void SendMarketData();
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/MarketDataServiceGateway.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/MarketDataServiceGateway.cs
new file mode 100644
index 00000000..a32633aa
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Gateways/MarketDataServiceGateway.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections;
+using System.Threading;
+using Common.Logging;
+using Spring.Messaging.Core;
+
+
+namespace Spring.MsmqQuickStart.Server.Gateways
+{
+ public class MarketDataServiceGateway : MessageQueueGatewaySupport, IMarketDataService
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof (MarketDataServiceGateway));
+
+ private readonly Random random;
+ private TimeSpan sleepTimeInSeconds = new TimeSpan(0,0,0,10,0);
+
+
+ public MarketDataServiceGateway()
+ {
+ random = new Random();
+ }
+
+ public TimeSpan SleepTimeInSeconds
+ {
+ set { sleepTimeInSeconds = value; }
+ }
+
+ public void SendMarketData()
+ {
+ while (true)
+ {
+ string data = GenerateFakeMarketData();
+ log.Info("Sending market data.");
+ MessageQueueTemplate.ConvertAndSend(data);
+ log.Info("Sleeping " + sleepTimeInSeconds + " seconds before sending more market data.");
+ Thread.Sleep(sleepTimeInSeconds);
+ }
+ }
+
+ private string GenerateFakeMarketData()
+ {
+ return "CSCO " + string.Format("{0:##.##}", 22 + Math.Abs(Gaussian()));
+ }
+
+ private double Gaussian()
+ {
+ double x1, x2, w;
+
+ do
+ {
+ x1 = 2.0*random.NextDouble() - 1.0;
+ x2 = 2.0*random.NextDouble() - 1.0;
+ w = x1*x1 + x2*x2;
+ } while (w >= 1.0);
+
+ w = Math.Sqrt(-2.0*Math.Log(w)/w);
+
+ // two Gaussian random numbers are generated
+ return x1*w;
+ //y2 = x2 * w;
+ }
+ }
+}
\ 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
new file mode 100644
index 00000000..3144c1e5
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Handlers/StockAppHandler.cs
@@ -0,0 +1,44 @@
+
+
+using System.Collections;
+using Spring.MsmqQuickStart.Common.Data;
+using Spring.MsmqQuickStart.Server.Services;
+using Spring.Util;
+
+namespace Spring.MsmqQuickStart.Server.Handlers
+{
+ public class StockAppHandler
+ {
+ private IExecutionVenueService executionVenueService;
+
+ private ICreditCheckService creditCheckService;
+
+ private ITradingService tradingService;
+
+ public StockAppHandler(IExecutionVenueService executionVenueService, ICreditCheckService creditCheckService, ITradingService tradingService)
+ {
+ this.executionVenueService = executionVenueService;
+ this.creditCheckService = creditCheckService;
+ this.tradingService = tradingService;
+ }
+
+ public TradeResponse Handle(TradeRequest tradeRequest)
+ {
+ TradeResponse tradeResponse;
+ ArrayList errors = new ArrayList();
+ if (creditCheckService.CanExecute(tradeRequest, errors))
+ {
+ tradeResponse = executionVenueService.ExecuteTradeRequest(tradeRequest);
+ }
+ else
+ {
+ tradeResponse = new TradeResponse();
+ tradeResponse.Error = true;
+ tradeResponse.ErrorMessage = StringUtils.ArrayToCommaDelimitedString(errors.ToArray());
+
+ }
+ tradingService.ProcessTrade(tradeRequest, tradeResponse);
+ return tradeResponse;
+ }
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 00000000..d1621d80
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Program.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Threading;
+using Spring.Context.Support;
+using Spring.MsmqQuickStart.Server.Gateways;
+
+namespace Spring.MsmqQuickStart.Server
+{
+ public class Program
+ {
+ static void Main(string[] args)
+ {
+ 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();
+ }
+ catch (Exception e)
+ {
+ Console.Out.WriteLine(e);
+ Console.Out.WriteLine("--- Press to quit ---");
+ Console.ReadLine();
+ }
+ }
+ }
+}
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Properties/AssemblyInfo.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..39d9d56d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Spring.MsmqQuickStart.Server")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Spring.MsmqQuickStart.Server")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3e4b803d-86c9-4634-9b38-e29d70a083e0")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ICreditCheckService.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ICreditCheckService.cs
new file mode 100644
index 00000000..4f388d3c
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ICreditCheckService.cs
@@ -0,0 +1,33 @@
+
+
+#region License
+
+/*
+ * Copyright 2002-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using System.Collections;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Server.Services
+{
+
+ public interface ICreditCheckService
+ {
+ bool CanExecute(TradeRequest tradeRequest, IList errors);
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/IExecutionVenueService.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/IExecutionVenueService.cs
new file mode 100644
index 00000000..6ef33ba9
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/IExecutionVenueService.cs
@@ -0,0 +1,31 @@
+
+
+#region License
+
+/*
+ * Copyright 2002-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Server.Services
+{
+ public interface IExecutionVenueService
+ {
+ TradeResponse ExecuteTradeRequest(TradeRequest request);
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ITradingService.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ITradingService.cs
new file mode 100644
index 00000000..f1e07ca9
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/ITradingService.cs
@@ -0,0 +1,31 @@
+
+
+#region License
+
+/*
+ * Copyright 2002-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Server.Services
+{
+ public interface ITradingService
+ {
+ void ProcessTrade(TradeRequest request, TradeResponse response);
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/CreditCheckServiceStub.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/CreditCheckServiceStub.cs
new file mode 100644
index 00000000..b4ee5832
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/CreditCheckServiceStub.cs
@@ -0,0 +1,16 @@
+
+
+using System.Collections;
+using Spring.MsmqQuickStart.Common.Data;
+
+
+namespace Spring.MsmqQuickStart.Server.Services.Stubs
+{
+ public class CreditCheckServiceStub : ICreditCheckService
+ {
+ public bool CanExecute(TradeRequest tradeRequest, IList errors)
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/ExecutionVenueServiceStub.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/ExecutionVenueServiceStub.cs
new file mode 100644
index 00000000..e2c095ba
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/ExecutionVenueServiceStub.cs
@@ -0,0 +1,35 @@
+
+
+using System;
+using Spring.MsmqQuickStart.Common.Data;
+
+namespace Spring.MsmqQuickStart.Server.Services.Stubs
+{
+ public class ExecutionVenueServiceStub : IExecutionVenueService
+ {
+ public TradeResponse ExecuteTradeRequest(TradeRequest request)
+ {
+ TradeResponse response = new TradeResponse();
+ response.OrderType = request.OrderType;
+ response.Price = CalculatePrice(request.Ticker, request.Quantity, request.OrderType, request.Price, request.UserName);
+ response.Quantity = request.Quantity;
+ response.Ticker = request.Ticker;
+ response.ConfirmationNumber = new Guid().ToString();
+ return response;
+ }
+
+ private decimal CalculatePrice(string ticker, long quantity, string ordertype, decimal limitPrice, string userName)
+ {
+ // provide as sophisticed an impl as testing requires...for now all the same price.
+ if (ordertype.CompareTo("LIMIT") == 0)
+ {
+ return limitPrice;
+ }
+ else
+ {
+ return 27.6m;
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/TradingServiceStub.cs b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/TradingServiceStub.cs
new file mode 100644
index 00000000..844bc03d
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Services/Stubs/TradingServiceStub.cs
@@ -0,0 +1,16 @@
+
+
+using Spring.MsmqQuickStart.Common.Data;
+using Spring.MsmqQuickStart.Server.Services;
+
+
+namespace Spring.MsmqQuickStart.Server.Services.Stubs
+{
+ public class TradingServiceStub : ITradingService
+ {
+ public void ProcessTrade(TradeRequest request, TradeResponse response)
+ {
+ //do nothing implementation, typical implementations would persist state to the database.
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.csproj b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.csproj
new file mode 100644
index 00000000..8599b5ce
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/src/Spring/Spring.MsmqQuickStart.Server/Spring.MsmqQuickStart.Server.csproj
@@ -0,0 +1,97 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {85E7B947-8153-45E4-B572-BEDB191F1FB2}
+ Exe
+ Properties
+ Spring.MsmqQuickStart.Server
+ Spring.MsmqQuickStart.Server
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {3A3A4E65-45A6-4B20-B460-0BEDC302C02C}
+ Spring.Aop.2005
+
+
+ {710961A3-0DF4-49E4-A26E-F5B9C044AC84}
+ Spring.Core.2005
+
+
+ {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}
+ Spring.Data.2005
+
+
+ {0E23AE41-D8D8-41C2-84A2-D35564049F0D}
+ Spring.Messaging.2005
+
+
+ {AC5A3035-75DD-48E5-ABCA-38FBC8193F22}
+ Spring.MsmqQuickStart.Common
+
+
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Integration.Tests/Spring.MsmqQuickStart.Integration.Tests.2005.csproj b/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Integration.Tests/Spring.MsmqQuickStart.Integration.Tests.2005.csproj
new file mode 100644
index 00000000..a73538ad
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Integration.Tests/Spring.MsmqQuickStart.Integration.Tests.2005.csproj
@@ -0,0 +1,41 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {E641F51F-1B51-4B94-B419-F902EABCE4D4}
+ Library
+ Properties
+ Spring
+ Spring.MsmqQuickStart.Integration.Tests
+
+
+ true
+ full
+ false
+ ..\..\..\build\VS.NET.2005\Spring.NmsQuickStart.Integration.Tests\Debug\
+ TRACE;DEBUG;NET_2_0
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ ..\..\..\build\VS.NET.2005\Spring.NmsQuickStart.Integration.Tests\Release\
+ TRACE;NET_2_0
+ prompt
+ 4
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Tests/Spring.MsmqQuickStart.Tests.2005.csproj b/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Tests/Spring.MsmqQuickStart.Tests.2005.csproj
new file mode 100644
index 00000000..5569d45f
--- /dev/null
+++ b/examples/Spring/Spring.MsmqQuickStart/test/Spring/Spring.MsmqQuickStart.Tests/Spring.MsmqQuickStart.Tests.2005.csproj
@@ -0,0 +1,41 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}
+ Library
+ Properties
+ Spring
+ Spring.MsmqQuickStart.Tests
+
+
+ true
+ full
+ false
+ ..\..\..\build\VS.NET.2005\Spring.NmsQuickStart.Tests\Debug\
+ TRACE;DEBUG;NET_2_0
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ ..\..\..\build\VS.NET.2005\Spring.NmsQuickStart.Tests\Release\
+ TRACE;NET_2_0
+ prompt
+ 4
+
+
+
+
+
+
+
\ No newline at end of file