You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2008/07/22 23:22:57 UTC
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
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);
}
-
+
/// <summary>
/// Creates a new session to work on this connection
/// </summary>
public ISession CreateSession(AcknowledgementMode sessionAcknowledgementMode)
{
+ return CreateSession(sessionAcknowledgementMode, transport.RequestTimeout);
+ }
+
+ /// <summary>
+ /// Creates a new session to work on this connection
+ /// </summary>
+ 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);
/// <summary>
+ /// Creates a new session to work on this connection
+ /// </summary>
+ ISession CreateSession(AcknowledgementMode acknowledgementMode, TimeSpan requestTimeout);
+
+ /// <summary>
/// The default acknowledgement mode
/// </summary>
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);
/// <summary>
+ /// Creates a producer of messages on a given destination
+ /// </summary>
+ IMessageProducer CreateProducer(IDestination destination, TimeSpan requestTimeout);
+
+ /// <summary>
/// Creates a consumer of messages on a given destination
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination);
/// <summary>
+ /// Creates a consumer of messages on a given destination
+ /// </summary>
+ IMessageConsumer CreateConsumer(IDestination destination, TimeSpan requestTimeout);
+
+ /// <summary>
/// Creates a consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination, string selector);
+ /// Creates a consumer of messages on a given destination with a selector
+ /// </summary>
+ IMessageConsumer CreateConsumer(IDestination destination, string selector, TimeSpan requestTimeout);
+
/// <summary>
/// Creates a consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal);
/// <summary>
+ /// Creates a consumer of messages on a given destination with a selector
+ /// </summary>
+ IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal, TimeSpan requestTimeout);
+
+ /// <summary>
/// Creates a named durable consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal);
/// <summary>
+ /// Creates a named durable consumer of messages on a given destination with a selector
+ /// </summary>
+ IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal, TimeSpan requestTimeout);
+
+ /// <summary>
/// Returns the queue for the given name
/// </summary>
IQueue GetQueue(string name);