From commits-return-8903-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Tue Jul 22 21:24:08 2008 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 59142 invoked from network); 22 Jul 2008 21:24:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 21:24:08 -0000 Received: (qmail 92842 invoked by uid 500); 22 Jul 2008 21:24:08 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 92824 invoked by uid 500); 22 Jul 2008 21:24:08 -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 92815 invoked by uid 99); 22 Jul 2008 21:24:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 14:24:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 22 Jul 2008 21:23:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 73535238889B; Tue, 22 Jul 2008 14:22:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r678911 - in /activemq/activemq-dotnet: Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs Apache.NMS/trunk/src/main/csharp/IConnection.cs Apache.NMS/trunk/src/main/csharp/ISession.cs Date: Tue, 22 Jul 2008 21:22:57 -0000 To: commits@activemq.apache.org From: jgomes@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080722212257.73535238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jgomes Date: Tue Jul 22 14:22:56 2008 New Revision: 678911 URL: http://svn.apache.org/viewvc?rev=678911&view=rev Log: Added overloaded methods to take optional timeout parameter. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=678911&r1=678910&r2=678911&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Tue Jul 22 14:22:56 2008 @@ -146,14 +146,22 @@ { return CreateSession(acknowledgementMode); } - + /// /// Creates a new session to work on this connection /// public ISession CreateSession(AcknowledgementMode sessionAcknowledgementMode) { + return CreateSession(sessionAcknowledgementMode, transport.RequestTimeout); + } + + /// + /// Creates a new session to work on this connection + /// + public ISession CreateSession(AcknowledgementMode sessionAcknowledgementMode, TimeSpan requestTimeout) + { SessionInfo info = CreateSessionInfo(sessionAcknowledgementMode); - SyncRequest(info); + SyncRequest(info, requestTimeout); Session session = new Session(this, info, sessionAcknowledgementMode); // Set properties on session using parameters prefixed with "session." Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs?rev=678911&r1=678910&r2=678911&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs Tue Jul 22 14:22:56 2008 @@ -214,11 +214,16 @@ public IMessageProducer CreateProducer() { - return CreateProducer(null); + return CreateProducer(null, Connection.ITransport.RequestTimeout); } public IMessageProducer CreateProducer(IDestination destination) { + return CreateProducer(destination, Connection.ITransport.RequestTimeout); + } + + public IMessageProducer CreateProducer(IDestination destination, TimeSpan requestTimeout) + { ProducerInfo command = CreateProducerInfo(destination); ProducerId producerId = command.ProducerId; MessageProducer producer = null; @@ -226,7 +231,7 @@ try { producer = new MessageProducer(this, command); - connection.SyncRequest(command); + connection.SyncRequest(command, requestTimeout); producers[producerId] = producer; } catch(Exception) @@ -244,16 +249,31 @@ public IMessageConsumer CreateConsumer(IDestination destination) { - return CreateConsumer(destination, null); + return CreateConsumer(destination, null, false, Connection.ITransport.RequestTimeout); + } + + public IMessageConsumer CreateConsumer(IDestination destination, TimeSpan requestTimeout) + { + return CreateConsumer(destination, null, false, requestTimeout); } public IMessageConsumer CreateConsumer(IDestination destination, string selector) { - return CreateConsumer(destination, selector, false); + return CreateConsumer(destination, selector, false, Connection.ITransport.RequestTimeout); + } + + public IMessageConsumer CreateConsumer(IDestination destination, string selector, TimeSpan requestTimeout) + { + return CreateConsumer(destination, selector, false, requestTimeout); } public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal) { + return CreateConsumer(destination, selector, noLocal, Connection.ITransport.RequestTimeout); + } + + public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal, TimeSpan requestTimeout) + { ConsumerInfo command = CreateConsumerInfo(destination, selector); command.NoLocal = noLocal; command.AcknowledgementMode = acknowledgementMode; @@ -266,7 +286,7 @@ consumer = new MessageConsumer(this, command, acknowledgementMode); // lets register the consumer first in case we start dispatching messages immediately consumers[consumerId] = consumer; - connection.SyncRequest(command); + connection.SyncRequest(command, requestTimeout); return consumer; } catch(Exception) @@ -280,11 +300,12 @@ } } - public IMessageConsumer CreateDurableConsumer( - ITopic destination, - string name, - string selector, - bool noLocal) + public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal) + { + return CreateDurableConsumer(destination, name, selector, noLocal, Connection.ITransport.RequestTimeout); + } + + public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal, TimeSpan requestTimeout) { ConsumerInfo command = CreateConsumerInfo(destination, selector); ConsumerId consumerId = command.ConsumerId; @@ -297,7 +318,7 @@ consumer = new MessageConsumer(this, command, acknowledgementMode); // lets register the consumer first in case we start dispatching messages immediately consumers[consumerId] = consumer; - connection.SyncRequest(command); + connection.SyncRequest(command, requestTimeout); } catch(Exception) { Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs?rev=678911&r1=678910&r2=678911&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs (original) +++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs Tue Jul 22 14:22:56 2008 @@ -76,6 +76,11 @@ ISession CreateSession(AcknowledgementMode acknowledgementMode); /// + /// Creates a new session to work on this connection + /// + ISession CreateSession(AcknowledgementMode acknowledgementMode, TimeSpan requestTimeout); + + /// /// The default acknowledgement mode /// AcknowledgementMode AcknowledgementMode { get; set; } Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs?rev=678911&r1=678910&r2=678911&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs (original) +++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs Tue Jul 22 14:22:56 2008 @@ -35,26 +35,50 @@ IMessageProducer CreateProducer(IDestination destination); /// + /// Creates a producer of messages on a given destination + /// + IMessageProducer CreateProducer(IDestination destination, TimeSpan requestTimeout); + + /// /// Creates a consumer of messages on a given destination /// IMessageConsumer CreateConsumer(IDestination destination); /// + /// Creates a consumer of messages on a given destination + /// + IMessageConsumer CreateConsumer(IDestination destination, TimeSpan requestTimeout); + + /// /// Creates a consumer of messages on a given destination with a selector /// IMessageConsumer CreateConsumer(IDestination destination, string selector); + /// Creates a consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateConsumer(IDestination destination, string selector, TimeSpan requestTimeout); + /// /// Creates a consumer of messages on a given destination with a selector /// IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal); /// + /// Creates a consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal, TimeSpan requestTimeout); + + /// /// Creates a named durable consumer of messages on a given destination with a selector /// IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); /// + /// Creates a named durable consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal, TimeSpan requestTimeout); + + /// /// Returns the queue for the given name /// IQueue GetQueue(string name);