activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r507158 - in /activemq/activemq-dotnet/trunk: ./ src/main/csharp/ActiveMQ/ src/main/csharp/ActiveMQ/Commands/ src/main/csharp/ActiveMQ/OpenWire/ src/main/csharp/ActiveMQ/Transport/Stomp/ src/main/csharp/ActiveMQ/Transport/Tcp/ src/main/csha...
Date Tue, 13 Feb 2007 18:59:46 GMT
Author: jstrachan
Date: Tue Feb 13 10:59:44 2007
New Revision: 507158

URL: http://svn.apache.org/viewvc?view=rev&rev=507158
Log:
added initial support for the STOMP transport inside the ActiveMQ NMS client so that the ActiveMQ
NMS implementation can communicate with any STOMP Broker not just the ActiveMQ Broker. The
Stomp support isn't quite working yet, but its getting close...

Added:
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/StompWireFormat.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/
    activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/ConnectionFactory.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/
    activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/JMSPropertyTest.cs
Modified:
    activemq/activemq-dotnet/trunk/README.txt
    activemq/activemq-dotnet/trunk/nant.build
    activemq/activemq-dotnet/trunk/pom.xml
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/CommonAssemblyInfo.cs

Modified: activemq/activemq-dotnet/trunk/README.txt
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/README.txt?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/README.txt (original)
+++ activemq/activemq-dotnet/trunk/README.txt Tue Feb 13 10:59:44 2007
@@ -5,7 +5,7 @@
  * NMS Client for MSMQ
 =======================================================================
 
-For more information see http://incubator.apache.org/activemq/nms.html
+For more information see http://activemq.apache.org/nms.html
 
 =======================================================================
 Building With Visual Stuido 2005

Modified: activemq/activemq-dotnet/trunk/nant.build
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/nant.build?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/nant.build (original)
+++ activemq/activemq-dotnet/trunk/nant.build Tue Feb 13 10:59:44 2007
@@ -142,7 +142,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache NMS Class Library"
/>
         <attribute type="AssemblyDescriptionAttribute"   value="NMS (.Net Messaging Library):
An abstract interface to Message Oriented Middleware (MOM) providers" />
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -188,7 +188,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache NMS Class Library
Tests" />
         <attribute type="AssemblyDescriptionAttribute"   value="NMS (.Net Messaging Library)
Unit Tests"/>
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -231,7 +231,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache NMS for ActiveMQ"
/>
         <attribute type="AssemblyDescriptionAttribute"   value="An NMS (.Net Messaging
Library) interface to Apache ActiveMQ"/>
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -248,6 +248,7 @@
       </nowarn>
       <sources failonempty="true">
         <include name="src/main/csharp/ActiveMQ/**.cs" />
+        <include name="src/main/csharp/Stomp/**.cs" />
       </sources>
       <references failonempty="true">
         <include name="System.dll" asis="true"/>
@@ -273,7 +274,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache ActiveMQ .NET Tests"
/>
         <attribute type="AssemblyDescriptionAttribute"   value="Unit Tests for the NMS
(.Net Messaging Library) to Apache ActiveMQ"/>
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -301,6 +302,51 @@
     </csc>
   </target>
 
+  <!-- Compile the stomp-test module -->
+  <target name="build-stomp-test" depends="init,build-nms,build-nms-test,build-activemq"
description="Build the stomp-test library">
+    <echo message="Building the stomp-test library" />
+
+    <attrib file="src/test/csharp/Stomp/CommonAssemblyInfo.cs" readonly="false" if="${file::exists('src/test/csharp/Stomp/CommonAssemblyInfo.cs')}"
/>
+    <asminfo output="src/test/csharp/Stomp/CommonAssemblyInfo.cs" language="CSharp">
+      <imports>
+        <import namespace="System" />
+        <import namespace="System.Reflection" />
+        <import namespace="System.Runtime.InteropServices" />
+      </imports>
+      <attributes>
+        <attribute type="ComVisibleAttribute"            value="false" />
+        <attribute type="CLSCompliantAttribute"          value="true" />
+        <attribute type="AssemblyTitleAttribute"         value="Stomp .NET Tests" />
+        <attribute type="AssemblyDescriptionAttribute"   value="Unit Tests for the NMS
(.Net Messaging Library) using the STOMP protocol"/>
+        <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
+        <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
+        <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
+        <attribute type="AssemblyTrademarkAttribute"     value="" />
+        <attribute type="AssemblyCultureAttribute"       value="" />
+        <attribute type="AssemblyVersionAttribute"       value="${project.version}" />
+        <attribute type="AssemblyInformationalVersionAttribute" value="${project.version}"
/>
+      </attributes>
+    </asminfo>
+
+    <csc target="library" define="${current.build.defines}" warnaserror="false" debug="${build.debug}"
+      output="${build.bin.dir}/stomp-test.dll" doc="${build.bin.dir}/stomp-test.xml">
+      <nowarn>
+        <warning number="1591" /> <!-- do not report warnings for missing XML comments
-->        <warning number="0618" /> <!-- do not report deprecation warnings -->
+      </nowarn>
+      <sources failonempty="true">
+        <include name="src/test/csharp/Stomp/**.cs" />
+      </sources>
+      <references failonempty="true">
+        <include name="System.dll" asis="true"/>
+        <include name="${lib.dir}/all/nunit/nunit.framework.dll"/>
+        <include name="${build.bin.dir}/nms.dll"/>
+        <include name="${build.bin.dir}/nms-test.dll"/>
+        <include name="${build.bin.dir}/activemq.dll"/>
+      </references>
+    </csc>
+  </target>
+
   <!-- Compile the msmq module -->
   <target name="build-msmq" depends="init,build-nms" description="Build the msmq library"
if="${platform::is-win32()}">
     <echo message="Building the msmq library" />
@@ -318,7 +364,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache NMS for MSMQ" />
         <attribute type="AssemblyDescriptionAttribute"   value="An NMS (.Net Messaging
Library) to MSMQ"/>
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -361,7 +407,7 @@
         <attribute type="AssemblyTitleAttribute"         value="Apache NMS for MSMQ Tests"
/>
         <attribute type="AssemblyDescriptionAttribute"   value="Unit Tests for the NMS
(.Net Messaging Library) to MSMQ"/>
         <attribute type="AssemblyConfigurationAttribute" value="${project.release.type}"
/>
-        <attribute type="AssemblyCompanyAttribute"       value="http://incubator.apache.org/activemq/"
/>
+        <attribute type="AssemblyCompanyAttribute"       value="http://activemq.apache.org/"
/>
         <attribute type="AssemblyProductAttribute"       value="Apache ActiveMQ" />
         <attribute type="AssemblyCopyrightAttribute"     value="Copyright (C) 2005-${datetime::get-year(datetime::now())}
Apache Software Foundation" />
         <attribute type="AssemblyTrademarkAttribute"     value="" />
@@ -405,6 +451,13 @@
     <nunit2>
       <formatter type="Plain" />
       <test assemblyname="${build.bin.dir}/activemq-test.dll" testname="${test}"></test>
+    </nunit2>
+  </target>
+
+  <target name="test-stomp" depends="build-stomp-test" description="Runs all the NUnit
test cases">
+    <nunit2>
+      <formatter type="Plain" />
+      <test assemblyname="${build.bin.dir}/stomp-test.dll"></test>
     </nunit2>
   </target>
 

Modified: activemq/activemq-dotnet/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/pom.xml?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/pom.xml (original)
+++ activemq/activemq-dotnet/trunk/pom.xml Tue Feb 13 10:59:44 2007
@@ -20,11 +20,11 @@
   <parent>
     <groupId>org.apache.activemq</groupId>
     <artifactId>activemq-parent</artifactId>
-    <version>4.1-incubator-SNAPSHOT</version>
+    <version>4.2-SNAPSHOT</version>
   </parent>
   -->
   <groupId>org.apache.activemq</groupId>
-  <version>4.1-incubator-SNAPSHOT</version>
+  <version>4.2-SNAPSHOT</version>
 
   <modelVersion>4.0.0</modelVersion>
   <artifactId>activemq-dotnet</artifactId>

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
(original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
Tue Feb 13 10:59:44 2007
@@ -268,7 +268,11 @@
         public static ActiveMQDestination CreateDestination(int type, String pyhsicalName)
         {
             ActiveMQDestination result = null;
-            if (type == ACTIVEMQ_TOPIC)
+			if (pyhsicalName == null)
+			{
+				return null;
+			}
+            else if (type == ACTIVEMQ_TOPIC)
             {
                 result = new ActiveMQTopic(pyhsicalName);
             }

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs Tue Feb
13 10:59:44 2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache NMS for ActiveMQ")]
 [assembly: AssemblyDescriptionAttribute("An NMS (.Net Messaging Library) interface to Apache
ActiveMQ")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs Tue
Feb 13 10:59:44 2007
@@ -24,7 +24,7 @@
 namespace ActiveMQ.OpenWire
 {
     /// <summary>
-    /// Represents the wire format
+    /// Implements the <a href="http://activemq.apache.org/openwire.html">OpenWire</a>
protocol.
     /// </summary>
     public class OpenWireFormat : IWireFormat
     {

Added: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/StompWireFormat.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/StompWireFormat.cs?view=auto&rev=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/StompWireFormat.cs
(added)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/StompWireFormat.cs
Tue Feb 13 10:59:44 2007
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+using System.Reflection;
+using ActiveMQ.Commands;
+using ActiveMQ.OpenWire.V1;
+using ActiveMQ.Transport;
+using NMS;
+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+
+namespace ActiveMQ.OpenWire
+{
+    /// <summary>
+    /// Implements the <a href="http://stomp.codehaus.org/">STOMP</a> protocol.
+    /// </summary>
+    public class StompWireFormat : IWireFormat
+    {
+		protected const String NEWLINE = "\n";
+		protected const String SEPARATOR = ":";
+		protected const char NULL = (char) 0;
+		protected Encoding encoding = new UTF8Encoding();
+		
+		public StompWireFormat()
+		{
+		}
+		
+        public int Version {
+            get { return 1; }
+        }
+
+        public void Marshal(Object o, BinaryWriter ds)
+        {
+			if (o is ConnectionInfo) 
+			{
+				WriteConnectionInfo((ConnectionInfo) o, ds);
+			}
+			else if (o is ActiveMQMessage)
+			{
+				WriteMessage((ActiveMQMessage) o, ds);
+			}
+			else if (o is ConsumerInfo)
+			{
+				WriteConsumerInfo((ConsumerInfo) o, ds);
+			}
+			else if (o is MessageAck)
+			{
+				WriteMessageAck((MessageAck) o, ds);
+			}
+			else 
+			{
+				Console.WriteLine("Ignored command: " + o);
+			}
+        }
+        
+        public Object Unmarshal(BinaryReader dis)
+        {
+			StreamReader socketReader = new StreamReader(dis.BaseStream);
+			string command;
+			do {
+				command = socketReader.ReadLine();
+			}
+			while (command == "");
+			
+			IDictionary headers = new Hashtable();
+			string line;
+			while((line = socketReader.ReadLine()) != "") 
+			{
+				string[] split = line.Split(new char[] {':'}, 2);
+				headers[split[0]] = split[1];
+			}
+
+			byte[] content = null;
+			string length = ToString(headers["content-length"]);
+			if (length != null) 
+			{
+				int size = Int32.Parse(length);
+				content = dis.ReadBytes(size);
+			}
+			else
+			{
+				StringBuilder body = new StringBuilder();
+				int nextChar;
+				while((nextChar = socketReader.Read()) != 0) 
+				{
+					body.Append((char)nextChar);
+				}
+				string text = body.ToString().TrimEnd('\r', '\n');
+				content = encoding.GetBytes(text);
+			}
+			return CreateCommand(command, headers, content);
+        }
+
+		protected Object CreateCommand(string command, IDictionary headers, byte[] content) 
+		{
+			if (command == "RECEIPT")
+			{
+				Response answer = new Response();
+				answer.CorrelationId = Int32.Parse(ToString(headers["receipt-id"]));
+				return answer; 
+			}
+			else if (command == "MESSAGE")
+			{
+				return ReadMessage(command, headers, content);
+			}
+			else if (command == "ERROR")
+			{
+				ExceptionResponse answer = new ExceptionResponse();
+				BrokerError error = new BrokerError();
+				error.Message = ToString(headers["message"]);
+				error.ExceptionClass = ToString(headers["exceptionClass"]); // TODO is this the right
header?
+				answer.Exception = error;
+				return answer; 
+			}
+			else
+			{
+				Console.WriteLine("Unknown command: " + command + " headers: " + headers);
+				return null;
+			}
+		}
+		
+		protected ActiveMQMessage ReadMessage(string command, IDictionary headers, byte[] content)

+		{
+			ActiveMQMessage message = null;
+			if (headers.Contains("content-length"))
+			{
+				message = new ActiveMQBytesMessage();
+			}
+			else 
+			{
+				message = new ActiveMQTextMessage();
+			}
+			message.Content = content;
+			
+			// TODO now lets set the various headers
+			message.Type = ToString(headers["type"]);
+			message.Destination = ActiveMQDestination.CreateDestination(ActiveMQDestination.ACTIVEMQ_QUEUE,
ToString(headers["destination"]));
+			message.ReplyTo = ActiveMQDestination.CreateDestination(ActiveMQDestination.ACTIVEMQ_QUEUE,
ToString(headers["reply-to"]));
+			
+			// lets remove all the standard headers as unfortunately there's no Remove method which
returns the removed value
+			string[] standardHeaders = { "type", "destination", "reply-to", "receipt-id" };
+			foreach (string header in standardHeaders) 
+			{
+				headers.Remove(header);
+			}
+			
+			// now lets add the generic headers
+			foreach (string key in headers.Keys)
+			{
+				message.Properties[key] = headers[key];
+			}
+			return message;
+		}
+		
+		protected void WriteConnectionInfo(ConnectionInfo command, BinaryWriter ds)
+		{
+			WriteCommand(ds, "CONNECT");
+			WriteHeader(ds, "client-id", command.ClientId);
+			WriteHeader(ds, "login", command.UserName);
+			WriteHeader(ds, "passcode", command.Password);
+			WriteCommonHeaders(ds, command);
+			WriteFrameEnd(ds);
+		}
+
+		protected void WriteConsumerInfo(ConsumerInfo command, BinaryWriter ds)
+		{
+			WriteCommand(ds, "SUBSCRIBE");
+			WriteHeader(ds, "destination", command.Destination);
+			WriteHeader(ds, "selector", command.Selector);
+			WriteHeader(ds, "id", command.ConsumerId);
+			WriteHeader(ds, "durable-subscriber-name", command.SubscriptionName);
+			WriteHeader(ds, "no-local", command.NoLocal);
+			WriteHeader(ds, "ack", "client");
+			
+			// ActiveMQ extensions to STOMP
+			WriteHeader(ds, "activemq.dispatchAsync", command.DispatchAsync);
+			WriteHeader(ds, "activemq.exclusive", command.Exclusive);
+			WriteHeader(ds, "activemq.maximumPendingMessageLimit", command.MaximumPendingMessageLimit);
+			WriteHeader(ds, "activemq.prefetchSize", command.PrefetchSize);
+			WriteHeader(ds, "activemq.priority ", command.Priority);
+			WriteHeader(ds, "activemq.retroactive", command.Retroactive);
+			
+			WriteCommonHeaders(ds, command);
+			WriteFrameEnd(ds);
+		}
+
+		protected void WriteMessage(ActiveMQMessage command, BinaryWriter ds)
+		{
+			WriteCommand(ds, "SEND");
+			WriteHeader(ds, "correlation-id", command.CorrelationId);
+			WriteHeader(ds, "reply-to", command.ReplyTo);
+			WriteHeader(ds, "expires", command.Expiration);
+			WriteHeader(ds, "priority", command.Priority);
+			WriteHeader(ds, "type", command.Type);
+			WriteHeader(ds, "transaction", command.TransactionId);
+			
+			if (!(command is ActiveMQTextMessage)) 
+			{
+				WriteHeader(ds, "content-length", command.Content.Length);
+			}
+	
+			// TODO write content
+			
+			IPrimitiveMap map = command.Properties;
+			foreach (string key in map.Keys)
+			{
+				WriteHeader(ds, key, map[key]);
+			}
+			WriteCommonHeaders(ds, command);
+			ds.Write(NEWLINE);
+			ds.Write(command.Content);
+			ds.Write(NULL);
+		}
+		
+		protected void WriteMessageAck(MessageAck command, BinaryWriter ds)
+		{
+			WriteCommand(ds, "ACK");
+			
+			// TODO handle bulk ACKs?
+			WriteHeader(ds, "message-id", command.FirstMessageId);
+			WriteHeader(ds, "transaction", command.TransactionId);
+			
+			WriteCommonHeaders(ds, command);
+			WriteFrameEnd(ds);
+		}
+		
+		protected void WriteCommand(BinaryWriter ds, String command)
+		{
+			ds.Write(command + NEWLINE);
+		}
+		
+		protected void WriteFrameEnd(BinaryWriter ds)
+		{
+			ds.Write(NEWLINE);
+			ds.Write(NULL);
+		}
+		
+		protected void WriteHeader(BinaryWriter ds, String name, Object value)
+		{
+			if (value != null) {
+				ds.Write(name + SEPARATOR + value + NEWLINE);
+			}
+		}
+		
+		protected void WriteCommonHeaders(BinaryWriter ds, Command command) 
+		{
+			if (command.ResponseRequired)
+			{
+				WriteHeader(ds, "receipt", command.CommandId);
+			}
+		}
+		
+		protected string ToString(object value) 
+		{
+			if (value != null) 
+			{
+				return value.ToString();
+			}
+			else 
+			{
+				return null;
+			}
+		}
+    }
+}

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs
(original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs
Tue Feb 13 10:59:44 2007
@@ -82,12 +82,22 @@
 				protected IWireFormat CreateWireFormat(Uri location, System.Collections.Specialized.StringDictionary
map)
 				{
 					// TODO detect STOMP etc
-					
-					OpenWireFormat answer = new OpenWireFormat();
+					if ("stomp".Equals(location.Scheme)) 
+					{
+						IWireFormat answer = new StompWireFormat();
 
-                    // Set wireformat. properties on the wireformat owned by the tcpTransport
-                    URISupport.SetProperties(answer.PreferedWireFormatInfo, map, "wireFormat.");
-					return answer;
+	                    // Set wireformat. properties on the wireformat owned by the tcpTransport
+	                    URISupport.SetProperties(answer, map, "wireFormat.");
+						return answer;
+					}
+					else 
+					{
+						OpenWireFormat answer = new OpenWireFormat();
+
+	                    // Set wireformat. properties on the wireformat owned by the tcpTransport
+	                    URISupport.SetProperties(answer.PreferedWireFormatInfo, map, "wireFormat.");
+						return answer;
+					}
 				}
         }
 }

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/CommonAssemblyInfo.cs Tue Feb 13 10:59:44
2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache NMS for MSMQ")]
 [assembly: AssemblyDescriptionAttribute("An NMS (.Net Messaging Library) to MSMQ")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs Tue Feb 13 10:59:44
2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache NMS Class Library")]
 [assembly: AssemblyDescriptionAttribute("NMS (.Net Messaging Library): An abstract interface
to Message Oriented Middleware (MOM) providers")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Added: activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/ConnectionFactory.cs?view=auto&rev=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/ConnectionFactory.cs (added)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/Stomp/ConnectionFactory.cs Tue Feb 13 10:59:44
2007
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+using ActiveMQ;
+using NMS;
+using System;
+
+namespace Stomp
+{
+    /// <summary>
+    /// Represents a connection with a message broker using the 
+	/// <a href="http://stomp.codehaus.org/">STOMP</a> protocol.
+    /// </summary>
+    public class ConnectionFactory : ActiveMQ.ConnectionFactory
+    {
+        public ConnectionFactory()
+        {
+			BrokerUri = new Uri("stomp://localhost:61613");
+        }
+    }
+}

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs Tue Feb
13 10:59:44 2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache ActiveMQ .NET Tests")]
 [assembly: AssemblyDescriptionAttribute("Unit Tests for the NMS (.Net Messaging Library)
to Apache ActiveMQ")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs Tue Feb 13 10:59:44
2007
@@ -24,8 +24,8 @@
 	[TestFixture]
     public class ConsumerTest : NMS.Test.ConsumerTest
     {
-
         private String brokerURI = "tcp://localhost:61616";
+
         protected override IConnectionFactory CreateConnectionFactory()
         {
             return new ConnectionFactory(new Uri(brokerURI));

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/CommonAssemblyInfo.cs Tue Feb 13 10:59:44
2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache NMS for MSMQ Tests")]
 [assembly: AssemblyDescriptionAttribute("Unit Tests for the NMS (.Net Messaging Library)
to MSMQ")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/CommonAssemblyInfo.cs?view=diff&rev=507158&r1=507157&r2=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/CommonAssemblyInfo.cs Tue Feb
13 10:59:44 2007
@@ -17,7 +17,7 @@
 [assembly: AssemblyTitleAttribute("Apache NMS Class Library Tests")]
 [assembly: AssemblyDescriptionAttribute("NMS (.Net Messaging Library) Unit Tests")]
 [assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
-[assembly: AssemblyCompanyAttribute("http://incubator.apache.org/activemq/")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
 [assembly: AssemblyProductAttribute("Apache ActiveMQ")]
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]

Added: activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/CommonAssemblyInfo.cs?view=auto&rev=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/CommonAssemblyInfo.cs (added)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/CommonAssemblyInfo.cs Tue Feb 13
10:59:44 2007
@@ -0,0 +1,27 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// ------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      Mono Runtime Version: 1.1.4322.2032
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+// ------------------------------------------------------------------------------
+
+[assembly: ComVisibleAttribute(false)]
+[assembly: CLSCompliantAttribute(true)]
+[assembly: AssemblyTitleAttribute("Stomp .NET Tests")]
+[assembly: AssemblyDescriptionAttribute("Unit Tests for the NMS (.Net Messaging Library)
using the STOMP protocol")]
+[assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/")]
+[assembly: AssemblyProductAttribute("Apache ActiveMQ")]
+[assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2007 Apache Software Foundation")]
+[assembly: AssemblyTrademarkAttribute("")]
+[assembly: AssemblyCultureAttribute("")]
+[assembly: AssemblyVersionAttribute("4.0")]
+[assembly: AssemblyInformationalVersionAttribute("4.0")]
+

Added: activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/JMSPropertyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/JMSPropertyTest.cs?view=auto&rev=507158
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/JMSPropertyTest.cs (added)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/JMSPropertyTest.cs Tue Feb 13 10:59:44
2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+using NMS;
+using NUnit.Framework;
+using Stomp;
+using System;
+
+namespace Stomp
+{
+    [ TestFixture ]
+    public class NMSPropertyTest : NMS.Test.NMSPropertyTest
+    {
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory();
+        }
+    }
+}
+
+
+



Mime
View raw message