Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 69047 invoked from network); 13 Feb 2007 14:04:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 14:04:56 -0000 Received: (qmail 48236 invoked by uid 500); 13 Feb 2007 14:05:04 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 48217 invoked by uid 500); 13 Feb 2007 14:05:04 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 48208 invoked by uid 99); 13 Feb 2007 14:05:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 06:05:04 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 06:04:54 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 4B1911A981A; Tue, 13 Feb 2007 06:04:34 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070213140434.4B1911A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ [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 @@ /// /// Represents the wire format /// - 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 +{ + /// + /// Represents the marshalling of commands to and from an IO stream + /// + public interface IWireFormat + { + /// + /// Marshalls the given command object onto the stream + /// + void Marshal(Object o, BinaryWriter ds); + + /// + /// Unmarshalls the next command object from the stream + /// + 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; } /// @@ -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; -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ [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; -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ [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; -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ [assembly: ComVisibleAttribute(false)] [assembly: CLSCompliantAttribute(true)]