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 2009/11/02 20:15:37 UTC

svn commit: r832067 - in /activemq/activemq-dotnet: Apache.NMS.ActiveMQ/trunk/src/main/csharp/ Apache.NMS.EMS/trunk/src/main/csharp/ Apache.NMS.MSMQ/trunk/src/main/csharp/ Apache.NMS/trunk/src/main/csharp/

Author: jgomes
Date: Mon Nov  2 19:15:37 2009
New Revision: 832067

URL: http://svn.apache.org/viewvc?rev=832067&view=rev
Log:
Added IRedeliveryPolicy attribute to IConnection, and added interface level support for IRedeliveryPolicy to EMS and MSMQ providers.  The EMS and MSMQ providers do not actually support the implementation of RedeliveryPolicy at this time.
Fixes [AMQNET-137]. (See https://issues.apache.org/activemq/browse/AMQNET-137)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.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=832067&r1=832066&r2=832067&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 Mon Nov  2 19:15:37 2009
@@ -238,7 +238,10 @@
             get { return brokerWireFormatInfo; }
         }
 
-        public IRedeliveryPolicy RedeliveryPolicy
+		/// <summary>
+		/// Get/or set the redelivery policy for this connection.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
         {
             get { return this.redeliveryPolicy; }
             set { this.redeliveryPolicy = value; }

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Connection.cs?rev=832067&r1=832066&r2=832067&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Connection.cs Mon Nov  2 19:15:37 2009
@@ -28,6 +28,7 @@
     {
     	private Apache.NMS.AcknowledgementMode acknowledgementMode;
     	public readonly TIBCO.EMS.Connection tibcoConnection;
+		private IRedeliveryPolicy redeliveryPolicy;
 		private ConnectionMetaData metaData = null;
 		private readonly Atomic<bool> started = new Atomic<bool>(false);
 		private bool closed = false;
@@ -175,6 +176,15 @@
         }
 
 		/// <summary>
+		/// Get/or set the redelivery policy for this connection.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set { this.redeliveryPolicy = value; }
+		}
+
+		/// <summary>
 		/// Gets the Meta Data for the NMS Connection instance.
 		/// </summary>
 		public IConnectionMetaData MetaData

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs?rev=832067&r1=832066&r2=832067&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs Mon Nov  2 19:15:37 2009
@@ -17,6 +17,7 @@
 
 using System;
 using System.Collections;
+using Apache.NMS.Policies;
 
 namespace Apache.NMS.EMS
 {
@@ -30,6 +31,8 @@
 		private string clientId;
 		private Hashtable properties;
 
+		private IRedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
+
 		public ConnectionFactory()
 		{
 			try
@@ -117,7 +120,9 @@
 		/// </summary>
 		public Apache.NMS.IConnection CreateConnection()
 		{
-			return EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection());
+			Apache.NMS.IConnection connection = EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection());
+			connection.RedeliveryPolicy = this.redeliveryPolicy.Clone() as IRedeliveryPolicy;
+			return connection;
 		}
 
 		/// <summary>
@@ -125,7 +130,9 @@
 		/// </summary>
 		public Apache.NMS.IConnection CreateConnection(string userName, string password)
 		{
-			return EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection(userName, password));
+			Apache.NMS.IConnection connection = EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection(userName, password));
+			connection.RedeliveryPolicy = this.redeliveryPolicy.Clone() as IRedeliveryPolicy;
+			return connection;
 		}
 
 		/// <summary>
@@ -166,6 +173,22 @@
 			}
 		}
 
+		/// <summary>
+		/// Get/or set the redelivery policy that new IConnection objects are
+		/// assigned upon creation.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set
+			{
+				if(value != null)
+				{
+					this.redeliveryPolicy = value;
+				}
+			}
+		}
+
 		#endregion
 	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Connection.cs?rev=832067&r1=832066&r2=832067&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Connection.cs Mon Nov  2 19:15:37 2009
@@ -29,6 +29,7 @@
 		private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
 		private IMessageConverter messageConverter = new DefaultMessageConverter();
 
+		private IRedeliveryPolicy redeliveryPolicy;
 		private ConnectionMetaData metaData = null;
 		private bool connected;
 		private bool closed;
@@ -116,6 +117,15 @@
 		}
 
 		/// <summary>
+		/// Get/or set the redelivery policy for this connection.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set { this.redeliveryPolicy = value; }
+		}
+
+		/// <summary>
 		/// Gets the Meta Data for the NMS Connection instance.
 		/// </summary>
 		public IConnectionMetaData MetaData

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs?rev=832067&r1=832066&r2=832067&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs Mon Nov  2 19:15:37 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 using System;
+using Apache.NMS.Policies;
 
 namespace Apache.NMS.MSMQ
 {
@@ -26,6 +27,7 @@
 		public const string DEFAULT_BROKER_URL = "msmq://localhost";
 		public const string ENV_BROKER_URL = "MSMQ_BROKER_URL";
 		private Uri brokerUri;
+		private IRedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
 
 		public static string GetDefaultBrokerUrl()
 		{
@@ -67,7 +69,7 @@
 		/// </summary>
 		public IConnection CreateConnection()
 		{
-			return new Connection();
+			return CreateConnection(string.Empty, string.Empty, false);
 		}
 
 		/// <summary>
@@ -75,7 +77,7 @@
 		/// </summary>
 		public IConnection CreateConnection(string userName, string password)
 		{
-			return new Connection();
+			return CreateConnection(userName, password, false);
 		}
 
 		/// <summary>
@@ -83,7 +85,10 @@
 		/// </summary>
 		public IConnection CreateConnection(string userName, string password, bool useLogging)
 		{
-			return new Connection();
+			IConnection connection = new Connection();
+
+			connection.RedeliveryPolicy = this.redeliveryPolicy.Clone() as IRedeliveryPolicy;
+			return connection;
 		}
 
 		/// <summary>
@@ -94,5 +99,21 @@
 			get { return brokerUri; }
 			set { brokerUri = value; }
 		}
+
+		/// <summary>
+		/// Get/or set the redelivery policy that new IConnection objects are
+		/// assigned upon creation.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set
+			{
+				if(value != null)
+				{
+					this.redeliveryPolicy = value;
+				}
+			}
+		}
 	}
 }

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=832067&r1=832066&r2=832067&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 Mon Nov  2 19:15:37 2009
@@ -139,7 +139,12 @@
         /// </summary>
         string ClientId { get; set; }
 
-        /// <summary>
+		/// <summary>
+		/// Get/or set the redelivery policy for this connection.
+		/// </summary>
+		IRedeliveryPolicy RedeliveryPolicy { get; set; }
+		
+		/// <summary>
         /// Gets the Meta Data for the NMS Connection instance.
         /// </summary>
         IConnectionMetaData MetaData{ get; }