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/05/23 00:02:37 UTC

svn commit: r777725 [1/2] - in /activemq/activemq-dotnet: Apache.NMS.ActiveMQ/trunk/src/main/csharp/ Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ Apache.NMS.EMS/trunk/src/main/csharp/ Apache.NMS.MSMQ/trunk/src/main/csharp/ Apache.NMS.MSMQ/trunk/...

Author: jgomes
Date: Fri May 22 22:02:35 2009
New Revision: 777725

URL: http://svn.apache.org/viewvc?rev=777725&view=rev
Log:
BREAKING API CHANGE!
Changed to use enumeration for persistence setting.  Previous use of boolean was too limiting, and not very clear when reading the code.  Use of enumeration allows extension by third-party providers, as well as being self-documenting in the code.
Changed to use enumeration for message priority.

Fixes [AMQNET-105,101]. (See https://issues.apache.org/activemq/browse/AMQNET-105,101)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Message.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/MessageProducer.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BaseMessage.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BytesMessage.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.MSMQ/trunk/src/main/csharp/DefaultMessageConverter.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Destination.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/IMessageConverter.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MapMessage.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageConsumer.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageProducer.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ObjectMessage.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/PrimitiveMap.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Queue.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/StreamMessage.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/TextMessage.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/MSMQTest.cs
    activemq/activemq-dotnet/Apache.NMS.WCF/trunk/src/main/csharp/NmsOutputChannel.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessage.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessageProducer.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageSelectorTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TempDestinationDeletionTest.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQMessage.cs Fri May 22 22:02:35 2009
@@ -144,19 +144,19 @@
 		/// <summary>
 		/// Whether or not this message is persistent
 		/// </summary>
-		public bool NMSPersistent
+		public MsgDeliveryMode NMSDeliveryMode
 		{
-			get { return Persistent; }
-			set { Persistent = value; }
+			get { return (Persistent ? MsgDeliveryMode.Persistent : MsgDeliveryMode.NonPersistent); }
+			set { Persistent = (MsgDeliveryMode.Persistent == value); }
 		}
 
 		/// <summary>
 		/// The Priority on this message
 		/// </summary>
-		public byte NMSPriority
+		public MsgPriority NMSPriority
 		{
-			get { return Priority; }
-			set { Priority = value; }
+			get { return (MsgPriority) Priority; }
+			set { Priority = (byte) value; }
 		}
 
 		/// <summary>

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs Fri May 22 22:02:35 2009
@@ -31,10 +31,10 @@
 		private readonly ProducerInfo info;
 		private int messageCounter = 0;
 
-		private bool msgPersistent = NMSConstants.defaultPersistence;
+		private MsgDeliveryMode msgDeliveryMode = NMSConstants.defaultDeliveryMode;
 		private TimeSpan requestTimeout = NMSConstants.defaultRequestTimeout;
 		private TimeSpan msgTimeToLive = NMSConstants.defaultTimeToLive;
-		private byte msgPriority = NMSConstants.defaultPriority;
+		private MsgPriority msgPriority = NMSConstants.defaultPriority;
 		private bool disableMessageID = false;
 		private bool disableMessageTimestamp = false;
 		protected bool disposed = false;
@@ -117,25 +117,25 @@
 
 		public void Send(IMessage message)
 		{
-			Send(info.Destination, message, this.msgPersistent, this.msgPriority, this.msgTimeToLive, false);
+			Send(info.Destination, message, this.msgDeliveryMode, this.msgPriority, this.msgTimeToLive, false);
 		}
 
 		public void Send(IDestination destination, IMessage message)
 		{
-			Send(destination, message, this.msgPersistent, this.msgPriority, this.msgTimeToLive, false);
+			Send(destination, message, this.msgDeliveryMode, this.msgPriority, this.msgTimeToLive, false);
 		}
 
-		public void Send(IMessage message, bool persistent, byte priority, TimeSpan timeToLive)
+		public void Send(IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
-			Send(info.Destination, message, persistent, priority, timeToLive, true);
+			Send(info.Destination, message, deliveryMode, priority, timeToLive, true);
 		}
 
-		public void Send(IDestination destination, IMessage message, bool persistent, byte priority, TimeSpan timeToLive)
+		public void Send(IDestination destination, IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
-			Send(destination, message, persistent, priority, timeToLive, true);
+			Send(destination, message, deliveryMode, priority, timeToLive, true);
 		}
 
-		protected void Send(IDestination destination, IMessage message, bool persistent, byte priority, TimeSpan timeToLive, bool specifiedTimeToLive)
+		protected void Send(IDestination destination, IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive, bool specifiedTimeToLive)
 		{
 			if(null == destination)
 			{
@@ -163,7 +163,7 @@
 
 			activeMessage.ProducerId = info.ProducerId;
 			activeMessage.FromDestination = destination;
-			activeMessage.NMSPersistent = persistent;
+			activeMessage.NMSDeliveryMode = deliveryMode;
 			activeMessage.NMSPriority = priority;
 
 			if(session.Transacted)
@@ -185,10 +185,10 @@
 			session.DoSend(activeMessage, this.RequestTimeout);
 		}
 
-		public bool Persistent
+		public MsgDeliveryMode DeliveryMode
 		{
-			get { return msgPersistent; }
-			set { this.msgPersistent = value; }
+			get { return msgDeliveryMode; }
+			set { this.msgDeliveryMode = value; }
 		}
 
 		public TimeSpan TimeToLive
@@ -203,7 +203,7 @@
 			set { this.requestTimeout = value; }
 		}
 
-		public byte Priority
+		public MsgPriority Priority
 		{
 			get { return msgPriority; }
 			set { this.msgPriority = value; }

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs Fri May 22 22:02:35 2009
@@ -224,16 +224,36 @@
 							: null);
 		}
 
-		public static TIBCO.EMS.MessageDeliveryMode ToMessageDeliveryMode(bool persistent)
+		public static TIBCO.EMS.MessageDeliveryMode ToMessageDeliveryMode(MsgDeliveryMode deliveryMode)
 		{
-			return (persistent
-						? TIBCO.EMS.MessageDeliveryMode.Persistent
-						: TIBCO.EMS.MessageDeliveryMode.NonPersistent);
+			if(MsgDeliveryMode.Persistent == deliveryMode)
+			{
+				return TIBCO.EMS.MessageDeliveryMode.Persistent;
+			}
+			
+			if(MsgDeliveryMode.NonPersistent == deliveryMode)
+			{
+				return TIBCO.EMS.MessageDeliveryMode.NonPersistent;
+			}
+
+			// Hard cast it to the enumeration.
+			return (TIBCO.EMS.MessageDeliveryMode) deliveryMode;
 		}
 
-		public static bool ToPersistent(TIBCO.EMS.MessageDeliveryMode deliveryMode)
+		public static MsgDeliveryMode ToNMSMsgDeliveryMode(TIBCO.EMS.MessageDeliveryMode deliveryMode)
 		{
-			return (TIBCO.EMS.MessageDeliveryMode.NonPersistent != deliveryMode);
+			if(TIBCO.EMS.MessageDeliveryMode.Persistent == deliveryMode)
+			{
+				return MsgDeliveryMode.Persistent;
+			}
+
+			if(TIBCO.EMS.MessageDeliveryMode.NonPersistent == deliveryMode)
+			{
+				return MsgDeliveryMode.NonPersistent;
+			}
+
+			// Hard cast it to the enumeration.
+			return (MsgDeliveryMode) deliveryMode;
 		}
 
 

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Message.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Message.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Message.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Message.cs Fri May 22 22:02:35 2009
@@ -75,28 +75,6 @@
 			get { return this.timeToLive; }
 			set { this.timeToLive = value; }
 		}
-#if false
-		{
-			get
-			{
-				if(this.tibcoMessage.Expiration > 0)
-				{
-					return Apache.ActiveMQ.Util.DateUtils.ToDateTime(this.tibcoMessage.Expiration)
-					       - DateTime.Now;
-				}
-				else
-				{
-					return new TimeSpan();
-				}
-			}
-
-			set
-			{
-				this.tibcoMessage.Expiration =
-						Apache.ActiveMQ.Util.DateUtils.ToJavaTime(DateTime.Now + value);
-			}
-		}
-#endif
 
 		/// <summary>
 		/// The message ID which is set by the provider
@@ -109,19 +87,19 @@
 		/// <summary>
 		/// Whether or not this message is persistent
 		/// </summary>
-		public bool NMSPersistent
+		public MsgDeliveryMode NMSDeliveryMode
 		{
-			get { return EMSConvert.ToPersistent(this.tibcoMessage.MsgDeliveryMode); }
+			get { return EMSConvert.ToNMSMsgDeliveryMode(this.tibcoMessage.MsgDeliveryMode); }
 			set { this.tibcoMessage.MsgDeliveryMode = EMSConvert.ToMessageDeliveryMode(value); }
 		}
 
 		/// <summary>
 		/// The Priority on this message
 		/// </summary>
-		public byte NMSPriority
+		public MsgPriority NMSPriority
 		{
-			get { return (byte) this.tibcoMessage.Priority; }
-			set { this.tibcoMessage.Priority = value; }
+			get { return (MsgPriority) this.tibcoMessage.Priority; }
+			set { this.tibcoMessage.Priority = (int) value; }
 		}
 
 		/// <summary>

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/MessageProducer.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/MessageProducer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/MessageProducer.cs Fri May 22 22:02:35 2009
@@ -65,14 +65,14 @@
 		/// <summary>
 		/// Sends the message to the default destination with the explicit QoS configuration
 		/// </summary>
-		public void Send(Apache.NMS.IMessage message, bool persistent, byte priority, TimeSpan timeToLive)
+		public void Send(Apache.NMS.IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
 			Apache.NMS.EMS.Message msg = (Apache.NMS.EMS.Message) message;
 
 			this.tibcoMessageProducer.Send(
 						msg.tibcoMessage,
-						EMSConvert.ToMessageDeliveryMode(persistent),
-						priority,
+						EMSConvert.ToMessageDeliveryMode(deliveryMode),
+						(int) priority,
 						(long) timeToLive.TotalMilliseconds);
 		}
 
@@ -102,7 +102,7 @@
 		/// Sends the message to the given destination with the explicit QoS configuration
 		/// </summary>
 		public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message,
-						bool persistent, byte priority, TimeSpan timeToLive)
+						MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
 			Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination) destination;
 			Apache.NMS.EMS.Message msg = (Apache.NMS.EMS.Message) message;
@@ -110,14 +110,14 @@
 			this.tibcoMessageProducer.Send(
 						dest.tibcoDestination,
 						msg.tibcoMessage,
-						EMSConvert.ToMessageDeliveryMode(persistent),
-						priority,
+						EMSConvert.ToMessageDeliveryMode(deliveryMode),
+						(int) priority,
 						(long) timeToLive.TotalMilliseconds);
 		}
 
-		public bool Persistent
+		public MsgDeliveryMode DeliveryMode
 		{
-			get { return EMSConvert.ToPersistent(this.tibcoMessageProducer.MsgDeliveryMode); }
+			get { return EMSConvert.ToNMSMsgDeliveryMode(this.tibcoMessageProducer.MsgDeliveryMode); }
 			set { this.tibcoMessageProducer.MsgDeliveryMode = EMSConvert.ToMessageDeliveryMode(value); }
 		}
 
@@ -136,10 +136,10 @@
 			set { this.requestTimeout = value; }
 		}
 
-		public byte Priority
+		public MsgPriority Priority
 		{
-			get { return (byte) this.tibcoMessageProducer.Priority; }
-			set { this.tibcoMessageProducer.Priority = value; }
+			get { return (MsgPriority) this.tibcoMessageProducer.Priority; }
+			set { this.tibcoMessageProducer.Priority = (int) value; }
 		}
 
 		public bool DisableMessageID

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BaseMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BaseMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BaseMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BaseMessage.cs Fri May 22 22:02:35 2009
@@ -14,198 +14,156 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 
 namespace Apache.NMS.MSMQ
 {
 	public delegate void AcknowledgeHandler(BaseMessage baseMessage);
 
-    public class BaseMessage : IMessage
-    {
-        private PrimitiveMap propertiesMap = new PrimitiveMap();
-        private IDestination destination;
-        private string correlationId;
-        private TimeSpan timeToLive;
-        private string messageId;
-        private bool persistent;
-        private byte priority;
-        private Destination replyTo;
-        private string type;
-        private event AcknowledgeHandler Acknowledger;
-        private byte[] content;
-        private DateTime timestamp = new DateTime();
-
-        public byte[] Content
-        {
-            get { return content; }
-            set { content = value; }
-        }
-
-        public void Acknowledge()
-        {
-            if (Acknowledger == null)
+	public class BaseMessage : IMessage
+	{
+		private PrimitiveMap propertiesMap = new PrimitiveMap();
+		private IDestination destination;
+		private string correlationId;
+		private TimeSpan timeToLive;
+		private string messageId;
+		private MsgDeliveryMode deliveryMode;
+		private MsgPriority priority;
+		private Destination replyTo;
+		private string type;
+		private event AcknowledgeHandler Acknowledger;
+		private byte[] content;
+		private DateTime timestamp = new DateTime();
+
+		public byte[] Content
+		{
+			get { return content; }
+			set { content = value; }
+		}
+
+		public void Acknowledge()
+		{
+			if(Acknowledger == null)
 			{
-                throw new NMSException("No Acknowledger has been associated with this message: " + this);
+				throw new NMSException("No Acknowledger has been associated with this message: " + this);
 			}
-            else
+			else
 			{
-                Acknowledger(this);
-            }
-        }
-        
-        
-        // Properties
-        
-        public IPrimitiveMap Properties
-        {
-            get {
-				return propertiesMap;
-            }
-        }
-        
-        
-        // IMessage interface
-        
-        // NMS headers
-        
-        /// <summary>
-        /// The correlation ID used to correlate messages with conversations or long running business processes
-        /// </summary>
-        public string NMSCorrelationID
-        {
-            get {
-                return correlationId;
-            }
-            set {
-                correlationId = value;
-            }
-        }
-        
-        /// <summary>
-        /// The destination of the message
-        /// </summary>
-        public IDestination NMSDestination
-        {
-            get {
-                return destination;
-            }
-            set {
-                destination = value;
-            }
-        }
-        
-        /// <summary>
-        /// The time in milliseconds that this message should expire in
-        /// </summary>
-        public TimeSpan NMSTimeToLive
-        {
-            get {
-				return timeToLive;
-            }
-            set {
-				timeToLive = value;
-            }
-        }
-        
-        /// <summary>
-        /// The message ID which is set by the provider
-        /// </summary>
-        public string NMSMessageId
-        {
-            get {
-                return messageId;
-            }
-			set {
-				messageId = value;
+				Acknowledger(this);
 			}
-        }
-        
-        /// <summary>
-        /// Whether or not this message is persistent
-        /// </summary>
-        public bool NMSPersistent
-        {
-            get {
-                return persistent;
-            }
-            set {
-                persistent = value;
-            }
-        }
-        
-        /// <summary>
-        /// The Priority on this message
-        /// </summary>
-        public byte NMSPriority
-        {
-            get {
-                return priority;
-            }
-            set {
-                priority = value;
-            }
-        }
-        
-        /// <summary>
-        /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
-        /// </summary>
-        public bool NMSRedelivered
-        {
-            get {
-                return false;
-            }
-        }
-        
-        
-        /// <summary>
-        /// The destination that the consumer of this message should send replies to
-        /// </summary>
-        public IDestination NMSReplyTo
-        {
-            get {
-                return replyTo;
-            }
-            set {
-                replyTo = (Destination) value;
-            }
-        }
-        
-        
-        /// <summary>
-        /// The timestamp the broker added to the message
-        /// </summary>
-        public DateTime NMSTimestamp
-        {
-            get {
-                return timestamp;
-            }
-        }
-        
-        /// <summary>
-        /// The type name of this message
-        /// </summary>
-        public string NMSType
-        {
-            get {
-                return type;
-            }
-            set {
-                type = value;
-            }
-        }
-        
-
-        public object GetObjectProperty(string name)
-        {
-            return null;
-        }
-        
-        public void SetObjectProperty(string name, object value)
-        {
-        }
-                
-        
-    }
+		}
+
+		// Properties
+
+		public IPrimitiveMap Properties
+		{
+			get { return propertiesMap; }
+		}
+
+
+		// IMessage interface
+
+		// NMS headers
+
+		/// <summary>
+		/// The correlation ID used to correlate messages with conversations or long running business processes
+		/// </summary>
+		public string NMSCorrelationID
+		{
+			get { return correlationId; }
+			set { correlationId = value; }
+		}
+
+		/// <summary>
+		/// The destination of the message
+		/// </summary>
+		public IDestination NMSDestination
+		{
+			get { return destination; }
+			set { destination = value; }
+		}
+
+		/// <summary>
+		/// The time in milliseconds that this message should expire in
+		/// </summary>
+		public TimeSpan NMSTimeToLive
+		{
+			get { return timeToLive; }
+			set { timeToLive = value; }
+		}
+
+		/// <summary>
+		/// The message ID which is set by the provider
+		/// </summary>
+		public string NMSMessageId
+		{
+			get { return messageId; }
+			set { messageId = value; }
+		}
+
+		/// <summary>
+		/// Whether or not this message is persistent
+		/// </summary>
+		public MsgDeliveryMode NMSDeliveryMode
+		{
+			get { return deliveryMode; }
+			set { deliveryMode = value; }
+		}
+
+		/// <summary>
+		/// The Priority on this message
+		/// </summary>
+		public MsgPriority NMSPriority
+		{
+			get { return priority; }
+			set { priority = value; }
+		}
+
+		/// <summary>
+		/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
+		/// </summary>
+		public bool NMSRedelivered
+		{
+			get { return false; }
+		}
+
+
+		/// <summary>
+		/// The destination that the consumer of this message should send replies to
+		/// </summary>
+		public IDestination NMSReplyTo
+		{
+			get { return replyTo; }
+			set { replyTo = (Destination) value; }
+		}
+
+
+		/// <summary>
+		/// The timestamp the broker added to the message
+		/// </summary>
+		public DateTime NMSTimestamp
+		{
+			get { return timestamp; }
+		}
+
+		/// <summary>
+		/// The type name of this message
+		/// </summary>
+		public string NMSType
+		{
+			get { return type; }
+			set { type = value; }
+		}
+
+
+		public object GetObjectProperty(string name)
+		{
+			return null;
+		}
+
+		public void SetObjectProperty(string name, object value)
+		{
+		}
+	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BytesMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BytesMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BytesMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/BytesMessage.cs Fri May 22 22:02:35 2009
@@ -14,14 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using System;
-using Apache.NMS;
 
 
 namespace Apache.NMS.MSMQ
 {
 	public class BytesMessage : BaseMessage, IBytesMessage
-    {
-    }
+	{
+	}
 }
 

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=777725&r1=777724&r2=777725&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 Fri May 22 22:02:35 2009
@@ -14,33 +14,32 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 
 namespace Apache.NMS.MSMQ
 {
-    /// <summary>
-    /// Represents a NMS connection MSMQ.  Since the underlying MSMQ APIs are actually
-    /// connectionless, NMS connection in the MSMQ case are not expensive operations.
-    /// </summary>
-    ///
-    public class Connection : IConnection
-    {
-        
-        private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
-        private IMessageConverter messageConverter = new DefaultMessageConverter();
-
-        private bool connected;
-        private bool closed;
-        private string clientId;
-
-        /// <summary>
-        /// Starts message delivery for this connection.
-        /// </summary>
-        public void Start()
-        {
-            CheckConnected();
-        }
+	/// <summary>
+	/// Represents a NMS connection MSMQ.  Since the underlying MSMQ APIs are actually
+	/// connectionless, NMS connection in the MSMQ case are not expensive operations.
+	/// </summary>
+	///
+	public class Connection : IConnection
+	{
+
+		private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+		private IMessageConverter messageConverter = new DefaultMessageConverter();
+
+		private bool connected;
+		private bool closed;
+		private string clientId;
+
+		/// <summary>
+		/// Starts message delivery for this connection.
+		/// </summary>
+		public void Start()
+		{
+			CheckConnected();
+		}
 
 		/// <summary>
 		/// This property determines if the asynchronous message delivery of incoming
@@ -55,34 +54,34 @@
 		}
 
 		/// <summary>
-        /// Stop message delivery for this connection.
-        /// </summary>
-        public void Stop()
-        {
-            CheckConnected();
-        }
-        
-        /// <summary>
-        /// Creates a new session to work on this connection
-        /// </summary>
-        public ISession CreateSession()
-        {
-            return CreateSession(acknowledgementMode);
-        }
-        
-        /// <summary>
-        /// Creates a new session to work on this connection
-        /// </summary>
-        public ISession CreateSession(AcknowledgementMode mode)
-        {
-            CheckConnected();
-            return new Session(this, mode);
-        }
-
-        public void Dispose()
-        {
-            closed = true;
-        }
+		/// Stop message delivery for this connection.
+		/// </summary>
+		public void Stop()
+		{
+			CheckConnected();
+		}
+
+		/// <summary>
+		/// Creates a new session to work on this connection
+		/// </summary>
+		public ISession CreateSession()
+		{
+			return CreateSession(acknowledgementMode);
+		}
+
+		/// <summary>
+		/// Creates a new session to work on this connection
+		/// </summary>
+		public ISession CreateSession(AcknowledgementMode mode)
+		{
+			CheckConnected();
+			return new Session(this, mode);
+		}
+
+		public void Dispose()
+		{
+			closed = true;
+		}
 
 		/// <summary>
 		/// The default timeout for network requests.
@@ -94,53 +93,54 @@
 		}
 
 		public AcknowledgementMode AcknowledgementMode
-        {
-            get { return acknowledgementMode; }
-            set { acknowledgementMode = value; }
-        }
-
-        public IMessageConverter MessageConverter
-        {
-            get { return messageConverter; }
-            set { messageConverter = value; }
-        }
-
-        public string ClientId
-        {
-            get { return clientId; }
-            set {
-                if (connected)
-                {
-                    throw new NMSException("You cannot change the ClientId once the Connection is connected");
-                }
-                clientId = value;
-            }
-        }
-
-        public event ExceptionListener ExceptionListener;
-
-        protected void CheckConnected()
-        {
-            if (closed)
-            {
-                throw new NMSException("Connection Closed");
-            }
-            if (!connected)
-            {
-                connected = true;
-                // now lets send the connection and see if we get an ack/nak
-                // TODO: establish a connection
-            }
-        }
-
-        public void Close()
-        {
-            Dispose();
-        }
+		{
+			get { return acknowledgementMode; }
+			set { acknowledgementMode = value; }
+		}
+
+		public IMessageConverter MessageConverter
+		{
+			get { return messageConverter; }
+			set { messageConverter = value; }
+		}
+
+		public string ClientId
+		{
+			get { return clientId; }
+			set
+			{
+				if(connected)
+				{
+					throw new NMSException("You cannot change the ClientId once the Connection is connected");
+				}
+				clientId = value;
+			}
+		}
+
+		public event ExceptionListener ExceptionListener;
+
+		protected void CheckConnected()
+		{
+			if(closed)
+			{
+				throw new NMSException("Connection Closed");
+			}
+			if(!connected)
+			{
+				connected = true;
+				// now lets send the connection and see if we get an ack/nak
+				// TODO: establish a connection
+			}
+		}
+
+		public void Close()
+		{
+			Dispose();
+		}
 
 		public void HandleException(Exception e)
 		{
-			if (ExceptionListener != null)
+			if(ExceptionListener != null)
 			{
 				ExceptionListener(e);
 			}
@@ -148,8 +148,8 @@
 			{
 				Tracer.Error(e);
 			}
-			
+
 		}
-        	        
-    }
+
+	}
 }

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=777725&r1=777724&r2=777725&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 Fri May 22 22:02:35 2009
@@ -15,68 +15,67 @@
  * limitations under the License.
  */
 using System;
-using Apache.NMS;
 
 namespace Apache.NMS.MSMQ
 {
-    /// <summary>
-    /// A Factory that can estbalish NMS connections to MSMQ
-    /// </summary>
-    public class ConnectionFactory : IConnectionFactory
-    {
-        public const string DEFAULT_BROKER_URL = "msmq://localhost";
-        public const string ENV_BROKER_URL = "MSMQ_BROKER_URL";
-
-        public static string GetDefaultBrokerUrl()
-        {
-            string answer = Environment.GetEnvironmentVariable(ENV_BROKER_URL);
-            if (answer == null)
-            {
-                answer = DEFAULT_BROKER_URL;
-            }
-            return answer;
-        }
-
-        public ConnectionFactory()
-            : this(GetDefaultBrokerUrl())
-        {
-        }
-
-        public ConnectionFactory(string brokerUri)
-            : this(brokerUri, null)
-        {
-        }
-
-        public ConnectionFactory(string brokerUri, string clientID)
-            : this(new Uri(brokerUri), clientID)
-        {
-        }
-
-        public ConnectionFactory(Uri brokerUri)
-            : this(brokerUri, null)
-        {
-        }
-
-        public ConnectionFactory(Uri brokerUri, string clientID)
-        {
-            
-        }
+	/// <summary>
+	/// A Factory that can estbalish NMS connections to MSMQ
+	/// </summary>
+	public class ConnectionFactory : IConnectionFactory
+	{
+		public const string DEFAULT_BROKER_URL = "msmq://localhost";
+		public const string ENV_BROKER_URL = "MSMQ_BROKER_URL";
 
-    	/// <summary>
+		public static string GetDefaultBrokerUrl()
+		{
+			string answer = Environment.GetEnvironmentVariable(ENV_BROKER_URL);
+			if(answer == null)
+			{
+				answer = DEFAULT_BROKER_URL;
+			}
+			return answer;
+		}
+
+		public ConnectionFactory()
+			: this(GetDefaultBrokerUrl())
+		{
+		}
+
+		public ConnectionFactory(string brokerUri)
+			: this(brokerUri, null)
+		{
+		}
+
+		public ConnectionFactory(string brokerUri, string clientID)
+			: this(new Uri(brokerUri), clientID)
+		{
+		}
+
+		public ConnectionFactory(Uri brokerUri)
+			: this(brokerUri, null)
+		{
+		}
+
+		public ConnectionFactory(Uri brokerUri, string clientID)
+		{
+
+		}
+
+		/// <summary>
 		/// Creates a new connection to MSMQ.
 		/// </summary>
 		public IConnection CreateConnection()
-        {
-            return new Connection();
-        }
+		{
+			return new Connection();
+		}
 
 		/// <summary>
 		/// Creates a new connection to MSMQ.
 		/// </summary>
 		public IConnection CreateConnection(string userName, string password)
-        {
-            return new Connection();
-        }
+		{
+			return new Connection();
+		}
 
 		/// <summary>
 		/// Creates a new connection to MSMQ.

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/DefaultMessageConverter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/DefaultMessageConverter.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/DefaultMessageConverter.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/DefaultMessageConverter.cs Fri May 22 22:02:35 2009
@@ -15,66 +15,101 @@
  * limitations under the License.
  */
 using System;
-using System.Text;
-using System.Messaging;
 using System.IO;
-using Apache.NMS;
+using System.Messaging;
 
 namespace Apache.NMS.MSMQ
 {
-    public class DefaultMessageConverter : IMessageConverter
+	public class DefaultMessageConverter : IMessageConverter
 	{
-        public virtual Message ToMsmqMessage(IMessage message)
-        {
-            Message answer = new Message();
-            ConvertMessageBodyToMSMQ(message, answer);
-            MessageQueue responseQueue=null;
-            if (message.NMSReplyTo != null)
-            {
-                IDestination destination = message.NMSReplyTo;
+		public virtual Message ToMsmqMessage(IMessage message)
+		{
+			Message answer = new Message();
+			ConvertMessageBodyToMSMQ(message, answer);
+			MessageQueue responseQueue = null;
+			if(message.NMSReplyTo != null)
+			{
+				IDestination destination = message.NMSReplyTo;
 				responseQueue = ToMsmqDestination(destination);
-            }
-            if (message.NMSTimeToLive != TimeSpan.Zero)
-            {
-                answer.TimeToBeReceived = message.NMSTimeToLive;
-            }
-            if (message.NMSCorrelationID != null)
-            {
-                answer.CorrelationId = message.NMSCorrelationID;
-            }
-            answer.Recoverable = message.NMSPersistent;
-            answer.Priority = MessagePriority.Normal;
-            answer.ResponseQueue = responseQueue;
+			}
+
+			if(message.NMSTimeToLive != TimeSpan.Zero)
+			{
+				answer.TimeToBeReceived = message.NMSTimeToLive;
+			}
+
+			if(message.NMSCorrelationID != null)
+			{
+				answer.CorrelationId = message.NMSCorrelationID;
+			}
+
+			answer.Recoverable = (message.NMSDeliveryMode == MsgDeliveryMode.Persistent);
+			answer.Priority = ToMessagePriority(message.NMSPriority);
+			answer.ResponseQueue = responseQueue;
 			if(message.NMSType != null)
 			{
 				answer.Label = message.NMSType;
 			}
-            return answer;
-        }
-		
-        protected virtual void ConvertMessageBodyToMSMQ(IMessage message,
-                                                        Message answer)
-        {
-            if (message is IBytesMessage)
-            {
-                byte[] bytes = (message as IBytesMessage).Content;
-                answer.BodyStream.Write(bytes, 0, bytes.Length);
-            }
-            else
-            {
-                throw new Exception("unhandled message type");
-            }
-        }
+			
+			return answer;
+		}
+
+		private static MessagePriority ToMessagePriority(MsgPriority msgPriority)
+		{
+			switch(msgPriority)
+			{
+			case MsgPriority.Lowest:
+				return MessagePriority.Lowest;
+
+			case MsgPriority.VeryLow:
+				return MessagePriority.VeryLow;
+
+			case MsgPriority.Low:
+			case MsgPriority.AboveLow:
+				return MessagePriority.Low;
+
+			default:
+			case MsgPriority.BelowNormal:
+			case MsgPriority.Normal:
+				return MessagePriority.Normal;
 
-        public virtual IMessage ToNmsMessage(Message message)
-        {
+			case MsgPriority.AboveNormal:
+				return MessagePriority.AboveNormal;
+
+			case MsgPriority.High:
+				return MessagePriority.High;
+
+			case MsgPriority.VeryHigh:
+				return MessagePriority.VeryHigh;
+
+			case MsgPriority.Highest:
+				return MessagePriority.Highest;
+			}
+		}
+
+		protected virtual void ConvertMessageBodyToMSMQ(IMessage message,
+														Message answer)
+		{
+			if(message is IBytesMessage)
+			{
+				byte[] bytes = (message as IBytesMessage).Content;
+				answer.BodyStream.Write(bytes, 0, bytes.Length);
+			}
+			else
+			{
+				throw new Exception("unhandled message type");
+			}
+		}
+
+		public virtual IMessage ToNmsMessage(Message message)
+		{
 			BaseMessage answer = CreateNmsMessage(message);
 			answer.NMSMessageId = message.Id;
 			try
 			{
 				answer.NMSCorrelationID = message.CorrelationId;
 			}
-			catch (InvalidOperationException)
+			catch(InvalidOperationException)
 			{
 			}
 
@@ -82,7 +117,7 @@
 			{
 				answer.NMSDestination = ToNmsDestination(message.DestinationQueue);
 			}
-			catch (InvalidOperationException)
+			catch(InvalidOperationException)
 			{
 			}
 
@@ -92,13 +127,13 @@
 			{
 				answer.NMSTimeToLive = message.TimeToBeReceived;
 			}
-			catch (InvalidOperationException)
+			catch(InvalidOperationException)
 			{
 			}
-            return answer;
-        }
-		
-		
+			return answer;
+		}
+
+
 		public MessageQueue ToMsmqDestination(IDestination destination)
 		{
 			return new MessageQueue((destination as Destination).Path);
@@ -106,24 +141,24 @@
 
 		protected virtual IDestination ToNmsDestination(MessageQueue destinationQueue)
 		{
-			if (destinationQueue == null)
+			if(destinationQueue == null)
 			{
 				return null;
 			}
 			return new Queue(destinationQueue.Path);
 		}
-	
+
 		protected virtual BaseMessage CreateNmsMessage(Message message)
 		{
 			Stream stream = message.BodyStream;
-			if (stream == null || stream.Length == 0)
+			if(stream == null || stream.Length == 0)
 			{
 				return new BaseMessage();
 			}
 			byte[] buf = new byte[stream.Length];
 			stream.Read(buf, 0, buf.Length);
 			// TODO: how to recognise other flavors of message?
-			BytesMessage result =  new BytesMessage();
+			BytesMessage result = new BytesMessage();
 			result.Content = buf;
 			return result;
 		}

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Destination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Destination.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Destination.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Destination.cs Fri May 22 22:02:35 2009
@@ -14,117 +14,119 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 namespace Apache.NMS.MSMQ
 {
-    
-    /// <summary>
-    /// Summary description for Destination.
-    /// </summary>
-    public abstract class Destination : IDestination
-    {
-        
-        private String path = "";
-        
-        /**
-         * The Default Constructor
-         */
-        protected Destination()
-        {
-        }
-        
-        /**
-         * Construct the Destination with a defined physical name;
-         *
-         * @param name
-         */
-        protected Destination(String name)
-        {
-            this.path = name;
-        }
-                
-        public String Path
-        {
-            get { return this.path; }
-            set { this.path = value; }
-        }
-        
-		
+
+	/// <summary>
+	/// Summary description for Destination.
+	/// </summary>
+	public abstract class Destination : IDestination
+	{
+
+		private String path = "";
+
+		/**
+		 * The Default Constructor
+		 */
+		protected Destination()
+		{
+		}
+
+		/**
+		 * Construct the Destination with a defined physical name;
+		 *
+		 * @param name
+		 */
+		protected Destination(String name)
+		{
+			this.path = name;
+		}
+
+		public String Path
+		{
+			get { return this.path; }
+			set { this.path = value; }
+		}
+
+
 		public bool IsTopic
 		{
-			get {
+			get
+			{
 				return DestinationType == DestinationType.Topic
 					|| DestinationType == DestinationType.TemporaryTopic;
 			}
 		}
-		
+
 		public bool IsQueue
 		{
-			get {
+			get
+			{
 				return !IsTopic;
 			}
 		}
-		
-		
+
+
 		public bool IsTemporary
 		{
-			get {
+			get
+			{
 				return DestinationType == DestinationType.TemporaryQueue
 					|| DestinationType == DestinationType.TemporaryTopic;
 			}
 		}
-        
-        /**
-         * @return string representation of this instance
-         */
-        public override String ToString()
-        {
-            return this.path;
-        }
-        
-        /**
-         * @return hashCode for this instance
-         */
-        public override int GetHashCode()
-        {
-            int answer = 37;
-            
-            if (this.path != null)
-            {
-                answer = path.GetHashCode();
-            }
-            if (IsTopic)
-            {
-                answer ^= 0xfabfab;
-            }
-            return answer;
-        }
-        
-        /**
-         * if the object passed in is equivalent, return true
-         *
-         * @param obj the object to compare
-         * @return true if this instance and obj are equivalent
-         */
-        public override bool Equals(Object obj)
-        {
-            bool result = this == obj;
-            if (!result && obj != null && obj is Destination)
-            {
-                Destination other = (Destination) obj;
-                result = this.DestinationType == other.DestinationType
-                    && this.path.Equals(other.path);
-            }
-            return result;
-        }
-                
-        /**
-         * Factory method to create a child destination if this destination is a composite
-         * @param name
-         * @return the created Destination
-         */
-        public abstract Destination CreateDestination(String name);
+
+		/**
+		 * @return string representation of this instance
+		 */
+		public override String ToString()
+		{
+			return this.path;
+		}
+
+		/**
+		 * @return hashCode for this instance
+		 */
+		public override int GetHashCode()
+		{
+			int answer = 37;
+
+			if(this.path != null)
+			{
+				answer = path.GetHashCode();
+			}
+			if(IsTopic)
+			{
+				answer ^= 0xfabfab;
+			}
+			return answer;
+		}
+
+		/**
+		 * if the object passed in is equivalent, return true
+		 *
+		 * @param obj the object to compare
+		 * @return true if this instance and obj are equivalent
+		 */
+		public override bool Equals(Object obj)
+		{
+			bool result = this == obj;
+			if(!result && obj != null && obj is Destination)
+			{
+				Destination other = (Destination) obj;
+				result = this.DestinationType == other.DestinationType
+					&& this.path.Equals(other.path);
+			}
+			return result;
+		}
+
+		/**
+		 * Factory method to create a child destination if this destination is a composite
+		 * @param name
+		 * @return the created Destination
+		 */
+		public abstract Destination CreateDestination(String name);
 
 
 		public abstract DestinationType DestinationType
@@ -132,6 +134,6 @@
 			get;
 		}
 
-    }
+	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/IMessageConverter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/IMessageConverter.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/IMessageConverter.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/IMessageConverter.cs Fri May 22 22:02:35 2009
@@ -15,13 +15,12 @@
  * limitations under the License.
  */
 using System.Messaging;
-using Apache.NMS;
 
 namespace Apache.NMS.MSMQ
 {
-    public interface IMessageConverter
-    {
-		
+	public interface IMessageConverter
+	{
+
 		/// <summary>
 		/// Method ToMSMQMessageQueue
 		/// </summary>
@@ -29,7 +28,7 @@
 		/// <returns>A  MessageQueue</returns>
 		MessageQueue ToMsmqDestination(IDestination destination);
 
-        Message ToMsmqMessage(IMessage message);
-        IMessage ToNmsMessage(Message message);
-    }
+		Message ToMsmqMessage(IMessage message);
+		IMessage ToNmsMessage(Message message);
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MapMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MapMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MapMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MapMessage.cs Fri May 22 22:02:35 2009
@@ -14,20 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
-using System;
 
 
 namespace Apache.NMS.MSMQ
 {
 	public class MapMessage : BaseMessage, IMapMessage
-    {
-        private PrimitiveMap body = new PrimitiveMap();
-                
-        public IPrimitiveMap Body
-        {
-            get { return body; }
-        }
-    }
+	{
+		private PrimitiveMap body = new PrimitiveMap();
+
+		public IPrimitiveMap Body
+		{
+			get { return body; }
+		}
+	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageConsumer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageConsumer.cs Fri May 22 22:02:35 2009
@@ -1,3 +1,6 @@
+using System;
+using System.Messaging;
+using System.Threading;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,74 +17,72 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using Apache.NMS.Util;
-using System;
-using System.Messaging;
-using System.Threading;
 
 namespace Apache.NMS.MSMQ
 {
-    /// <summary>
-    /// An object capable of receiving messages from some destination
-    /// </summary>
-    public class MessageConsumer : IMessageConsumer
-    {
+	/// <summary>
+	/// An object capable of receiving messages from some destination
+	/// </summary>
+	public class MessageConsumer : IMessageConsumer
+	{
 		protected TimeSpan zeroTimeout = new TimeSpan(0);
-		
-        private readonly Session session;
-        private readonly AcknowledgementMode acknowledgementMode;
+
+		private readonly Session session;
+		private readonly AcknowledgementMode acknowledgementMode;
 		private MessageQueue messageQueue;
 		private event MessageListener listener;
 		private AtomicBoolean asyncDelivery = new AtomicBoolean(false);
-		
-        public MessageConsumer(Session session, AcknowledgementMode acknowledgementMode, MessageQueue messageQueue)
-        {
-            this.session = session;
-            this.acknowledgementMode = acknowledgementMode;
+
+		public MessageConsumer(Session session, AcknowledgementMode acknowledgementMode, MessageQueue messageQueue)
+		{
+			this.session = session;
+			this.acknowledgementMode = acknowledgementMode;
 			this.messageQueue = messageQueue;
-        }
-        
-        public event MessageListener Listener
-        {
-			add {
+		}
+
+		public event MessageListener Listener
+		{
+			add
+			{
 				listener += value;
 				StartAsyncDelivery();
 			}
-			remove {
+			remove
+			{
 				listener -= value;
 			}
-        }
-		
-        public IMessage Receive()
-        {
+		}
+
+		public IMessage Receive()
+		{
 			Message message = messageQueue.Receive();
 			return ToNmsMessage(message);
-        }
+		}
 
-        public IMessage Receive(TimeSpan timeout)
-        {
+		public IMessage Receive(TimeSpan timeout)
+		{
 			Message message = messageQueue.Receive(timeout);
 			return ToNmsMessage(message);
-        }
+		}
 
-        public IMessage ReceiveNoWait()
-        {
+		public IMessage ReceiveNoWait()
+		{
 			Message message = messageQueue.Receive(zeroTimeout);
 			return ToNmsMessage(message);
-        }
+		}
 
-        public void Dispose()
-        {
-            throw new NotImplementedException();
-        }
+		public void Dispose()
+		{
+			throw new NotImplementedException();
+		}
 
-        public void Close()
-        {
+		public void Close()
+		{
 			StopAsyncDelivery();
-            Dispose();
-        }
-		
+			Dispose();
+		}
+
 		public void StopAsyncDelivery()
 		{
 			asyncDelivery.Value = false;
@@ -89,26 +90,27 @@
 
 		protected virtual void StartAsyncDelivery()
 		{
-			if (asyncDelivery.CompareAndSet(false, true)) {
+			if(asyncDelivery.CompareAndSet(false, true))
+			{
 				Thread thread = new Thread(new ThreadStart(DispatchLoop));
 				thread.IsBackground = true;
 				thread.Start();
 			}
 		}
-		
+
 		protected virtual void DispatchLoop()
 		{
 			Tracer.Info("Starting dispatcher thread consumer: " + this);
-			while (asyncDelivery.Value)
+			while(asyncDelivery.Value)
 			{
 				IMessage message = Receive();
-				if (message != null)
+				if(message != null)
 				{
 					try
 					{
 						listener(message);
 					}
-					catch (Exception e)
+					catch(Exception e)
 					{
 						HandleAsyncException(e);
 					}
@@ -121,14 +123,14 @@
 		{
 			session.Connection.HandleException(e);
 		}
-		
+
 		protected virtual IMessage ToNmsMessage(Message message)
 		{
-			if (message == null)
+			if(message == null)
 			{
 				return null;
 			}
 			return session.MessageConverter.ToNmsMessage(message);
 		}
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageProducer.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageProducer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/MessageProducer.cs Fri May 22 22:02:35 2009
@@ -16,8 +16,6 @@
  */
 using System;
 using System.Messaging;
-using System.Threading;
-using Apache.NMS;
 
 namespace Apache.NMS.MSMQ
 {
@@ -26,17 +24,17 @@
 	/// </summary>
 	public class MessageProducer : IMessageProducer
 	{
-		
+
 		private readonly Session session;
 		private Destination destination;
 
 		//private long messageCounter;
-		private bool persistent;
+		private MsgDeliveryMode deliveryMode;
 		private TimeSpan timeToLive;
-		private byte priority;
+		private MsgPriority priority;
 		private bool disableMessageID;
 		private bool disableMessageTimestamp;
-		
+
 		private MessageQueue messageQueue;
 		private IMessageConverter messageConverter;
 
@@ -45,7 +43,7 @@
 			this.session = session;
 			this.destination = destination;
 			MessageConverter = session.MessageConverter;
-			if (destination != null)
+			if(destination != null)
 			{
 				messageQueue = openMessageQueue(destination);
 			}
@@ -53,31 +51,32 @@
 
 		private MessageQueue openMessageQueue(Destination dest)
 		{
-			MessageQueue rc=null;
+			MessageQueue rc = null;
 			try
 			{
-				if (!MessageQueue.Exists(dest.Path))
+				if(!MessageQueue.Exists(dest.Path))
 				{
 					// create the new message queue and make it transactional
 					rc = MessageQueue.Create(dest.Path, session.Transacted);
 					this.destination.Path = rc.Path;
-				} else
+				}
+				else
 				{
 					rc = new MessageQueue(dest.Path);
 					this.destination.Path = rc.Path;
-					if( !rc.CanWrite )
+					if(!rc.CanWrite)
 					{
 						throw new NMSSecurityException("Do not have write access to: " + dest);
 					}
 				}
 			}
-			catch( Exception e )
+			catch(Exception e)
 			{
-				if( rc!=null )
+				if(rc != null)
 				{
 					rc.Dispose();
 				}
-				throw new NMSException(e.Message+": "+dest, e);
+				throw new NMSException(e.Message + ": " + dest, e);
 			}
 			return rc;
 		}
@@ -87,28 +86,28 @@
 			Send(Destination, message);
 		}
 
-		public void Send(IMessage message, bool persistent, byte priority, TimeSpan timeToLive)
+		public void Send(IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
-			Send(Destination, message, persistent, priority, timeToLive);
+			Send(Destination, message, deliveryMode, priority, timeToLive);
 		}
 
 		public void Send(IDestination destination, IMessage message)
 		{
-			Send(destination, message, Persistent, Priority, TimeToLive);
+			Send(destination, message, DeliveryMode, Priority, TimeToLive);
 		}
-		
-		public void Send(IDestination destination, IMessage imessage, bool persistent, byte priority, TimeSpan timeToLive)
+
+		public void Send(IDestination destination, IMessage imessage, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
 		{
 			BaseMessage message = (BaseMessage) imessage;
-			MessageQueue mq=null;
+			MessageQueue mq = null;
 			MessageQueue responseQueue = null;
 			MessageQueueTransaction transaction = null;
 			try
 			{
 				// Locate the MSMQ Queue we will be sending to
-				if (messageQueue != null)
+				if(messageQueue != null)
 				{
-					if( destination.Equals(this.destination) )
+					if(destination.Equals(this.destination))
 					{
 						mq = messageQueue;
 					}
@@ -121,23 +120,24 @@
 				{
 					mq = openMessageQueue((Destination) destination);
 				}
-				
+
 				// Convert the Mesasge into a MSMQ message
-				message.NMSPersistent = persistent;
+				message.NMSDeliveryMode = deliveryMode;
 				message.NMSTimeToLive = timeToLive;
 				message.NMSPriority = priority;
-				
+
 				// message.NMSTimestamp = new DateTime().Date.;
 				Message msg = messageConverter.ToMsmqMessage(message);
 				// TODO: message.NMSMessageId =
 				// Now Send the message
-				if( mq.Transactional )
+				if(mq.Transactional)
 				{
-					if (session.Transacted)
+					if(session.Transacted)
 					{
 						mq.Send(msg, session.MessageQueueTransaction);
-						
-					} else
+
+					}
+					else
 					{
 						// Start our own mini transaction here to send the message.
 						transaction = new MessageQueueTransaction();
@@ -145,9 +145,10 @@
 						mq.Send(msg, transaction);
 						transaction.Commit();
 					}
-				} else
+				}
+				else
 				{
-					if( session.Transacted )
+					if(session.Transacted)
 					{
 						// We may want to raise an exception here since app requested
 						// a transeced NMS session, but is using a non transacted message queue
@@ -155,19 +156,22 @@
 					}
 					mq.Send(msg);
 				}
-				
-			} finally
+
+			}
+			finally
 			{
 				// Cleanup
-				if(transaction!=null)
+				if(transaction != null)
 				{
 					transaction.Dispose();
 				}
-				if (responseQueue != null)
+
+				if(responseQueue != null)
 				{
 					responseQueue.Dispose();
 				}
-				if( mq!=null && mq!=messageQueue )
+
+				if(mq != null && mq != messageQueue)
 				{
 					mq.Dispose();
 				}
@@ -182,51 +186,51 @@
 				messageQueue = null;
 			}
 		}
-		
+
 		public void Dispose()
 		{
 			Close();
 		}
-		
+
 		public IMessage CreateMessage()
 		{
 			return session.CreateMessage();
 		}
-		
+
 		public ITextMessage CreateTextMessage()
 		{
 			return session.CreateTextMessage();
 		}
-		
+
 		public ITextMessage CreateTextMessage(String text)
 		{
 			return session.CreateTextMessage(text);
 		}
-		
+
 		public IMapMessage CreateMapMessage()
 		{
 			return session.CreateMapMessage();
 		}
-		
+
 		public IObjectMessage CreateObjectMessage(Object body)
 		{
 			return session.CreateObjectMessage(body);
 		}
-		
+
 		public IBytesMessage CreateBytesMessage()
 		{
 			return session.CreateBytesMessage();
 		}
-		
+
 		public IBytesMessage CreateBytesMessage(byte[] body)
 		{
 			return session.CreateBytesMessage(body);
 		}
 
-		public bool Persistent
+		public MsgDeliveryMode DeliveryMode
 		{
-			get { return persistent; }
-			set { persistent = value; }
+			get { return deliveryMode; }
+			set { deliveryMode = value; }
 		}
 
 		public TimeSpan TimeToLive
@@ -244,19 +248,13 @@
 			set { }
 		}
 
-		byte IMessageProducer.Priority
-		{
-			get { return NMSConstants.defaultPriority; }
-			set {  }
-		}
-
 		public IDestination Destination
 		{
 			get { return destination; }
 			set { destination = (Destination) value; }
 		}
-		
-		public byte Priority
+
+		public MsgPriority Priority
 		{
 			get { return priority; }
 			set { priority = value; }
@@ -279,6 +277,5 @@
 			get { return messageConverter; }
 			set { messageConverter = value; }
 		}
-
 	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ObjectMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ObjectMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ObjectMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ObjectMessage.cs Fri May 22 22:02:35 2009
@@ -15,9 +15,6 @@
  * limitations under the License.
  */
 
-using Apache.NMS;
-using System;
-using System.Collections;
 using System.IO;
 
 #if !(PocketPC||NETCF||NETCF_2_0)
@@ -27,67 +24,71 @@
 
 namespace Apache.NMS.MSMQ
 {
-    public class ObjectMessage : BaseMessage, IObjectMessage
-    {
+	public class ObjectMessage : BaseMessage, IObjectMessage
+	{
 		private object body;
-		#if !(PocketPC||NETCF||NETCF_2_0)
+#if !(PocketPC||NETCF||NETCF_2_0)
 		private IFormatter formatter;
-		#endif
-		
+#endif
+
 		public ObjectMessage()
 		{
 		}
-		
+
 		public ObjectMessage(object body)
 		{
 			this.body = body;
 		}
-		
+
 		public object Body
 		{
-			get {
-				#if !(PocketPC||NETCF||NETCF_2_0)
-				if (body == null)
+			get
+			{
+#if !(PocketPC||NETCF||NETCF_2_0)
+				if(body == null)
 				{
 					body = Formatter.Deserialize(new MemoryStream(Content));
 				}
-				#else
-				#endif
+#else
+#endif
 				return body;
 			}
-			
-			set {
-				#if !(PocketPC||NETCF||NETCF_2_0)
+
+			set
+			{
+#if !(PocketPC||NETCF||NETCF_2_0)
 				body = value;
-				#else
-                throw new NotImplementedException();
-				#endif
+#else
+				throw new NotImplementedException();
+#endif
 			}
 		}
-		
-		
-		#if !(PocketPC||NETCF||NETCF_2_0)
+
+
+#if !(PocketPC||NETCF||NETCF_2_0)
 		public IFormatter Formatter
 		{
-			get {
-				if (formatter == null)
+			get
+			{
+				if(formatter == null)
 				{
 					formatter = new BinaryFormatter();
 				}
 				return formatter;
 			}
-			
-			set {
+
+			set
+			{
 				formatter = value;
 			}
 		}
-	
-		#endif
+
+#endif
 	}
 }
 
 
-		
 
-		
+
+
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/PrimitiveMap.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/PrimitiveMap.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/PrimitiveMap.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/PrimitiveMap.cs Fri May 22 22:02:35 2009
@@ -14,274 +14,273 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
-using Apache.NMS;
 using System;
 using System.Collections;
 
 namespace Apache.NMS.MSMQ
 {
-    /// <summary>
-    /// A default implementation of IPrimitiveMap
-    /// </summary>
-    [Serializable()]
-    public class PrimitiveMap : IPrimitiveMap
-    {
-        public const byte NULL = 0;
-        public const byte BOOLEAN_TYPE = 1;
-        public const byte BYTE_TYPE = 2;
-        public const byte CHAR_TYPE = 3;
-        public const byte SHORT_TYPE = 4;
-        public const byte INTEGER_TYPE = 5;
-        public const byte LONG_TYPE = 6;
-        public const byte DOUBLE_TYPE = 7;
-        public const byte FLOAT_TYPE = 8;
-        public const byte STRING_TYPE = 9;
-        public const byte BYTE_ARRAY_TYPE = 10;
-        public const byte MAP_TYPE = 11;
-        public const byte LIST_TYPE = 12;
-        public const byte BIG_STRING_TYPE = 13;
+	/// <summary>
+	/// A default implementation of IPrimitiveMap
+	/// </summary>
+	[Serializable()]
+	public class PrimitiveMap : IPrimitiveMap
+	{
+		public const byte NULL = 0;
+		public const byte BOOLEAN_TYPE = 1;
+		public const byte BYTE_TYPE = 2;
+		public const byte CHAR_TYPE = 3;
+		public const byte SHORT_TYPE = 4;
+		public const byte INTEGER_TYPE = 5;
+		public const byte LONG_TYPE = 6;
+		public const byte DOUBLE_TYPE = 7;
+		public const byte FLOAT_TYPE = 8;
+		public const byte STRING_TYPE = 9;
+		public const byte BYTE_ARRAY_TYPE = 10;
+		public const byte MAP_TYPE = 11;
+		public const byte LIST_TYPE = 12;
+		public const byte BIG_STRING_TYPE = 13;
 
 		private IDictionary dictionary = Hashtable.Synchronized(new Hashtable());
 
-        public void Clear()
-        {
-            dictionary.Clear();
-        }
-
-        public bool Contains(Object key)
-        {
-            return dictionary.Contains(key);
-        }
-
-        public void Remove(Object key)
-        {
-            dictionary.Remove((string) key);
-        }
-
-
-        public int Count
-        {
-            get
-            {
-                return dictionary.Count;
-            }
-        }
-
-        public ICollection Keys
-        {
-            get
-            {
-                return dictionary.Keys;
-            }
-        }
-
-        public ICollection Values
-        {
-            get
-            {
-                return dictionary.Values;
-            }
-        }
-
-        public object this[string key]
-        {
-            get
-            {
-                return GetValue(key);
-            }
-            set
-            {
-                CheckValidType(value);
-                SetValue(key, value);
-            }
-        }
-
-        public string GetString(string key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(string));
-            return (string)value;
-        }
-
-        public void SetString(string key, string value)
-        {
-            SetValue(key, value);
-        }
-
-        public bool GetBool(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(bool));
-            return (bool)value;
-        }
-
-        public void SetBool(String key, bool value)
-        {
-            SetValue(key, value);
-        }
-
-        public byte GetByte(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(byte));
-            return (byte)value;
-        }
-
-        public void SetByte(String key, byte value)
-        {
-            SetValue(key, value);
-        }
-
-        public char GetChar(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(char));
-            return (char)value;
-        }
-
-        public void SetChar(String key, char value)
-        {
-            SetValue(key, value);
-        }
-
-        public short GetShort(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(short));
-            return (short)value;
-        }
-
-        public void SetShort(String key, short value)
-        {
-            SetValue(key, value);
-        }
-
-        public int GetInt(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(int));
-            return (int)value;
-        }
-
-        public void SetInt(String key, int value)
-        {
-            SetValue(key, value);
-        }
-
-        public long GetLong(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(long));
-            return (long)value;
-        }
-
-        public void SetLong(String key, long value)
-        {
-            SetValue(key, value);
-        }
-
-        public float GetFloat(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(float));
-            return (float)value;
-        }
-
-        public void SetFloat(String key, float value)
-        {
-            SetValue(key, value);
-        }
-
-        public double GetDouble(String key)
-        {
-            Object value = GetValue(key);
-            CheckValueType(value, typeof(double));
-            return (double)value;
-        }
-
-        public void SetDouble(String key, double value)
-        {
-            SetValue(key, value);
-        }
-
-        public IList GetList(String key)
-        {
-            Object value = GetValue(key);
-            if (value != null && !(value is IList))
-            {
-                throw new NMSException("Property: " + key + " is not an IList but is: " + value);
-            }
-            return (IList)value;
-        }
-
-        public void SetList(String key, IList value)
-        {
-            SetValue(key, value);
-        }
-
-        public IDictionary GetDictionary(String key)
-        {
-            Object value = GetValue(key);
-            if (value != null && !(value is IDictionary))
-            {
-                throw new NMSException("Property: " + key + " is not an IDictionary but is: " + value);
-            }
-            return (IDictionary)value;
-        }
-
-        public void SetDictionary(String key, IDictionary value)
-        {
-            SetValue(key, value);
-        }
-
-
-        protected virtual void SetValue(String key, Object value)
-        {
-            dictionary[key] = value;
-        }
-
-        protected virtual Object GetValue(String key)
-        {
-            return dictionary[key];
-        }
-
-        protected virtual void CheckValueType(Object value, Type type)
-        {
-            if (!type.IsInstanceOfType(value))
-            {
-                throw new NMSException("Expected type: " + type.Name + " but was: " + value);
-            }
-        }
-
-        protected virtual void CheckValidType(Object value)
-        {
-            if (value != null && !(value is IList) && !(value is IDictionary))
-            {
-                Type type = value.GetType();
-                if (!type.IsPrimitive && !type.IsValueType && !type.IsAssignableFrom(typeof(string)))
-                {
-                    throw new NMSException("Invalid type: " + type.Name + " for value: " + value);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Method ToString
-        /// </summary>
-        /// <returns>A string</returns>
-        public override String ToString()
-        {
-			String s="{";
-			bool first=true;
+		public void Clear()
+		{
+			dictionary.Clear();
+		}
+
+		public bool Contains(Object key)
+		{
+			return dictionary.Contains(key);
+		}
+
+		public void Remove(Object key)
+		{
+			dictionary.Remove((string) key);
+		}
+
+
+		public int Count
+		{
+			get
+			{
+				return dictionary.Count;
+			}
+		}
+
+		public ICollection Keys
+		{
+			get
+			{
+				return dictionary.Keys;
+			}
+		}
+
+		public ICollection Values
+		{
+			get
+			{
+				return dictionary.Values;
+			}
+		}
+
+		public object this[string key]
+		{
+			get
+			{
+				return GetValue(key);
+			}
+			set
+			{
+				CheckValidType(value);
+				SetValue(key, value);
+			}
+		}
+
+		public string GetString(string key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(string));
+			return (string) value;
+		}
+
+		public void SetString(string key, string value)
+		{
+			SetValue(key, value);
+		}
+
+		public bool GetBool(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(bool));
+			return (bool) value;
+		}
+
+		public void SetBool(String key, bool value)
+		{
+			SetValue(key, value);
+		}
+
+		public byte GetByte(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(byte));
+			return (byte) value;
+		}
+
+		public void SetByte(String key, byte value)
+		{
+			SetValue(key, value);
+		}
+
+		public char GetChar(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(char));
+			return (char) value;
+		}
+
+		public void SetChar(String key, char value)
+		{
+			SetValue(key, value);
+		}
+
+		public short GetShort(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(short));
+			return (short) value;
+		}
+
+		public void SetShort(String key, short value)
+		{
+			SetValue(key, value);
+		}
+
+		public int GetInt(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(int));
+			return (int) value;
+		}
+
+		public void SetInt(String key, int value)
+		{
+			SetValue(key, value);
+		}
+
+		public long GetLong(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(long));
+			return (long) value;
+		}
+
+		public void SetLong(String key, long value)
+		{
+			SetValue(key, value);
+		}
+
+		public float GetFloat(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(float));
+			return (float) value;
+		}
+
+		public void SetFloat(String key, float value)
+		{
+			SetValue(key, value);
+		}
+
+		public double GetDouble(String key)
+		{
+			Object value = GetValue(key);
+			CheckValueType(value, typeof(double));
+			return (double) value;
+		}
+
+		public void SetDouble(String key, double value)
+		{
+			SetValue(key, value);
+		}
+
+		public IList GetList(String key)
+		{
+			Object value = GetValue(key);
+			if(value != null && !(value is IList))
+			{
+				throw new NMSException("Property: " + key + " is not an IList but is: " + value);
+			}
+			return (IList) value;
+		}
+
+		public void SetList(String key, IList value)
+		{
+			SetValue(key, value);
+		}
+
+		public IDictionary GetDictionary(String key)
+		{
+			Object value = GetValue(key);
+			if(value != null && !(value is IDictionary))
+			{
+				throw new NMSException("Property: " + key + " is not an IDictionary but is: " + value);
+			}
+			return (IDictionary) value;
+		}
+
+		public void SetDictionary(String key, IDictionary value)
+		{
+			SetValue(key, value);
+		}
+
+
+		protected virtual void SetValue(String key, Object value)
+		{
+			dictionary[key] = value;
+		}
+
+		protected virtual Object GetValue(String key)
+		{
+			return dictionary[key];
+		}
+
+		protected virtual void CheckValueType(Object value, Type type)
+		{
+			if(!type.IsInstanceOfType(value))
+			{
+				throw new NMSException("Expected type: " + type.Name + " but was: " + value);
+			}
+		}
+
+		protected virtual void CheckValidType(Object value)
+		{
+			if(value != null && !(value is IList) && !(value is IDictionary))
+			{
+				Type type = value.GetType();
+				if(!type.IsPrimitive && !type.IsValueType && !type.IsAssignableFrom(typeof(string)))
+				{
+					throw new NMSException("Invalid type: " + type.Name + " for value: " + value);
+				}
+			}
+		}
+
+		/// <summary>
+		/// Method ToString
+		/// </summary>
+		/// <returns>A string</returns>
+		public override String ToString()
+		{
+			String s = "{";
+			bool first = true;
 			lock(dictionary.SyncRoot)
 			{
 				foreach(DictionaryEntry entry in dictionary)
 				{
 					if(!first)
 					{
-						s+=", ";
+						s += ", ";
 					}
-					first=false;
+					first = false;
 					String name = (String) entry.Key;
 					Object value = entry.Value;
 					s += name + "=" + value;
@@ -289,6 +288,6 @@
 			}
 			s += "}";
 			return s;
-        }
-    }
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Queue.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Queue.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Queue.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Queue.cs Fri May 22 22:02:35 2009
@@ -14,45 +14,47 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 
 namespace Apache.NMS.MSMQ
 {
-	
+
 	/// <summary>
 	/// Summary description for Queue.
 	/// </summary>
 	public class Queue : Destination, IQueue
-    {
-		
-        public Queue() : base()
-        {
-        }
-		
-        public Queue(String name) : base(name)
-        {
-        }
-		
+	{
+
+		public Queue()
+			: base()
+		{
+		}
+
+		public Queue(String name)
+			: base(name)
+		{
+		}
+
 		override public DestinationType DestinationType
 		{
-			get {
+			get
+			{
 				return DestinationType.Queue;
 			}
 		}
-		
-        public String QueueName
-        {
-            get { return Path; }
-        }
-        
-        
-        public override Destination CreateDestination(String name)
-        {
-            return new Queue(name);
-        }
 
-        
-    }
+		public String QueueName
+		{
+			get { return Path; }
+		}
+
+
+		public override Destination CreateDestination(String name)
+		{
+			return new Queue(name);
+		}
+
+
+	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs Fri May 22 22:02:35 2009
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 using System.Messaging;
 
@@ -35,7 +34,7 @@
 			this.connection = connection;
 			this.acknowledgementMode = acknowledgementMode;
 			MessageConverter = connection.MessageConverter;
-			if (this.acknowledgementMode == AcknowledgementMode.Transactional)
+			if(this.acknowledgementMode == AcknowledgementMode.Transactional)
 			{
 				MessageQueueTransaction = new MessageQueueTransaction();
 			}
@@ -43,12 +42,12 @@
 
 		public void Dispose()
 		{
-			if(MessageQueueTransaction!=null)
+			if(MessageQueueTransaction != null)
 			{
 				MessageQueueTransaction.Dispose();
 			}
 		}
-		
+
 		public IMessageProducer CreateProducer()
 		{
 			return CreateProducer(null);
@@ -93,17 +92,17 @@
 		{
 			return new Queue(name);
 		}
-		
+
 		public ITopic GetTopic(string name)
 		{
 			throw new NotSupportedException("Topics are not supported by MSMQ");
 		}
-		
+
 		public ITemporaryQueue CreateTemporaryQueue()
 		{
 			throw new NotSupportedException("Tempoary Queues are not supported by MSMQ");
 		}
-		
+
 		public ITemporaryTopic CreateTemporaryTopic()
 		{
 			throw new NotSupportedException("Tempoary Topics are not supported by MSMQ");
@@ -123,62 +122,62 @@
 			BaseMessage answer = new BaseMessage();
 			return answer;
 		}
-		
-		
+
+
 		public ITextMessage CreateTextMessage()
 		{
 			TextMessage answer = new TextMessage();
 			return answer;
 		}
-		
+
 		public ITextMessage CreateTextMessage(string text)
 		{
 			TextMessage answer = new TextMessage(text);
 			return answer;
 		}
-		
+
 		public IMapMessage CreateMapMessage()
 		{
 			return new MapMessage();
 		}
-		
+
 		public IBytesMessage CreateBytesMessage()
 		{
 			return new BytesMessage();
 		}
-		
+
 		public IBytesMessage CreateBytesMessage(byte[] body)
 		{
 			BytesMessage answer = new BytesMessage();
 			answer.Content = body;
 			return answer;
 		}
-		
+
 		public IObjectMessage CreateObjectMessage(Object body)
 		{
 			ObjectMessage answer = new ObjectMessage();
 			answer.Body = body;
 			return answer;
 		}
-		
+
 		public void Commit()
 		{
-			if (! Transacted )
+			if(!Transacted)
 			{
 				throw new InvalidOperationException("You cannot perform a Commit() on a non-transacted session. Acknowlegement mode is: " + acknowledgementMode);
 			}
 			messageQueueTransaction.Commit();
 		}
-		
+
 		public void Rollback()
 		{
-			if (! Transacted)
+			if(!Transacted)
 			{
 				throw new InvalidOperationException("You cannot perform a Commit() on a non-transacted session. Acknowlegement mode is: " + acknowledgementMode);
 			}
 			messageQueueTransaction.Abort();
 		}
-		
+
 		// Properties
 		public Connection Connection
 		{
@@ -208,7 +207,7 @@
 		{
 			get
 			{
-				if( messageQueueTransaction.Status != MessageQueueTransactionStatus.Pending )
+				if(messageQueueTransaction.Status != MessageQueueTransactionStatus.Pending)
 					messageQueueTransaction.Begin();
 				return messageQueueTransaction;
 			}

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/StreamMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/StreamMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/StreamMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/StreamMessage.cs Fri May 22 22:02:35 2009
@@ -18,8 +18,8 @@
 namespace Apache.NMS.MSMQ
 {
 	public class StreamMessage : BaseMessage
-    {
-		
-    }
+	{
+
+	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/TextMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/TextMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/TextMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/TextMessage.cs Fri May 22 22:02:35 2009
@@ -14,84 +14,88 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS;
 using System;
 
 
 namespace Apache.NMS.MSMQ
 {
 	public class TextMessage : BaseMessage, ITextMessage
-    {
+	{
 		public const int SIZE_OF_INT = 4; // sizeof(int) - though causes unsafe issues with net 1.1
 
-        private String text;
-        
-        public TextMessage()
-        {
-        }
-        
-        public TextMessage(String text)
-        {
-            this.Text = text;
-        }
-        
-        
-        // Properties
-        
-        public string Text
-        {
-            get {
-                if (text == null)
-                {
-                    // now lets read the content
-                    byte[] data = this.Content;
-                    if (data != null)
-                    {
-                        // TODO assume that the text is ASCII
-                        char[] chars = new char[data.Length - SIZE_OF_INT];
-                        for (int i = 0; i < chars.Length; i++)
-                        {
-                            chars[i] = (char) data[i + SIZE_OF_INT];
-                        }
-                        text = new String(chars);
-                    }
-                }
-                return text;
-            }
-            
-            set {
-                this.text = value;
-                byte[] data = null;
-                if (text != null)
-                {
+		private String text;
+
+		public TextMessage()
+		{
+		}
+
+		public TextMessage(String text)
+		{
+			this.Text = text;
+		}
+
+
+		// Properties
+
+		public string Text
+		{
+			get
+			{
+				if(text == null)
+				{
+					// now lets read the content
+					byte[] data = this.Content;
+					if(data != null)
+					{
+						// TODO assume that the text is ASCII
+						char[] chars = new char[data.Length - SIZE_OF_INT];
+						for(int i = 0; i < chars.Length; i++)
+						{
+							chars[i] = (char) data[i + SIZE_OF_INT];
+						}
+						text = new String(chars);
+					}
+				}
+				return text;
+			}
+
+			set
+			{
+				this.text = value;
+				byte[] data = null;
+				if(text != null)
+				{
 					// TODO assume that the text is ASCII
-					
-                    byte[] sizePrefix = System.BitConverter.GetBytes(text.Length);
+
+					byte[] sizePrefix = System.BitConverter.GetBytes(text.Length);
 					data = new byte[text.Length + sizePrefix.Length];  //int at the front of it
-															
+
 					// add the size prefix
-					for (int j = 0; j < sizePrefix.Length; j++)
-                    {
+					for(int j = 0; j < sizePrefix.Length; j++)
+					{
 						// The bytes need to be encoded in big endian
-						if ( BitConverter.IsLittleEndian ) {
+						if(BitConverter.IsLittleEndian)
+						{
 							data[j] = sizePrefix[sizePrefix.Length - j - 1];
-						} else {
+						}
+						else
+						{
 							data[j] = sizePrefix[j];
 						}
-                    }
-					
+					}
+
 					// Add the data.
-                    char[] chars = text.ToCharArray();
-					for (int i = 0; i < chars.Length; i++)
-                    {
-                        data[i + sizePrefix.Length] = (byte)chars[i];
-                    }
+					char[] chars = text.ToCharArray();
+					for(int i = 0; i < chars.Length; i++)
+					{
+						data[i + sizePrefix.Length] = (byte) chars[i];
+					}
 				}
 				this.Content = data;
-					
-            }
-        }
 
-    }
+			}
+		}
+
+	}
 }