activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r707747 [2/4] - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk: ./ src/main/csharp/ src/main/csharp/Commands/ src/main/csharp/State/ src/main/csharp/Threads/ src/main/csharp/Transport/ src/main/csharp/Transport/Failover/ src/main/cs...
Date Fri, 24 Oct 2008 21:10:23 GMT
Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConnectionInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConnectionInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConnectionInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConnectionInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,98 +20,101 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ConnectionInfo Command
-    /// </summary>
-    public class ConnectionInfo : BaseCommand
-    {
-        public const byte ID_ConnectionInfo = 3;
-    			
-        ConnectionId connectionId;
-        string clientId;
-        string password;
-        string userName;
-        BrokerId[] brokerPath;
-        bool brokerMasterConnector;
-        bool manageable;
-        bool clientMaster = true;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " ClientId=" + ClientId
-                + " Password=" + Password
-                + " UserName=" + UserName
-                + " BrokerPath=" + BrokerPath
-                + " BrokerMasterConnector=" + BrokerMasterConnector
-                + " Manageable=" + Manageable
-                + " ClientMaster=" + ClientMaster
-                + " ]";
-
-		}
-
-        public override byte GetDataStructureType() {
-            return ID_ConnectionInfo;
-        }
-
-
-        // Properties
-
-        public ConnectionId ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }            
-        }
-
-        public string ClientId
-        {
-            get { return clientId; }
-            set { this.clientId = value; }            
-        }
-
-        public string Password
-        {
-            get { return password; }
-            set { this.password = value; }            
-        }
-
-        public string UserName
-        {
-            get { return userName; }
-            set { this.userName = value; }            
-        }
-
-        public BrokerId[] BrokerPath
-        {
-            get { return brokerPath; }
-            set { this.brokerPath = value; }            
-        }
-
-        public bool BrokerMasterConnector
-        {
-            get { return brokerMasterConnector; }
-            set { this.brokerMasterConnector = value; }            
-        }
-
-        public bool Manageable
-        {
-            get { return manageable; }
-            set { this.manageable = value; }            
-        }
-
-        public bool ClientMaster
-        {
-            get { return clientMaster; }
-            set { this.clientMaster = value; }            
-        }
+	/// <summary>
+	///  The ActiveMQ ConnectionInfo Command
+	/// </summary>
+	public class ConnectionInfo : BaseCommand
+	{
+		public const byte ID_ConnectionInfo = 3;
+
+		ConnectionId connectionId;
+		string clientId;
+		string password;
+		string userName;
+		BrokerId[] brokerPath;
+		bool brokerMasterConnector;
+		bool manageable;
+		bool clientMaster = true;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConnectionId=" + ConnectionId
+				+ " ClientId=" + ClientId
+				+ " Password=" + Password
+				+ " UserName=" + UserName
+				+ " BrokerPath=" + BrokerPath
+				+ " BrokerMasterConnector=" + BrokerMasterConnector
+				+ " Manageable=" + Manageable
+				+ " ClientMaster=" + ClientMaster
+				+ " ]";
 
-    }
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_ConnectionInfo;
+		}
+
+
+		// Properties
+
+		public ConnectionId ConnectionId
+		{
+			get { return connectionId; }
+			set { this.connectionId = value; }
+		}
+
+		public string ClientId
+		{
+			get { return clientId; }
+			set { this.clientId = value; }
+		}
+
+		public string Password
+		{
+			get { return password; }
+			set { this.password = value; }
+		}
+
+		public string UserName
+		{
+			get { return userName; }
+			set { this.userName = value; }
+		}
+
+		public BrokerId[] BrokerPath
+		{
+			get { return brokerPath; }
+			set { this.brokerPath = value; }
+		}
+
+		public bool BrokerMasterConnector
+		{
+			get { return brokerMasterConnector; }
+			set { this.brokerMasterConnector = value; }
+		}
+
+		public bool Manageable
+		{
+			get { return manageable; }
+			set { this.manageable = value; }
+		}
+
+		public bool ClientMaster
+		{
+			get { return clientMaster; }
+			set { this.clientMaster = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processAddConnection(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerControl.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerControl.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerControl.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerControl.cs Fri Oct 24 14:10:22 2008
@@ -20,82 +20,85 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ConsumerControl Command
-    /// </summary>
-    public class ConsumerControl : BaseCommand
-    {
-        public const byte ID_ConsumerControl = 17;
-    			
-        bool close;
-        ConsumerId consumerId;
-        int prefetch;
-        bool flush;
-        bool start;
-        bool stop;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " Close=" + Close
-                + " ConsumerId=" + ConsumerId
-                + " Prefetch=" + Prefetch
-                + " Flush=" + Flush
-                + " Start=" + Start
-                + " Stop=" + Stop
-                + " ]";
-
-		}
-
-        public override byte GetDataStructureType() {
-            return ID_ConsumerControl;
-        }
-
-
-        // Properties
-
-        public bool Close
-        {
-            get { return close; }
-            set { this.close = value; }            
-        }
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public int Prefetch
-        {
-            get { return prefetch; }
-            set { this.prefetch = value; }            
-        }
-
-        public bool Flush
-        {
-            get { return flush; }
-            set { this.flush = value; }            
-        }
-
-        public bool Start
-        {
-            get { return start; }
-            set { this.start = value; }            
-        }
-
-        public bool Stop
-        {
-            get { return stop; }
-            set { this.stop = value; }            
-        }
+	/// <summary>
+	///  The ActiveMQ ConsumerControl Command
+	/// </summary>
+	public class ConsumerControl : BaseCommand
+	{
+		public const byte ID_ConsumerControl = 17;
+
+		bool close;
+		ConsumerId consumerId;
+		int prefetch;
+		bool flush;
+		bool start;
+		bool stop;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " Close=" + Close
+				+ " ConsumerId=" + ConsumerId
+				+ " Prefetch=" + Prefetch
+				+ " Flush=" + Flush
+				+ " Start=" + Start
+				+ " Stop=" + Stop
+				+ " ]";
 
-    }
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_ConsumerControl;
+		}
+
+
+		// Properties
+
+		public bool Close
+		{
+			get { return close; }
+			set { this.close = value; }
+		}
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public int Prefetch
+		{
+			get { return prefetch; }
+			set { this.prefetch = value; }
+		}
+
+		public bool Flush
+		{
+			get { return flush; }
+			set { this.flush = value; }
+		}
+
+		public bool Start
+		{
+			get { return start; }
+			set { this.start = value; }
+		}
+
+		public bool Stop
+		{
+			get { return stop; }
+			set { this.stop = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processConsumerControl(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerId.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerId.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerId.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerId.cs Fri Oct 24 14:10:22 2008
@@ -20,82 +20,97 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
-
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
-
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ConsumerId Command
-    /// </summary>
-    public class ConsumerId : BaseDataStructure, DataStructure
-    {
-        public const byte ID_ConsumerId = 122;
-    			
-        string connectionId;
-        long sessionId;
-        long value;
-
-		public override int GetHashCode() {
-            int answer = 0;
-            answer = (answer * 37) + HashCode(ConnectionId);
-            answer = (answer * 37) + HashCode(SessionId);
-            answer = (answer * 37) + HashCode(Value);
-            return answer;
+	/// <summary>
+	///  The ActiveMQ ConsumerId Command
+	/// </summary>
+	public class ConsumerId : BaseDataStructure, DataStructure
+	{
+		public const byte ID_ConsumerId = 122;
+
+		string connectionId;
+		long sessionId;
+		long value;
+		private SessionId _parentId;
+
+		public override int GetHashCode()
+		{
+			int answer = 0;
+			answer = (answer * 37) + HashCode(ConnectionId);
+			answer = (answer * 37) + HashCode(SessionId);
+			answer = (answer * 37) + HashCode(Value);
+			return answer;
 
 		}
 
-		public override bool Equals(object that) {
-	    	if (that is ConsumerId) {
-	    	    return Equals((ConsumerId) that);
+		public override bool Equals(object that)
+		{
+			if(that is ConsumerId)
+			{
+				return Equals((ConsumerId) that);
 			}
 			return false;
-    	}
+		}
 
-		public virtual bool Equals(ConsumerId that) {
-            if (! Equals(this.ConnectionId, that.ConnectionId)) return false;
-            if (! Equals(this.SessionId, that.SessionId)) return false;
-            if (! Equals(this.Value, that.Value)) return false;
-            return true;
+		public virtual bool Equals(ConsumerId that)
+		{
+			if(!Equals(this.ConnectionId, that.ConnectionId))
+				return false;
+			if(!Equals(this.SessionId, that.SessionId))
+				return false;
+			if(!Equals(this.Value, that.Value))
+				return false;
+			return true;
 
 		}
 
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " SessionId=" + SessionId
-                + " Value=" + Value
-                + " ]";
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConnectionId=" + ConnectionId
+				+ " SessionId=" + SessionId
+				+ " Value=" + Value
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_ConsumerId;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_ConsumerId;
+		}
 
 
-        // Properties
+		// Properties
 
-        public string ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }            
-        }
+		public string ConnectionId
+		{
+			get { return connectionId; }
+			set { this.connectionId = value; }
+		}
 
-        public long SessionId
-        {
-            get { return sessionId; }
-            set { this.sessionId = value; }            
-        }
+		public long SessionId
+		{
+			get { return sessionId; }
+			set { this.sessionId = value; }
+		}
 
-        public long Value
-        {
-            get { return value; }
-            set { this.value = value; }            
-        }
+		public long Value
+		{
+			get { return value; }
+			set { this.value = value; }
+		}
 
-    }
+		public SessionId ParentId
+		{
+			get
+			{
+				if(_parentId == null)
+				{
+					_parentId = new SessionId(this);
+				}
+				return _parentId;
+			}
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ConsumerInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,178 +20,181 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS;
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ConsumerInfo Command
-    /// </summary>
-    public class ConsumerInfo : BaseCommand
-    {
-        public const byte ID_ConsumerInfo = 5;
-    			
-        ConsumerId consumerId;
-        bool browser;
-        ActiveMQDestination destination;
-        int prefetchSize;
-        int maximumPendingMessageLimit;
-        bool dispatchAsync;
-        string selector;
-        string subscriptionName;
-        bool noLocal;
-        bool exclusive;
-        bool retroactive;
-        byte priority;
-        BrokerId[] brokerPath;
-        BooleanExpression additionalPredicate;
-        bool networkSubscription;
-        bool optimizedAcknowledge;
-        bool noRangeAcks;
-        AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConsumerId=" + ConsumerId
-                + " Browser=" + Browser
-                + " Destination=" + Destination
-                + " PrefetchSize=" + PrefetchSize
-                + " MaximumPendingMessageLimit=" + MaximumPendingMessageLimit
-                + " DispatchAsync=" + DispatchAsync
-                + " Selector=" + Selector
-                + " SubscriptionName=" + SubscriptionName
-                + " NoLocal=" + NoLocal
-                + " Exclusive=" + Exclusive
-                + " Retroactive=" + Retroactive
-                + " Priority=" + Priority
-                + " BrokerPath=" + BrokerPath
-                + " AdditionalPredicate=" + AdditionalPredicate
-                + " NetworkSubscription=" + NetworkSubscription
-                + " OptimizedAcknowledge=" + OptimizedAcknowledge
-                + " NoRangeAcks=" + NoRangeAcks
-                + " AcknowledgementMode=" + AcknowledgementMode
-                + " ]";
-
-		}
-
-        public override byte GetDataStructureType() {
-            return ID_ConsumerInfo;
-        }
-
-
-        // Properties
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public bool Browser
-        {
-            get { return browser; }
-            set { this.browser = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public int PrefetchSize
-        {
-            get { return prefetchSize; }
-            set { this.prefetchSize = value; }            
-        }
-
-        public int MaximumPendingMessageLimit
-        {
-            get { return maximumPendingMessageLimit; }
-            set { this.maximumPendingMessageLimit = value; }            
-        }
-
-        public bool DispatchAsync
-        {
-            get { return dispatchAsync; }
-            set { this.dispatchAsync = value; }            
-        }
-
-        public string Selector
-        {
-            get { return selector; }
-            set { this.selector = value; }            
-        }
-
-        public string SubscriptionName
-        {
-            get { return subscriptionName; }
-            set { this.subscriptionName = value; }            
-        }
-
-        public bool NoLocal
-        {
-            get { return noLocal; }
-            set { this.noLocal = value; }            
-        }
-
-        public bool Exclusive
-        {
-            get { return exclusive; }
-            set { this.exclusive = value; }            
-        }
-
-        public bool Retroactive
-        {
-            get { return retroactive; }
-            set { this.retroactive = value; }            
-        }
-
-        public byte Priority
-        {
-            get { return priority; }
-            set { this.priority = value; }            
-        }
-
-        public BrokerId[] BrokerPath
-        {
-            get { return brokerPath; }
-            set { this.brokerPath = value; }            
-        }
-
-        public BooleanExpression AdditionalPredicate
-        {
-            get { return additionalPredicate; }
-            set { this.additionalPredicate = value; }            
-        }
-
-        public bool NetworkSubscription
-        {
-            get { return networkSubscription; }
-            set { this.networkSubscription = value; }            
-        }
-
-        public bool OptimizedAcknowledge
-        {
-            get { return optimizedAcknowledge; }
-            set { this.optimizedAcknowledge = value; }            
-        }
-
-        public bool NoRangeAcks
-        {
-            get { return noRangeAcks; }
-            set { this.noRangeAcks = value; }            
-        }
-
-        public AcknowledgementMode AcknowledgementMode
-        {
-            get { return acknowledgementMode; }
-            set { this.acknowledgementMode = value; }            
-        }
-    }
+	/// <summary>
+	///  The ActiveMQ ConsumerInfo Command
+	/// </summary>
+	public class ConsumerInfo : BaseCommand
+	{
+		public const byte ID_ConsumerInfo = 5;
+
+		ConsumerId consumerId;
+		bool browser;
+		ActiveMQDestination destination;
+		int prefetchSize;
+		int maximumPendingMessageLimit;
+		bool dispatchAsync;
+		string selector;
+		string subscriptionName;
+		bool noLocal;
+		bool exclusive;
+		bool retroactive;
+		byte priority;
+		BrokerId[] brokerPath;
+		BooleanExpression additionalPredicate;
+		bool networkSubscription;
+		bool optimizedAcknowledge;
+		bool noRangeAcks;
+		AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConsumerId=" + ConsumerId
+				+ " Browser=" + Browser
+				+ " Destination=" + Destination
+				+ " PrefetchSize=" + PrefetchSize
+				+ " MaximumPendingMessageLimit=" + MaximumPendingMessageLimit
+				+ " DispatchAsync=" + DispatchAsync
+				+ " Selector=" + Selector
+				+ " SubscriptionName=" + SubscriptionName
+				+ " NoLocal=" + NoLocal
+				+ " Exclusive=" + Exclusive
+				+ " Retroactive=" + Retroactive
+				+ " Priority=" + Priority
+				+ " BrokerPath=" + BrokerPath
+				+ " AdditionalPredicate=" + AdditionalPredicate
+				+ " NetworkSubscription=" + NetworkSubscription
+				+ " OptimizedAcknowledge=" + OptimizedAcknowledge
+				+ " NoRangeAcks=" + NoRangeAcks
+				+ " AcknowledgementMode=" + AcknowledgementMode
+				+ " ]";
+
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_ConsumerInfo;
+		}
+
+
+		// Properties
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public bool Browser
+		{
+			get { return browser; }
+			set { this.browser = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public int PrefetchSize
+		{
+			get { return prefetchSize; }
+			set { this.prefetchSize = value; }
+		}
+
+		public int MaximumPendingMessageLimit
+		{
+			get { return maximumPendingMessageLimit; }
+			set { this.maximumPendingMessageLimit = value; }
+		}
+
+		public bool DispatchAsync
+		{
+			get { return dispatchAsync; }
+			set { this.dispatchAsync = value; }
+		}
+
+		public string Selector
+		{
+			get { return selector; }
+			set { this.selector = value; }
+		}
+
+		public string SubscriptionName
+		{
+			get { return subscriptionName; }
+			set { this.subscriptionName = value; }
+		}
+
+		public bool NoLocal
+		{
+			get { return noLocal; }
+			set { this.noLocal = value; }
+		}
+
+		public bool Exclusive
+		{
+			get { return exclusive; }
+			set { this.exclusive = value; }
+		}
+
+		public bool Retroactive
+		{
+			get { return retroactive; }
+			set { this.retroactive = value; }
+		}
+
+		public byte Priority
+		{
+			get { return priority; }
+			set { this.priority = value; }
+		}
+
+		public BrokerId[] BrokerPath
+		{
+			get { return brokerPath; }
+			set { this.brokerPath = value; }
+		}
+
+		public BooleanExpression AdditionalPredicate
+		{
+			get { return additionalPredicate; }
+			set { this.additionalPredicate = value; }
+		}
+
+		public bool NetworkSubscription
+		{
+			get { return networkSubscription; }
+			set { this.networkSubscription = value; }
+		}
+
+		public bool OptimizedAcknowledge
+		{
+			get { return optimizedAcknowledge; }
+			set { this.optimizedAcknowledge = value; }
+		}
+
+		public bool NoRangeAcks
+		{
+			get { return noRangeAcks; }
+			set { this.noRangeAcks = value; }
+		}
+
+		public AcknowledgementMode AcknowledgementMode
+		{
+			get { return acknowledgementMode; }
+			set { this.acknowledgementMode = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processAddConsumer(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ControlCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ControlCommand.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ControlCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ControlCommand.cs Fri Oct 24 14:10:22 2008
@@ -20,42 +20,45 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ControlCommand Command
-    /// </summary>
-    public class ControlCommand : BaseCommand
-    {
-        public const byte ID_ControlCommand = 14;
-    			
-        string command;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " Command=" + Command
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ ControlCommand Command
+	/// </summary>
+	public class ControlCommand : BaseCommand
+	{
+		public const byte ID_ControlCommand = 14;
+
+		string command;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " Command=" + Command
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_ControlCommand;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_ControlCommand;
+		}
 
 
-        // Properties
+		// Properties
 
-        public string Command
-        {
-            get { return command; }
-            set { this.command = value; }            
-        }
+		public string Command
+		{
+			get { return command; }
+			set { this.command = value; }
+		}
 
-    }
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processControlCommand(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructure.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructure.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructure.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructure.cs Fri Oct 24 14:10:22 2008
@@ -14,15 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+using System;
+
 namespace Apache.NMS.ActiveMQ.Commands
 {
-	
+
 	/// <summary>
 	/// An OpenWire command
 	/// </summary>
-	public interface DataStructure
+	public interface DataStructure : ICloneable
 	{
-		
 		byte GetDataStructureType();
 		bool IsMarshallAware();
 	}

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructureSupport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructureSupport.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructureSupport.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DataStructureSupport.cs Fri Oct 24 14:10:22 2008
@@ -14,30 +14,41 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-using Apache.NMS.ActiveMQ.Commands;
+
+using System;
+
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-	
+
 	/// <summary>
 	/// Summary description for DataStructureSupport.
 	/// </summary>
 	public abstract class DataStructureSupport : DataStructure
 	{
-		
+
 		protected DataStructureSupport()
 		{
 		}
-		
+
 		public virtual byte GetDataStructureType()
 		{
 			return 0;
 		}
-		
+
 		public virtual bool IsMarshallAware()
 		{
 			return false;
 		}
+
+		public virtual Object Clone()
+		{
+			// Since we are the lowest level base class, do a
+			// shallow copy which will include the derived classes.
+			// From here we would do deep cloning of other objects
+			// if we had any.
+			return this.MemberwiseClone();
+		}
 	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DestinationInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DestinationInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DestinationInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/DestinationInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,74 +20,104 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ DestinationInfo Command
-    /// </summary>
-    public class DestinationInfo : BaseCommand
-    {
-        public const byte ID_DestinationInfo = 8;
-    			
-        ConnectionId connectionId;
-        ActiveMQDestination destination;
-        byte operationType;
-        long timeout;
-        BrokerId[] brokerPath;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " Destination=" + Destination
-                + " OperationType=" + OperationType
-                + " Timeout=" + Timeout
-                + " BrokerPath=" + BrokerPath
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ DestinationInfo Command
+	/// </summary>
+	public class DestinationInfo : BaseCommand
+	{
+		public const byte ID_DestinationInfo = 8;
+
+		public const byte ADD_OPERATION_TYPE = 0;
+		public const byte REMOVE_OPERATION_TYPE = 1;
+
+		ConnectionId connectionId;
+		ActiveMQDestination destination;
+		byte operationType;
+		long timeout;
+		BrokerId[] brokerPath;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConnectionId=" + ConnectionId
+				+ " Destination=" + Destination
+				+ " OperationType=" + OperationType
+				+ " Timeout=" + Timeout
+				+ " BrokerPath=" + BrokerPath
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_DestinationInfo;
-        }
-
-
-        // Properties
-
-        public ConnectionId ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public byte OperationType
-        {
-            get { return operationType; }
-            set { this.operationType = value; }            
-        }
-
-        public long Timeout
-        {
-            get { return timeout; }
-            set { this.timeout = value; }            
-        }
-
-        public BrokerId[] BrokerPath
-        {
-            get { return brokerPath; }
-            set { this.brokerPath = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_DestinationInfo;
+		}
+
+
+		// Properties
+
+		public ConnectionId ConnectionId
+		{
+			get { return connectionId; }
+			set { this.connectionId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public byte OperationType
+		{
+			get { return operationType; }
+			set { this.operationType = value; }
+		}
 
-    }
+		public long Timeout
+		{
+			get { return timeout; }
+			set { this.timeout = value; }
+		}
+
+		public BrokerId[] BrokerPath
+		{
+			get { return brokerPath; }
+			set { this.brokerPath = value; }
+		}
+
+		public bool IsAddOperation
+		{
+			get
+			{
+				return OperationType == ADD_OPERATION_TYPE;
+			}
+		}
+
+		public bool IsRemoveOperation
+		{
+			get
+			{
+				return OperationType == REMOVE_OPERATION_TYPE;
+			}
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			if(IsAddOperation)
+			{
+				return visitor.processAddDestination(this);
+			}
+			else if(IsRemoveOperation)
+			{
+				return visitor.processRemoveDestination(this);
+			}
+			throw new IOException("Unknown operation type: " + OperationType);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/FlushCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/FlushCommand.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/FlushCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/FlushCommand.cs Fri Oct 24 14:10:22 2008
@@ -20,34 +20,37 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ FlushCommand Command
-    /// </summary>
-    public class FlushCommand : BaseCommand
-    {
-        public const byte ID_FlushCommand = 15;
-    			
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ FlushCommand Command
+	/// </summary>
+	public class FlushCommand : BaseCommand
+	{
+		public const byte ID_FlushCommand = 15;
+
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_FlushCommand;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_FlushCommand;
+		}
 
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processFlush(this);
+		}
 
-        // Properties
+		// Properties
 
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/KeepAliveInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/KeepAliveInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/KeepAliveInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/KeepAliveInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,34 +20,38 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ KeepAliveInfo Command
-    /// </summary>
-    public class KeepAliveInfo : BaseCommand
-    {
-        public const byte ID_KeepAliveInfo = 10;
-    			
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ KeepAliveInfo Command
+	/// </summary>
+	public class KeepAliveInfo : BaseCommand
+	{
+		public const byte ID_KeepAliveInfo = 10;
+
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_KeepAliveInfo;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_KeepAliveInfo;
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processKeepAlive(this);
+		}
 
 
-        // Properties
+		// Properties
 
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/LastPartialCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/LastPartialCommand.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/LastPartialCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/LastPartialCommand.cs Fri Oct 24 14:10:22 2008
@@ -21,33 +21,36 @@
 //
 
 using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ LastPartialCommand Command
-    /// </summary>
-    public class LastPartialCommand : PartialCommand
-    {
-        public const byte ID_LastPartialCommand = 61;
-    			
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ LastPartialCommand Command
+	/// </summary>
+	public class LastPartialCommand : PartialCommand
+	{
+		public const byte ID_LastPartialCommand = 61;
+
+
+		public override string ToString()
+		{
+			return GetType().Name + "[" + " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_LastPartialCommand;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_LastPartialCommand;
+		}
 
+		public override Response visit(ICommandVisitor visitor)
+		{
+			throw new ApplicationException("The transport layer should filter out LastPartialCommand instances but received: " + this);
+		}
 
-        // Properties
+		// Properties
 
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/Message.cs Fri Oct 24 14:10:22 2008
@@ -21,241 +21,328 @@
 //
 
 using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ Message Command
-    /// </summary>
-    public class Message : BaseCommand, MarshallAware, MessageReference
-    {
-        public const byte ID_Message = 0;
-    			
-        ProducerId producerId;
-        ActiveMQDestination destination;
-        TransactionId transactionId;
-        ActiveMQDestination originalDestination;
-        MessageId messageId;
-        TransactionId originalTransactionId;
-        string groupID;
-        int groupSequence;
-        string correlationId;
-        bool persistent;
-        long expiration;
-        byte priority;
-        ActiveMQDestination replyTo;
-        long timestamp;
-        string type;
-        byte[] content;
-        byte[] marshalledProperties;
-        DataStructure dataStructure;
-        ConsumerId targetConsumerId;
-        bool compressed;
-        int redeliveryCounter;
-        BrokerId[] brokerPath;
-        long arrival;
-        string userID;
-        bool recievedByDFBridge;
-        bool droppable;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ProducerId=" + ProducerId
-                + " Destination=" + Destination
-                + " TransactionId=" + TransactionId
-                + " OriginalDestination=" + OriginalDestination
-                + " MessageId=" + MessageId
-                + " OriginalTransactionId=" + OriginalTransactionId
-                + " GroupID=" + GroupID
-                + " GroupSequence=" + GroupSequence
-                + " CorrelationId=" + CorrelationId
-                + " Persistent=" + Persistent
-                + " Expiration=" + Expiration
-                + " Priority=" + Priority
-                + " ReplyTo=" + ReplyTo
-                + " Timestamp=" + Timestamp
-                + " Type=" + Type
-                + " Content=" + Content
-                + " MarshalledProperties=" + MarshalledProperties
-                + " DataStructure=" + DataStructure
-                + " TargetConsumerId=" + TargetConsumerId
-                + " Compressed=" + Compressed
-                + " RedeliveryCounter=" + RedeliveryCounter
-                + " BrokerPath=" + BrokerPath
-                + " Arrival=" + Arrival
-                + " UserID=" + UserID
-                + " RecievedByDFBridge=" + RecievedByDFBridge
-                + " Droppable=" + Droppable
-                + " ]";
-
-		}
-
-        public override byte GetDataStructureType() {
-            return ID_Message;
-        }
-
-
-        // Properties
-
-        public ProducerId ProducerId
-        {
-            get { return producerId; }
-            set { this.producerId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public TransactionId TransactionId
-        {
-            get { return transactionId; }
-            set { this.transactionId = value; }            
-        }
-
-        public ActiveMQDestination OriginalDestination
-        {
-            get { return originalDestination; }
-            set { this.originalDestination = value; }            
-        }
-
-        public MessageId MessageId
-        {
-            get { return messageId; }
-            set { this.messageId = value; }            
-        }
-
-        public TransactionId OriginalTransactionId
-        {
-            get { return originalTransactionId; }
-            set { this.originalTransactionId = value; }            
-        }
-
-        public string GroupID
-        {
-            get { return groupID; }
-            set { this.groupID = value; }            
-        }
-
-        public int GroupSequence
-        {
-            get { return groupSequence; }
-            set { this.groupSequence = value; }            
-        }
-
-        public string CorrelationId
-        {
-            get { return correlationId; }
-            set { this.correlationId = value; }            
-        }
-
-        public bool Persistent
-        {
-            get { return persistent; }
-            set { this.persistent = value; }            
-        }
-
-        public long Expiration
-        {
-            get { return expiration; }
-            set { this.expiration = value; }            
-        }
-
-        public byte Priority
-        {
-            get { return priority; }
-            set { this.priority = value; }            
-        }
-
-        public ActiveMQDestination ReplyTo
-        {
-            get { return replyTo; }
-            set { this.replyTo = value; }            
-        }
-
-        public long Timestamp
-        {
-            get { return timestamp; }
-            set { this.timestamp = value; }            
-        }
-
-        public string Type
-        {
-            get { return type; }
-            set { this.type = value; }            
-        }
-
-        public byte[] Content
-        {
-            get { return content; }
-            set { this.content = value; }            
-        }
-
-        public byte[] MarshalledProperties
-        {
-            get { return marshalledProperties; }
-            set { this.marshalledProperties = value; }            
-        }
-
-        public DataStructure DataStructure
-        {
-            get { return dataStructure; }
-            set { this.dataStructure = value; }            
-        }
-
-        public ConsumerId TargetConsumerId
-        {
-            get { return targetConsumerId; }
-            set { this.targetConsumerId = value; }            
-        }
-
-        public bool Compressed
-        {
-            get { return compressed; }
-            set { this.compressed = value; }            
-        }
-
-        public int RedeliveryCounter
-        {
-            get { return redeliveryCounter; }
-            set { this.redeliveryCounter = value; }            
-        }
-
-        public BrokerId[] BrokerPath
-        {
-            get { return brokerPath; }
-            set { this.brokerPath = value; }            
-        }
-
-        public long Arrival
-        {
-            get { return arrival; }
-            set { this.arrival = value; }            
-        }
-
-        public string UserID
-        {
-            get { return userID; }
-            set { this.userID = value; }            
-        }
-
-        public bool RecievedByDFBridge
-        {
-            get { return recievedByDFBridge; }
-            set { this.recievedByDFBridge = value; }            
-        }
-
-        public bool Droppable
-        {
-            get { return droppable; }
-            set { this.droppable = value; }            
-        }
+	/// <summary>
+	///  The ActiveMQ Message Command
+	/// </summary>
+	public class Message : BaseCommand, MarshallAware, MessageReference, ICloneable
+	{
+		public const byte ID_Message = 0;
+
+		ProducerId producerId;
+		ActiveMQDestination destination;
+		TransactionId transactionId;
+		ActiveMQDestination originalDestination;
+		MessageId messageId;
+		TransactionId originalTransactionId;
+		string groupID;
+		int groupSequence;
+		string correlationId;
+		bool persistent;
+		long expiration;
+		byte priority;
+		ActiveMQDestination replyTo;
+		long timestamp;
+		string type;
+		byte[] content;
+		byte[] marshalledProperties;
+		DataStructure dataStructure;
+		ConsumerId targetConsumerId;
+		bool compressed;
+		int redeliveryCounter;
+		BrokerId[] brokerPath;
+		long arrival;
+		string userID;
+		bool receivedByDFBridge;
+		bool droppable;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ProducerId=" + ProducerId
+				+ " Destination=" + Destination
+				+ " TransactionId=" + TransactionId
+				+ " OriginalDestination=" + OriginalDestination
+				+ " MessageId=" + MessageId
+				+ " OriginalTransactionId=" + OriginalTransactionId
+				+ " GroupID=" + GroupID
+				+ " GroupSequence=" + GroupSequence
+				+ " CorrelationId=" + CorrelationId
+				+ " Persistent=" + Persistent
+				+ " Expiration=" + Expiration
+				+ " Priority=" + Priority
+				+ " ReplyTo=" + ReplyTo
+				+ " Timestamp=" + Timestamp
+				+ " Type=" + Type
+				+ " Content=" + Content
+				+ " MarshalledProperties=" + MarshalledProperties
+				+ " DataStructure=" + DataStructure
+				+ " TargetConsumerId=" + TargetConsumerId
+				+ " Compressed=" + Compressed
+				+ " RedeliveryCounter=" + RedeliveryCounter
+				+ " BrokerPath=" + BrokerPath
+				+ " Arrival=" + Arrival
+				+ " UserID=" + UserID
+				+ " RecievedByDFBridge=" + RecievedByDFBridge
+				+ " Droppable=" + Droppable
+				+ " ]";
 
-    }
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_Message;
+		}
+
+
+		// Properties
+
+		public ProducerId ProducerId
+		{
+			get { return producerId; }
+			set { this.producerId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public TransactionId TransactionId
+		{
+			get { return transactionId; }
+			set { this.transactionId = value; }
+		}
+
+		public ActiveMQDestination OriginalDestination
+		{
+			get { return originalDestination; }
+			set { this.originalDestination = value; }
+		}
+
+		public MessageId MessageId
+		{
+			get { return messageId; }
+			set { this.messageId = value; }
+		}
+
+		public TransactionId OriginalTransactionId
+		{
+			get { return originalTransactionId; }
+			set { this.originalTransactionId = value; }
+		}
+
+		public string GroupID
+		{
+			get { return groupID; }
+			set { this.groupID = value; }
+		}
+
+		public int GroupSequence
+		{
+			get { return groupSequence; }
+			set { this.groupSequence = value; }
+		}
+
+		public string CorrelationId
+		{
+			get { return correlationId; }
+			set { this.correlationId = value; }
+		}
+
+		public bool Persistent
+		{
+			get { return persistent; }
+			set { this.persistent = value; }
+		}
+
+		public long Expiration
+		{
+			get { return expiration; }
+			set { this.expiration = value; }
+		}
+
+		public byte Priority
+		{
+			get { return priority; }
+			set { this.priority = value; }
+		}
+
+		public ActiveMQDestination ReplyTo
+		{
+			get { return replyTo; }
+			set { this.replyTo = value; }
+		}
+
+		public long Timestamp
+		{
+			get { return timestamp; }
+			set { this.timestamp = value; }
+		}
+
+		public string Type
+		{
+			get { return type; }
+			set { this.type = value; }
+		}
+
+		public byte[] Content
+		{
+			get { return content; }
+			set { this.content = value; }
+		}
+
+		public byte[] MarshalledProperties
+		{
+			get { return marshalledProperties; }
+			set { this.marshalledProperties = value; }
+		}
+
+		public DataStructure DataStructure
+		{
+			get { return dataStructure; }
+			set { this.dataStructure = value; }
+		}
+
+		public ConsumerId TargetConsumerId
+		{
+			get { return targetConsumerId; }
+			set { this.targetConsumerId = value; }
+		}
+
+		public bool Compressed
+		{
+			get { return compressed; }
+			set { this.compressed = value; }
+		}
+
+		public int RedeliveryCounter
+		{
+			get { return redeliveryCounter; }
+			set { this.redeliveryCounter = value; }
+		}
+
+		public BrokerId[] BrokerPath
+		{
+			get { return brokerPath; }
+			set { this.brokerPath = value; }
+		}
+
+		public long Arrival
+		{
+			get { return arrival; }
+			set { this.arrival = value; }
+		}
+
+		public string UserID
+		{
+			get { return userID; }
+			set { this.userID = value; }
+		}
+
+		public bool RecievedByDFBridge
+		{
+			get { return receivedByDFBridge; }
+			set { this.receivedByDFBridge = value; }
+		}
+
+		public bool Droppable
+		{
+			get { return droppable; }
+			set { this.droppable = value; }
+		}
+
+		public override bool IsMessage
+		{
+			get
+			{
+				return true;
+			}
+		}
+
+		public override Object Clone()
+		{
+			// Since we are a derived class use the base's Clone()
+			// to perform the shallow copy. Since it is shallow it
+			// will include our derived class. Since we are derived,
+			// this method is an override.
+			Message o = (Message) base.Clone();
+
+			// Now do the deep work required
+			// If any new variables are added then this routine will
+			// likely need updating
+			if(o.producerId != null)
+			{
+				o.producerId = (ProducerId) o.producerId.Clone();
+			}
+
+			if(o.destination != null)
+			{
+				o.destination = (ActiveMQDestination) o.destination.Clone();
+			}
+
+			if(o.transactionId != null)
+			{
+				o.transactionId = (TransactionId) o.transactionId.Clone();
+			}
+
+			if(o.originalDestination != null)
+			{
+				o.originalDestination = (ActiveMQDestination) o.originalDestination.Clone();
+			}
+
+			if(o.messageId != null)
+			{
+				o.messageId = (MessageId) o.messageId.Clone();
+			}
+
+			if(o.originalTransactionId != null)
+			{
+				o.originalTransactionId = (TransactionId) o.originalTransactionId.Clone();
+			}
+
+			if(o.replyTo != null)
+			{
+				o.replyTo = (ActiveMQDestination) o.replyTo.Clone();
+			}
+
+			if(o.content != null)
+			{
+				o.content = (byte[]) o.content.Clone();
+			}
+
+			if(o.marshalledProperties != null)
+			{
+				o.marshalledProperties = (byte[]) o.marshalledProperties.Clone();
+			}
+
+			if(o.dataStructure != null)
+			{
+				o.dataStructure = (DataStructure) o.dataStructure.Clone();
+			}
+
+			if(o.targetConsumerId != null)
+			{
+				o.targetConsumerId = (ConsumerId) o.targetConsumerId.Clone();
+			}
+
+			if(o.brokerPath != null)
+			{
+				o.brokerPath = (BrokerId[]) o.brokerPath.Clone();
+				for(int i = 0; i < o.brokerPath.Length; i++)
+				{
+					if(o.brokerPath[i] != null)
+					{
+						o.brokerPath[i] = (BrokerId) (o.brokerPath[i].Clone());
+					}
+				}
+			}
+
+			return o;
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageAck.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageAck.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageAck.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageAck.cs Fri Oct 24 14:10:22 2008
@@ -20,90 +20,93 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ MessageAck Command
-    /// </summary>
-    public class MessageAck : BaseCommand
-    {
-        public const byte ID_MessageAck = 22;
-    			
-        ActiveMQDestination destination;
-        TransactionId transactionId;
-        ConsumerId consumerId;
-        byte ackType;
-        MessageId firstMessageId;
-        MessageId lastMessageId;
-        int messageCount;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " Destination=" + Destination
-                + " TransactionId=" + TransactionId
-                + " ConsumerId=" + ConsumerId
-                + " AckType=" + AckType
-                + " FirstMessageId=" + FirstMessageId
-                + " LastMessageId=" + LastMessageId
-                + " MessageCount=" + MessageCount
-                + " ]";
-
-		}
-
-        public override byte GetDataStructureType() {
-            return ID_MessageAck;
-        }
-
-
-        // Properties
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public TransactionId TransactionId
-        {
-            get { return transactionId; }
-            set { this.transactionId = value; }            
-        }
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public byte AckType
-        {
-            get { return ackType; }
-            set { this.ackType = value; }            
-        }
-
-        public MessageId FirstMessageId
-        {
-            get { return firstMessageId; }
-            set { this.firstMessageId = value; }            
-        }
-
-        public MessageId LastMessageId
-        {
-            get { return lastMessageId; }
-            set { this.lastMessageId = value; }            
-        }
-
-        public int MessageCount
-        {
-            get { return messageCount; }
-            set { this.messageCount = value; }            
-        }
+	/// <summary>
+	///  The ActiveMQ MessageAck Command
+	/// </summary>
+	public class MessageAck : BaseCommand
+	{
+		public const byte ID_MessageAck = 22;
+
+		ActiveMQDestination destination;
+		TransactionId transactionId;
+		ConsumerId consumerId;
+		byte ackType;
+		MessageId firstMessageId;
+		MessageId lastMessageId;
+		int messageCount;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " Destination=" + Destination
+				+ " TransactionId=" + TransactionId
+				+ " ConsumerId=" + ConsumerId
+				+ " AckType=" + AckType
+				+ " FirstMessageId=" + FirstMessageId
+				+ " LastMessageId=" + LastMessageId
+				+ " MessageCount=" + MessageCount
+				+ " ]";
 
-    }
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_MessageAck;
+		}
+
+
+		// Properties
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public TransactionId TransactionId
+		{
+			get { return transactionId; }
+			set { this.transactionId = value; }
+		}
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public byte AckType
+		{
+			get { return ackType; }
+			set { this.ackType = value; }
+		}
+
+		public MessageId FirstMessageId
+		{
+			get { return firstMessageId; }
+			set { this.firstMessageId = value; }
+		}
+
+		public MessageId LastMessageId
+		{
+			get { return lastMessageId; }
+			set { this.lastMessageId = value; }
+		}
+
+		public int MessageCount
+		{
+			get { return messageCount; }
+			set { this.messageCount = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processMessageAck(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatch.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatch.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatch.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatch.cs Fri Oct 24 14:10:22 2008
@@ -20,66 +20,69 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ MessageDispatch Command
-    /// </summary>
-    public class MessageDispatch : BaseCommand
-    {
-        public const byte ID_MessageDispatch = 21;
-    			
-        ConsumerId consumerId;
-        ActiveMQDestination destination;
-        Message message;
-        int redeliveryCounter;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConsumerId=" + ConsumerId
-                + " Destination=" + Destination
-                + " Message=" + Message
-                + " RedeliveryCounter=" + RedeliveryCounter
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ MessageDispatch Command
+	/// </summary>
+	public class MessageDispatch : BaseCommand
+	{
+		public const byte ID_MessageDispatch = 21;
+
+		ConsumerId consumerId;
+		ActiveMQDestination destination;
+		Message message;
+		int redeliveryCounter;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConsumerId=" + ConsumerId
+				+ " Destination=" + Destination
+				+ " Message=" + Message
+				+ " RedeliveryCounter=" + RedeliveryCounter
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_MessageDispatch;
-        }
-
-
-        // Properties
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public Message Message
-        {
-            get { return message; }
-            set { this.message = value; }            
-        }
-
-        public int RedeliveryCounter
-        {
-            get { return redeliveryCounter; }
-            set { this.redeliveryCounter = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_MessageDispatch;
+		}
+
+
+		// Properties
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public Message Message
+		{
+			get { return message; }
+			set { this.message = value; }
+		}
 
-    }
+		public int RedeliveryCounter
+		{
+			get { return redeliveryCounter; }
+			set { this.redeliveryCounter = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processMessageDispatch(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatchNotification.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatchNotification.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatchNotification.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessageDispatchNotification.cs Fri Oct 24 14:10:22 2008
@@ -20,66 +20,70 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ MessageDispatchNotification Command
-    /// </summary>
-    public class MessageDispatchNotification : BaseCommand
-    {
-        public const byte ID_MessageDispatchNotification = 90;
-    			
-        ConsumerId consumerId;
-        ActiveMQDestination destination;
-        long deliverySequenceId;
-        MessageId messageId;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConsumerId=" + ConsumerId
-                + " Destination=" + Destination
-                + " DeliverySequenceId=" + DeliverySequenceId
-                + " MessageId=" + MessageId
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ MessageDispatchNotification Command
+	/// </summary>
+	public class MessageDispatchNotification : BaseCommand
+	{
+		public const byte ID_MessageDispatchNotification = 90;
+
+		ConsumerId consumerId;
+		ActiveMQDestination destination;
+		long deliverySequenceId;
+		MessageId messageId;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConsumerId=" + ConsumerId
+				+ " Destination=" + Destination
+				+ " DeliverySequenceId=" + DeliverySequenceId
+				+ " MessageId=" + MessageId
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_MessageDispatchNotification;
-        }
-
-
-        // Properties
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public long DeliverySequenceId
-        {
-            get { return deliverySequenceId; }
-            set { this.deliverySequenceId = value; }            
-        }
-
-        public MessageId MessageId
-        {
-            get { return messageId; }
-            set { this.messageId = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_MessageDispatchNotification;
+		}
+
+
+		// Properties
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public long DeliverySequenceId
+		{
+			get { return deliverySequenceId; }
+			set { this.deliverySequenceId = value; }
+		}
+
+		public MessageId MessageId
+		{
+			get { return messageId; }
+			set { this.messageId = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processMessageDispatchNotification(this);
+		}
 
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessagePull.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessagePull.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessagePull.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/MessagePull.cs Fri Oct 24 14:10:22 2008
@@ -20,58 +20,62 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ MessagePull Command
-    /// </summary>
-    public class MessagePull : BaseCommand
-    {
-        public const byte ID_MessagePull = 20;
-    			
-        ConsumerId consumerId;
-        ActiveMQDestination destination;
-        long timeout;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConsumerId=" + ConsumerId
-                + " Destination=" + Destination
-                + " Timeout=" + Timeout
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ MessagePull Command
+	/// </summary>
+	public class MessagePull : BaseCommand
+	{
+		public const byte ID_MessagePull = 20;
+
+		ConsumerId consumerId;
+		ActiveMQDestination destination;
+		long timeout;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConsumerId=" + ConsumerId
+				+ " Destination=" + Destination
+				+ " Timeout=" + Timeout
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_MessagePull;
-        }
-
-
-        // Properties
-
-        public ConsumerId ConsumerId
-        {
-            get { return consumerId; }
-            set { this.consumerId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public long Timeout
-        {
-            get { return timeout; }
-            set { this.timeout = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_MessagePull;
+		}
+
+
+		// Properties
+
+		public ConsumerId ConsumerId
+		{
+			get { return consumerId; }
+			set { this.consumerId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public long Timeout
+		{
+			get { return timeout; }
+			set { this.timeout = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processMessagePull(this);
+		}
 
-    }
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs Fri Oct 24 14:10:22 2008
@@ -21,49 +21,97 @@
 //
 
 using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ PartialCommand Command
-    /// </summary>
-    public class PartialCommand : BaseDataStructure, Command
-    {
-        public const byte ID_PartialCommand = 60;
-    			
-        int commandId;
-        byte[] data;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " CommandId=" + CommandId
-                + " Data=" + Data
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ PartialCommand Command
+	/// </summary>
+	public class PartialCommand : BaseDataStructure, Command
+	{
+		public const byte ID_PartialCommand = 60;
+
+		int commandId;
+		byte[] data;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " CommandId=" + CommandId
+				+ " Data=" + Data
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_PartialCommand;
-        }
-
-
-        // Properties
-
-        public int CommandId
-        {
-            get { return commandId; }
-            set { this.commandId = value; }            
-        }
-
-        public byte[] Data
-        {
-            get { return data; }
-            set { this.data = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_PartialCommand;
+		}
+
+
+		// Properties
+
+		public int CommandId
+		{
+			get { return commandId; }
+			set { this.commandId = value; }
+		}
+
+		public byte[] Data
+		{
+			get { return data; }
+			set { this.data = value; }
+		}
+
+		public bool IsMessage
+		{
+			get
+			{
+				return false;
+			}
+		}
 
-    }
+		public bool IsShutdownInfo
+		{
+			get
+			{
+				return false;
+			}
+		}
+
+		public bool IsBrokerInfo
+		{
+			get
+			{
+				return false;
+			}
+		}
+
+		public bool IsResponse
+		{
+			get
+			{
+				return false;
+			}
+		}
+
+		public virtual bool ResponseRequired
+		{
+			get
+			{
+				return false;
+			}
+			set
+			{
+				throw new ApplicationException("PartialCommand should not set ResponseRequired");
+			}
+		}
+
+		public virtual Response visit(ICommandVisitor visitor)
+		{
+			throw new ApplicationException("The transport layer should filter out PartialCommand instances but received: " + this);
+		}
+	}
 }

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerAck.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerAck.cs?rev=707747&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerAck.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerAck.cs Fri Oct 24 14:10:22 2008
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Apache.NMS.ActiveMQ.State;
+
+namespace Apache.NMS.ActiveMQ.Commands
+{
+
+	/**
+	 * A ProducerAck command is sent by a broker to a producer to let it know it has
+	 * received and processed messages that it has produced. The producer will be
+	 * flow controlled if it does not receive ProducerAck commands back from the
+	 * broker.
+	 * 
+	 */
+	public class ProducerAck : BaseCommand
+	{
+
+		protected ProducerId myProducerId;
+		protected int mySize;
+
+		public ProducerAck()
+		{
+		}
+
+		public ProducerAck(ProducerId producerId, int size)
+		{
+			this.myProducerId = producerId;
+			this.mySize = size;
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processProducerAck(this);
+		}
+
+		/**
+		 * The producer id that this ack message is destined for.
+		 * 
+		 */
+		public ProducerId ProducerId
+		{
+			get
+			{
+				return myProducerId;
+			}
+			set
+			{
+				myProducerId = value;
+			}
+		}
+
+		/**
+		 * The number of bytes that are being acked.
+		 * 
+		 */
+		public int Size
+		{
+			get
+			{
+				return mySize;
+			}
+			set
+			{
+				mySize = value;
+			}
+		}
+	}
+}

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerId.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerId.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerId.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerId.cs Fri Oct 24 14:10:22 2008
@@ -20,82 +20,96 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ProducerId Command
-    /// </summary>
-    public class ProducerId : BaseDataStructure, DataStructure
-    {
-        public const byte ID_ProducerId = 123;
-    			
-        string connectionId;
-        long value;
-        long sessionId;
-
-		public override int GetHashCode() {
-            int answer = 0;
-            answer = (answer * 37) + HashCode(ConnectionId);
-            answer = (answer * 37) + HashCode(Value);
-            answer = (answer * 37) + HashCode(SessionId);
-            return answer;
+	/// <summary>
+	///  The ActiveMQ ProducerId Command
+	/// </summary>
+	public class ProducerId : BaseDataStructure, DataStructure
+	{
+		public const byte ID_ProducerId = 123;
+
+		string connectionId;
+		long value;
+		long sessionId;
+
+		private SessionId parentId;
+
+		public SessionId ParentId
+		{
+			get
+			{
+				if(parentId == null)
+				{
+					parentId = new SessionId(this);
+				}
+				return parentId;
+			}
+		}
 
+		public override int GetHashCode()
+		{
+			int answer = 0;
+			answer = (answer * 37) + HashCode(ConnectionId);
+			answer = (answer * 37) + HashCode(Value);
+			answer = (answer * 37) + HashCode(SessionId);
+			return answer;
 		}
 
-		public override bool Equals(object that) {
-	    	if (that is ProducerId) {
-	    	    return Equals((ProducerId) that);
+		public override bool Equals(object that)
+		{
+			if(that is ProducerId)
+			{
+				return Equals((ProducerId) that);
 			}
 			return false;
-    	}
-
-		public virtual bool Equals(ProducerId that) {
-            if (! Equals(this.ConnectionId, that.ConnectionId)) return false;
-            if (! Equals(this.Value, that.Value)) return false;
-            if (! Equals(this.SessionId, that.SessionId)) return false;
-            return true;
-
 		}
 
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " Value=" + Value
-                + " SessionId=" + SessionId
-                + " ]";
-
+		public virtual bool Equals(ProducerId that)
+		{
+			if(!Equals(this.ConnectionId, that.ConnectionId))
+				return false;
+			if(!Equals(this.Value, that.Value))
+				return false;
+			if(!Equals(this.SessionId, that.SessionId))
+				return false;
+			return true;
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_ProducerId;
-        }
-
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConnectionId=" + ConnectionId
+				+ " Value=" + Value
+				+ " SessionId=" + SessionId
+				+ " ]";
+		}
 
-        // Properties
+		public override byte GetDataStructureType()
+		{
+			return ID_ProducerId;
+		}
 
-        public string ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }            
-        }
+		// Properties
 
-        public long Value
-        {
-            get { return value; }
-            set { this.value = value; }            
-        }
+		public string ConnectionId
+		{
+			get { return connectionId; }
+			set { this.connectionId = value; }
+		}
 
-        public long SessionId
-        {
-            get { return sessionId; }
-            set { this.sessionId = value; }            
-        }
+		public long Value
+		{
+			get { return value; }
+			set { this.value = value; }
+		}
 
-    }
+		public long SessionId
+		{
+			get { return sessionId; }
+			set { this.sessionId = value; }
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ProducerInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,66 +20,69 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ProducerInfo Command
-    /// </summary>
-    public class ProducerInfo : BaseCommand
-    {
-        public const byte ID_ProducerInfo = 6;
-    			
-        ProducerId producerId;
-        ActiveMQDestination destination;
-        BrokerId[] brokerPath;
-        bool dispatchAsync;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ProducerId=" + ProducerId
-                + " Destination=" + Destination
-                + " BrokerPath=" + BrokerPath
-                + " DispatchAsync=" + DispatchAsync
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ ProducerInfo Command
+	/// </summary>
+	public class ProducerInfo : BaseCommand
+	{
+		public const byte ID_ProducerInfo = 6;
+
+		ProducerId producerId;
+		ActiveMQDestination destination;
+		BrokerId[] brokerPath;
+		bool dispatchAsync;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ProducerId=" + ProducerId
+				+ " Destination=" + Destination
+				+ " BrokerPath=" + BrokerPath
+				+ " DispatchAsync=" + DispatchAsync
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_ProducerInfo;
-        }
-
-
-        // Properties
-
-        public ProducerId ProducerId
-        {
-            get { return producerId; }
-            set { this.producerId = value; }            
-        }
-
-        public ActiveMQDestination Destination
-        {
-            get { return destination; }
-            set { this.destination = value; }            
-        }
-
-        public BrokerId[] BrokerPath
-        {
-            get { return brokerPath; }
-            set { this.brokerPath = value; }            
-        }
-
-        public bool DispatchAsync
-        {
-            get { return dispatchAsync; }
-            set { this.dispatchAsync = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_ProducerInfo;
+		}
+
+
+		// Properties
+
+		public ProducerId ProducerId
+		{
+			get { return producerId; }
+			set { this.producerId = value; }
+		}
+
+		public ActiveMQDestination Destination
+		{
+			get { return destination; }
+			set { this.destination = value; }
+		}
+
+		public BrokerId[] BrokerPath
+		{
+			get { return brokerPath; }
+			set { this.brokerPath = value; }
+		}
 
-    }
+		public bool DispatchAsync
+		{
+			get { return dispatchAsync; }
+			set { this.dispatchAsync = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processAddProducer(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,42 +20,57 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ RemoveInfo Command
-    /// </summary>
-    public class RemoveInfo : BaseCommand
-    {
-        public const byte ID_RemoveInfo = 12;
-    			
-        DataStructure objectId;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ObjectId=" + ObjectId
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ RemoveInfo Command
+	/// </summary>
+	public class RemoveInfo : BaseCommand
+	{
+		public const byte ID_RemoveInfo = 12;
+
+		DataStructure objectId;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ObjectId=" + ObjectId
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_RemoveInfo;
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_RemoveInfo;
+		}
 
 
-        // Properties
+		// Properties
 
-        public DataStructure ObjectId
-        {
-            get { return objectId; }
-            set { this.objectId = value; }            
-        }
+		public DataStructure ObjectId
+		{
+			get { return objectId; }
+			set { this.objectId = value; }
+		}
 
-    }
+		public override Response visit(ICommandVisitor visitor)
+		{
+			switch(objectId.GetDataStructureType())
+			{
+				case ConnectionId.ID_ConnectionId:
+					return visitor.processRemoveConnection((ConnectionId) objectId);
+				case SessionId.ID_SessionId:
+					return visitor.processRemoveSession((SessionId) objectId);
+				case ConsumerId.ID_ConsumerId:
+					return visitor.processRemoveConsumer((ConsumerId) objectId);
+				case ProducerId.ID_ProducerId:
+					return visitor.processRemoveProducer((ProducerId) objectId);
+				default:
+					throw new IOException("Unknown remove command type: " + objectId.GetDataStructureType());
+			}
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveSubscriptionInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveSubscriptionInfo.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveSubscriptionInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/RemoveSubscriptionInfo.cs Fri Oct 24 14:10:22 2008
@@ -20,58 +20,61 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ RemoveSubscriptionInfo Command
-    /// </summary>
-    public class RemoveSubscriptionInfo : BaseCommand
-    {
-        public const byte ID_RemoveSubscriptionInfo = 9;
-
-        ConnectionId connectionId;
-        string subcriptionName;
-        string clientId;
-
-        public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " SubcriptionName=" + SubcriptionName
-                + " ClientId=" + ClientId
-                + " ]";
-
-        }
-
-        public override byte GetDataStructureType() {
-            return ID_RemoveSubscriptionInfo;
-        }
-
-
-        // Properties
-
-        public ConnectionId ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }
-        }
-
-        public string SubcriptionName
-        {
-            get { return subcriptionName; }
-            set { this.subcriptionName = value; }
-        }
-
-        public string ClientId
-        {
-            get { return clientId; }
-            set { this.clientId = value; }
-        }
-
-    }
+	/// <summary>
+	///  The ActiveMQ RemoveSubscriptionInfo Command
+	/// </summary>
+	public class RemoveSubscriptionInfo : BaseCommand
+	{
+		public const byte ID_RemoveSubscriptionInfo = 9;
+
+		ConnectionId connectionId;
+		string subcriptionName;
+		string clientId;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " ConnectionId=" + ConnectionId
+				+ " SubcriptionName=" + SubcriptionName
+				+ " ClientId=" + ClientId
+				+ " ]";
+
+		}
+
+		public override byte GetDataStructureType()
+		{
+			return ID_RemoveSubscriptionInfo;
+		}
+
+
+		// Properties
+
+		public ConnectionId ConnectionId
+		{
+			get { return connectionId; }
+			set { this.connectionId = value; }
+		}
+
+		public string SubcriptionName
+		{
+			get { return subcriptionName; }
+			set { this.subcriptionName = value; }
+		}
+
+		public string ClientId
+		{
+			get { return clientId; }
+			set { this.clientId = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return visitor.processRemoveSubscription(this);
+		}
+	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ReplayCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ReplayCommand.cs?rev=707747&r1=707746&r2=707747&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ReplayCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ReplayCommand.cs Fri Oct 24 14:10:22 2008
@@ -20,50 +20,54 @@
 //         activemq-core module
 //
 
-using System;
-using System.Collections;
 
-using Apache.NMS.ActiveMQ.OpenWire;
-using Apache.NMS.ActiveMQ.Commands;
+using Apache.NMS.ActiveMQ.State;
 
 namespace Apache.NMS.ActiveMQ.Commands
 {
-    /// <summary>
-    ///  The ActiveMQ ReplayCommand Command
-    /// </summary>
-    public class ReplayCommand : BaseCommand
-    {
-        public const byte ID_ReplayCommand = 65;
-    			
-        int firstNakNumber;
-        int lastNakNumber;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " FirstNakNumber=" + FirstNakNumber
-                + " LastNakNumber=" + LastNakNumber
-                + " ]";
+	/// <summary>
+	///  The ActiveMQ ReplayCommand Command
+	/// </summary>
+	public class ReplayCommand : BaseCommand
+	{
+		public const byte ID_ReplayCommand = 65;
+
+		int firstNakNumber;
+		int lastNakNumber;
+
+		public override string ToString()
+		{
+			return GetType().Name + "["
+				+ " FirstNakNumber=" + FirstNakNumber
+				+ " LastNakNumber=" + LastNakNumber
+				+ " ]";
 
 		}
 
-        public override byte GetDataStructureType() {
-            return ID_ReplayCommand;
-        }
-
-
-        // Properties
-
-        public int FirstNakNumber
-        {
-            get { return firstNakNumber; }
-            set { this.firstNakNumber = value; }            
-        }
-
-        public int LastNakNumber
-        {
-            get { return lastNakNumber; }
-            set { this.lastNakNumber = value; }            
-        }
+		public override byte GetDataStructureType()
+		{
+			return ID_ReplayCommand;
+		}
+
+
+		// Properties
+
+		public int FirstNakNumber
+		{
+			get { return firstNakNumber; }
+			set { this.firstNakNumber = value; }
+		}
+
+		public int LastNakNumber
+		{
+			get { return lastNakNumber; }
+			set { this.lastNakNumber = value; }
+		}
+
+		public override Response visit(ICommandVisitor visitor)
+		{
+			return null;
+		}
 
-    }
+	}
 }



Mime
View raw message