Return-Path: Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: (qmail 73305 invoked from network); 3 Dec 2009 22:31:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Dec 2009 22:31:51 -0000 Received: (qmail 99228 invoked by uid 500); 3 Dec 2009 22:31:51 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 99212 invoked by uid 500); 3 Dec 2009 22:31:51 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 99203 invoked by uid 99); 3 Dec 2009 22:31:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 22:31:51 +0000 X-ASF-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 22:31:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 132D123888E9; Thu, 3 Dec 2009 22:31:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r886962 [1/5] - in /qpid/trunk/qpid/dotnet/client-010: ./ addins/ExcelAddIn/ addins/ExcelAddInMessageProcessor/ addins/ExcelAddInProducer/ client/ client/client/ client/transport/ client/transport/codec/ client/transport/exception/ client/t... Date: Thu, 03 Dec 2009 22:31:17 -0000 To: commits@qpid.apache.org From: aidan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091203223123.132D123888E9@eris.apache.org> Author: aidan Date: Thu Dec 3 22:31:12 2009 New Revision: 886962 URL: http://svn.apache.org/viewvc?rev=886962&view=rev Log: QPID-500: Fix public API to match .Net conventions QPID-1987: misc test fixes, - Fixes ToString() methods that don't override base classes - Fixes blocking TearingDown in unit tests - Use a .config file for tests/samples - Adds interface to Invoker, Session and ClientSession to allow easy mocking of the API - Make the console solution compiling under Visual Studio 2008 patch from julien.lavigne Added: qpid/trunk/qpid/dotnet/client-010/client/client/IClient.cs qpid/trunk/qpid/dotnet/client-010/client/client/IClientSession.cs qpid/trunk/qpid/dotnet/client-010/client/client/IClosedListener.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs qpid/trunk/qpid/dotnet/client-010/client/client/IMessageListener.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs qpid/trunk/qpid/dotnet/client-010/client/transport/IBinding.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/IFuture.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs qpid/trunk/qpid/dotnet/client-010/client/transport/IProtocolDelegate.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs qpid/trunk/qpid/dotnet/client-010/client/transport/IProtocolEvent.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs qpid/trunk/qpid/dotnet/client-010/client/transport/IReceiver.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ISender.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ISession.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/IDecoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/IEncodable.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/IEncoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/INetworkDelegate.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/INetworkEvent.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IIoSender.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/RequestResponseClient.cs - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs qpid/trunk/qpid/dotnet/client-010/gentool/IInvoker.tpl - copied, changed from r886946, qpid/trunk/qpid/dotnet/client-010/management/console/SchemaStatistic.cs Removed: qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs Modified: qpid/trunk/qpid/dotnet/client-010/README.txt qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs qpid/trunk/qpid/dotnet/client-010/client/Client.csproj qpid/trunk/qpid/dotnet/client-010/client/client.sln qpid/trunk/qpid/dotnet/client-010/client/client/Client.cs qpid/trunk/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs qpid/trunk/qpid/dotnet/client-010/client/client/ClientSession.cs qpid/trunk/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs qpid/trunk/qpid/dotnet/client-010/client/client/ErrorCode.cs qpid/trunk/qpid/dotnet/client-010/client/client/IMessage.cs qpid/trunk/qpid/dotnet/client-010/client/client/Message.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Binary.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Connection.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Field.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Header.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Method.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ProtocolError.cs qpid/trunk/qpid/dotnet/client-010/client/transport/ProtocolHeader.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs qpid/trunk/qpid/dotnet/client-010/client/transport/SessionDelegate.cs qpid/trunk/qpid/dotnet/client-010/client/transport/Struct.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/Assembler.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/Disassembler.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/Frame.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/InputHandler.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IIoTransport.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoSender.cs qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/Logger.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs qpid/trunk/qpid/dotnet/client-010/client/transport/util/Serial.cs qpid/trunk/qpid/dotnet/client-010/demo/Demo.csproj qpid/trunk/qpid/dotnet/client-010/demo/Program.cs qpid/trunk/qpid/dotnet/client-010/demo/default.build qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build qpid/trunk/qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build qpid/trunk/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.cs qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build qpid/trunk/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build qpid/trunk/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj qpid/trunk/qpid/dotnet/client-010/management/console/Agent.cs qpid/trunk/qpid/dotnet/client-010/management/console/Broker.cs qpid/trunk/qpid/dotnet/client-010/management/console/BrokerURL.cs qpid/trunk/qpid/dotnet/client-010/management/console/ClassKey.cs qpid/trunk/qpid/dotnet/client-010/management/console/ObjectID.cs qpid/trunk/qpid/dotnet/client-010/management/console/QMFEvent.cs qpid/trunk/qpid/dotnet/client-010/management/console/QMFObject.cs qpid/trunk/qpid/dotnet/client-010/management/console/SchemaArgument.cs qpid/trunk/qpid/dotnet/client-010/management/console/SchemaClass.cs qpid/trunk/qpid/dotnet/client-010/management/console/SchemaMethod.cs qpid/trunk/qpid/dotnet/client-010/management/console/SchemaProperty.cs qpid/trunk/qpid/dotnet/client-010/management/console/SchemaStatistic.cs qpid/trunk/qpid/dotnet/client-010/management/console/Session.cs qpid/trunk/qpid/dotnet/client-010/management/console/console.csproj qpid/trunk/qpid/dotnet/client-010/management/console/console.sln qpid/trunk/qpid/dotnet/client-010/perftest/PerfTest.cs qpid/trunk/qpid/dotnet/client-010/perftest/perftest.csproj qpid/trunk/qpid/dotnet/client-010/test/Test.csproj qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs qpid/trunk/qpid/dotnet/client-010/test/interop/ApplicationHeaders.cs qpid/trunk/qpid/dotnet/client-010/test/interop/Message.cs qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs qpid/trunk/qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs qpid/trunk/qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs qpid/trunk/qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs qpid/trunk/qpid/dotnet/client-010/test/transport/util/SerialTest.cs Modified: qpid/trunk/qpid/dotnet/client-010/README.txt URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/README.txt?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/README.txt (original) +++ qpid/trunk/qpid/dotnet/client-010/README.txt Thu Dec 3 22:31:12 2009 @@ -3,17 +3,19 @@ AMQP 0.10 Native .NET client supporting WCF and xcel -This client is self contained, all dependancies are in this -directory. +In order to build this client from the sources you'll need the following folders : +- /java/lib +- /python +- /specs Setup ===== Install: - Microsoft Visual Studio 2005 (VS2005) - NAnt 0.85 - only required for builds outside VS2005 (.net 1.1, .net 2.0, mono 2.0) - Ant 1.6.5 + Microsoft Visual Studio 2008 (VS2008). It's also possible to build with vs2005 by creating a new solution and adding Client.csproj + NAnt 0.85 - only required for builds outside VS2008 (.net 1.1, .net 2.0, mono 2.0) + Ant 1.6.5 (requires Java) Cygwin (or alternatively build via cmd but alter instructions below accordingly) Set up PATH to include Nant.exe: @@ -33,7 +35,7 @@ $ cd /dotnet/client-010/gentool $ ant -You can build from Visual Studio 2005 normally. Alternatively, you +You can build from Visual Studio 2008 normally. Alternatively, you can build debug releases for any supported framework from the command line using Nant: Modified: qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs Thu Dec 3 22:31:12 2009 @@ -49,8 +49,8 @@ private readonly Dictionary _topicMessages = new Dictionary(); private readonly Dictionary _queueListener = new Dictionary(); private readonly Dictionary _topicQueueName = new Dictionary(); - private Client _client; - private ClientSession _session; + private IClient _client; + private IClientSession _session; private ProcessMessage _messageProcessor; #region properties @@ -65,7 +65,7 @@ get { return _topicMessages; } } - public ClientSession Session + public IClientSession Session { get { return _session; } } @@ -103,7 +103,7 @@ { virtualhost = ConfigurationManager.AppSettings["VirtualHost"]; } - if (ConfigurationManager.AppSettings["UserName"] != null) + if (ConfigurationManager.AppSettings["Username"] != null) { username = ConfigurationManager.AppSettings["UserName"]; } @@ -132,9 +132,9 @@ try { _client = new Client(); - _client.connect(host, Convert.ToInt16(port), virtualhost, username, password); + _client.Connect(host, Convert.ToInt16(port), virtualhost, username, password); // create a session - _session = _client.createSession(0); + _session = _client.CreateSession(0); } catch (Exception e) { @@ -164,8 +164,8 @@ queuename = (string) Strings.GetValue(0); } // Error message if the queue does not exist - QueueQueryResult result = (QueueQueryResult)_session.queueQuery(queuename).Result; - if( result.getQueue() == null ) + QueueQueryResult result = (QueueQueryResult)_session.QueueQuery(queuename).Result; + if( result.GetQueue() == null ) { System.Windows.Forms.MessageBox.Show("Error: \n queue " + queuename + " does not exist"); return "error"; @@ -184,14 +184,14 @@ listener = new QpidListener(this); listener.addTopic(TopicID); _queueListener.Add(queuename, listener); - _session.attachMessageListener(listener, destinationName); - _session.messageSubscribe(queuename, destinationName, MessageAcceptMode.EXPLICIT, + _session.AttachMessageListener(listener, destinationName); + _session.MessageSubscribe(queuename, destinationName, MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null, 0, null); // issue credits - _session.messageSetFlowMode(destinationName, MessageFlowMode.WINDOW); - _session.messageFlow(destinationName, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES); - _session.messageFlow(destinationName, MessageCreditUnit.MESSAGE, 1000); - _session.sync(); + _session.MessageSetFlowMode(destinationName, MessageFlowMode.WINDOW); + _session.MessageFlow(destinationName, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES); + _session.MessageFlow(destinationName, MessageCreditUnit.MESSAGE, 1000); + _session.Sync(); } } catch (Exception e) @@ -212,7 +212,7 @@ string queueName = _topicQueueName[TopicID]; if (_topicQueueName.Remove(TopicID) && !_topicQueueName.ContainsValue(queueName)) { - _session.messageStop("ExcelAddIn-" + queueName); + _session.MessageStop("ExcelAddIn-" + queueName); _session.MessageListeners.Remove("ExcelAddIn-" + queueName); } } @@ -271,7 +271,7 @@ _topics.Add(topic); } - public void messageTransfer(IMessage m) + public void MessageTransfer(IMessage m) { foreach (int i in _topics) { @@ -282,9 +282,9 @@ } // ack this message RangeSet rs = new RangeSet(); - rs.add(m.Id); - _excel.Session.messageAccept(rs); + rs.Add(m.Id); + _excel.Session.MessageAccept(rs); _excel.OnMessage.UpdateNotify(); } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj (original) +++ qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj Thu Dec 3 22:31:12 2009 @@ -2,7 +2,7 @@ Debug AnyCPU - 8.0.50727 + 9.0.30729 2.0 {85EFD719-39F6-4471-90FF-9E621430344B} Library @@ -45,7 +45,7 @@ - + @@ -54,7 +54,9 @@ - + + App.config + - \ No newline at end of file + Modified: qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj (original) +++ qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj Thu Dec 3 22:31:12 2009 @@ -2,7 +2,7 @@ Debug AnyCPU - 8.0.50727 + 9.0.30729 2.0 {80F00C3B-EB38-4B3B-9F77-68977A30B155} Exe @@ -34,11 +34,12 @@ + - + @@ -46,6 +47,11 @@ Client + + + App.config + + - \ No newline at end of file + Modified: qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs Thu Dec 3 22:31:12 2009 @@ -19,6 +19,7 @@ * */ using System; +using System.Configuration; using System.Text; using System.Threading; using org.apache.qpid.client; @@ -29,27 +30,33 @@ { static void Main(string[] args) { + string host = ConfigurationManager.AppSettings["Host"]; + int port = int.Parse(ConfigurationManager.AppSettings["Port"]); + string virtualhost = ConfigurationManager.AppSettings["VirtualHost"]; + string username = ConfigurationManager.AppSettings["Username"]; + string password = ConfigurationManager.AppSettings["Password"]; + Client client = new Client(); Console.WriteLine("Client created"); - client.connect("192.168.1.14", 5672, "test", "guest", "guest"); + client.Connect(host, port, virtualhost, username, password); Console.WriteLine("Connection established"); - ClientSession ssn = client.createSession(50000); + IClientSession ssn = client.CreateSession(50000); Console.WriteLine("Session created"); - ssn.queueDeclare("queue1", null, null); - ssn.exchangeBind("queue1", "amq.direct", "queue1", null); + ssn.QueueDeclare("queue1", null, null); + ssn.ExchangeBind("queue1", "amq.direct", "queue1", null); IMessage message = new Message(); message.ApplicationHeaders.Add("price", 0); for (int i = 0; i < 100; i++) { - message.clearData(); - message.appendData( Encoding.UTF8.GetBytes("test: " + i)); + message.ClearData(); + message.AppendData( Encoding.UTF8.GetBytes("test: " + i)); message.ApplicationHeaders["price"] = i; - ssn.messageTransfer("amq.direct", "queue1", message); + ssn.MessageTransfer("amq.direct", "queue1", message); Thread.Sleep(1000); } - client.close(); + client.Close(); } } } Modified: qpid/trunk/qpid/dotnet/client-010/client/Client.csproj URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/Client.csproj?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/Client.csproj (original) +++ qpid/trunk/qpid/dotnet/client-010/client/Client.csproj Thu Dec 3 22:31:12 2009 @@ -2,7 +2,7 @@ Debug AnyCPU - 8.0.50727 + 9.0.30729 2.0 {B911FFD7-754F-4735-A188-218D5065BE79} Library @@ -42,7 +42,174 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + Modified: qpid/trunk/qpid/dotnet/client-010/client/client.sln URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client.sln?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client.sln (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client.sln Thu Dec 3 22:31:12 2009 @@ -31,6 +31,11 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelAddInMessageProcessor", "..\addins\ExcelAddInMessageProcessor\ExcelAddInMessageProcessor.csproj", "{C2AE83A3-D5D1-469D-8611-A4738B9997CF}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3CE4FA2A-393F-4DED-ABDF-1BC2F253ACA8}" + ProjectSection(SolutionItems) = preProject + ..\App.config = ..\App.config + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Modified: qpid/trunk/qpid/dotnet/client-010/client/client/Client.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/Client.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/Client.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/Client.cs Thu Dec 3 22:31:12 2009 @@ -25,19 +25,20 @@ namespace org.apache.qpid.client { - public class Client : ClientInterface + public class Client : IClient { private Connection _conn; - private static readonly Logger _log = Logger.get(typeof (Client)); + private static readonly Logger _log = Logger.Get(typeof (Client)); private const long timeout = 60000; - private bool _closed; + private bool _isClosed; private readonly Object _closeOK; - private ClosedListener _closedListner; + private IClosedListener _closedListner; - public bool Closed + + public bool IsClosed { - get { return _closed; } - set { _closed = value; } + get { return _isClosed; } + set { _isClosed = value; } } public Object CloseOk @@ -47,11 +48,11 @@ public Client() { - _closed = false; + _isClosed = false; _closeOK = new object(); } - #region Interface ClientInterface + #region Interface IClient /// /// Establishes a connection with a broker using the provided user auths @@ -62,17 +63,17 @@ /// virtual host name /// User Name /// Password - public void connect(String host, int port, String virtualHost, String username, String password) + public void Connect(String host, int port, String virtualHost, String username, String password) { - _log.debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host, + _log.Debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host, port, virtualHost, username)); ConnectionDelegate connectionDelegate = new ClientConnectionDelegate(this, username, password); ManualResetEvent negotiationComplete = new ManualResetEvent(false); connectionDelegate.setCondition(negotiationComplete); connectionDelegate.VirtualHost = virtualHost; - _conn = IoTransport.connect(host, port, connectionDelegate); + _conn = IoTransport.Connect(host, port, connectionDelegate); - _conn.send(new ProtocolHeader(1, 0, 10)); + _conn.Send(new ProtocolHeader(1, 0, 10)); negotiationComplete.WaitOne(); } @@ -88,53 +89,53 @@ /// Name of the SSL server /// Path to the X509 certificate to be used for client authentication /// If true connection will not be established if the broker is not trusted - public void connectSSL(String host, int port, String virtualHost, String username, String password, string serverName, string certPath, bool rejectUntrusted) + public void ConnectSSL(String host, int port, String virtualHost, String username, String password, string serverName, string certPath, bool rejectUntrusted) { - _log.debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host, + _log.Debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host, port, virtualHost, username)); - _log.debug(String.Format("SSL paramters: serverName: {0}; certPath: {1}; rejectUntrusted: {2}", serverName, certPath, rejectUntrusted)); + _log.Debug(String.Format("SSL paramters: serverName: {0}; certPath: {1}; rejectUntrusted: {2}", serverName, certPath, rejectUntrusted)); ConnectionDelegate connectionDelegate = new ClientConnectionDelegate(this, username, password); ManualResetEvent negotiationComplete = new ManualResetEvent(false); connectionDelegate.setCondition(negotiationComplete); connectionDelegate.VirtualHost = virtualHost; - _conn = IoSSLTransport.connect(host, port, serverName, certPath, rejectUntrusted, connectionDelegate); + _conn = IoSSLTransport.Connect(host, port, serverName, certPath, rejectUntrusted, connectionDelegate); - _conn.send(new ProtocolHeader(1, 0, 10)); + _conn.Send(new ProtocolHeader(1, 0, 10)); negotiationComplete.WaitOne(); } - public void close() + public void Close() { - Channel ch = _conn.getChannel(0); - ch.connectionClose(ConnectionCloseCode.NORMAL, "client is closing"); + Channel ch = _conn.GetChannel(0); + ch.ConnectionClose(ConnectionCloseCode.NORMAL, "client is closing"); lock (CloseOk) { DateTime start = DateTime.Now; long elapsed = 0; - while (!Closed && elapsed < timeout) + while (!IsClosed && elapsed < timeout) { Monitor.Wait(CloseOk, (int) (timeout - elapsed)); elapsed = DateTime.Now.Subtract(start).Milliseconds; } - if (!Closed) + if (!IsClosed) { throw new Exception("Timed out when closing connection"); } - _conn.close(); + _conn.Close(); } } - public ClientSession createSession(long expiryInSeconds) + public IClientSession CreateSession(long expiryInSeconds) { - Channel ch = _conn.getChannel(); - ClientSession ssn = new ClientSession(Encoding.UTF8.GetBytes(UUID.randomUUID().ToString())); - ssn.attach(ch); - ssn.sessionAttach(ssn.getName()); - ssn.sessionRequestTimeout(expiryInSeconds); + Channel ch = _conn.GetChannel(); + ClientSession ssn = new ClientSession(Encoding.UTF8.GetBytes(UUID.RandomUuid().ToString())); + ssn.Attach(ch); + ssn.SessionAttach(ssn.GetName()); + ssn.SessionRequestTimeout(expiryInSeconds); return ssn; } - public ClosedListener ClosedListener + public IClosedListener ClosedListener { set { _closedListner = value; } get { return _closedListner; } Modified: qpid/trunk/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs Thu Dec 3 22:31:12 2009 @@ -29,7 +29,7 @@ { internal class ClientConnectionDelegate : ClientDelegate { - private static readonly Logger log = Logger.get(typeof (ClientConnectionDelegate)); + private static readonly Logger log = Logger.Get(typeof (ClientConnectionDelegate)); private readonly Client _client; private string _username; private string _password; @@ -41,17 +41,17 @@ _password = pasword; } - public override SessionDelegate getSessionDelegate() + public override SessionDelegate GetSessionDelegate() { return new ClientSessionDelegate(); } - public override void exception(Exception t) + public override void Exception(Exception t) { throw t; } - public override void connectionStart(Channel context, ConnectionStart mystruct) + public override void ConnectionStart(Channel context, ConnectionStart mystruct) { const string mechanism = "PLAIN"; MemoryStream stResponse = new MemoryStream(); @@ -62,17 +62,17 @@ part = Encoding.UTF8.GetBytes(_password); stResponse.Write(part, 0, part.Length); Dictionary props = new Dictionary(); - context.connectionStartOk(props, mechanism, stResponse.ToArray(), "utf8"); + context.ConnectionStartOk(props, mechanism, stResponse.ToArray(), "utf8"); } - public override void closed() + public override void Closed() { - log.debug("Delegate closed"); + log.Debug("Delegate Closed"); lock (_client.CloseOk) { try { - _client.Closed = true; + _client.IsClosed = true; Monitor.PulseAll(_client.CloseOk); } catch (Exception e) @@ -82,16 +82,16 @@ } } - public override void connectionClose(Channel context, ConnectionClose connectionClose) + public override void ConnectionClose(Channel context, ConnectionClose connectionClose) { - base.connectionClose(context, connectionClose); - ErrorCode errorCode = ErrorCode.getErrorCode((int) connectionClose.getReplyCode()); + base.ConnectionClose(context, connectionClose); + ErrorCode errorCode = ErrorCode.GetErrorCode((int) connectionClose.GetReplyCode()); if (_client.ClosedListener == null && errorCode.Code != (int) QpidErrorCode.NO_ERROR) { - throw new Exception ("Server closed the connection: Reason " + - connectionClose.getReplyText()); + throw new Exception ("Server Closed the connection: Reason " + + connectionClose.GetReplyText()); } - _client.ClosedListener.onClosed(errorCode, connectionClose.getReplyText(), null); + _client.ClosedListener.OnClosed(errorCode, connectionClose.GetReplyText(), null); } } } Modified: qpid/trunk/qpid/dotnet/client-010/client/client/ClientSession.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/ClientSession.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/ClientSession.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/ClientSession.cs Thu Dec 3 22:31:12 2009 @@ -24,14 +24,13 @@ using System; using System.Collections.Generic; using System.IO; -using System.Text; using org.apache.qpid.transport; using org.apache.qpid.transport.util; namespace org.apache.qpid.client { /// Implements a Qpid Sesion. - public class ClientSession : Session + public class ClientSession : Session, IClientSession { public static short TRANSFER_ACQUIRE_MODE_NO_ACQUIRE = 1; public static short TRANSFER_ACQUIRE_MODE_PRE_ACQUIRE = 0; @@ -47,13 +46,13 @@ public static short MESSAGE_ACQUIRE_ANY_AVAILABLE_MESSAGE = 0; public static short MESSAGE_ACQUIRE_MESSAGES_IF_ALL_ARE_AVAILABLE = 1; - private Dictionary _listeners = new Dictionary(); + private readonly Dictionary _listeners = new Dictionary(); public ClientSession(byte[] name) : base(name) { } - public void attachMessageListener(IMessageListener listener, string Destination) + public void AttachMessageListener(IMessageListener listener, string Destination) { _listeners.Add(Destination, listener); } @@ -63,47 +62,47 @@ get { return _listeners; } } - public void messageTransfer(String destination, string routingkey, IMessage message) + public void MessageTransfer(String destination, string routingkey, IMessage message) { - message.DeliveryProperties.setRoutingKey(routingkey); - messageTransfer(destination, message); + message.DeliveryProperties.SetRoutingKey(routingkey); + MessageTransfer(destination, message); } - public void messageTransfer(String destination, IMessage message) + public void MessageTransfer(String destination, IMessage message) { byte[] body = new byte[message.Body.Position]; message.Body.Seek(0, SeekOrigin.Begin); message.Body.Read(body, 0, body.Length); - message.MessageProperties.setMessageId(UUID.randomUUID()); - messageTransfer(destination, + message.MessageProperties.SetMessageId(UUID.RandomUuid()); + MessageTransfer(destination, MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED, message.Header, body); } - public void queueDeclare(String queue) + public void QueueDeclare(String queue) { - queueDeclare(queue, null, null); + QueueDeclare(queue, null, null); } - public void queueDeclare(String queue, params Option[] options) + public void QueueDeclare(String queue, params Option[] options) { - queueDeclare(queue, null, null, options); + QueueDeclare(queue, null, null, options); } - public void exchangeBind(String queue, String exchange, String bindingKey) + public void ExchangeBind(String queue, String exchange, String bindingKey) { - exchangeBind(queue, exchange, bindingKey, null); + ExchangeBind(queue, exchange, bindingKey, null); } - public void messageSubscribe(String queue) + public void MessageSubscribe(String queue) { - messageSubscribe(queue, queue, MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null, 0, null); + MessageSubscribe(queue, queue, MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null, 0, null); // issue credits - messageSetFlowMode(queue, MessageFlowMode.WINDOW); - messageFlow(queue, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES); - messageFlow(queue, MessageCreditUnit.MESSAGE, 10000); + MessageSetFlowMode(queue, MessageFlowMode.WINDOW); + MessageFlow(queue, MessageCreditUnit.BYTE, MESSAGE_FLOW_MAX_BYTES); + MessageFlow(queue, MessageCreditUnit.MESSAGE, 10000); } } Modified: qpid/trunk/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs Thu Dec 3 22:31:12 2009 @@ -23,33 +23,33 @@ { public class ClientSessionDelegate : SessionDelegate { - private static readonly Logger _log = Logger.get(typeof (ClientSessionDelegate)); + private static readonly Logger _log = Logger.Get(typeof (ClientSessionDelegate)); // -------------------------------------------- // Message methods // -------------------------------------------- - public override void messageTransfer(Session session, MessageTransfer xfr) + public override void MessageTransfer(Session session, MessageTransfer xfr) { - if (((ClientSession) session).MessageListeners.ContainsKey(xfr.getDestination())) + if (((ClientSession) session).MessageListeners.ContainsKey(xfr.GetDestination())) { - IMessageListener listener = ((ClientSession)session).MessageListeners[xfr.getDestination()]; - listener.messageTransfer( new Message(xfr)); + IMessageListener listener = ((ClientSession)session).MessageListeners[xfr.GetDestination()]; + listener.MessageTransfer( new Message(xfr)); } else { - _log.warn("No listener set for: {0}", xfr); + _log.Warn("No listener set for: {0}", xfr); } } - public override void messageReject(Session session, MessageReject mstruct) + public override void MessageReject(Session session, MessageReject mstruct) { - foreach (Range range in mstruct.getTransfers()) + foreach (Range range in mstruct.GetTransfers()) { for (long l = range.Lower; l <= range.Upper; l++) { - _log.warn("message rejected: " + session.getCommand((int) l)); + _log.Warn("message rejected: " + session.GetCommand((int) l)); } } } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/client/ErrorCode.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/ErrorCode.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/ErrorCode.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/ErrorCode.cs Thu Dec 3 22:31:12 2009 @@ -74,7 +74,7 @@ get { return _hardError; } } - public static ErrorCode getErrorCode(int code) + public static ErrorCode GetErrorCode(int code) { switch (code) { @@ -137,4 +137,4 @@ } } } -} \ No newline at end of file +} Added: qpid/trunk/qpid/dotnet/client-010/client/client/IClient.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/IClient.cs?rev=886962&view=auto ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/IClient.cs (added) +++ qpid/trunk/qpid/dotnet/client-010/client/client/IClient.cs Thu Dec 3 22:31:12 2009 @@ -0,0 +1,75 @@ +/* +* 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; + +namespace org.apache.qpid.client +{ + public interface IClient + { + /// + /// Establish a connection with the broker using the given parameters + /// + /// + /// host name + /// port number + /// virtualHost the virtual host name + /// username user name + /// password password + void Connect(String host, int port, String virtualHost, String username, String passwor); + + /// + /// Close this client + /// + void Close(); + + /// + /// Create a session for this connection. + /// The returned session is suspended + /// (i.e. this session is not attached to an underlying channel) + /// + /// Expiry time expressed in seconds, if the value is less than + /// or equal to 0 then the session does not expire. + /// A newly created (suspended) session. + IClientSession CreateSession(long expiryInSeconds); + + /// + /// If the communication layer detects a serious problem with a connection, it + // informs the client's ClosedListener + /// + /// + IClosedListener ClosedListener { set; } + + bool IsClosed { get; set; } + + /// + /// Establishes a connection with a broker using SSL + /// + /// + /// Host name on which a broker is deployed + /// Broker port + /// virtual host name + /// User Name + /// Password + /// Name of the SSL server + /// Path to the X509 certificate to be used for client authentication + /// If true connection will not be established if the broker is not trusted + void ConnectSSL(String host, int port, String virtualHost, String username, String password, string serverName, string certPath, bool rejectUntrusted); + } +} Added: qpid/trunk/qpid/dotnet/client-010/client/client/IClientSession.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/IClientSession.cs?rev=886962&view=auto ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/IClientSession.cs (added) +++ qpid/trunk/qpid/dotnet/client-010/client/client/IClientSession.cs Thu Dec 3 22:31:12 2009 @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using org.apache.qpid.transport; + +namespace org.apache.qpid.client +{ + public interface IClientSession : ISession + { + void AttachMessageListener(IMessageListener listener, string Destination); + Dictionary MessageListeners { get; } + void MessageTransfer(String destination, string routingkey, IMessage message); + void MessageTransfer(String destination, IMessage message); + void QueueDeclare(String queue); + void QueueDeclare(String queue, params Option[] options); + void ExchangeBind(String queue, String exchange, String bindingKey); + void MessageSubscribe(String queue); + } +} Copied: qpid/trunk/qpid/dotnet/client-010/client/client/IClosedListener.cs (from r886946, qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs) URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/IClosedListener.cs?p2=qpid/trunk/qpid/dotnet/client-010/client/client/IClosedListener.cs&p1=qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs&r1=886946&r2=886962&rev=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/IClosedListener.cs Thu Dec 3 22:31:12 2009 @@ -17,15 +17,13 @@ * under the License. */ +using System; namespace org.apache.qpid.client { - public interface IMessageListener + public interface IClosedListener { - /// - /// Inform the listener of the message transfer - /// - /// The message transfer object - void messageTransfer(IMessage xfr); + + void OnClosed(ErrorCode errorCode, String reason, Exception t); } } Modified: qpid/trunk/qpid/dotnet/client-010/client/client/IMessage.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/IMessage.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/IMessage.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/IMessage.cs Thu Dec 3 22:31:12 2009 @@ -37,12 +37,12 @@ Dictionary ApplicationHeaders { get; set; } - void appendData(byte[] bytes); + void AppendData(byte[] bytes); MemoryStream Body { get; } string Destination { get; } - void clearData(); + void ClearData(); } } Copied: qpid/trunk/qpid/dotnet/client-010/client/client/IMessageListener.cs (from r886946, qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs) URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/IMessageListener.cs?p2=qpid/trunk/qpid/dotnet/client-010/client/client/IMessageListener.cs&p1=qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs&r1=886946&r2=886962&rev=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/IMessageListener.cs Thu Dec 3 22:31:12 2009 @@ -26,6 +26,6 @@ /// Inform the listener of the message transfer /// /// The message transfer object - void messageTransfer(IMessage xfr); + void MessageTransfer(IMessage xfr); } } Modified: qpid/trunk/qpid/dotnet/client-010/client/client/Message.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/client/Message.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/client/Message.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/client/Message.cs Thu Dec 3 22:31:12 2009 @@ -37,7 +37,7 @@ { _message = new MessageTransfer(); _message.Header = new Header( new MessageProperties(), new DeliveryProperties()); - ((MessageProperties) _message.Header.Structs[0]).setApplicationHeaders(new Dictionary()); + ((MessageProperties) _message.Header.Structs[0]).SetApplicationHeaders(new Dictionary()); } public MessageProperties MessageProperties @@ -84,24 +84,24 @@ get { if (Header != null) - return ((MessageProperties) Header.Structs[0]).getApplicationHeaders(); + return ((MessageProperties) Header.Structs[0]).GetApplicationHeaders(); return null; } set { if (Header != null) { - ((MessageProperties) Header.Structs[0]).setApplicationHeaders(value); + ((MessageProperties) Header.Structs[0]).SetApplicationHeaders(value); } } } - public void appendData(byte[] bytes) + public void AppendData(byte[] bytes) { Body.Write(bytes, 0, bytes.Length); } - public void clearData() + public void ClearData() { Body.Seek(0, SeekOrigin.Begin); } @@ -125,7 +125,7 @@ public string Destination { - get{ return _message.getDestination();} + get{ return _message.GetDestination();} } } } Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/Binary.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/Binary.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/Binary.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/Binary.cs Thu Dec 3 22:31:12 2009 @@ -51,22 +51,22 @@ { } - public byte[] array() + public byte[] Array() { return bytes; } - public int offset() + public int Offset() { return offset_Renamed_Field; } - public int size() + public int Size() { return size_Renamed_Field; } - public Binary slice(int low, int high) + public Binary Slice(int low, int high) { int sz; @@ -126,4 +126,4 @@ return true; } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs Thu Dec 3 22:31:12 2009 @@ -27,9 +27,9 @@ /// /// Channel /// - public class Channel : Invoker, ProtocolDelegate + public class Channel : Invoker, IProtocolDelegate { - private static readonly Logger log = Logger.get(typeof (Channel)); + private static readonly Logger log = Logger.Get(typeof (Channel)); private readonly Connection _connection; private readonly int _channel; @@ -52,7 +52,7 @@ } // Invoked when a network event is received - public void On_ReceivedEvent(object sender, ReceivedPayload payload) + public void On_ReceivedEvent(object sender, ReceivedPayload payload) { if (payload.Payload.Channel == _channel) { @@ -72,10 +72,10 @@ switch (method.EncodedTrack) { case Frame.L1: - method.dispatch(this, _connection.ConnectionDelegate); + method.Dispatch(this, _connection.ConnectionDelegate); break; case Frame.L2: - method.dispatch(this, _methoddelegate); + method.Dispatch(this, _methoddelegate); break; case Frame.L3: method.ProcessProtocolEvent(_session, _sessionDelegate); @@ -97,28 +97,28 @@ #endregion - public void exception(Exception t) + public void Exception(Exception t) { - _session.exception(t); + _session.Exception(t); } - public void closedFromConnection() + public void ClosedFromConnection() { - log.debug("channel closed: ", this); + log.Debug("channel Closed: ", this); if (_session != null) { - _session.closed(); + _session.Closed(); } } - public void closed() + public void Closed() { - log.debug("channel closed: ", this); + log.Debug("channel Closed: ", this); if (_session != null) { - _session.closed(); + _session.Closed(); } - _connection.removeChannel(_channel); + _connection.RemoveChannel(_channel); } public int EncodedChannel @@ -132,43 +132,43 @@ set { _session = value; } } - public void closeCode(ConnectionClose close) + public void CloseCode(ConnectionClose close) { if (_session != null) { - _session.closeCode(close); + _session.CloseCode(close); } } - private void emit(ProtocolEvent pevent) + private void Emit(IProtocolEvent pevent) { pevent.Channel = _channel; - _connection.send(pevent); + _connection.Send(pevent); } - public void method(Method m) + public void Method(Method m) { - emit(m); + Emit(m); if (!m.Batch) { - _connection.flush(); + _connection.Flush(); } } - protected override void invoke(Method m) + protected override void Invoke(Method m) { - method(m); + Method(m); } - public override Future invoke(Method m, Future future) + public override IFuture Invoke(Method m, IFuture future) { throw new Exception("UnsupportedOperation"); } - public String toString() + public override String ToString() { return String.Format("{0}:{1}", _connection, _channel); } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs Thu Dec 3 22:31:12 2009 @@ -26,16 +26,16 @@ /// internal class ChannelDelegate : MethodDelegate { - public override void sessionDetached(Channel channel, SessionDetached closed) + public override void SessionDetached(Channel channel, SessionDetached closed) { - channel.closed(); + channel.Closed(); } - public override void sessionDetach(Channel channel, SessionDetach dtc) + public override void SessionDetach(Channel channel, SessionDetach dtc) { - channel.Session.closed(); - channel.sessionDetached(dtc.getName(), SessionDetachCode.NORMAL); - channel.closed(); + channel.Session.Closed(); + channel.SessionDetached(dtc.GetName(), SessionDetachCode.NORMAL); + channel.Closed(); } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/Connection.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/Connection.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/Connection.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/Connection.cs Thu Dec 3 22:31:12 2009 @@ -29,17 +29,17 @@ /// public class Connection { - private static readonly Logger log = Logger.get(typeof (Connection)); + private static readonly Logger log = Logger.Get(typeof (Connection)); - private readonly Sender _sender; + private readonly ISender _sender; private readonly ConnectionDelegate _connDdelegate; private int _channelMax = 1; private int _connectionId; - private readonly Receiver> _receiver; + private readonly IReceiver> _receiver; private readonly Dictionary _channels = new Dictionary(); - public Connection(Receiver> receiver, Sender sender, ConnectionDelegate connDdelegate) + public Connection(IReceiver> receiver, ISender sender, ConnectionDelegate connDdelegate) { _receiver = receiver; _sender = sender; @@ -63,20 +63,20 @@ set { _channelMax = value; } } - public void send(ProtocolEvent pevent) + public void Send(IProtocolEvent pevent) { - log.debug("SEND: [{0}] {1}", this, pevent); - _sender.send(pevent); + log.Debug("SEND: [{0}] {1}", this, pevent); + _sender.Send(pevent); } - public void flush() + public void Flush() { - log.debug("FLUSH: [{0}]", this); - _sender.flush(); + log.Debug("FLUSH: [{0}]", this); + _sender.Flush(); } - public Channel getChannel() + public Channel GetChannel() { lock (_channels) { @@ -84,14 +84,14 @@ { if (!_channels.ContainsKey(i)) { - return getChannel(i); + return GetChannel(i); } } throw new Exception("no more _channels available"); } } - public Channel getChannel(int number) + public Channel GetChannel(int number) { lock (_channels) { @@ -103,7 +103,7 @@ } if (channel == null) { - channel = new Channel(this, number, _connDdelegate.getSessionDelegate()); + channel = new Channel(this, number, _connDdelegate.GetSessionDelegate()); _receiver.Received += channel.On_ReceivedEvent; _channels.Add(number, channel); } @@ -111,7 +111,7 @@ } } - public void removeChannel(int number) + public void RemoveChannel(int number) { lock (_channels) { @@ -120,51 +120,51 @@ } } - public void On_ReceivedEvent(object sender, ReceivedPayload payload) + public void On_ReceivedEvent(object sender, ReceivedPayload payload) { - log.debug("RECV: [{0}] {1}", this, payload.Payload); + log.Debug("RECV: [{0}] {1}", this, payload.Payload); if (_channels.ContainsKey(payload.Payload.Channel)) return; - Channel channel = getChannel(payload.Payload.Channel); + Channel channel = GetChannel(payload.Payload.Channel); channel.On_ReceivedEvent(sender, payload); } public void On_ReceivedException(Object sender, ExceptionArgs arg) { - _connDdelegate.exception(arg.Exception); + _connDdelegate.Exception(arg.Exception); } public void On_ReceivedClosed(Object sender, EventArgs arg) { - log.debug("Connection closed: {0}", this); + log.Debug("Connection Closed: {0}", this); lock (_channels) { foreach (Channel ch in _channels.Values) { - ch.closedFromConnection(); + ch.ClosedFromConnection(); } } _channels.Clear(); - _connDdelegate.closed(); + _connDdelegate.Closed(); } - public void closeCode(ConnectionClose close) + public void CloseCode(ConnectionClose close) { lock (_channels) { foreach (Channel ch in _channels.Values) { - ch.closeCode(close); + ch.CloseCode(close); } } } - public void close() + public void Close() { - _sender.close(); + _sender.Close(); } - public String toString() + public override String ToString() { return String.Format("conn:{0}", this); } Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs Thu Dec 3 22:31:12 2009 @@ -32,16 +32,16 @@ /// public abstract class ConnectionDelegate : MethodDelegate { - private static readonly Logger log = Logger.get(typeof(ConnectionDelegate)); + private static readonly Logger log = Logger.Get(typeof(ConnectionDelegate)); private String _virtualHost; private ManualResetEvent _negotiationComplete; - public abstract SessionDelegate getSessionDelegate(); + public abstract SessionDelegate GetSessionDelegate(); - public abstract void exception(Exception t); + public abstract void Exception(Exception t); - public abstract void closed(); + public abstract void Closed(); public void setCondition(ManualResetEvent negotiationComplete) { @@ -50,12 +50,12 @@ public virtual void init(Channel ch, ProtocolHeader hdr) { - ch.Connection.send(new ProtocolHeader((byte)1, hdr.Major, hdr.Minor)); + ch.Connection.Send(new ProtocolHeader((byte)1, hdr.Major, hdr.Minor)); List plain = new List(); plain.Add("PLAIN"); List utf8 = new List(); utf8.Add("utf8"); - ch.connectionStart(null, plain, utf8); + ch.ConnectionStart(null, plain, utf8); } public String VirtualHost @@ -67,42 +67,42 @@ // ---------------------------------------------- // Client side //----------------------------------------------- - public override void connectionStart(Channel context, ConnectionStart mstruct) + public override void ConnectionStart(Channel context, ConnectionStart mstruct) { Dictionary props = new Dictionary(); - context.connectionStartOk(props, null, null, "utf8"); + context.ConnectionStartOk(props, null, null, "utf8"); } - public override void connectionSecure(Channel context, ConnectionSecure mstruct) + public override void ConnectionSecure(Channel context, ConnectionSecure mstruct) { // todo SASL - context.connectionSecureOk(new byte[0]); + context.ConnectionSecureOk(new byte[0]); } - public override void connectionTune(Channel context, ConnectionTune mstruct) + public override void ConnectionTune(Channel context, ConnectionTune mstruct) { - context.Connection.ChannelMax = mstruct.getChannelMax(); - context.connectionTuneOk(mstruct.getChannelMax(), mstruct.getMaxFrameSize(), mstruct.getHeartbeatMax()); - context.connectionOpen(_virtualHost, null, Option.INSIST); + context.Connection.ChannelMax = mstruct.GetChannelMax(); + context.ConnectionTuneOk(mstruct.GetChannelMax(), mstruct.GetMaxFrameSize(), mstruct.GetHeartbeatMax()); + context.ConnectionOpen(_virtualHost, null, Option.INSIST); } - public override void connectionOpenOk(Channel context, ConnectionOpenOk mstruct) + public override void ConnectionOpenOk(Channel context, ConnectionOpenOk mstruct) { - List knownHosts = mstruct.getKnownHosts(); + List knownHosts = mstruct.GetKnownHosts(); if (_negotiationComplete != null) { _negotiationComplete.Set(); } } - public override void connectionRedirect(Channel context, ConnectionRedirect mstruct) + public override void ConnectionRedirect(Channel context, ConnectionRedirect mstruct) { // not going to bother at the moment } - public override void connectionClose(Channel ch, ConnectionClose close) + public override void ConnectionClose(Channel ch, ConnectionClose close) { - ch.Connection.closeCode(close); - ch.connectionCloseOk(); + ch.Connection.CloseCode(close); + ch.ConnectionCloseOk(); } } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/Field.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/Field.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/Field.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/Field.cs Thu Dec 3 22:31:12 2009 @@ -19,8 +19,7 @@ * */ using System; -using Decoder = org.apache.qpid.transport.codec.Decoder; -using Encoder = org.apache.qpid.transport.codec.Encoder; +using org.apache.qpid.transport.codec; namespace org.apache.qpid.transport { @@ -62,14 +61,14 @@ get { return index; } } - public abstract bool has(Object mystruct); + public abstract bool Has(Object mystruct); - public abstract void has(Object mystruct, bool value); + public abstract void Has(Object mystruct, bool value); - public abstract T get(Object mystruct); + public abstract T Get(Object mystruct); - public abstract void read(Decoder dec, Object mystruct); + public abstract void Read(IDecoder dec, Object mystruct); - public abstract void write(Encoder enc, Object mystruct); + public abstract void Write(IEncoder enc, Object mystruct); } -} \ No newline at end of file +} Modified: qpid/trunk/qpid/dotnet/client-010/client/transport/Header.cs URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/Header.cs?rev=886962&r1=886961&r2=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/Header.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/Header.cs Thu Dec 3 22:31:12 2009 @@ -47,7 +47,7 @@ } - public Struct get(Struct klass) + public Struct Get(Struct klass) { foreach (Struct st in _mystructs) { @@ -59,7 +59,7 @@ return null; } - public String toString() + public override String ToString() { StringBuilder str = new StringBuilder(); str.Append(" Header("); @@ -80,4 +80,4 @@ return str.ToString(); } } -} \ No newline at end of file +} Copied: qpid/trunk/qpid/dotnet/client-010/client/transport/IBinding.cs (from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs) URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/IBinding.cs?p2=qpid/trunk/qpid/dotnet/client-010/client/transport/IBinding.cs&p1=qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs&r1=886946&r2=886962&rev=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/util/Functions.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/IBinding.cs Thu Dec 3 22:31:12 2009 @@ -18,24 +18,17 @@ * under the License. * */ +using System; -namespace org.apache.qpid.transport.util +namespace org.apache.qpid.transport { - - /// - /// Functions - /// - - public class Functions - { - public static sbyte lsb(int i) - { - return (sbyte) (0xFF & i); - } - - public static sbyte lsb(long l) - { - return (sbyte) (0xFF & l); - } - } -} \ No newline at end of file + /// + /// Binding + /// + internal interface IBinding + { + E Endpoint(ISender sender); + + IReceiver Receiver(E endpoint) where R : EventArgs; + } +} Copied: qpid/trunk/qpid/dotnet/client-010/client/transport/IFuture.cs (from r886946, qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs) URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/dotnet/client-010/client/transport/IFuture.cs?p2=qpid/trunk/qpid/dotnet/client-010/client/transport/IFuture.cs&p1=qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs&r1=886946&r2=886962&rev=886962&view=diff ============================================================================== --- qpid/trunk/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs (original) +++ qpid/trunk/qpid/dotnet/client-010/client/transport/IFuture.cs Thu Dec 3 22:31:12 2009 @@ -19,23 +19,20 @@ * */ -using System; - namespace org.apache.qpid.transport { - public class ExceptionArgs : EventArgs + /// + /// Future + /// + public interface IFuture { - public ExceptionArgs(Exception e) + Struct Result { - m_exception = e; + get; set; } - private Exception m_exception; - public Exception Exception - { - get { return m_exception; } - set { m_exception = value; } + Session Session + { set; } - } } --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org