activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r507007 - in /activemq/activemq-dotnet/trunk/src: main/csharp/ActiveMQ/ main/csharp/ActiveMQ/OpenWire/ main/csharp/ActiveMQ/Transport/ main/csharp/ActiveMQ/Transport/Stomp/ main/csharp/ActiveMQ/Transport/Tcp/ main/csharp/NMS/ test/csharp/Ac...
Date Tue, 13 Feb 2007 14:04:33 GMT
Author: jstrachan
Date: Tue Feb 13 06:04:28 2007
New Revision: 507007

URL: http://svn.apache.org/viewvc?view=rev&rev=507007
Log:
minor refactor to make it easy to add pluggable IWireFormat instances to do things like support
STOMP natively etc

Added:
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/IWireFormat.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Stomp/
Modified:
    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/TcpTransport.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.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/NMS/Test/CommonAssemblyInfo.cs

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=507007&r1=507006&r2=507007
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/CommonAssemblyInfo.cs Tue Feb
13 06:04:28 2007
@@ -2,15 +2,15 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
+//  <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)]

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=507007&r1=507006&r2=507007
==============================================================================
--- 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 06:04:28 2007
@@ -17,6 +17,7 @@
 using System.Reflection;
 using ActiveMQ.Commands;
 using ActiveMQ.OpenWire.V1;
+using ActiveMQ.Transport;
 using System;
 using System.IO;
 
@@ -25,7 +26,7 @@
     /// <summary>
     /// Represents the wire format
     /// </summary>
-    public class OpenWireFormat
+    public class OpenWireFormat : IWireFormat
     {
         
         private BaseDataStreamMarshaller[] dataMarshallers;

Added: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/IWireFormat.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/IWireFormat.cs?view=auto&rev=507007
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/IWireFormat.cs (added)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/IWireFormat.cs Tue Feb
13 06:04:28 2007
@@ -0,0 +1,38 @@
+/*
+ * 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;
+using System.IO;
+
+namespace ActiveMQ.Transport
+{
+	/// <summary>
+	/// Represents the marshalling of commands to and from an IO stream
+	/// </summary>
+	public interface IWireFormat
+    {
+		/// <summary>
+		/// Marshalls the given command object onto the stream
+		/// </summary>
+	    void Marshal(Object o, BinaryWriter ds);
+
+		/// <summary>
+		/// Unmarshalls the next command object from the stream
+		/// </summary>
+        Object Unmarshal(BinaryReader dis);
+    }
+}
+

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs?view=diff&rev=507007&r1=507006&r2=507007
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs
(original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs
Tue Feb 13 06:04:28 2007
@@ -34,7 +34,7 @@
     public class TcpTransport : ITransport
     {
         private Socket socket;
-        private OpenWireFormat wireformat = new OpenWireFormat();
+        private IWireFormat wireformat = new OpenWireFormat();
         private BinaryReader socketReader;
         private BinaryWriter socketWriter;
         private Thread readThread;
@@ -44,9 +44,10 @@
         private CommandHandler commandHandler;
         private ExceptionHandler exceptionHandler;
         
-        public TcpTransport(Socket socket)
+        public TcpTransport(Socket socket, IWireFormat wireformat)
         {
             this.socket = socket;
+			this.wireformat = wireformat;
         }
         
         /// <summary>
@@ -164,7 +165,7 @@
             set { this.exceptionHandler = value; }
         }
 
-        public OpenWireFormat Wireformat
+        public IWireFormat Wireformat
         {
             get { return wireformat; }
             set { wireformat = value; }

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=507007&r1=507006&r2=507007
==============================================================================
--- 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 06:04:28 2007
@@ -43,7 +43,8 @@
 
                         // Console.WriteLine("Opening socket to: " + host + " on port: "
+ port);
                         Socket socket = Connect(location.Host, location.Port);
-                        TcpTransport tcpTransport = new TcpTransport(socket);
+						IWireFormat wireformat = CreateWireFormat(location, map);
+                        TcpTransport tcpTransport = new TcpTransport(socket, wireformat);
                         ITransport rc = tcpTransport;
 
                         if (UseLogging)
@@ -51,10 +52,10 @@
                                 rc = new LoggingTransport(rc);
                         }
 
-                        // Set wireformat. properties on the wireformat owned by the tcpTransport
-                        URISupport.SetProperties(tcpTransport.Wireformat.PreferedWireFormatInfo,
map, "wireFormat.");
-
-                        rc = new WireFormatNegotiator(rc, tcpTransport.Wireformat);
+						if (wireformat is OpenWireFormat)
+						{
+	                        rc = new WireFormatNegotiator(rc, (OpenWireFormat) wireformat);
+						}
                         rc = new MutexTransport(rc);
                         rc = new ResponseCorrelator(rc);
 
@@ -77,5 +78,16 @@
                         }
                         throw new SocketException();
                 }
+
+				protected IWireFormat CreateWireFormat(Uri location, System.Collections.Specialized.StringDictionary
map)
+				{
+					// TODO detect STOMP etc
+					
+					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/NMS/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs?view=diff&rev=507007&r1=507006&r2=507007
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/NMS/CommonAssemblyInfo.cs Tue Feb 13 06:04:28
2007
@@ -2,21 +2,20 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
+//  <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("Apache NMS Class Library")]
-[assembly: AssemblyDescriptionAttribute("NMS (.Net Messaging Library): An abstract interface
to Message Oriented Middlewar" +
-    "e (MOM) providers")]
+[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: AssemblyProductAttribute("Apache ActiveMQ")]

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=507007&r1=507006&r2=507007
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/CommonAssemblyInfo.cs Tue Feb
13 06:04:28 2007
@@ -2,15 +2,15 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
+//  <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)]

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=507007&r1=507006&r2=507007
==============================================================================
--- 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 06:04:28 2007
@@ -2,15 +2,15 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
+//  <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)]



Mime
View raw message