activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r909224 [2/9] - in /activemq/sandbox/activemq-apollo-actor/activemq-amqp/src: main/java/org/apache/activemq/amqp/protocol/marshaller/ main/java/org/apache/activemq/amqp/protocol/marshaller/v1_0_0/ main/java/org/apache/activemq/amqp/protocol...
Date Fri, 12 Feb 2010 04:25:28 GMT
Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/marshaller/v1_0_0/Encoder.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/marshaller/v1_0_0/Encoder.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/marshaller/v1_0_0/Encoder.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/marshaller/v1_0_0/Encoder.java Fri Feb 12 04:25:25 2010
@@ -35,6 +35,7 @@
 import org.apache.activemq.amqp.protocol.BitUtils;
 import org.apache.activemq.amqp.protocol.types.AmqpType;
 import org.apache.activemq.amqp.protocol.types.IAmqpList;
+import org.apache.activemq.amqp.protocol.types.IAmqpMap;
 import org.apache.activemq.util.buffer.Buffer;
 
 public class Encoder extends BaseEncoder {
@@ -56,13 +57,18 @@
         }
     };
 
-    static final MapDecoder DEFAULT_MAP_DECODER = new MapDecoder() {
+    static final MapDecoder<AmqpType<?,?>, AmqpType<?, ?>> DEFAULT_MAP_DECODER = new MapDecoder<AmqpType<?,?>, AmqpType<?, ?>>() {
 
-        public final void decodeToMap(EncodedBuffer key, EncodedBuffer val, Map<AmqpType<?, ?>, AmqpType<?, ?>> map) throws AmqpEncodingError {
+        public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> createMap(int entryCount) {
+            return new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
+        }
+
+        public void decodeToMap(EncodedBuffer key, EncodedBuffer val, IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> map) throws AmqpEncodingError {
             map.put(MARSHALLER.decodeType(key), MARSHALLER.decodeType(key));
+            
         }
 
-        public final void unmarshalToMap(DataInput in, Map<AmqpType<?, ?>, AmqpType<?, ?>> map) throws IOException, AmqpEncodingError {
+        public void unmarshalToMap(DataInput in, IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> map) throws IOException, AmqpEncodingError {
             map.put(MARSHALLER.unmarshalType(in), MARSHALLER.unmarshalType(in));
         }
     };
@@ -1104,10 +1110,12 @@
         AmqpType<?, ?> unmarshalType(int pos, DataInput in) throws IOException, AmqpEncodingError;
     }
 
-    public static interface MapDecoder {
-        void decodeToMap(EncodedBuffer key, EncodedBuffer val, Map<AmqpType<?, ?>, AmqpType<?, ?>> map) throws AmqpEncodingError;
+    public static interface MapDecoder<K extends AmqpType<?, ?>, V extends AmqpType<?, ?>> {
+        void decodeToMap(EncodedBuffer key, EncodedBuffer val, IAmqpMap<K, V> map) throws AmqpEncodingError;
 
-        public void unmarshalToMap(DataInput in, Map<AmqpType<?, ?>, AmqpType<?, ?>> map) throws IOException, AmqpEncodingError;
+        public void unmarshalToMap(DataInput in, IAmqpMap<K, V> map) throws IOException, AmqpEncodingError;
+
+        IAmqpMap<K, V> createMap(int entryCount);
     }
 
     // ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1203,7 +1211,7 @@
             return new AmqpListIterator(this);
         }
     }
-
+    
     public static final AmqpListMarshaller.LIST_ENCODING chooseListEncoding(IAmqpList val) throws AmqpEncodingError {
         if (val.getListCount() > 255) {
             return AmqpListMarshaller.LIST_ENCODING.LIST32;
@@ -1392,8 +1400,9 @@
     // ///////////////////////////////////////////////////////////////////////////////////////////////////
     // Map ENCODINGS
     // ///////////////////////////////////////////////////////////////////////////////////////////////////
-    public static final AmqpMapMarshaller.MAP_ENCODING chooseMapEncoding(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val) throws AmqpEncodingError {
-        for (Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>> me : val.entrySet()) {
+    public static final AmqpMapMarshaller.MAP_ENCODING chooseMapEncoding(IAmqpMap<?, ?> map) throws AmqpEncodingError {
+        for (Map.Entry<? extends AmqpType<?,?>, ? extends AmqpType<?,?>> me : map) {
+            
             int size = me.getKey().getBuffer(MARSHALLER).getEncoded().getEncodedSize() + me.getValue().getBuffer(MARSHALLER).getEncoded().getEncodedSize();
             if (size > 255) {
                 return AmqpMapMarshaller.MAP_ENCODING.MAP32;
@@ -1402,54 +1411,54 @@
         return AmqpMapMarshaller.MAP_ENCODING.MAP8;
     }
 
-    public final int getEncodedSizeOfMap(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val, MAP_ENCODING encoding) throws AmqpEncodingError {
+    public final int getEncodedSizeOfMap(IAmqpMap<?, ?> map, MAP_ENCODING encoding) throws AmqpEncodingError {
         int size = 0;
-        for (Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>> me : val.entrySet()) {
+        for (Map.Entry<? extends AmqpType<?,?>, ? extends AmqpType<?,?>> me : map) {
             size += me.getKey().getBuffer(MARSHALLER).getEncoded().getEncodedSize() + me.getValue().getBuffer(MARSHALLER).getEncoded().getEncodedSize();
         }
         return size;
     }
 
-    public final int getEncodedCountOfMap(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val, MAP_ENCODING mapENCODING) throws AmqpEncodingError {
-        return val.size() * 2;
+    public final int getEncodedCountOfMap(IAmqpMap<?, ?> map, MAP_ENCODING mapENCODING) throws AmqpEncodingError {
+        return map.getEntryCount() * 2;
     }
 
-    public final void encodeMapMap32(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> value, Buffer target, int offset) throws AmqpEncodingError {
+    public final void encodeMapMap32(IAmqpMap<?, ?> value, Buffer target, int offset) throws AmqpEncodingError {
         encodeMap(value, target, offset);
     }
 
-    public final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> decodeMapMap32(Buffer source, int offset, int count, int size, MapDecoder decoder) throws AmqpEncodingError {
+    public final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> decodeMapMap32(Buffer source, int offset, int count, int size, MapDecoder<K, V> decoder) throws AmqpEncodingError {
         return decodeMap(source, offset, count, size, decoder);
     }
 
-    public final void writeMapMap32(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val, DataOutput out) throws AmqpEncodingError, IOException {
+    public final void writeMapMap32(IAmqpMap<?, ?> val, DataOutput out) throws AmqpEncodingError, IOException {
         writeMap(val, out);
 
     }
 
-    public final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> readMapMap32(int count, int size, DataInput in, MapDecoder decoder) throws AmqpEncodingError, IOException {
+    public final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> readMapMap32(int count, int size, DataInput in, MapDecoder<K, V> decoder) throws AmqpEncodingError, IOException {
         return readMap(count, size, in, decoder);
     }
 
-    public final void encodeMapMap8(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> value, Buffer target, int offset) throws AmqpEncodingError {
+    public final void encodeMapMap8(IAmqpMap<?, ?> value, Buffer target, int offset) throws AmqpEncodingError {
         encodeMap(value, target, offset);
     }
 
-    public final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> decodeMapMap8(Buffer source, int offset, int count, int size, MapDecoder decoder) throws AmqpEncodingError {
+    public final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> decodeMapMap8(Buffer source, int offset, int count, int size, MapDecoder<K, V> decoder) throws AmqpEncodingError {
         return decodeMap(source, offset, count, size, decoder);
     }
 
-    public final void writeMapMap8(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val, DataOutput out) throws AmqpEncodingError, IOException {
+    public final void writeMapMap8(IAmqpMap<?, ?> val, DataOutput out) throws AmqpEncodingError, IOException {
         writeMap(val, out);
 
     }
 
-    public final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> readMapMap8(int count, int size, DataInput in, MapDecoder decoder) throws AmqpEncodingError, IOException {
+    public final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> readMapMap8(int count, int size, DataInput in, MapDecoder<K, V> decoder) throws AmqpEncodingError, IOException {
         return readMap(count, size, in, decoder);
     }
 
-    public static final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> decodeMap(Buffer source, int offset, int count, int size, MapDecoder decoder) throws AmqpEncodingError {
-        HashMap<AmqpType<?, ?>, AmqpType<?, ?>> rc = new HashMap<AmqpType<?, ?>, AmqpType<?, ?>>();
+    public static final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> decodeMap(Buffer source, int offset, int count, int size, MapDecoder<K, V> decoder) throws AmqpEncodingError {
+        IAmqpMap<K, V> rc = decoder.createMap(count / 2);
         for (int i = 0; i < count; i += 2) {
             EncodedBuffer encodedKey = FormatCategory.createBuffer(source, offset);
             offset += encodedKey.getEncodedSize();
@@ -1459,9 +1468,18 @@
         }
         return rc;
     }
+    
+
+    public static final <K extends AmqpType<?,?>, V extends AmqpType<?,?>> IAmqpMap<K, V> readMap(int count, int size, DataInput in, MapDecoder<K, V> decoder) throws IOException, AmqpEncodingError {
+        IAmqpMap<K, V> rc = decoder.createMap(count / 2);
+        for (int i = 0; i < count; i += 2) {
+            decoder.unmarshalToMap(in, rc);
+        }
+        return rc;
+    }
 
-    public static final void encodeMap(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> value, Buffer target, int offset) throws AmqpEncodingError {
-        for (Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>> me : value.entrySet()) {
+    public static final void encodeMap(IAmqpMap<?, ?> value, Buffer target, int offset) throws AmqpEncodingError {
+        for (Map.Entry<? extends AmqpType<?,?>, ? extends AmqpType<?,?>> me : value) {
             Encoded<?> eKey = me.getKey().getBuffer(MARSHALLER).getEncoded();
             eKey.encode(target, offset);
             offset += eKey.getEncodedSize();
@@ -1472,18 +1490,10 @@
         }
     }
 
-    public static final void writeMap(HashMap<AmqpType<?, ?>, AmqpType<?, ?>> val, DataOutput out) throws IOException, AmqpEncodingError {
-        for (Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>> me : val.entrySet()) {
+    public static final void writeMap(IAmqpMap<?, ?> val, DataOutput out) throws IOException, AmqpEncodingError {
+        for (Map.Entry<? extends AmqpType<?,?>, ? extends AmqpType<?,?>> me : val) {
             me.getKey().marshal(out, MARSHALLER);
             me.getValue().marshal(out, MARSHALLER);
         }
     }
-
-    public static final HashMap<AmqpType<?, ?>, AmqpType<?, ?>> readMap(int count, int size, DataInput in, MapDecoder decoder) throws IOException, AmqpEncodingError {
-        HashMap<AmqpType<?, ?>, AmqpType<?, ?>> rc = new HashMap<AmqpType<?, ?>, AmqpType<?, ?>>();
-        for (int i = 0; i < count; i += 2) {
-            decoder.unmarshalToMap(in, rc);
-        }
-        return rc;
-    }
 }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAddress.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAddress.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAddress.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAddress.java Fri Feb 12 04:25:25 2010
@@ -43,14 +43,11 @@
         private AmqpAddressBean bean = this;
         private Buffer value;
 
-        protected AmqpAddressBean() {
-        }
-
-        public AmqpAddressBean(Buffer value) {
+        AmqpAddressBean(Buffer value) {
             this.value = value;
         }
 
-        public AmqpAddressBean(AmqpAddress.AmqpAddressBean other) {
+        AmqpAddressBean(AmqpAddress.AmqpAddressBean other) {
             this.bean = other;
         }
 
@@ -84,29 +81,10 @@
                 return false;
             }
 
-            return equivalent((AmqpAddress) o);
-        }
-
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpAddress.AmqpAddressBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpAddress)) {
-                return false;
-            }
-
-            return equivalent((AmqpAddress) t);
+            return equals((AmqpAddress) o);
         }
 
-        public boolean equivalent(AmqpAddress b) {
+        public boolean equals(AmqpAddress b) {
             if(b == null) {
                 return false;
             }
@@ -117,6 +95,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpAddress.AmqpAddressBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpAddressBuffer extends AmqpBinary.AmqpBinaryBuffer implements AmqpAddress{
@@ -147,8 +132,16 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpAddress o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpAddress.AmqpAddressBuffer create(Encoded<Buffer> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAttach.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAttach.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAttach.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpAttach.java Fri Feb 12 04:25:25 2010
@@ -56,6 +56,22 @@
      * <p>
      * The name of the Session whose endpoint has been attached to the Connection.
      * </p>
+     * <p>
+     * The Session name uniquely identifies an interaction between two peers. It is globally
+     * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused.
+     * </p>
+     */
+    public void setName(Buffer name);
+
+    /**
+     * the Session name
+     * <p>
+     * The name of the Session whose endpoint has been attached to the Connection.
+     * </p>
+     * <p>
+     * The Session name uniquely identifies an interaction between two peers. It is globally
+     * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused.
+     * </p>
      */
     public void setName(AmqpSessionName name);
 
@@ -64,6 +80,10 @@
      * <p>
      * The name of the Session whose endpoint has been attached to the Connection.
      * </p>
+     * <p>
+     * The Session name uniquely identifies an interaction between two peers. It is globally
+     * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused.
+     * </p>
      */
     public AmqpSessionName getName();
 
@@ -83,6 +103,15 @@
      * been attached to another endpoint.
      * </p>
      */
+    public void setOpening(boolean opening);
+
+    /**
+     * true iff the Session endpoint has never been attached
+     * <p>
+     * This field, if set, indicates that the Session endpoint is newly created and has never
+     * been attached to another endpoint.
+     * </p>
+     */
     public void setOpening(AmqpBoolean opening);
 
     /**
@@ -101,6 +130,38 @@
      * has received commands. This field indicates where replay will begin when resuming a
      * Session.
      * </p>
+     * <p>
+     * A sequence-no encodes a serial number as defined in RFC-1982. The arithmetic, and
+     * operators for these numbers are defined by RFC-1982.
+     * </p>
+     */
+    public void setReceived(Long received);
+
+    /**
+     * the id of the last command received
+     * <p>
+     * The id of the last received command. This field MUST be set if and only if the Session
+     * has received commands. This field indicates where replay will begin when resuming a
+     * Session.
+     * </p>
+     * <p>
+     * A sequence-no encodes a serial number as defined in RFC-1982. The arithmetic, and
+     * operators for these numbers are defined by RFC-1982.
+     * </p>
+     */
+    public void setReceived(long received);
+
+    /**
+     * the id of the last command received
+     * <p>
+     * The id of the last received command. This field MUST be set if and only if the Session
+     * has received commands. This field indicates where replay will begin when resuming a
+     * Session.
+     * </p>
+     * <p>
+     * A sequence-no encodes a serial number as defined in RFC-1982. The arithmetic, and
+     * operators for these numbers are defined by RFC-1982.
+     * </p>
      */
     public void setReceived(AmqpSequenceNo received);
 
@@ -111,6 +172,10 @@
      * has received commands. This field indicates where replay will begin when resuming a
      * Session.
      * </p>
+     * <p>
+     * A sequence-no encodes a serial number as defined in RFC-1982. The arithmetic, and
+     * operators for these numbers are defined by RFC-1982.
+     * </p>
      */
     public AmqpSequenceNo getReceived();
 
@@ -130,6 +195,15 @@
      * associated Connection. If not set, the endpoint will be kept indefinitely.
      * </p>
      */
+    public void setTimeout(long timeout);
+
+    /**
+     * the Session timeout
+     * <p>
+     * The Session timeout indicates how long a detached endpoint will be kept without an
+     * associated Connection. If not set, the endpoint will be kept indefinitely.
+     * </p>
+     */
     public void setTimeout(AmqpUint timeout);
 
     /**
@@ -173,282 +247,304 @@
         private AmqpTxnLevel txnMode;
         private AmqpTxnLevel txnSupport;
 
-        public AmqpAttachBean() {
+        AmqpAttachBean() {
         }
 
-        public AmqpAttachBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpAttachBean(IAmqpList value) {
 
-        public AmqpAttachBean(AmqpAttach.AmqpAttachBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpAttachBean copy() {
-            return new AmqpAttach.AmqpAttachBean(bean);
-        }
+    AmqpAttachBean(AmqpAttach.AmqpAttachBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleAttach(this);
-        }
+    public final AmqpAttachBean copy() {
+        return new AmqpAttach.AmqpAttachBean(bean);
+    }
 
-        public final AmqpAttach.AmqpAttachBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpAttachBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleAttach(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpAttach.AmqpAttachBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpAttachBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public final void setOptions(AmqpOptions options) {
-            copyCheck();
-            bean.options = options;
-        }
 
-        public final AmqpOptions getOptions() {
-            return bean.options;
-        }
+    public final void setOptions(AmqpOptions options) {
+        copyCheck();
+        bean.options = options;
+    }
 
-        public final void setName(AmqpSessionName name) {
-            copyCheck();
-            bean.name = name;
-        }
+    public final AmqpOptions getOptions() {
+        return bean.options;
+    }
 
-        public final AmqpSessionName getName() {
-            return bean.name;
-        }
+    public void setName(Buffer name) {
+        setName(TypeFactory.createAmqpSessionName(name));
+    }
 
-        public void setOpening(Boolean opening) {
-            setOpening(new AmqpBoolean.AmqpBooleanBean(opening));
-        }
 
+    public final void setName(AmqpSessionName name) {
+        copyCheck();
+        bean.name = name;
+    }
 
-        public final void setOpening(AmqpBoolean opening) {
-            copyCheck();
-            bean.opening = opening;
-        }
+    public final AmqpSessionName getName() {
+        return bean.name;
+    }
 
-        public final Boolean getOpening() {
-            return bean.opening.getValue();
-        }
+    public void setOpening(Boolean opening) {
+        setOpening(TypeFactory.createAmqpBoolean(opening));
+    }
 
-        public final void setReceived(AmqpSequenceNo received) {
-            copyCheck();
-            bean.received = received;
-        }
 
-        public final AmqpSequenceNo getReceived() {
-            return bean.received;
-        }
+    public void setOpening(boolean opening) {
+        setOpening(TypeFactory.createAmqpBoolean(opening));
+    }
 
-        public void setTimeout(Long timeout) {
-            setTimeout(new AmqpUint.AmqpUintBean(timeout));
-        }
 
+    public final void setOpening(AmqpBoolean opening) {
+        copyCheck();
+        bean.opening = opening;
+    }
 
-        public final void setTimeout(AmqpUint timeout) {
-            copyCheck();
-            bean.timeout = timeout;
-        }
+    public final Boolean getOpening() {
+        return bean.opening.getValue();
+    }
 
-        public final Long getTimeout() {
-            return bean.timeout.getValue();
-        }
+    public void setReceived(Long received) {
+        setReceived(TypeFactory.createAmqpSequenceNo(received));
+    }
 
-        public final void setTxnMode(AmqpTxnLevel txnMode) {
-            copyCheck();
-            bean.txnMode = txnMode;
-        }
 
-        public final AmqpTxnLevel getTxnMode() {
-            return bean.txnMode;
-        }
+    public void setReceived(long received) {
+        setReceived(TypeFactory.createAmqpSequenceNo(received));
+    }
 
-        public final void setTxnSupport(AmqpTxnLevel txnSupport) {
-            copyCheck();
-            bean.txnSupport = txnSupport;
-        }
 
-        public final AmqpTxnLevel getTxnSupport() {
-            return bean.txnSupport;
-        }
+    public final void setReceived(AmqpSequenceNo received) {
+        copyCheck();
+        bean.received = received;
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setName((AmqpSessionName) value);
-                break;
-            }
-            case 2: {
-                setOpening((AmqpBoolean) value);
-                break;
-            }
-            case 3: {
-                setReceived((AmqpSequenceNo) value);
-                break;
-            }
-            case 4: {
-                setTimeout((AmqpUint) value);
-                break;
-            }
-            case 5: {
-                setTxnMode(AmqpTxnLevel.get((AmqpUbyte)value));
-                break;
-            }
-            case 6: {
-                setTxnSupport(AmqpTxnLevel.get((AmqpUbyte)value));
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+    public final AmqpSequenceNo getReceived() {
+        return bean.received;
+    }
+
+    public void setTimeout(Long timeout) {
+        setTimeout(TypeFactory.createAmqpUint(timeout));
+    }
+
+
+    public void setTimeout(long timeout) {
+        setTimeout(TypeFactory.createAmqpUint(timeout));
+    }
+
+
+    public final void setTimeout(AmqpUint timeout) {
+        copyCheck();
+        bean.timeout = timeout;
+    }
+
+    public final Long getTimeout() {
+        return bean.timeout.getValue();
+    }
+
+    public final void setTxnMode(AmqpTxnLevel txnMode) {
+        copyCheck();
+        bean.txnMode = txnMode;
+    }
+
+    public final AmqpTxnLevel getTxnMode() {
+        return bean.txnMode;
+    }
+
+    public final void setTxnSupport(AmqpTxnLevel txnSupport) {
+        copyCheck();
+        bean.txnSupport = txnSupport;
+    }
+
+    public final AmqpTxnLevel getTxnSupport() {
+        return bean.txnSupport;
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setName((AmqpSessionName) value);
+            break;
+        }
+        case 2: {
+            setOpening((AmqpBoolean) value);
+            break;
+        }
+        case 3: {
+            setReceived((AmqpSequenceNo) value);
+            break;
+        }
+        case 4: {
+            setTimeout((AmqpUint) value);
+            break;
+        }
+        case 5: {
+            setTxnMode(AmqpTxnLevel.get((AmqpUbyte)value));
+            break;
+        }
+        case 6: {
+            setTxnSupport(AmqpTxnLevel.get((AmqpUbyte)value));
+            break;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
+        }
+    }
 
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.options;
-            }
-            case 1: {
-                return bean.name;
-            }
-            case 2: {
-                return bean.opening;
-            }
-            case 3: {
-                return bean.received;
-            }
-            case 4: {
-                return bean.timeout;
-            }
-            case 5: {
-                if(txnMode == null) {
-                    return null;
-                }
-                return txnMode.getValue();
-            }
-            case 6: {
-                if(txnSupport == null) {
-                    return null;
-                }
-                return txnSupport.getValue();
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
+        }
+        case 1: {
+            return bean.name;
+        }
+        case 2: {
+            return bean.opening;
+        }
+        case 3: {
+            return bean.received;
+        }
+        case 4: {
+            return bean.timeout;
+        }
+        case 5: {
+            if(txnMode == null) {
+                return null;
             }
+            return txnMode.getValue();
+        }
+        case 6: {
+            if(txnSupport == null) {
+                return null;
             }
+            return txnSupport.getValue();
         }
-
-        public int getListCount() {
-            return 7;
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-
-        public IAmqpList getValue() {
-            return bean;
         }
+    }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
-        }
+    public int getListCount() {
+        return 7;
+    }
 
+    public IAmqpList getValue() {
+        return bean;
+    }
+
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
-        }
 
-        private final void copy(AmqpAttach.AmqpAttachBean other) {
-            this.options= other.options;
-            this.name= other.name;
-            this.opening= other.opening;
-            this.received= other.received;
-            this.timeout= other.timeout;
-            this.txnMode= other.txnMode;
-            this.txnSupport= other.txnSupport;
-            bean = this;
+    private final void copyCheck() {
+        if(buffer != null) {;
+            throw new IllegalStateException("unwriteable");
         }
+        if(bean != this) {;
+            copy(bean);
+        }
+    }
 
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
+    private final void copy(AmqpAttach.AmqpAttachBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpAttach)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpAttach) t);
+        if(o == null || !(o instanceof AmqpAttach)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpAttach b) {
+        return equals((AmqpAttach) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpAttach b) {
 
-            if(b.getName() == null ^ getName() == null) {
-                return false;
-            }
-            if(b.getName() != null && !b.getName().equals(getName())){ 
-                return false;
-            }
+        if(b.getOptions() == null ^ getOptions() == null) {
+            return false;
+        }
+        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+            return false;
+        }
 
-            if(b.getOpening() == null ^ getOpening() == null) {
-                return false;
-            }
-            if(b.getOpening() != null && !b.getOpening().equals(getOpening())){ 
-                return false;
-            }
+        if(b.getName() == null ^ getName() == null) {
+            return false;
+        }
+        if(b.getName() != null && !b.getName().equals(getName())){ 
+            return false;
+        }
 
-            if(b.getReceived() == null ^ getReceived() == null) {
-                return false;
-            }
-            if(b.getReceived() != null && !b.getReceived().equals(getReceived())){ 
-                return false;
-            }
+        if(b.getOpening() == null ^ getOpening() == null) {
+            return false;
+        }
+        if(b.getOpening() != null && !b.getOpening().equals(getOpening())){ 
+            return false;
+        }
 
-            if(b.getTimeout() == null ^ getTimeout() == null) {
-                return false;
-            }
-            if(b.getTimeout() != null && !b.getTimeout().equals(getTimeout())){ 
-                return false;
-            }
+        if(b.getReceived() == null ^ getReceived() == null) {
+            return false;
+        }
+        if(b.getReceived() != null && !b.getReceived().equals(getReceived())){ 
+            return false;
+        }
 
-            if(b.getTxnMode() == null ^ getTxnMode() == null) {
-                return false;
-            }
-            if(b.getTxnMode() != null && !b.getTxnMode().equals(getTxnMode())){ 
-                return false;
-            }
+        if(b.getTimeout() == null ^ getTimeout() == null) {
+            return false;
+        }
+        if(b.getTimeout() != null && !b.getTimeout().equals(getTimeout())){ 
+            return false;
+        }
 
-            if(b.getTxnSupport() == null ^ getTxnSupport() == null) {
-                return false;
-            }
-            if(b.getTxnSupport() != null && !b.getTxnSupport().equals(getTxnSupport())){ 
-                return false;
-            }
-            return true;
+        if(b.getTxnMode() == null ^ getTxnMode() == null) {
+            return false;
+        }
+        if(b.getTxnMode() != null && !b.getTxnMode().equals(getTxnMode())){ 
+            return false;
         }
+
+        if(b.getTxnSupport() == null ^ getTxnSupport() == null) {
+            return false;
+        }
+        if(b.getTxnSupport() != null && !b.getTxnSupport().equals(getTxnSupport())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpAttachBuffer extends AmqpList.AmqpListBuffer implements AmqpAttach{
 
@@ -466,6 +562,10 @@
             return bean().getOptions();
         }
 
+        public void setName(Buffer name) {
+            bean().setName(name);
+        }
+
         public final void setName(AmqpSessionName name) {
             bean().setName(name);
         }
@@ -474,10 +574,15 @@
             return bean().getName();
         }
 
-    public void setOpening(Boolean opening) {
+        public void setOpening(Boolean opening) {
+            bean().setOpening(opening);
+        }
+
+        public void setOpening(boolean opening) {
             bean().setOpening(opening);
         }
 
+
         public final void setOpening(AmqpBoolean opening) {
             bean().setOpening(opening);
         }
@@ -486,6 +591,15 @@
             return bean().getOpening();
         }
 
+        public void setReceived(Long received) {
+            bean().setReceived(received);
+        }
+
+        public void setReceived(long received) {
+            bean().setReceived(received);
+        }
+
+
         public final void setReceived(AmqpSequenceNo received) {
             bean().setReceived(received);
         }
@@ -494,10 +608,15 @@
             return bean().getReceived();
         }
 
-    public void setTimeout(Long timeout) {
+        public void setTimeout(Long timeout) {
             bean().setTimeout(timeout);
         }
 
+        public void setTimeout(long timeout) {
+            bean().setTimeout(timeout);
+        }
+
+
         public final void setTimeout(AmqpUint timeout) {
             bean().setTimeout(timeout);
         }
@@ -558,8 +677,16 @@
             handler.handleAttach(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpAttach o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpAttach.AmqpAttachBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBar.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBar.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBar.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBar.java Fri Feb 12 04:25:25 2010
@@ -54,6 +54,38 @@
      * <p>
      * Specifies the Link to which the barrier applies.
      * </p>
+     * <p>
+     * command and subsequently used
+     * by endpoints as a shorthand to refer to the Link in all outgoing commands. The two
+     * endpoints may potentially use different handles to refer to the same Link. Link handles
+     * may be reused once a Link is closed for both send and receive.
+     * </p>
+     */
+    public void setHandle(Long handle);
+
+    /**
+     * <p>
+     * Specifies the Link to which the barrier applies.
+     * </p>
+     * <p>
+     * command and subsequently used
+     * by endpoints as a shorthand to refer to the Link in all outgoing commands. The two
+     * endpoints may potentially use different handles to refer to the same Link. Link handles
+     * may be reused once a Link is closed for both send and receive.
+     * </p>
+     */
+    public void setHandle(long handle);
+
+    /**
+     * <p>
+     * Specifies the Link to which the barrier applies.
+     * </p>
+     * <p>
+     * command and subsequently used
+     * by endpoints as a shorthand to refer to the Link in all outgoing commands. The two
+     * endpoints may potentially use different handles to refer to the same Link. Link handles
+     * may be reused once a Link is closed for both send and receive.
+     * </p>
      */
     public void setHandle(AmqpHandle handle);
 
@@ -61,6 +93,12 @@
      * <p>
      * Specifies the Link to which the barrier applies.
      * </p>
+     * <p>
+     * command and subsequently used
+     * by endpoints as a shorthand to refer to the Link in all outgoing commands. The two
+     * endpoints may potentially use different handles to refer to the same Link. Link handles
+     * may be reused once a Link is closed for both send and receive.
+     * </p>
      */
     public AmqpHandle getHandle();
 
@@ -69,6 +107,13 @@
      * If the barrier field is not set then the barrier is removed.
      * </p>
      */
+    public void setBarrier(Buffer barrier);
+
+    /**
+     * <p>
+     * If the barrier field is not set then the barrier is removed.
+     * </p>
+     */
     public void setBarrier(AmqpDeliveryTag barrier);
 
     /**
@@ -86,170 +131,186 @@
         private AmqpHandle handle;
         private AmqpDeliveryTag barrier;
 
-        public AmqpBarBean() {
+        AmqpBarBean() {
         }
 
-        public AmqpBarBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpBarBean(IAmqpList value) {
 
-        public AmqpBarBean(AmqpBar.AmqpBarBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpBarBean copy() {
-            return new AmqpBar.AmqpBarBean(bean);
-        }
+    AmqpBarBean(AmqpBar.AmqpBarBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleBar(this);
-        }
+    public final AmqpBarBean copy() {
+        return new AmqpBar.AmqpBarBean(bean);
+    }
 
-        public final AmqpBar.AmqpBarBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpBarBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleBar(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpBar.AmqpBarBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpBarBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public final void setOptions(AmqpOptions options) {
-            copyCheck();
-            bean.options = options;
-        }
 
-        public final AmqpOptions getOptions() {
-            return bean.options;
-        }
+    public final void setOptions(AmqpOptions options) {
+        copyCheck();
+        bean.options = options;
+    }
 
-        public final void setHandle(AmqpHandle handle) {
-            copyCheck();
-            bean.handle = handle;
-        }
+    public final AmqpOptions getOptions() {
+        return bean.options;
+    }
 
-        public final AmqpHandle getHandle() {
-            return bean.handle;
-        }
+    public void setHandle(Long handle) {
+        setHandle(TypeFactory.createAmqpHandle(handle));
+    }
 
-        public final void setBarrier(AmqpDeliveryTag barrier) {
-            copyCheck();
-            bean.barrier = barrier;
+
+    public void setHandle(long handle) {
+        setHandle(TypeFactory.createAmqpHandle(handle));
+    }
+
+
+    public final void setHandle(AmqpHandle handle) {
+        copyCheck();
+        bean.handle = handle;
+    }
+
+    public final AmqpHandle getHandle() {
+        return bean.handle;
+    }
+
+    public void setBarrier(Buffer barrier) {
+        setBarrier(TypeFactory.createAmqpDeliveryTag(barrier));
+    }
+
+
+    public final void setBarrier(AmqpDeliveryTag barrier) {
+        copyCheck();
+        bean.barrier = barrier;
+    }
+
+    public final AmqpDeliveryTag getBarrier() {
+        return bean.barrier;
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setHandle((AmqpHandle) value);
+            break;
+        }
+        case 2: {
+            setBarrier((AmqpDeliveryTag) value);
+            break;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
         }
+    }
 
-        public final AmqpDeliveryTag getBarrier() {
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
+        }
+        case 1: {
+            return bean.handle;
+        }
+        case 2: {
             return bean.barrier;
         }
-
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setHandle((AmqpHandle) value);
-                break;
-            }
-            case 2: {
-                setBarrier((AmqpDeliveryTag) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.options;
-            }
-            case 1: {
-                return bean.handle;
-            }
-            case 2: {
-                return bean.barrier;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
         }
+    }
 
-        public int getListCount() {
-            return 3;
-        }
+    public int getListCount() {
+        return 3;
+    }
 
-        public IAmqpList getValue() {
-            return bean;
-        }
+    public IAmqpList getValue() {
+        return bean;
+    }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
-        }
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
 
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
+    private final void copyCheck() {
+        if(buffer != null) {;
+            throw new IllegalStateException("unwriteable");
         }
-
-        private final void copy(AmqpBar.AmqpBarBean other) {
-            this.options= other.options;
-            this.handle= other.handle;
-            this.barrier= other.barrier;
-            bean = this;
+        if(bean != this) {;
+            copy(bean);
         }
+    }
 
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
+    private final void copy(AmqpBar.AmqpBarBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpBar)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpBar) t);
+        if(o == null || !(o instanceof AmqpBar)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpBar b) {
+        return equals((AmqpBar) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpBar b) {
 
-            if(b.getHandle() == null ^ getHandle() == null) {
-                return false;
-            }
-            if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ 
-                return false;
-            }
+        if(b.getOptions() == null ^ getOptions() == null) {
+            return false;
+        }
+        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+            return false;
+        }
 
-            if(b.getBarrier() == null ^ getBarrier() == null) {
-                return false;
-            }
-            if(b.getBarrier() != null && !b.getBarrier().equals(getBarrier())){ 
-                return false;
-            }
-            return true;
+        if(b.getHandle() == null ^ getHandle() == null) {
+            return false;
+        }
+        if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ 
+            return false;
+        }
+
+        if(b.getBarrier() == null ^ getBarrier() == null) {
+            return false;
         }
+        if(b.getBarrier() != null && !b.getBarrier().equals(getBarrier())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpBarBuffer extends AmqpList.AmqpListBuffer implements AmqpBar{
 
@@ -267,6 +328,15 @@
             return bean().getOptions();
         }
 
+        public void setHandle(Long handle) {
+            bean().setHandle(handle);
+        }
+
+        public void setHandle(long handle) {
+            bean().setHandle(handle);
+        }
+
+
         public final void setHandle(AmqpHandle handle) {
             bean().setHandle(handle);
         }
@@ -275,6 +345,10 @@
             return bean().getHandle();
         }
 
+        public void setBarrier(Buffer barrier) {
+            bean().setBarrier(barrier);
+        }
+
         public final void setBarrier(AmqpDeliveryTag barrier) {
             bean().setBarrier(barrier);
         }
@@ -319,8 +393,16 @@
             handler.handleBar(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpBar o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpBar.AmqpBarBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBinary.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBinary.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBinary.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBinary.java Fri Feb 12 04:25:25 2010
@@ -38,14 +38,11 @@
         private AmqpBinaryBean bean = this;
         private Buffer value;
 
-        protected AmqpBinaryBean() {
-        }
-
-        public AmqpBinaryBean(Buffer value) {
+        AmqpBinaryBean(Buffer value) {
             this.value = value;
         }
 
-        public AmqpBinaryBean(AmqpBinary.AmqpBinaryBean other) {
+        AmqpBinaryBean(AmqpBinary.AmqpBinaryBean other) {
             this.bean = other;
         }
 
@@ -79,29 +76,10 @@
                 return false;
             }
 
-            return equivalent((AmqpBinary) o);
+            return equals((AmqpBinary) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpBinary.AmqpBinaryBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpBinary)) {
-                return false;
-            }
-
-            return equivalent((AmqpBinary) t);
-        }
-
-        public boolean equivalent(AmqpBinary b) {
+        public boolean equals(AmqpBinary b) {
             if(b == null) {
                 return false;
             }
@@ -112,6 +90,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpBinary.AmqpBinaryBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpBinaryBuffer implements AmqpBinary, AmqpBuffer< Buffer> {
@@ -154,12 +139,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpBinary o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpBinary.AmqpBinaryBuffer create(Encoded<Buffer> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBoolean.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBoolean.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBoolean.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpBoolean.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpBooleanBean bean = this;
         private Boolean value;
 
-        protected AmqpBooleanBean() {
-        }
-
-        public AmqpBooleanBean(Boolean value) {
+        AmqpBooleanBean(Boolean value) {
             this.value = value;
         }
 
-        public AmqpBooleanBean(AmqpBoolean.AmqpBooleanBean other) {
+        AmqpBooleanBean(AmqpBoolean.AmqpBooleanBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpBoolean) o);
+            return equals((AmqpBoolean) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpBoolean.AmqpBooleanBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpBoolean)) {
-                return false;
-            }
-
-            return equivalent((AmqpBoolean) t);
-        }
-
-        public boolean equivalent(AmqpBoolean b) {
+        public boolean equals(AmqpBoolean b) {
             if(b == null) {
                 return false;
             }
@@ -113,6 +91,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpBoolean.AmqpBooleanBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpBooleanBuffer implements AmqpBoolean, AmqpBuffer< Boolean> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpBoolean o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpBoolean.AmqpBooleanBuffer create(Encoded<Boolean> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpByte.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpByte.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpByte.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpByte.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpByteBean bean = this;
         private Byte value;
 
-        protected AmqpByteBean() {
-        }
-
-        public AmqpByteBean(Byte value) {
+        AmqpByteBean(Byte value) {
             this.value = value;
         }
 
-        public AmqpByteBean(AmqpByte.AmqpByteBean other) {
+        AmqpByteBean(AmqpByte.AmqpByteBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpByte) o);
+            return equals((AmqpByte) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpByte.AmqpByteBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpByte)) {
-                return false;
-            }
-
-            return equivalent((AmqpByte) t);
-        }
-
-        public boolean equivalent(AmqpByte b) {
+        public boolean equals(AmqpByte b) {
             if(b == null) {
                 return false;
             }
@@ -113,6 +91,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpByte.AmqpByteBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpByteBuffer implements AmqpByte, AmqpBuffer< Byte> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpByte o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpByte.AmqpByteBuffer create(Encoded<Byte> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpChar.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpChar.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpChar.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpChar.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpCharBean bean = this;
         private Integer value;
 
-        protected AmqpCharBean() {
-        }
-
-        public AmqpCharBean(Integer value) {
+        AmqpCharBean(Integer value) {
             this.value = value;
         }
 
-        public AmqpCharBean(AmqpChar.AmqpCharBean other) {
+        AmqpCharBean(AmqpChar.AmqpCharBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpChar) o);
+            return equals((AmqpChar) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpChar.AmqpCharBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpChar)) {
-                return false;
-            }
-
-            return equivalent((AmqpChar) t);
-        }
-
-        public boolean equivalent(AmqpChar b) {
+        public boolean equals(AmqpChar b) {
             if(b == null) {
                 return false;
             }
@@ -113,6 +91,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpChar.AmqpCharBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpCharBuffer implements AmqpChar, AmqpBuffer< Integer> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpChar o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpChar.AmqpCharBuffer create(Encoded<Integer> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpClose.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpClose.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpClose.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpClose.java Fri Feb 12 04:25:25 2010
@@ -75,146 +75,148 @@
         private AmqpOptions options;
         private AmqpConnectionError exception;
 
-        public AmqpCloseBean() {
+        AmqpCloseBean() {
         }
 
-        public AmqpCloseBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpCloseBean(IAmqpList value) {
 
-        public AmqpCloseBean(AmqpClose.AmqpCloseBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpCloseBean copy() {
-            return new AmqpClose.AmqpCloseBean(bean);
-        }
+    AmqpCloseBean(AmqpClose.AmqpCloseBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleClose(this);
-        }
+    public final AmqpCloseBean copy() {
+        return new AmqpClose.AmqpCloseBean(bean);
+    }
 
-        public final AmqpClose.AmqpCloseBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpCloseBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleClose(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpClose.AmqpCloseBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpCloseBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public final void setOptions(AmqpOptions options) {
-            copyCheck();
-            bean.options = options;
-        }
 
-        public final AmqpOptions getOptions() {
-            return bean.options;
-        }
+    public final void setOptions(AmqpOptions options) {
+        copyCheck();
+        bean.options = options;
+    }
 
-        public final void setException(AmqpConnectionError exception) {
-            copyCheck();
-            bean.exception = exception;
+    public final AmqpOptions getOptions() {
+        return bean.options;
+    }
+
+    public final void setException(AmqpConnectionError exception) {
+        copyCheck();
+        bean.exception = exception;
+    }
+
+    public final AmqpConnectionError getException() {
+        return bean.exception;
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setException((AmqpConnectionError) value);
+            break;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
         }
+    }
 
-        public final AmqpConnectionError getException() {
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
+        }
+        case 1: {
             return bean.exception;
         }
-
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setException((AmqpConnectionError) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.options;
-            }
-            case 1: {
-                return bean.exception;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
         }
+    }
 
-        public int getListCount() {
-            return 2;
-        }
+    public int getListCount() {
+        return 2;
+    }
 
-        public IAmqpList getValue() {
-            return bean;
-        }
+    public IAmqpList getValue() {
+        return bean;
+    }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
-        }
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
 
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
+    private final void copyCheck() {
+        if(buffer != null) {;
+            throw new IllegalStateException("unwriteable");
         }
-
-        private final void copy(AmqpClose.AmqpCloseBean other) {
-            this.options= other.options;
-            this.exception= other.exception;
-            bean = this;
+        if(bean != this) {;
+            copy(bean);
         }
+    }
 
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
+    private final void copy(AmqpClose.AmqpCloseBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpClose)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpClose) t);
+        if(o == null || !(o instanceof AmqpClose)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpClose b) {
+        return equals((AmqpClose) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpClose b) {
 
-            if(b.getException() == null ^ getException() == null) {
-                return false;
-            }
-            if(b.getException() != null && !b.getException().equivalent(getException())){ 
-                return false;
-            }
-            return true;
+        if(b.getOptions() == null ^ getOptions() == null) {
+            return false;
         }
+        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+            return false;
+        }
+
+        if(b.getException() == null ^ getException() == null) {
+            return false;
+        }
+        if(b.getException() != null && !b.getException().equals(getException())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpCloseBuffer extends AmqpList.AmqpListBuffer implements AmqpClose{
 
@@ -276,8 +278,16 @@
             handler.handleClose(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpClose o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpClose.AmqpCloseBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpCompleted.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpCompleted.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpCompleted.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpCompleted.java Fri Feb 12 04:25:25 2010
@@ -21,9 +21,12 @@
 import java.io.IOException;
 import java.lang.Boolean;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 import org.apache.activemq.amqp.protocol.marshaller.AmqpEncodingError;
 import org.apache.activemq.amqp.protocol.marshaller.AmqpMarshaller;
 import org.apache.activemq.amqp.protocol.marshaller.Encoded;
+import org.apache.activemq.amqp.protocol.types.IAmqpMap;
 import org.apache.activemq.util.buffer.Buffer;
 
 /**
@@ -37,6 +40,12 @@
 public interface AmqpCompleted extends AmqpMap {
 
 
+    /**
+     * Key for: permit truncation of the remaining transfer
+     */
+    public static final AmqpSymbol TRUNCATE_KEY = TypeFactory.createAmqpSymbol("truncate");
+
+
 
     /**
      * permit truncation of the remaining transfer
@@ -54,6 +63,15 @@
      * the Message content, and the sender is free to omit it.
      * </p>
      */
+    public void setTruncate(boolean truncate);
+
+    /**
+     * permit truncation of the remaining transfer
+     * <p>
+     * The truncate flag, if true, indicates that the receiver is not interested in the rest of
+     * the Message content, and the sender is free to omit it.
+     * </p>
+     */
     public void setTruncate(AmqpBoolean truncate);
 
     /**
@@ -70,16 +88,17 @@
         private AmqpCompletedBuffer buffer;
         private AmqpCompletedBean bean = this;
         private AmqpBoolean truncate;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        public AmqpCompletedBean() {
+        AmqpCompletedBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpCompletedBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpCompletedBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpCompletedBean(AmqpCompleted.AmqpCompletedBean other) {
+        AmqpCompletedBean(AmqpCompleted.AmqpCompletedBean other) {
             this.bean = other;
         }
 
@@ -100,7 +119,12 @@
 
 
         public void setTruncate(Boolean truncate) {
-            setTruncate(new AmqpBoolean.AmqpBooleanBean(truncate));
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
+        }
+
+
+        public void setTruncate(boolean truncate) {
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
         }
 
 
@@ -113,14 +137,23 @@
             return bean.truncate.getValue();
         }
         public void put(AmqpType<?, ?> key, AmqpType<?, ?> value) {
+            copyCheck();
             bean.value.put(key, value);
         }
 
-        public AmqpType<?, ?> get(AmqpType<?, ?> key) {
+        public AmqpType<?, ?> get(Object key) {
             return bean.value.get(key);
         }
 
-        public HashMap<AmqpType<?,?>, AmqpType<?,?>> getValue() {
+        public int getEntryCount() {
+            return bean.value.getEntryCount();
+        }
+
+        public Iterator<Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>>> iterator() {
+            return bean.value.iterator();
+        }
+
+        public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getValue() {
             return bean.value;
         }
 
@@ -135,23 +168,22 @@
         }
 
         private final void copy(AmqpCompleted.AmqpCompletedBean other) {
-            this.truncate= other.truncate;
             bean = this;
         }
 
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
+        public boolean equals(Object o){
+            if(this == o) {
                 return true;
             }
 
-            if(t == null || !(t instanceof AmqpCompleted)) {
+            if(o == null || !(o instanceof AmqpCompleted)) {
                 return false;
             }
 
-            return equivalent((AmqpCompleted) t);
+            return equals((AmqpCompleted) o);
         }
 
-        public boolean equivalent(AmqpCompleted b) {
+        public boolean equals(AmqpCompleted b) {
 
             if(b.getTruncate() == null ^ getTruncate() == null) {
                 return false;
@@ -161,20 +193,29 @@
             }
             return true;
         }
+
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
+        }
     }
 
     public static class AmqpCompletedBuffer extends AmqpMap.AmqpMapBuffer implements AmqpCompleted{
 
         private AmqpCompletedBean bean;
 
-        protected AmqpCompletedBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpCompletedBuffer(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             super(encoded);
         }
 
-    public void setTruncate(Boolean truncate) {
+        public void setTruncate(Boolean truncate) {
             bean().setTruncate(truncate);
         }
 
+        public void setTruncate(boolean truncate) {
+            bean().setTruncate(truncate);
+        }
+
+
         public final void setTruncate(AmqpBoolean truncate) {
             bean().setTruncate(truncate);
         }
@@ -186,11 +227,19 @@
             bean().put(key, value);
         }
 
-        public AmqpType<?, ?> get(AmqpType<?, ?> key) {
+        public AmqpType<?, ?> get(Object key) {
             return bean().get(key);
         }
 
-        public HashMap<AmqpType<?,?>, AmqpType<?,?>> getValue() {
+        public int getEntryCount() {
+            return bean().getEntryCount();
+        }
+
+        public Iterator<Map.Entry<AmqpType<?, ?>, AmqpType<?, ?>>> iterator() {
+            return bean().iterator();
+        }
+
+        public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getValue() {
             return bean().getValue();
         }
 
@@ -206,11 +255,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpCompleted o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpCompleted.AmqpCompletedBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpCompleted.AmqpCompletedBuffer create(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }



Mime
View raw message