You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/03/07 03:33:12 UTC

svn commit: r383749 [6/13] - in /incubator/activemq/trunk: activemq-core/ activemq-core/src/gram/java/org/apache/activemq/openwire/tool/ activemq-core/src/gram/script/ activemq-core/src/main/java/org/apache/activemq/command/ activemq-core/src/main/java...

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs Mon Mar  6 18:32:50 2006
@@ -1,75 +1 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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 System.Collections;
-
-using ActiveMQ.OpenWire;
-using ActiveMQ.Commands;
-
-namespace ActiveMQ.Commands
-{
-    //
-    //  Marshalling code for Open Wire Format for TransactionId
-    //
-    //
-    //  NOTE!: This file is autogenerated - do not modify!
-    //         if you need to make a change, please see the Groovy scripts in the
-    //         activemq-core module
-    //
-    public class TransactionId : AbstractCommand
-    {
-        public const byte ID_TransactionId = 0;
-    			
-
-		public override int GetHashCode() {
-            int answer = 0;
-            return answer;
-
-		}
-	
-
-		public override bool Equals(object that) {
-	    	if (that is TransactionId) {
-	    	    return Equals((TransactionId) that);
-			}
-			return false;
-    	}
-    
-		public virtual bool Equals(TransactionId that) {
-            return true;
-
-		}
-	
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ]";
-
-		}
-	
-
-
-        public override byte GetDataStructureType() {
-            return ID_TransactionId;
-        }
-
-
-        // Properties
-
-    }
-}
+/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed 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 System.Collections;

using ActiveMQ.OpenWire;
using ActiveMQ.Commands;

namespace ActiveMQ.Commands
{
    //
    //  Marshalling code for Open Wire Format for TransactionId
    //
    //
    //  NOTE!: This file is autogenerated - do not modify!
    //         if you need to make a change, please see the Groovy scripts in the
    /
 /         activemq-core module
    //
    public class TransactionId : AbstractCommand, DataStructure
    {
        public const byte ID_TransactionId = 0;
    			

		public override int GetHashCode() {
            int answer = 0;
            return answer;

		}
	

		public override bool Equals(object that) {
	    	if (that is TransactionId) {
	    	    return Equals((TransactionId) that);
			}
			return false;
    	}
    
		public virtual bool Equals(TransactionId that) {
            return true;

		}
	

		public override string ToString() {
            return GetType().Name + "["
                + " ]";

		}
	


        public override byte GetDataStructureType() {
            return ID_TransactionId;
        }


        // Properties

    }
}
\ No newline at end of file

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs Mon Mar  6 18:32:50 2006
@@ -1,79 +1 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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 System.Collections;
-
-using ActiveMQ.OpenWire;
-using ActiveMQ.Commands;
-
-namespace ActiveMQ.Commands
-{
-    //
-    //  Marshalling code for Open Wire Format for TransactionInfo
-    //
-    //
-    //  NOTE!: This file is autogenerated - do not modify!
-    //         if you need to make a change, please see the Groovy scripts in the
-    //         activemq-core module
-    //
-    public class TransactionInfo : BaseCommand
-    {
-        public const byte ID_TransactionInfo = 7;
-    			
-        ConnectionId connectionId;
-        TransactionId transactionId;
-        byte type;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " ConnectionId=" + ConnectionId
-                + " TransactionId=" + TransactionId
-                + " Type=" + Type
-                + " ]";
-
-		}
-	
-
-
-        public override byte GetDataStructureType() {
-            return ID_TransactionInfo;
-        }
-
-
-        // Properties
-
-        public ConnectionId ConnectionId
-        {
-            get { return connectionId; }
-            set { this.connectionId = value; }            
-        }
-
-        public TransactionId TransactionId
-        {
-            get { return transactionId; }
-            set { this.transactionId = value; }            
-        }
-
-        public byte Type
-        {
-            get { return type; }
-            set { this.type = value; }            
-        }
-
-    }
-}
+/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed 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 System.Collections;

using ActiveMQ.OpenWire;
using ActiveMQ.Commands;

namespace ActiveMQ.Commands
{
    //
    //  Marshalling code for Open Wire Format for TransactionInfo
    //
    //
    //  NOTE!: This file is autogenerated - do not modify!
    //         if you need to make a change, please see the Groovy scripts in the
   
  //         activemq-core module
    //
    public class TransactionInfo : BaseCommand
    {
        public const byte ID_TransactionInfo = 7;
    			
        ConnectionId connectionId;
        TransactionId transactionId;
        byte type;

		public override string ToString() {
            return GetType().Name + "["
                + " ConnectionId=" + ConnectionId
                + " TransactionId=" + TransactionId
                + " Type=" + Type
                + " ]";

		}
	


        public override byte GetDataStructureType() {
            return ID_TransactionInfo;
        }


        // Properties

        public ConnectionId ConnectionId
        {
            get { return connectionId; }
            set { this.connectionId = value; }            
        }

        public TransactionId TransactionId
        {
            get { return transactionId; }
            set { this.transactionId = value; }            
        }

        public byte Type
        {
        
     get { return type; }
            set { this.type = value; }            
        }

    }
}
\ No newline at end of file

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/WireFormatInfo.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/WireFormatInfo.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/WireFormatInfo.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/WireFormatInfo.cs Mon Mar  6 18:32:50 2006
@@ -1,111 +1,124 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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 System.Collections;
-
-using ActiveMQ.OpenWire;
-using ActiveMQ.Commands;
-
-namespace ActiveMQ.Commands
-{
-    //
-    //  Marshalling code for Open Wire Format for WireFormatInfo
-    //
-    //
-    //  NOTE!: This file is autogenerated - do not modify!
-    //         if you need to make a change, please see the Groovy scripts in the
-    //         activemq-core module
-    //
-    public class WireFormatInfo : AbstractCommand
-    {
-        public const byte ID_WireFormatInfo = 1;
-    			
-        byte[] magic;
-        int version;
-        bool cacheEnabled;
-        bool stackTraceEnabled;
-        bool tcpNoDelayEnabled;
-        bool prefixPacketSize;
-        bool tightEncodingEnabled;
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " Magic=" + Magic
-                + " Version=" + Version
-                + " CacheEnabled=" + CacheEnabled
-                + " StackTraceEnabled=" + StackTraceEnabled
-                + " TcpNoDelayEnabled=" + TcpNoDelayEnabled
-                + " PrefixPacketSize=" + PrefixPacketSize
-                + " TightEncodingEnabled=" + TightEncodingEnabled
-                + " ]";
-
-		}
-	
-
-
-        public override byte GetDataStructureType() {
-            return ID_WireFormatInfo;
-        }
-
-
-        // Properties
-
-        public byte[] Magic
-        {
-            get { return magic; }
-            set { this.magic = value; }            
-        }
-
-        public int Version
-        {
-            get { return version; }
-            set { this.version = value; }            
-        }
-
-        public bool CacheEnabled
-        {
-            get { return cacheEnabled; }
-            set { this.cacheEnabled = value; }            
-        }
-
-        public bool StackTraceEnabled
-        {
-            get { return stackTraceEnabled; }
-            set { this.stackTraceEnabled = value; }            
-        }
-
-        public bool TcpNoDelayEnabled
-        {
-            get { return tcpNoDelayEnabled; }
-            set { this.tcpNoDelayEnabled = value; }            
-        }
-
-        public bool PrefixPacketSize
-        {
-            get { return prefixPacketSize; }
-            set { this.prefixPacketSize = value; }            
-        }
-
-        public bool TightEncodingEnabled
-        {
-            get { return tightEncodingEnabled; }
-            set { this.tightEncodingEnabled = value; }            
-        }
-
-    }
-}
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed 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 System.Collections;
+
+using ActiveMQ.OpenWire;
+using ActiveMQ.Commands;
+using JMS;
+
+namespace ActiveMQ.Commands
+{
+    //
+    //  Marshalling code for Open Wire Format for WireFormatInfo
+    //
+    //
+    public class WireFormatInfo : AbstractCommand, Command, MarshallAware
+    {
+        public const byte ID_WireFormatInfo = 1;
+    			
+        byte[] magic;
+        int version;
+        byte[] marshalledProperties;
+		
+        protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper();
+        private PrimitiveMap properties;
+		
+		public override string ToString() {
+            return GetType().Name + "["
+                + " Magic=" + Magic
+                + " Version=" + Version
+                + " MarshalledProperties=" + MarshalledProperties
+                + " ]";
+
+		}
+	
+        public override byte GetDataStructureType() {
+            return ID_WireFormatInfo;
+        }
+
+
+        // Properties
+        public byte[] Magic
+        {
+            get { return magic; }
+            set { this.magic = value; }
+        }
+
+        public int Version
+        {
+            get { return version; }
+            set { this.version = value; }
+        }
+
+        public byte[] MarshalledProperties
+        {
+            get { return marshalledProperties; }
+            set { this.marshalledProperties = value; }
+        }
+		
+		public IPrimitiveMap Properties
+        {
+            get {
+                if (properties == null)
+                {
+                    properties = PrimitiveMap.Unmarshal(MarshalledProperties);
+                }
+                return properties;
+            }
+        }
+
+        public bool StackTraceEnabled
+        {
+            get { return true.Equals(Properties["stackTrace"]) ; }
+            set { Properties["stackTrace"] = value; }
+        }
+        public bool TcpNoDelayEnabled
+        {
+            get { return true.Equals(Properties["tcpNoDelay"]); }
+            set { Properties["tcpNoDelay"] = value; }
+        }
+        public bool PrefixPacketSize
+        {
+            get { return true.Equals(Properties["prefixPacketSize"]); }
+            set { Properties["prefixPacketSize"] = value; }
+        }
+        public bool TightEncodingEnabled
+        {
+            get { return true.Equals(Properties["tightEncodingEnabled"]); }
+            set { Properties["tightEncodingEnabled"] = value; }
+        }
+		
+		// MarshallAware interface
+        public override bool IsMarshallAware()
+        {
+            return true;
+        }
+        
+        public override void BeforeMarshall(OpenWireFormat wireFormat)
+        {
+            MarshalledProperties = null;
+            if (properties != null)
+            {
+                MarshalledProperties = properties.Marshal();
+            }
+        }
+		
+
+    }
+}

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs Mon Mar  6 18:32:50 2006
@@ -1,105 +1 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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 System.Collections;
-
-using ActiveMQ.OpenWire;
-using ActiveMQ.Commands;
-
-namespace ActiveMQ.Commands
-{
-    //
-    //  Marshalling code for Open Wire Format for XATransactionId
-    //
-    //
-    //  NOTE!: This file is autogenerated - do not modify!
-    //         if you need to make a change, please see the Groovy scripts in the
-    //         activemq-core module
-    //
-    public class XATransactionId : TransactionId
-    {
-        public const byte ID_XATransactionId = 112;
-    			
-        int formatId;
-        byte[] globalTransactionId;
-        byte[] branchQualifier;
-
-		public override int GetHashCode() {
-            int answer = 0;
-            answer = (answer * 37) + HashCode(FormatId);
-            answer = (answer * 37) + HashCode(GlobalTransactionId);
-            answer = (answer * 37) + HashCode(BranchQualifier);
-            return answer;
-
-		}
-	
-
-		public override bool Equals(object that) {
-	    	if (that is XATransactionId) {
-	    	    return Equals((XATransactionId) that);
-			}
-			return false;
-    	}
-    
-		public virtual bool Equals(XATransactionId that) {
-            if (! Equals(this.FormatId, that.FormatId)) return false;
-            if (! Equals(this.GlobalTransactionId, that.GlobalTransactionId)) return false;
-            if (! Equals(this.BranchQualifier, that.BranchQualifier)) return false;
-            return true;
-
-		}
-	
-
-		public override string ToString() {
-            return GetType().Name + "["
-                + " FormatId=" + FormatId
-                + " GlobalTransactionId=" + GlobalTransactionId
-                + " BranchQualifier=" + BranchQualifier
-                + " ]";
-
-		}
-	
-
-
-        public override byte GetDataStructureType() {
-            return ID_XATransactionId;
-        }
-
-
-        // Properties
-
-        public int FormatId
-        {
-            get { return formatId; }
-            set { this.formatId = value; }            
-        }
-
-        public byte[] GlobalTransactionId
-        {
-            get { return globalTransactionId; }
-            set { this.globalTransactionId = value; }            
-        }
-
-        public byte[] BranchQualifier
-        {
-            get { return branchQualifier; }
-            set { this.branchQualifier = value; }            
-        }
-
-    }
-}
+/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed 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 System.Collections;

using ActiveMQ.OpenWire;
using ActiveMQ.Commands;

namespace ActiveMQ.Commands
{
    //
    //  Marshalling code for Open Wire Format for XATransactionId
    //
    //
    //  NOTE!: This file is autogenerated - do not modify!
    //         if you need to make a change, please see the Groovy scripts in the
   
  //         activemq-core module
    //
    public class XATransactionId : TransactionId, Xid
    {
        public const byte ID_XATransactionId = 112;
    			
        int formatId;
        byte[] globalTransactionId;
        byte[] branchQualifier;

		public override int GetHashCode() {
            int answer = 0;
            answer = (answer * 37) + HashCode(FormatId);
            answer = (answer * 37) + HashCode(GlobalTransactionId);
            answer = (answer * 37) + HashCode(BranchQualifier);
            return answer;

		}
	

		public override bool Equals(object that) {
	    	if (that is XATransactionId) {
	    	    return Equals((XATransactionId) that);
			}
			return false;
    	}
    
		public virtual bool Equals(XATransactionId that) {
            if (! Equals(this.FormatId, that.FormatId)) return false;
            if (! Equals(this.GlobalTransactionId, that.GlobalTransactionId)) return false;
            if (! Equals(this.BranchQualifier, that.BranchQualifier)
 ) return false;
            return true;

		}
	

		public override string ToString() {
            return GetType().Name + "["
                + " FormatId=" + FormatId
                + " GlobalTransactionId=" + GlobalTransactionId
                + " BranchQualifier=" + BranchQualifier
                + " ]";

		}
	


        public override byte GetDataStructureType() {
            return ID_XATransactionId;
        }


        // Properties

        public int FormatId
        {
            get { return formatId; }
            set { this.formatId = value; }            
        }

        public byte[] GlobalTransactionId
        {
            get { return globalTransactionId; }
            set { this.globalTransactionId = value; }            
        }

        public byte[] BranchQualifier
        {
            get { return branchQualifier; }
            set { this.branchQualifier = value; }            
        }

    }
}
\ No newline at end of file

Added: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Xid.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Xid.cs?rev=383749&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Xid.cs (added)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Xid.cs Mon Mar  6 18:32:50 2006
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+namespace ActiveMQ.Commands
+{
+	public interface Xid
+	{
+	}
+}

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BaseDataStreamMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BaseDataStreamMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BaseDataStreamMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BaseDataStreamMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -1,789 +1,750 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 ActiveMQ.Commands;
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-
-namespace ActiveMQ.OpenWire
-
-{
-    /// <summary>
-    /// A base class with useful implementation inheritence methods
-    /// for creating marshallers of the OpenWire protocol
-    /// </summary>
-    public abstract class BaseDataStreamMarshaller
-    {
-        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;
-        
-        private static String[] HEX_TABLE = new String[]{
-            "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
-            "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
-            "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f",
-            "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f",
-            "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f",
-            "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f",
-            "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f",
-            "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f",
-            "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f",
-            "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f",
-            "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af",
-            "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf",
-            "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf",
-            "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df",
-            "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef",
-            "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff",
-        };
-        
-        public abstract DataStructure CreateObject();
-        public abstract byte GetDataStructureType();
-        
-        public virtual int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs)
-        {
-            return 0;
-        }
-        public virtual void TightMarshal2(
-            OpenWireFormat wireFormat,
-            Object o,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-        }
-        
-        public virtual void TightUnmarshal(
-            OpenWireFormat wireFormat,
-            Object o,
-            BinaryReader dataIn,
-            BooleanStream bs)
-        {
-        }
-        
-        
-        protected virtual DataStructure TightUnmarshalNestedObject(
-            OpenWireFormat wireFormat,
-            BinaryReader dataIn,
-            BooleanStream bs)
-        {
-            return wireFormat.TightUnmarshalNestedObject(dataIn, bs);
-        }
-        
-        protected virtual int TightMarshalNestedObject1(
-            OpenWireFormat wireFormat,
-            DataStructure o,
-            BooleanStream bs)
-        {
-            return wireFormat.TightMarshalNestedObject1(o, bs);
-        }
-        
-        protected virtual void TightMarshalNestedObject2(
-            OpenWireFormat wireFormat,
-            DataStructure o,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-            wireFormat.TightMarshalNestedObject2(o, dataOut, bs);
-        }
-        
-        protected virtual DataStructure TightUnmarshalCachedObject(
-            OpenWireFormat wireFormat,
-            BinaryReader dataIn,
-            BooleanStream bs)
-        {
-            /*
-             if (wireFormat.isCacheEnabled()) {
-             if (bs.ReadBoolean()) {
-             short index = dataIndataIn.ReadInt16()Int16();
-             DataStructure value = wireFormat.UnmarshalNestedObject(dataIn, bs);
-             wireFormat.setInUnmarshallCache(index, value);
-             return value;
-             } else {
-             short index = dataIn.ReadInt16();
-             return wireFormat.getFromUnmarshallCache(index);
-             }
-             } else {
-             return wireFormat.UnmarshalNestedObject(dataIn, bs);
-             }
-             */
-            return wireFormat.TightUnmarshalNestedObject(dataIn, bs);
-        }
-        
-        protected virtual int TightMarshalCachedObject1(
-            OpenWireFormat wireFormat,
-            DataStructure o,
-            BooleanStream bs)
-        {
-            /*
-             if (wireFormat.isCacheEnabled()) {
-             Short index = wireFormat.getMarshallCacheIndex(o);
-             bs.WriteBoolean(index == null);
-             if (index == null) {
-             int rc = wireFormat.Marshal1NestedObject(o, bs);
-             wireFormat.addToMarshallCache(o);
-             return 2 + rc;
-             } else {
-             return 2;
-             }
-             } else {
-             return wireFormat.Marshal1NestedObject(o, bs);
-             }
-             */
-            return wireFormat.TightMarshalNestedObject1(o, bs);
-        }
-        
-        protected virtual void TightMarshalCachedObject2(
-            OpenWireFormat wireFormat,
-            DataStructure o,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-            /*
-             if (wireFormat.isCacheEnabled()) {
-             Short index = wireFormat.getMarshallCacheIndex(o);
-             if (bs.ReadBoolean()) {
-             dataOut.Write(index.shortValue(), dataOut);
-             wireFormat.Marshal2NestedObject(o, dataOut, bs);
-             } else {
-             dataOut.Write(index.shortValue(), dataOut);
-             }
-             } else {
-             wireFormat.Marshal2NestedObject(o, dataOut, bs);
-             }
-             */
-            wireFormat.TightMarshalNestedObject2(o, dataOut, bs);
-        }
-        
-        
-        
-        protected virtual String TightUnmarshalString(BinaryReader dataIn, BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                if (bs.ReadBoolean())
-                {
-                    return ReadAsciiString(dataIn);
-                }
-                else
-                {
-                    return dataIn.ReadString();
-                }
-            }
-            else
-            {
-                return null;
-            }
-        }
-        
-        protected virtual String ReadAsciiString(BinaryReader dataIn)
-        {
-            int size = dataIn.ReadInt16();
-            byte[] data = new byte[size];
-            dataIn.Read(data, 0, size);
-            char[] text = new char[size];
-            for (int i = 0; i < size; i++)
-            {
-                text[i] = (char) data[i];
-            }
-            return new String(text);
-        }
-        
-        protected virtual int TightMarshalString1(String value, BooleanStream bs)
-        {
-            bs.WriteBoolean(value != null);
-            if (value != null)
-            {
-                int strlen = value.Length;
-                
-				int utflen = 0;
-				int c = 0;
-				bool isOnlyAscii = true;
-				char[] charr = value.ToCharArray();
-				for (int i = 0; i < strlen; i++)
-				{
-					c = charr[i];
-					if ((c >= 0x0001) && (c <= 0x007F))
-					{
-						utflen++;
-					}
-					else if (c > 0x07FF)
-					{
-						utflen += 3;
-						isOnlyAscii = false;
-					}
-					else
-					{
-						isOnlyAscii = false;
-						utflen += 2;
-					}
-				}
-				
-				if (utflen >= Int16.MaxValue)
-					throw new IOException("Encountered a String value that is too long to encode.");
-				
-				bs.WriteBoolean(isOnlyAscii);
-				return utflen + 2;
-            }
-            else
-            {
-                return 0;
-            }
-        }
-        
-        public static void TightMarshalString2(String value, BinaryWriter dataOut, BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                // If we verified it only holds ascii values
-                if (bs.ReadBoolean())
-                {
-                    dataOut.Write((short) value.Length);
-                    // now lets write the bytes
-                    char[] chars = value.ToCharArray();
-                    for (int i = 0; i < chars.Length; i++)
-                    {
-                        dataOut.Write((byte)(chars[i]&0xFF00>>8));
-                    }
-                }
-                else
-                {
-                    dataOut.Write(value);
-                }
-            }
-        }
-                
-        public virtual int TightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs)
-        {
-            if (o == 0L)
-            {
-                bs.WriteBoolean(false);
-                bs.WriteBoolean(false);
-                return 0;
-            }
-            else
-            {
-                ulong ul = (ulong) o;
-                if ((ul & 0xFFFFFFFFFFFF0000ul) == 0L)
-                {
-                    bs.WriteBoolean(false);
-                    bs.WriteBoolean(true);
-                    return 2;
-                }
-                else if ((ul & 0xFFFFFFFF00000000ul) == 0L)
-                {
-                    bs.WriteBoolean(true);
-                    bs.WriteBoolean(false);
-                    return 4;
-                }
-                else
-                {
-                    bs.WriteBoolean(true);
-                    bs.WriteBoolean(true);
-                    return 8;
-                }
-            }
-        }
-        
-        public virtual void TightMarshalLong2(
-            OpenWireFormat wireFormat,
-            long o,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                if (bs.ReadBoolean())
-                {
-                    dataOut.Write(o);
-                }
-                else
-                {
-                    dataOut.Write((int)o);
-                }
-            }
-            else
-            {
-                if (bs.ReadBoolean())
-                {
-                    dataOut.Write((short)o);
-                }
-            }
-        }
-        public virtual long TightUnmarshalLong(OpenWireFormat wireFormat, BinaryReader dataIn, BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                if (bs.ReadBoolean())
-                {
-                    return dataIn.ReadInt64(); // dataIn.ReadInt64();
-                }
-                else
-                {
-                    return dataIn.ReadInt32();
-                }
-            }
-            else
-            {
-                if (bs.ReadBoolean())
-                {
-                    return dataIn.ReadInt16();
-                }
-                else
-                {
-                    return 0;
-                }
-            }
-        }
-        protected virtual int TightMarshalObjectArray1(
-            OpenWireFormat wireFormat,
-            DataStructure[] objects,
-            BooleanStream bs)
-        {
-            if (objects != null)
-            {
-                int rc = 0;
-                bs.WriteBoolean(true);
-                rc += 2;
-                for (int i = 0; i < objects.Length; i++)
-                {
-                    rc += TightMarshalNestedObject1(wireFormat, objects[i], bs);
-                }
-                return rc;
-            }
-            else
-            {
-                bs.WriteBoolean(false);
-                return 0;
-            }
-        }
-        
-        protected virtual void TightMarshalObjectArray2(
-            OpenWireFormat wireFormat,
-            DataStructure[] objects,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                dataOut.Write((short) objects.Length);
-                for (int i = 0; i < objects.Length; i++)
-                {
-                    TightMarshalNestedObject2(wireFormat, objects[i], dataOut, bs);
-                }
-            }
-        }
-        
-        protected virtual byte[] ReadBytes(BinaryReader dataIn, bool flag)
-        {
-            if (flag)
-            {
-                int size = dataIn.ReadInt32();
-                return dataIn.ReadBytes(size);
-            }
-            else
-            {
-                return null;
-            }
-        }
-        
-        protected virtual byte[] ReadBytes(BinaryReader dataIn)
-        {
-            int size = dataIn.ReadInt32();
-            return dataIn.ReadBytes(size);
-        }
-        
-        protected virtual byte[] ReadBytes(BinaryReader dataIn, int size)
-        {
-            return dataIn.ReadBytes(size);
-        }
-        
-        protected virtual void WriteBytes(byte[] command, BinaryWriter dataOut)
-        {
-            dataOut.Write(command.Length);
-            dataOut.Write(command);
-        }
-        
-        protected virtual BrokerError TightUnmarshalBrokerError(
-            OpenWireFormat wireFormat,
-            BinaryReader dataIn,
-            BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                BrokerError answer = new BrokerError();
-                
-                answer.ExceptionClass = TightUnmarshalString(dataIn, bs);
-                answer.Message = TightUnmarshalString(dataIn, bs);
-                if (wireFormat.StackTraceEnabled)
-                {
-                    short length = dataIn.ReadInt16();
-                    StackTraceElement[] stackTrace = new StackTraceElement[length];
-                    for (int i = 0; i < stackTrace.Length; i++)
-                    {
-                        StackTraceElement element = new StackTraceElement();
-                        element.ClassName = TightUnmarshalString(dataIn, bs);
-                        element.MethodName = TightUnmarshalString(dataIn, bs);
-                        element.FileName = TightUnmarshalString(dataIn, bs);
-                        element.LineNumber = dataIn.ReadInt32();
-                        stackTrace[i] = element;
-                    }
-                    answer.StackTraceElements = stackTrace;
-                    answer.Cause = TightUnmarshalBrokerError(wireFormat, dataIn, bs);
-                }
-                return answer;
-            }
-            else
-            {
-                return null;
-            }
-        }
-        
-        protected int TightMarshalBrokerError1(OpenWireFormat wireFormat, BrokerError o, BooleanStream bs)
-        {
-            if (o == null)
-            {
-                bs.WriteBoolean(false);
-                return 0;
-            }
-            else
-            {
-                int rc = 0;
-                bs.WriteBoolean(true);
-                rc += TightMarshalString1(o.ExceptionClass, bs);
-                rc += TightMarshalString1(o.Message, bs);
-                if (wireFormat.StackTraceEnabled)
-                {
-                    rc += 2;
-                    StackTraceElement[] stackTrace = o.StackTraceElements;
-                    for (int i = 0; i < stackTrace.Length; i++)
-                    {
-                        StackTraceElement element = stackTrace[i];
-                        rc += TightMarshalString1(element.ClassName, bs);
-                        rc += TightMarshalString1(element.MethodName, bs);
-                        rc += TightMarshalString1(element.FileName, bs);
-                        rc += 4;
-                    }
-                    rc += TightMarshalBrokerError1(wireFormat, o.Cause, bs);
-                }
-                
-                return rc;
-            }
-        }
-        
-        protected void TightMarshalBrokerError2(
-            OpenWireFormat wireFormat,
-            BrokerError o,
-            BinaryWriter dataOut,
-            BooleanStream bs)
-        {
-            if (bs.ReadBoolean())
-            {
-                TightMarshalString2(o.ExceptionClass, dataOut, bs);
-                TightMarshalString2(o.Message, dataOut, bs);
-                if (wireFormat.StackTraceEnabled)
-                {
-                    StackTraceElement[] stackTrace = o.StackTraceElements;
-                    dataOut.Write((short) stackTrace.Length);
-                    
-                    for (int i = 0; i < stackTrace.Length; i++)
-                    {
-                        StackTraceElement element = stackTrace[i];
-                        TightMarshalString2(element.ClassName, dataOut, bs);
-                        TightMarshalString2(element.MethodName, dataOut, bs);
-                        TightMarshalString2(element.FileName, dataOut, bs);
-                        dataOut.Write(element.LineNumber);
-                    }
-                    TightMarshalBrokerError2(wireFormat, o.Cause, dataOut, bs);
-                }
-            }
-        }
-        
-        /// <summary>
-        /// Marshals the primitive type map to a byte array
-        /// </summary>
-        public static byte[] MarshalPrimitiveMap(IDictionary map)
-        {
-            if (map == null)
-            {
-                return null;
-            }
-            else
-            {
-                MemoryStream memoryStream = new MemoryStream();
-                MarshalPrimitiveMap(map, new OpenWireBinaryWriter(memoryStream));
-                return memoryStream.GetBuffer();
-            }
-        }
-        public static void MarshalPrimitiveMap(IDictionary map, BinaryWriter dataOut)
-        {
-            if (map == null)
-            {
-                dataOut.Write((int)-1);
-            }
-            else
-            {
-                dataOut.Write(map.Count);
-                foreach (DictionaryEntry entry in map)
-                {
-                    String name = (String) entry.Key;
-                    dataOut.Write(name);
-                    Object value = entry.Value;
-                    MarshalPrimitive(dataOut, value);
-                }
-            }}
-        
-        
-        
-        /// <summary>
-        /// Unmarshals the primitive type map from the given byte array
-        /// </summary>
-        public static  IDictionary UnmarshalPrimitiveMap(byte[] data)
-        {
-            if (data == null)
-            {
-                return new Hashtable();
-            }
-            else
-            {
-                return UnmarshalPrimitiveMap(new OpenWireBinaryReader(new MemoryStream(data)));
-            }
-        }
-        
-        public static  IDictionary UnmarshalPrimitiveMap(BinaryReader dataIn)
-        {
-            int size = dataIn.ReadInt32();
-            if (size < 0)
-            {
-                return null;
-            }
-            else
-            {
-                IDictionary answer = new Hashtable(size);
-                for (int i=0; i < size; i++)
-                {
-                    String name = dataIn.ReadString();
-                    answer[name] = UnmarshalPrimitive(dataIn);
-                }
-                return answer;
-            }
-            
-        }
-        
-        public static void MarshalPrimitive(BinaryWriter dataOut, Object value)
-        {
-            if (value == null)
-            {
-                dataOut.Write(NULL);
-            }
-            else if (value is bool)
-            {
-                dataOut.Write(BOOLEAN_TYPE);
-                dataOut.Write((bool) value);
-            }
-            else if (value is byte)
-            {
-                dataOut.Write(BYTE_TYPE);
-                dataOut.Write(((Byte)value));
-            }
-            else if (value is char)
-            {
-                dataOut.Write(CHAR_TYPE);
-                dataOut.Write((char) value);
-            }
-            else if (value is short)
-            {
-                dataOut.Write(SHORT_TYPE);
-                dataOut.Write((short) value);
-            }
-            else if (value is int)
-            {
-                dataOut.Write(INTEGER_TYPE);
-                dataOut.Write((int) value);
-            }
-            else if (value is long)
-            {
-                dataOut.Write(LONG_TYPE);
-                dataOut.Write((long) value);
-            }
-            else if (value is float)
-            {
-                dataOut.Write(FLOAT_TYPE);
-                dataOut.Write((float) value);
-            }
-            else if (value is double)
-            {
-                dataOut.Write(DOUBLE_TYPE);
-                dataOut.Write((double) value);
-            }
-            else if (value is byte[])
-            {
-                byte[] data = (byte[]) value;
-                dataOut.Write(BYTE_ARRAY_TYPE);
-                dataOut.Write(data.Length);
-                dataOut.Write(data);
-            }
-            else if (value is string)
-            {
-                dataOut.Write(STRING_TYPE);
-                dataOut.Write((string) value);
-            }
-            else
-            {
-                throw new IOException("Object is not a primitive: " + value);
-            }
-        }
-        
-        public static Object UnmarshalPrimitive(BinaryReader dataIn)
-        {
-            Object value=null;
-            switch (dataIn.ReadByte())
-            {
-                case BYTE_TYPE:
-                    value = dataIn.ReadByte();
-                    break;
-                case BOOLEAN_TYPE:
-                    value = dataIn.ReadBoolean();
-                    break;
-                case CHAR_TYPE:
-                    value = dataIn.ReadChar();
-                    break;
-                case SHORT_TYPE:
-                    value = dataIn.ReadInt16();
-                    break;
-                case INTEGER_TYPE:
-                    value = dataIn.ReadInt32();
-                    break;
-                case LONG_TYPE:
-                    value = dataIn.ReadInt64();
-                    break;
-                case FLOAT_TYPE:
-                    value = ReadFloat(dataIn);
-                    break;
-                case DOUBLE_TYPE:
-                    value = ReadDouble(dataIn);
-                    break;
-                case BYTE_ARRAY_TYPE:
-                    int size = dataIn.ReadInt32();
-                    byte[] data = new byte[size];
-                    dataIn.Read(data, 0, size);
-                    value = data;
-                    break;
-                case STRING_TYPE:
-                    value = dataIn.ReadString();
-                    break;
-            }
-            return value;
-        }
-        
-        private static Object ReadDouble(BinaryReader dataIn)
-        {
-            // TODO: Implement this method
-            return dataIn.ReadDouble();
-        }
-        
-        /// <summary>
-        /// Method ReadFloat
-        /// </summary>
-        private static Object ReadFloat(BinaryReader dataIn)
-        {
-            // TODO: Implement this method
-            return (float) dataIn.ReadDouble();
-        }
-        
-        private static Object ReadBoolean(BinaryReader dataIn)
-        {
-            // TODO: Implement this method
-            return dataIn.ReadBoolean();
-        }
-        
-        private static void WriteDouble(double value, BinaryWriter dataOut)
-        {
-            // TODO: Implement this method
-            dataOut.Write(value);
-        }
-        
-        private static void WriteFloat(float value, BinaryWriter dataOut)
-        {
-            // TODO: Implement this method
-            dataOut.Write(value);
-        }
-        
-        private static void WriteBoolean(bool value, BinaryWriter dataOut)
-        {
-            // TODO: Implement this method
-            dataOut.Write(value);
-        }
-        
-        /// <summary>
-        /// Converts the object to a String
-        /// </summary>
-        public static string ToString(MessageId id)
-        {
-            return ToString(id.ProducerId) + ":" + id.ProducerSequenceId;
-        }
-        /// <summary>
-        /// Converts the object to a String
-        /// </summary>
-        public static string ToString(ProducerId id)
-        {
-            return id.ConnectionId + ":" + id.SessionId + ":" + id.Value;
-        }
-        
-        
-        /// <summary>
-        /// Converts the given transaction ID into a String
-        /// </summary>
-        public static String ToString(TransactionId txnId)
-        {
-            if (txnId is LocalTransactionId)
-            {
-                LocalTransactionId ltxnId = (LocalTransactionId) txnId;
-                return "" + ltxnId.Value;
-            }
-            else if (txnId is XATransactionId)
-            {
-                XATransactionId xaTxnId = (XATransactionId) txnId;
-                return "XID:" + xaTxnId.FormatId + ":" + ToHexFromBytes(xaTxnId.GlobalTransactionId) + ":" + ToHexFromBytes(xaTxnId.BranchQualifier);
-            }
-            return null;
-        }
-        
-        /// <summary>
-        /// Creates the byte array into hexidecimal
-        /// </summary>
-        public static String ToHexFromBytes(byte[] data)
-        {
-            StringBuilder buffer = new StringBuilder(data.Length * 2);
-            for (int i = 0; i < data.Length; i++)
-            {
-                buffer.Append(HEX_TABLE[0xFF & data[i]]);
-            }
-            return buffer.ToString();
-        }
-        
-    }
-}
-
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 ActiveMQ.Commands;
+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+
+namespace ActiveMQ.OpenWire
+
+{
+    /// <summary>
+    /// A base class with useful implementation inheritence methods
+    /// for creating marshallers of the OpenWire protocol
+    /// </summary>
+    public abstract class BaseDataStreamMarshaller
+    {
+        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;
+        
+        private static String[] HEX_TABLE = new String[]{
+            "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
+            "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
+            "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f",
+            "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f",
+            "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f",
+            "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f",
+            "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f",
+            "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f",
+            "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f",
+            "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f",
+            "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af",
+            "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf",
+            "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf",
+            "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df",
+            "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef",
+            "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff",
+        };
+        
+        public abstract DataStructure CreateObject();
+        public abstract byte GetDataStructureType();
+        
+        public virtual int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs)
+        {
+            return 0;
+        }
+        public virtual void TightMarshal2(
+            OpenWireFormat wireFormat,
+            Object o,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+        }
+        
+        public virtual void TightUnmarshal(
+            OpenWireFormat wireFormat,
+            Object o,
+            BinaryReader dataIn,
+            BooleanStream bs)
+        {
+        }
+        
+        
+        protected virtual DataStructure TightUnmarshalNestedObject(
+            OpenWireFormat wireFormat,
+            BinaryReader dataIn,
+            BooleanStream bs)
+        {
+            return wireFormat.TightUnmarshalNestedObject(dataIn, bs);
+        }
+        
+        protected virtual int TightMarshalNestedObject1(
+            OpenWireFormat wireFormat,
+            DataStructure o,
+            BooleanStream bs)
+        {
+            return wireFormat.TightMarshalNestedObject1(o, bs);
+        }
+        
+        protected virtual void TightMarshalNestedObject2(
+            OpenWireFormat wireFormat,
+            DataStructure o,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+            wireFormat.TightMarshalNestedObject2(o, dataOut, bs);
+        }
+        
+        protected virtual DataStructure TightUnmarshalCachedObject(
+            OpenWireFormat wireFormat,
+            BinaryReader dataIn,
+            BooleanStream bs)
+        {
+            /*
+             if (wireFormat.isCacheEnabled()) {
+             if (bs.ReadBoolean()) {
+             short index = dataIndataIn.ReadInt16()Int16();
+             DataStructure value = wireFormat.UnmarshalNestedObject(dataIn, bs);
+             wireFormat.setInUnmarshallCache(index, value);
+             return value;
+             } else {
+             short index = dataIn.ReadInt16();
+             return wireFormat.getFromUnmarshallCache(index);
+             }
+             } else {
+             return wireFormat.UnmarshalNestedObject(dataIn, bs);
+             }
+             */
+            return wireFormat.TightUnmarshalNestedObject(dataIn, bs);
+        }
+        
+        protected virtual int TightMarshalCachedObject1(
+            OpenWireFormat wireFormat,
+            DataStructure o,
+            BooleanStream bs)
+        {
+            /*
+             if (wireFormat.isCacheEnabled()) {
+             Short index = wireFormat.getMarshallCacheIndex(o);
+             bs.WriteBoolean(index == null);
+             if (index == null) {
+             int rc = wireFormat.Marshal1NestedObject(o, bs);
+             wireFormat.addToMarshallCache(o);
+             return 2 + rc;
+             } else {
+             return 2;
+             }
+             } else {
+             return wireFormat.Marshal1NestedObject(o, bs);
+             }
+             */
+            return wireFormat.TightMarshalNestedObject1(o, bs);
+        }
+        
+        protected virtual void TightMarshalCachedObject2(
+            OpenWireFormat wireFormat,
+            DataStructure o,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+            /*
+             if (wireFormat.isCacheEnabled()) {
+             Short index = wireFormat.getMarshallCacheIndex(o);
+             if (bs.ReadBoolean()) {
+             dataOut.Write(index.shortValue(), dataOut);
+             wireFormat.Marshal2NestedObject(o, dataOut, bs);
+             } else {
+             dataOut.Write(index.shortValue(), dataOut);
+             }
+             } else {
+             wireFormat.Marshal2NestedObject(o, dataOut, bs);
+             }
+             */
+            wireFormat.TightMarshalNestedObject2(o, dataOut, bs);
+        }
+        
+        
+        
+        protected virtual String TightUnmarshalString(BinaryReader dataIn, BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                if (bs.ReadBoolean())
+                {
+                    return ReadAsciiString(dataIn);
+                }
+                else
+                {
+                    return dataIn.ReadString();
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+        
+        protected virtual String ReadAsciiString(BinaryReader dataIn)
+        {
+            int size = dataIn.ReadInt16();
+            byte[] data = new byte[size];
+            dataIn.Read(data, 0, size);
+            char[] text = new char[size];
+            for (int i = 0; i < size; i++)
+            {
+                text[i] = (char) data[i];
+            }
+            return new String(text);
+        }
+        
+        protected virtual int TightMarshalString1(String value, BooleanStream bs)
+        {
+            bs.WriteBoolean(value != null);
+            if (value != null)
+            {
+                int strlen = value.Length;
+                
+				int utflen = 0;
+				int c = 0;
+				bool isOnlyAscii = true;
+				char[] charr = value.ToCharArray();
+				for (int i = 0; i < strlen; i++)
+				{
+					c = charr[i];
+					if ((c >= 0x0001) && (c <= 0x007F))
+					{
+						utflen++;
+					}
+					else if (c > 0x07FF)
+					{
+						utflen += 3;
+						isOnlyAscii = false;
+					}
+					else
+					{
+						isOnlyAscii = false;
+						utflen += 2;
+					}
+				}
+				
+				if (utflen >= Int16.MaxValue)
+					throw new IOException("Encountered a String value that is too long to encode.");
+				
+				bs.WriteBoolean(isOnlyAscii);
+				return utflen + 2;
+            }
+            else
+            {
+                return 0;
+            }
+        }
+        
+        public static void TightMarshalString2(String value, BinaryWriter dataOut, BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                // If we verified it only holds ascii values
+                if (bs.ReadBoolean())
+                {
+                    dataOut.Write((short) value.Length);
+                    // now lets write the bytes
+                    char[] chars = value.ToCharArray();
+                    for (int i = 0; i < chars.Length; i++)
+                    {
+                        dataOut.Write((byte)(chars[i]&0xFF00>>8));
+                    }
+                }
+                else
+                {
+                    dataOut.Write(value);
+                }
+            }
+        }
+                
+        public virtual int TightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs)
+        {
+            if (o == 0L)
+            {
+                bs.WriteBoolean(false);
+                bs.WriteBoolean(false);
+                return 0;
+            }
+            else
+            {
+                ulong ul = (ulong) o;
+                if ((ul & 0xFFFFFFFFFFFF0000ul) == 0L)
+                {
+                    bs.WriteBoolean(false);
+                    bs.WriteBoolean(true);
+                    return 2;
+                }
+                else if ((ul & 0xFFFFFFFF00000000ul) == 0L)
+                {
+                    bs.WriteBoolean(true);
+                    bs.WriteBoolean(false);
+                    return 4;
+                }
+                else
+                {
+                    bs.WriteBoolean(true);
+                    bs.WriteBoolean(true);
+                    return 8;
+                }
+            }
+        }
+        
+        public virtual void TightMarshalLong2(
+            OpenWireFormat wireFormat,
+            long o,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                if (bs.ReadBoolean())
+                {
+                    dataOut.Write(o);
+                }
+                else
+                {
+                    dataOut.Write((int)o);
+                }
+            }
+            else
+            {
+                if (bs.ReadBoolean())
+                {
+                    dataOut.Write((short)o);
+                }
+            }
+        }
+        public virtual long TightUnmarshalLong(OpenWireFormat wireFormat, BinaryReader dataIn, BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                if (bs.ReadBoolean())
+                {
+                    return dataIn.ReadInt64(); // dataIn.ReadInt64();
+                }
+                else
+                {
+                    return dataIn.ReadInt32();
+                }
+            }
+            else
+            {
+                if (bs.ReadBoolean())
+                {
+                    return dataIn.ReadInt16();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+        }
+        protected virtual int TightMarshalObjectArray1(
+            OpenWireFormat wireFormat,
+            DataStructure[] objects,
+            BooleanStream bs)
+        {
+            if (objects != null)
+            {
+                int rc = 0;
+                bs.WriteBoolean(true);
+                rc += 2;
+                for (int i = 0; i < objects.Length; i++)
+                {
+                    rc += TightMarshalNestedObject1(wireFormat, objects[i], bs);
+                }
+                return rc;
+            }
+            else
+            {
+                bs.WriteBoolean(false);
+                return 0;
+            }
+        }
+        
+        protected virtual void TightMarshalObjectArray2(
+            OpenWireFormat wireFormat,
+            DataStructure[] objects,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                dataOut.Write((short) objects.Length);
+                for (int i = 0; i < objects.Length; i++)
+                {
+                    TightMarshalNestedObject2(wireFormat, objects[i], dataOut, bs);
+                }
+            }
+        }
+        
+        protected virtual byte[] ReadBytes(BinaryReader dataIn, bool flag)
+        {
+            if (flag)
+            {
+                int size = dataIn.ReadInt32();
+                return dataIn.ReadBytes(size);
+            }
+            else
+            {
+                return null;
+            }
+        }
+        
+        protected virtual byte[] ReadBytes(BinaryReader dataIn)
+        {
+            int size = dataIn.ReadInt32();
+            return dataIn.ReadBytes(size);
+        }
+        
+        protected virtual byte[] ReadBytes(BinaryReader dataIn, int size)
+        {
+            return dataIn.ReadBytes(size);
+        }
+        
+        protected virtual void WriteBytes(byte[] command, BinaryWriter dataOut)
+        {
+            dataOut.Write(command.Length);
+            dataOut.Write(command);
+        }
+        
+        protected virtual BrokerError TightUnmarshalBrokerError(
+            OpenWireFormat wireFormat,
+            BinaryReader dataIn,
+            BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                BrokerError answer = new BrokerError();
+                
+                answer.ExceptionClass = TightUnmarshalString(dataIn, bs);
+                answer.Message = TightUnmarshalString(dataIn, bs);
+                if (wireFormat.StackTraceEnabled)
+                {
+                    short length = dataIn.ReadInt16();
+                    StackTraceElement[] stackTrace = new StackTraceElement[length];
+                    for (int i = 0; i < stackTrace.Length; i++)
+                    {
+                        StackTraceElement element = new StackTraceElement();
+                        element.ClassName = TightUnmarshalString(dataIn, bs);
+                        element.MethodName = TightUnmarshalString(dataIn, bs);
+                        element.FileName = TightUnmarshalString(dataIn, bs);
+                        element.LineNumber = dataIn.ReadInt32();
+                        stackTrace[i] = element;
+                    }
+                    answer.StackTraceElements = stackTrace;
+                    answer.Cause = TightUnmarshalBrokerError(wireFormat, dataIn, bs);
+                }
+                return answer;
+            }
+            else
+            {
+                return null;
+            }
+        }
+        
+        protected int TightMarshalBrokerError1(OpenWireFormat wireFormat, BrokerError o, BooleanStream bs)
+        {
+            if (o == null)
+            {
+                bs.WriteBoolean(false);
+                return 0;
+            }
+            else
+            {
+                int rc = 0;
+                bs.WriteBoolean(true);
+                rc += TightMarshalString1(o.ExceptionClass, bs);
+                rc += TightMarshalString1(o.Message, bs);
+                if (wireFormat.StackTraceEnabled)
+                {
+                    rc += 2;
+                    StackTraceElement[] stackTrace = o.StackTraceElements;
+                    for (int i = 0; i < stackTrace.Length; i++)
+                    {
+                        StackTraceElement element = stackTrace[i];
+                        rc += TightMarshalString1(element.ClassName, bs);
+                        rc += TightMarshalString1(element.MethodName, bs);
+                        rc += TightMarshalString1(element.FileName, bs);
+                        rc += 4;
+                    }
+                    rc += TightMarshalBrokerError1(wireFormat, o.Cause, bs);
+                }
+                
+                return rc;
+            }
+        }
+        
+        protected void TightMarshalBrokerError2(
+            OpenWireFormat wireFormat,
+            BrokerError o,
+            BinaryWriter dataOut,
+            BooleanStream bs)
+        {
+            if (bs.ReadBoolean())
+            {
+                TightMarshalString2(o.ExceptionClass, dataOut, bs);
+                TightMarshalString2(o.Message, dataOut, bs);
+                if (wireFormat.StackTraceEnabled)
+                {
+                    StackTraceElement[] stackTrace = o.StackTraceElements;
+                    dataOut.Write((short) stackTrace.Length);
+                    
+                    for (int i = 0; i < stackTrace.Length; i++)
+                    {
+                        StackTraceElement element = stackTrace[i];
+                        TightMarshalString2(element.ClassName, dataOut, bs);
+                        TightMarshalString2(element.MethodName, dataOut, bs);
+                        TightMarshalString2(element.FileName, dataOut, bs);
+                        dataOut.Write(element.LineNumber);
+                    }
+                    TightMarshalBrokerError2(wireFormat, o.Cause, dataOut, bs);
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Marshals the primitive type map to a byte array
+        /// </summary>
+        public static byte[] MarshalPrimitiveMap(IDictionary map)
+        {
+            if (map == null)
+            {
+                return null;
+            }
+            else
+            {
+                MemoryStream memoryStream = new MemoryStream();
+                MarshalPrimitiveMap(map, new OpenWireBinaryWriter(memoryStream));
+                return memoryStream.GetBuffer();
+            }
+        }
+        public static void MarshalPrimitiveMap(IDictionary map, BinaryWriter dataOut)
+        {
+            if (map == null)
+            {
+                dataOut.Write((int)-1);
+            }
+            else
+            {
+                dataOut.Write(map.Count);
+                foreach (DictionaryEntry entry in map)
+                {
+                    String name = (String) entry.Key;
+                    dataOut.Write(name);
+                    Object value = entry.Value;
+                    MarshalPrimitive(dataOut, value);
+                }
+            }}
+        
+        
+        
+        /// <summary>
+        /// Unmarshals the primitive type map from the given byte array
+        /// </summary>
+        public static  IDictionary UnmarshalPrimitiveMap(byte[] data)
+        {
+            if (data == null)
+            {
+                return new Hashtable();
+            }
+            else
+            {
+                return UnmarshalPrimitiveMap(new OpenWireBinaryReader(new MemoryStream(data)));
+            }
+        }
+        
+        public static  IDictionary UnmarshalPrimitiveMap(BinaryReader dataIn)
+        {
+            int size = dataIn.ReadInt32();
+            if (size < 0)
+            {
+                return null;
+            }
+            else
+            {
+                IDictionary answer = new Hashtable(size);
+                for (int i=0; i < size; i++)
+                {
+                    String name = dataIn.ReadString();
+                    answer[name] = UnmarshalPrimitive(dataIn);
+                }
+                return answer;
+            }
+            
+        }
+        
+        public static void MarshalPrimitive(BinaryWriter dataOut, Object value)
+        {
+            if (value == null)
+            {
+                dataOut.Write(NULL);
+            }
+            else if (value is bool)
+            {
+                dataOut.Write(BOOLEAN_TYPE);
+                dataOut.Write((bool) value);
+            }
+            else if (value is byte)
+            {
+                dataOut.Write(BYTE_TYPE);
+                dataOut.Write(((Byte)value));
+            }
+            else if (value is char)
+            {
+                dataOut.Write(CHAR_TYPE);
+                dataOut.Write((char) value);
+            }
+            else if (value is short)
+            {
+                dataOut.Write(SHORT_TYPE);
+                dataOut.Write((short) value);
+            }
+            else if (value is int)
+            {
+                dataOut.Write(INTEGER_TYPE);
+                dataOut.Write((int) value);
+            }
+            else if (value is long)
+            {
+                dataOut.Write(LONG_TYPE);
+                dataOut.Write((long) value);
+            }
+            else if (value is float)
+            {
+                dataOut.Write(FLOAT_TYPE);
+                dataOut.Write((float) value);
+            }
+            else if (value is double)
+            {
+                dataOut.Write(DOUBLE_TYPE);
+                dataOut.Write((double) value);
+            }
+            else if (value is byte[])
+            {
+                byte[] data = (byte[]) value;
+                dataOut.Write(BYTE_ARRAY_TYPE);
+                dataOut.Write(data.Length);
+                dataOut.Write(data);
+            }
+            else if (value is string)
+            {
+                dataOut.Write(STRING_TYPE);
+                dataOut.Write((string) value);
+            }
+            else
+            {
+                throw new IOException("Object is not a primitive: " + value);
+            }
+        }
+        
+        public static Object UnmarshalPrimitive(BinaryReader dataIn)
+        {
+            Object value=null;
+            switch (dataIn.ReadByte())
+            {
+                case BYTE_TYPE:
+                    value = dataIn.ReadByte();
+                    break;
+                case BOOLEAN_TYPE:
+                    value = dataIn.ReadBoolean();
+                    break;
+                case CHAR_TYPE:
+                    value = dataIn.ReadChar();
+                    break;
+                case SHORT_TYPE:
+                    value = dataIn.ReadInt16();
+                    break;
+                case INTEGER_TYPE:
+                    value = dataIn.ReadInt32();
+                    break;
+                case LONG_TYPE:
+                    value = dataIn.ReadInt64();
+                    break;
+                case FLOAT_TYPE:
+                    value = dataIn.ReadSingle();
+                    break;
+                case DOUBLE_TYPE:
+                    value = dataIn.ReadDouble();
+                    break;
+                case BYTE_ARRAY_TYPE:
+                    int size = dataIn.ReadInt32();
+                    byte[] data = new byte[size];
+                    dataIn.Read(data, 0, size);
+                    value = data;
+                    break;
+                case STRING_TYPE:
+                    value = dataIn.ReadString();
+                    break;
+            }
+            return value;
+        }
+                
+        /// <summary>
+        /// Converts the object to a String
+        /// </summary>
+        public static string ToString(MessageId id)
+        {
+            return ToString(id.ProducerId) + ":" + id.ProducerSequenceId;
+        }
+        /// <summary>
+        /// Converts the object to a String
+        /// </summary>
+        public static string ToString(ProducerId id)
+        {
+            return id.ConnectionId + ":" + id.SessionId + ":" + id.Value;
+        }
+        
+        
+        /// <summary>
+        /// Converts the given transaction ID into a String
+        /// </summary>
+        public static String ToString(TransactionId txnId)
+        {
+            if (txnId is LocalTransactionId)
+            {
+                LocalTransactionId ltxnId = (LocalTransactionId) txnId;
+                return "" + ltxnId.Value;
+            }
+            else if (txnId is XATransactionId)
+            {
+                XATransactionId xaTxnId = (XATransactionId) txnId;
+                return "XID:" + xaTxnId.FormatId + ":" + ToHexFromBytes(xaTxnId.GlobalTransactionId) + ":" + ToHexFromBytes(xaTxnId.BranchQualifier);
+            }
+            return null;
+        }
+        
+        /// <summary>
+        /// Creates the byte array into hexidecimal
+        /// </summary>
+        public static String ToHexFromBytes(byte[] data)
+        {
+            StringBuilder buffer = new StringBuilder(data.Length * 2);
+            for (int i = 0; i < data.Length; i++)
+            {
+                buffer.Append(HEX_TABLE[0xFF & data[i]]);
+            }
+            return buffer.ToString();
+        }
+        
+    }
+}
+

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/BrokerInfoMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/BrokerInfoMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/BrokerInfoMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/BrokerInfoMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -82,7 +82,7 @@
         BrokerInfo info = (BrokerInfo)o;
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
-    rc += TightMarshalCachedObject1(wireFormat, info.BrokerId, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.BrokerId, bs);
     rc += TightMarshalString1(info.BrokerURL, bs);
     rc += TightMarshalObjectArray1(wireFormat, info.PeerBrokerInfos, bs);
     rc += TightMarshalString1(info.BrokerName, bs);
@@ -98,7 +98,7 @@
         base.TightMarshal2(wireFormat, o, dataOut, bs);
 
         BrokerInfo info = (BrokerInfo)o;
-    TightMarshalCachedObject2(wireFormat, info.BrokerId, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.BrokerId, dataOut, bs);
     TightMarshalString2(info.BrokerURL, dataOut, bs);
     TightMarshalObjectArray2(wireFormat, info.PeerBrokerInfos, dataOut, bs);
     TightMarshalString2(info.BrokerName, dataOut, bs);

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionErrorMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionErrorMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionErrorMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionErrorMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -69,7 +69,7 @@
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
     rc += TightMarshalBrokerError1(wireFormat, info.Exception, bs);
-    rc += TightMarshalNestedObject1(wireFormat, info.ConnectionId, bs);
+    rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.ConnectionId, bs);
 
         return rc + 0;
     }
@@ -82,7 +82,7 @@
 
         ConnectionError info = (ConnectionError)o;
     TightMarshalBrokerError2(wireFormat, info.Exception, dataOut, bs);
-    TightMarshalNestedObject2(wireFormat, info.ConnectionId, dataOut, bs);
+    TightMarshalNestedObject2(wireFormat, (DataStructure)info.ConnectionId, dataOut, bs);
 
     }
   }

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionInfoMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionInfoMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionInfoMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConnectionInfoMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -82,7 +82,7 @@
         ConnectionInfo info = (ConnectionInfo)o;
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
-    rc += TightMarshalCachedObject1(wireFormat, info.ConnectionId, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConnectionId, bs);
     rc += TightMarshalString1(info.ClientId, bs);
     rc += TightMarshalString1(info.Password, bs);
     rc += TightMarshalString1(info.UserName, bs);
@@ -98,7 +98,7 @@
         base.TightMarshal2(wireFormat, o, dataOut, bs);
 
         ConnectionInfo info = (ConnectionInfo)o;
-    TightMarshalCachedObject2(wireFormat, info.ConnectionId, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConnectionId, dataOut, bs);
     TightMarshalString2(info.ClientId, dataOut, bs);
     TightMarshalString2(info.Password, dataOut, bs);
     TightMarshalString2(info.UserName, dataOut, bs);

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConsumerInfoMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConsumerInfoMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConsumerInfoMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ConsumerInfoMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -79,6 +79,7 @@
         else {
             info.BrokerPath = null;
         }
+        info.AdditionalPredicate = (BooleanExpression) TightUnmarshalNestedObject(wireFormat, dataIn, bs);
         info.NetworkSubscription = bs.ReadBoolean();
 
     }
@@ -91,9 +92,9 @@
         ConsumerInfo info = (ConsumerInfo)o;
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
-    rc += TightMarshalCachedObject1(wireFormat, info.ConsumerId, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConsumerId, bs);
     bs.WriteBoolean(info.Browser);
-    rc += TightMarshalCachedObject1(wireFormat, info.Destination, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.Destination, bs);
             bs.WriteBoolean(info.DispatchAsync);
     rc += TightMarshalString1(info.Selector, bs);
     rc += TightMarshalString1(info.SubcriptionName, bs);
@@ -101,6 +102,7 @@
     bs.WriteBoolean(info.Exclusive);
     bs.WriteBoolean(info.Retroactive);
         rc += TightMarshalObjectArray1(wireFormat, info.BrokerPath, bs);
+    rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.AdditionalPredicate, bs);
     bs.WriteBoolean(info.NetworkSubscription);
 
         return rc + 9;
@@ -113,9 +115,9 @@
         base.TightMarshal2(wireFormat, o, dataOut, bs);
 
         ConsumerInfo info = (ConsumerInfo)o;
-    TightMarshalCachedObject2(wireFormat, info.ConsumerId, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConsumerId, dataOut, bs);
     bs.ReadBoolean();
-    TightMarshalCachedObject2(wireFormat, info.Destination, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.Destination, dataOut, bs);
     dataOut.Write(info.PrefetchSize);
     dataOut.Write(info.MaximumPendingMessageLimit);
     bs.ReadBoolean();
@@ -126,6 +128,7 @@
     bs.ReadBoolean();
     dataOut.Write(info.Priority);
     TightMarshalObjectArray2(wireFormat, info.BrokerPath, dataOut, bs);
+    TightMarshalNestedObject2(wireFormat, (DataStructure)info.AdditionalPredicate, dataOut, bs);
     bs.ReadBoolean();
 
     }

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataResponseMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataResponseMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataResponseMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataResponseMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -67,7 +67,7 @@
         DataResponse info = (DataResponse)o;
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
-    rc += TightMarshalNestedObject1(wireFormat, info.Data, bs);
+    rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.Data, bs);
 
         return rc + 0;
     }
@@ -79,7 +79,7 @@
         base.TightMarshal2(wireFormat, o, dataOut, bs);
 
         DataResponse info = (DataResponse)o;
-    TightMarshalNestedObject2(wireFormat, info.Data, dataOut, bs);
+    TightMarshalNestedObject2(wireFormat, (DataStructure)info.Data, dataOut, bs);
 
     }
   }

Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DestinationInfoMarshaller.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DestinationInfoMarshaller.cs?rev=383749&r1=383748&r2=383749&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DestinationInfoMarshaller.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DestinationInfoMarshaller.cs Mon Mar  6 18:32:50 2006
@@ -82,8 +82,8 @@
         DestinationInfo info = (DestinationInfo)o;
 
         int rc = base.TightMarshal1(wireFormat, info, bs);
-    rc += TightMarshalCachedObject1(wireFormat, info.ConnectionId, bs);
-    rc += TightMarshalCachedObject1(wireFormat, info.Destination, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConnectionId, bs);
+    rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.Destination, bs);
         rc += TightMarshalLong1(wireFormat, info.Timeout, bs);
     rc += TightMarshalObjectArray1(wireFormat, info.BrokerPath, bs);
 
@@ -97,8 +97,8 @@
         base.TightMarshal2(wireFormat, o, dataOut, bs);
 
         DestinationInfo info = (DestinationInfo)o;
-    TightMarshalCachedObject2(wireFormat, info.ConnectionId, dataOut, bs);
-    TightMarshalCachedObject2(wireFormat, info.Destination, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConnectionId, dataOut, bs);
+    TightMarshalCachedObject2(wireFormat, (DataStructure)info.Destination, dataOut, bs);
     dataOut.Write(info.OperationType);
     TightMarshalLong2(wireFormat, info.Timeout, dataOut, bs);
     TightMarshalObjectArray2(wireFormat, info.BrokerPath, dataOut, bs);