activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r909224 [6/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/types/AmqpOpen.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpOpen.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/AmqpOpen.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpOpen.java Fri Feb 12 04:25:25 2010
@@ -22,7 +22,6 @@
 import java.lang.Integer;
 import java.lang.Long;
 import java.lang.String;
-import java.util.HashMap;
 import java.util.Iterator;
 import org.apache.activemq.amqp.protocol.AmqpCommand;
 import org.apache.activemq.amqp.protocol.AmqpCommandHandler;
@@ -127,6 +126,21 @@
      * large.
      * </p>
      */
+    public void setMaxFrameSize(long maxFrameSize);
+
+    /**
+     * proposed maximum frame size
+     * <p>
+     * The largest frame size that the sending peer is able to accept on this Connection. If
+     * this field is not set it means that the peer does not impose any specific limit. A peer
+     * MUST NOT send frames larger than its partner can handle. A peer that receives an
+     * oversized frame MUST close the Connection with the framing-error error-code.
+     * </p>
+     * <p>
+     * octets
+     * large.
+     * </p>
+     */
     public void setMaxFrameSize(AmqpUint maxFrameSize);
 
     /**
@@ -166,6 +180,18 @@
      * Connection with the framing-error error-code.
      * </p>
      */
+    public void setChannelMax(int channelMax);
+
+    /**
+     * the maximum channel number that may be used on the Connection
+     * <p>
+     * The channel-max value is the highest channel number that may be used on the Connection.
+     * This value plus one is the maximum number of Sessions that may be simultaneously
+     * attached. A peer MUST not use channel numbers outside the range that its partner can
+     * handle. A peer that receives a channel number outside the supported range MUST close the
+     * Connection with the framing-error error-code.
+     * </p>
+     */
     public void setChannelMax(AmqpUshort channelMax);
 
     /**
@@ -200,7 +226,7 @@
      * the two proposed heartbeat-intervals. If neither value is set, there is no heartbeat.
      * </p>
      */
-    public void setHeartbeatInterval(AmqpUshort heartbeatInterval);
+    public void setHeartbeatInterval(int heartbeatInterval);
 
     /**
      * proposed heartbeat interval
@@ -211,18 +237,18 @@
      * the two proposed heartbeat-intervals. If neither value is set, there is no heartbeat.
      * </p>
      */
-    public Integer getHeartbeatInterval();
+    public void setHeartbeatInterval(AmqpUshort heartbeatInterval);
 
     /**
-     * locales available for outgoing text
+     * proposed heartbeat interval
      * <p>
-     * A list of the locales that the peer supports for sending informational text. This
-     * includes Connection, Session and Link exception text. The default is the en_US locale.
-     * A peer MUST support at least the en_US locale. Since this value is always supported, it
-     * need not be supplied in the outgoing-locales.
+     * The proposed interval, in seconds, of the Connection heartbeat desired by the sender. A
+     * value of zero means heartbeats are not supported. If the value is not set, the sender
+     * supports all heartbeat intervals. The heartbeat-interval established is the minimum of
+     * the two proposed heartbeat-intervals. If neither value is set, there is no heartbeat.
      * </p>
      */
-    public void setOutgoingLocales(IAmqpList outgoingLocales);
+    public Integer getHeartbeatInterval();
 
     /**
      * locales available for outgoing text
@@ -258,20 +284,6 @@
      * specified in the outgoing-locales field.
      * </p>
      */
-    public void setIncomingLocales(IAmqpList incomingLocales);
-
-    /**
-     * desired locales for incoming text in decreasing level of preference
-     * <p>
-     * A list of locales that the sending peer permits for incoming informational text. This
-     * list is ordered in decreasing level of preference. The receiving partner will chose the
-     * first (most preferred) incoming locale from those which it supports. If none of the
-     * requested locales are supported, en_US will be chosen. Note that en_US need not be
-     * supplied in this list as it is always the fallback. A peer may determine which of the
-     * permitted incoming locales is chosen by examining the partner's supported locales as
-     * specified in the outgoing-locales field.
-     * </p>
-     */
     public void setIncomingLocales(AmqpList incomingLocales);
 
     /**
@@ -297,17 +309,6 @@
      * other general information.
      * </p>
      */
-    public void setPeerProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> peerProperties);
-
-    /**
-     * peer properties
-     * <p>
-     * The properties SHOULD contain at least these fields: "product", giving the name of the
-     * client product, "version", giving the name of the client version, "platform", giving the
-     * name of the operating system, "copyright", if appropriate, and "information", giving
-     * other general information.
-     * </p>
-     */
     public void setPeerProperties(AmqpMap peerProperties);
 
     /**
@@ -319,16 +320,7 @@
      * other general information.
      * </p>
      */
-    public HashMap<AmqpType<?,?>, AmqpType<?,?>> getPeerProperties();
-
-    /**
-     * the extension capabilities the sender supports
-     * <p>
-     * If the receiver of the offered-capabilities requires an extension capability which is
-     * not present in the offered-capability list then it MUST close the connection.
-     * </p>
-     */
-    public void setOfferedCapabilities(IAmqpList offeredCapabilities);
+    public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getPeerProperties();
 
     /**
      * the extension capabilities the sender supports
@@ -359,19 +351,6 @@
      * Connection.
      * </p>
      */
-    public void setDesiredCapabilities(IAmqpList desiredCapabilities);
-
-    /**
-     * the extension capabilities the sender may use if the receiver supports them
-     * <p>
-     * The desired-capability list defines which extension capabilities the sender MAY use if
-     * the receiver offers them (i.e. they are in the offered-capabilities list received by the
-     * sender of the desired-capabilities). If the receiver of the desired-capabilities offers
-     * extension capabilities which are not present in the desired-capability list it received,
-     * then it can be sure those (undesired) capabilities will not be used on the
-     * Connection.
-     * </p>
-     */
     public void setDesiredCapabilities(AmqpList desiredCapabilities);
 
     /**
@@ -403,413 +382,396 @@
         private AmqpList offeredCapabilities;
         private AmqpList desiredCapabilities;
 
-        public AmqpOpenBean() {
+        AmqpOpenBean() {
         }
 
-        public AmqpOpenBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpOpenBean(IAmqpList value) {
 
-        public AmqpOpenBean(AmqpOpen.AmqpOpenBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpOpenBean copy() {
-            return new AmqpOpen.AmqpOpenBean(bean);
-        }
+    AmqpOpenBean(AmqpOpen.AmqpOpenBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleOpen(this);
-        }
+    public final AmqpOpenBean copy() {
+        return new AmqpOpen.AmqpOpenBean(bean);
+    }
 
-        public final AmqpOpen.AmqpOpenBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpOpenBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleOpen(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpOpen.AmqpOpenBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpOpenBuffer(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 void setContainerId(String containerId) {
-            setContainerId(new AmqpString.AmqpStringBean(containerId));
-        }
+    public final void setOptions(AmqpOptions options) {
+        copyCheck();
+        bean.options = options;
+    }
 
+    public final AmqpOptions getOptions() {
+        return bean.options;
+    }
 
-        public final void setContainerId(AmqpString containerId) {
-            copyCheck();
-            bean.containerId = containerId;
-        }
+    public void setContainerId(String containerId) {
+        setContainerId(TypeFactory.createAmqpString(containerId));
+    }
 
-        public final String getContainerId() {
-            return bean.containerId.getValue();
-        }
 
-        public void setHostname(String hostname) {
-            setHostname(new AmqpString.AmqpStringBean(hostname));
-        }
+    public final void setContainerId(AmqpString containerId) {
+        copyCheck();
+        bean.containerId = containerId;
+    }
 
+    public final String getContainerId() {
+        return bean.containerId.getValue();
+    }
 
-        public final void setHostname(AmqpString hostname) {
-            copyCheck();
-            bean.hostname = hostname;
-        }
+    public void setHostname(String hostname) {
+        setHostname(TypeFactory.createAmqpString(hostname));
+    }
 
-        public final String getHostname() {
-            return bean.hostname.getValue();
-        }
 
-        public void setMaxFrameSize(Long maxFrameSize) {
-            setMaxFrameSize(new AmqpUint.AmqpUintBean(maxFrameSize));
-        }
+    public final void setHostname(AmqpString hostname) {
+        copyCheck();
+        bean.hostname = hostname;
+    }
 
+    public final String getHostname() {
+        return bean.hostname.getValue();
+    }
 
-        public final void setMaxFrameSize(AmqpUint maxFrameSize) {
-            copyCheck();
-            bean.maxFrameSize = maxFrameSize;
-        }
+    public void setMaxFrameSize(Long maxFrameSize) {
+        setMaxFrameSize(TypeFactory.createAmqpUint(maxFrameSize));
+    }
 
-        public final Long getMaxFrameSize() {
-            return bean.maxFrameSize.getValue();
-        }
 
-        public void setChannelMax(Integer channelMax) {
-            setChannelMax(new AmqpUshort.AmqpUshortBean(channelMax));
-        }
+    public void setMaxFrameSize(long maxFrameSize) {
+        setMaxFrameSize(TypeFactory.createAmqpUint(maxFrameSize));
+    }
 
 
-        public final void setChannelMax(AmqpUshort channelMax) {
-            copyCheck();
-            bean.channelMax = channelMax;
-        }
+    public final void setMaxFrameSize(AmqpUint maxFrameSize) {
+        copyCheck();
+        bean.maxFrameSize = maxFrameSize;
+    }
 
-        public final Integer getChannelMax() {
-            return bean.channelMax.getValue();
-        }
+    public final Long getMaxFrameSize() {
+        return bean.maxFrameSize.getValue();
+    }
 
-        public void setHeartbeatInterval(Integer heartbeatInterval) {
-            setHeartbeatInterval(new AmqpUshort.AmqpUshortBean(heartbeatInterval));
-        }
+    public void setChannelMax(Integer channelMax) {
+        setChannelMax(TypeFactory.createAmqpUshort(channelMax));
+    }
 
 
-        public final void setHeartbeatInterval(AmqpUshort heartbeatInterval) {
-            copyCheck();
-            bean.heartbeatInterval = heartbeatInterval;
-        }
+    public void setChannelMax(int channelMax) {
+        setChannelMax(TypeFactory.createAmqpUshort(channelMax));
+    }
 
-        public final Integer getHeartbeatInterval() {
-            return bean.heartbeatInterval.getValue();
-        }
 
-        public void setOutgoingLocales(IAmqpList outgoingLocales) {
-            setOutgoingLocales(new AmqpList.AmqpListBean(outgoingLocales));
-        }
+    public final void setChannelMax(AmqpUshort channelMax) {
+        copyCheck();
+        bean.channelMax = channelMax;
+    }
 
+    public final Integer getChannelMax() {
+        return bean.channelMax.getValue();
+    }
 
-        public final void setOutgoingLocales(AmqpList outgoingLocales) {
-            copyCheck();
-            bean.outgoingLocales = outgoingLocales;
-        }
+    public void setHeartbeatInterval(Integer heartbeatInterval) {
+        setHeartbeatInterval(TypeFactory.createAmqpUshort(heartbeatInterval));
+    }
 
-        public final IAmqpList getOutgoingLocales() {
-            return bean.outgoingLocales.getValue();
-        }
 
-        public void setIncomingLocales(IAmqpList incomingLocales) {
-            setIncomingLocales(new AmqpList.AmqpListBean(incomingLocales));
-        }
+    public void setHeartbeatInterval(int heartbeatInterval) {
+        setHeartbeatInterval(TypeFactory.createAmqpUshort(heartbeatInterval));
+    }
 
 
-        public final void setIncomingLocales(AmqpList incomingLocales) {
-            copyCheck();
-            bean.incomingLocales = incomingLocales;
-        }
+    public final void setHeartbeatInterval(AmqpUshort heartbeatInterval) {
+        copyCheck();
+        bean.heartbeatInterval = heartbeatInterval;
+    }
 
-        public final IAmqpList getIncomingLocales() {
-            return bean.incomingLocales.getValue();
-        }
+    public final Integer getHeartbeatInterval() {
+        return bean.heartbeatInterval.getValue();
+    }
 
-        public void setPeerProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> peerProperties) {
-            setPeerProperties(new AmqpMap.AmqpMapBean(peerProperties));
-        }
+    public final void setOutgoingLocales(AmqpList outgoingLocales) {
+        copyCheck();
+        bean.outgoingLocales = outgoingLocales;
+    }
 
+    public final IAmqpList getOutgoingLocales() {
+        return bean.outgoingLocales.getValue();
+    }
 
-        public final void setPeerProperties(AmqpMap peerProperties) {
-            copyCheck();
-            bean.peerProperties = peerProperties;
-        }
+    public final void setIncomingLocales(AmqpList incomingLocales) {
+        copyCheck();
+        bean.incomingLocales = incomingLocales;
+    }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getPeerProperties() {
-            return bean.peerProperties.getValue();
-        }
+    public final IAmqpList getIncomingLocales() {
+        return bean.incomingLocales.getValue();
+    }
 
-        public void setOfferedCapabilities(IAmqpList offeredCapabilities) {
-            setOfferedCapabilities(new AmqpList.AmqpListBean(offeredCapabilities));
-        }
+    public final void setPeerProperties(AmqpMap peerProperties) {
+        copyCheck();
+        bean.peerProperties = peerProperties;
+    }
 
+    public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getPeerProperties() {
+        return bean.peerProperties.getValue();
+    }
 
-        public final void setOfferedCapabilities(AmqpList offeredCapabilities) {
-            copyCheck();
-            bean.offeredCapabilities = offeredCapabilities;
-        }
+    public final void setOfferedCapabilities(AmqpList offeredCapabilities) {
+        copyCheck();
+        bean.offeredCapabilities = offeredCapabilities;
+    }
 
-        public final IAmqpList getOfferedCapabilities() {
-            return bean.offeredCapabilities.getValue();
-        }
+    public final IAmqpList getOfferedCapabilities() {
+        return bean.offeredCapabilities.getValue();
+    }
 
-        public void setDesiredCapabilities(IAmqpList desiredCapabilities) {
-            setDesiredCapabilities(new AmqpList.AmqpListBean(desiredCapabilities));
-        }
+    public final void setDesiredCapabilities(AmqpList desiredCapabilities) {
+        copyCheck();
+        bean.desiredCapabilities = desiredCapabilities;
+    }
 
+    public final IAmqpList getDesiredCapabilities() {
+        return bean.desiredCapabilities.getValue();
+    }
 
-        public final void setDesiredCapabilities(AmqpList desiredCapabilities) {
-            copyCheck();
-            bean.desiredCapabilities = desiredCapabilities;
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setContainerId((AmqpString) value);
+            break;
+        }
+        case 2: {
+            setHostname((AmqpString) value);
+            break;
+        }
+        case 3: {
+            setMaxFrameSize((AmqpUint) value);
+            break;
+        }
+        case 4: {
+            setChannelMax((AmqpUshort) value);
+            break;
+        }
+        case 5: {
+            setHeartbeatInterval((AmqpUshort) value);
+            break;
+        }
+        case 6: {
+            setOutgoingLocales((AmqpList) value);
+            break;
+        }
+        case 7: {
+            setIncomingLocales((AmqpList) value);
+            break;
+        }
+        case 8: {
+            setPeerProperties((AmqpMap) value);
+            break;
+        }
+        case 9: {
+            setOfferedCapabilities((AmqpList) value);
+            break;
+        }
+        case 10: {
+            setDesiredCapabilities((AmqpList) value);
+            break;
         }
-
-        public final IAmqpList getDesiredCapabilities() {
-            return bean.desiredCapabilities.getValue();
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setContainerId((AmqpString) value);
-                break;
-            }
-            case 2: {
-                setHostname((AmqpString) value);
-                break;
-            }
-            case 3: {
-                setMaxFrameSize((AmqpUint) value);
-                break;
-            }
-            case 4: {
-                setChannelMax((AmqpUshort) value);
-                break;
-            }
-            case 5: {
-                setHeartbeatInterval((AmqpUshort) value);
-                break;
-            }
-            case 6: {
-                setOutgoingLocales((AmqpList) value);
-                break;
-            }
-            case 7: {
-                setIncomingLocales((AmqpList) value);
-                break;
-            }
-            case 8: {
-                setPeerProperties((AmqpMap) value);
-                break;
-            }
-            case 9: {
-                setOfferedCapabilities((AmqpList) value);
-                break;
-            }
-            case 10: {
-                setDesiredCapabilities((AmqpList) 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.containerId;
-            }
-            case 2: {
-                return bean.hostname;
-            }
-            case 3: {
-                return bean.maxFrameSize;
-            }
-            case 4: {
-                return bean.channelMax;
-            }
-            case 5: {
-                return bean.heartbeatInterval;
-            }
-            case 6: {
-                return bean.outgoingLocales;
-            }
-            case 7: {
-                return bean.incomingLocales;
-            }
-            case 8: {
-                return bean.peerProperties;
-            }
-            case 9: {
-                return bean.offeredCapabilities;
-            }
-            case 10: {
-                return bean.desiredCapabilities;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
         }
-
-        public int getListCount() {
-            return 11;
+        case 1: {
+            return bean.containerId;
         }
-
-        public IAmqpList getValue() {
-            return bean;
+        case 2: {
+            return bean.hostname;
         }
-
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
+        case 3: {
+            return bean.maxFrameSize;
+        }
+        case 4: {
+            return bean.channelMax;
+        }
+        case 5: {
+            return bean.heartbeatInterval;
+        }
+        case 6: {
+            return bean.outgoingLocales;
+        }
+        case 7: {
+            return bean.incomingLocales;
+        }
+        case 8: {
+            return bean.peerProperties;
+        }
+        case 9: {
+            return bean.offeredCapabilities;
+        }
+        case 10: {
+            return bean.desiredCapabilities;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
+        }
+    }
 
+    public int getListCount() {
+        return 11;
+    }
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
+    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(AmqpOpen.AmqpOpenBean other) {
-            this.options= other.options;
-            this.containerId= other.containerId;
-            this.hostname= other.hostname;
-            this.maxFrameSize= other.maxFrameSize;
-            this.channelMax= other.channelMax;
-            this.heartbeatInterval= other.heartbeatInterval;
-            this.outgoingLocales= other.outgoingLocales;
-            this.incomingLocales= other.incomingLocales;
-            this.peerProperties= other.peerProperties;
-            this.offeredCapabilities= other.offeredCapabilities;
-            this.desiredCapabilities= other.desiredCapabilities;
-            bean = this;
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
+    private final void copy(AmqpOpen.AmqpOpenBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpOpen)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpOpen) t);
+        if(o == null || !(o instanceof AmqpOpen)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpOpen b) {
+        return equals((AmqpOpen) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpOpen b) {
 
-            if(b.getContainerId() == null ^ getContainerId() == null) {
-                return false;
-            }
-            if(b.getContainerId() != null && !b.getContainerId().equals(getContainerId())){ 
-                return false;
-            }
+        if(b.getOptions() == null ^ getOptions() == null) {
+            return false;
+        }
+        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+            return false;
+        }
 
-            if(b.getHostname() == null ^ getHostname() == null) {
-                return false;
-            }
-            if(b.getHostname() != null && !b.getHostname().equals(getHostname())){ 
-                return false;
-            }
+        if(b.getContainerId() == null ^ getContainerId() == null) {
+            return false;
+        }
+        if(b.getContainerId() != null && !b.getContainerId().equals(getContainerId())){ 
+            return false;
+        }
 
-            if(b.getMaxFrameSize() == null ^ getMaxFrameSize() == null) {
-                return false;
-            }
-            if(b.getMaxFrameSize() != null && !b.getMaxFrameSize().equals(getMaxFrameSize())){ 
-                return false;
-            }
+        if(b.getHostname() == null ^ getHostname() == null) {
+            return false;
+        }
+        if(b.getHostname() != null && !b.getHostname().equals(getHostname())){ 
+            return false;
+        }
 
-            if(b.getChannelMax() == null ^ getChannelMax() == null) {
-                return false;
-            }
-            if(b.getChannelMax() != null && !b.getChannelMax().equals(getChannelMax())){ 
-                return false;
-            }
+        if(b.getMaxFrameSize() == null ^ getMaxFrameSize() == null) {
+            return false;
+        }
+        if(b.getMaxFrameSize() != null && !b.getMaxFrameSize().equals(getMaxFrameSize())){ 
+            return false;
+        }
 
-            if(b.getHeartbeatInterval() == null ^ getHeartbeatInterval() == null) {
-                return false;
-            }
-            if(b.getHeartbeatInterval() != null && !b.getHeartbeatInterval().equals(getHeartbeatInterval())){ 
-                return false;
-            }
+        if(b.getChannelMax() == null ^ getChannelMax() == null) {
+            return false;
+        }
+        if(b.getChannelMax() != null && !b.getChannelMax().equals(getChannelMax())){ 
+            return false;
+        }
 
-            if(b.getOutgoingLocales() == null ^ getOutgoingLocales() == null) {
-                return false;
-            }
-            if(b.getOutgoingLocales() != null && !b.getOutgoingLocales().equals(getOutgoingLocales())){ 
-                return false;
-            }
+        if(b.getHeartbeatInterval() == null ^ getHeartbeatInterval() == null) {
+            return false;
+        }
+        if(b.getHeartbeatInterval() != null && !b.getHeartbeatInterval().equals(getHeartbeatInterval())){ 
+            return false;
+        }
 
-            if(b.getIncomingLocales() == null ^ getIncomingLocales() == null) {
-                return false;
-            }
-            if(b.getIncomingLocales() != null && !b.getIncomingLocales().equals(getIncomingLocales())){ 
-                return false;
-            }
+        if(b.getOutgoingLocales() == null ^ getOutgoingLocales() == null) {
+            return false;
+        }
+        if(b.getOutgoingLocales() != null && !b.getOutgoingLocales().equals(getOutgoingLocales())){ 
+            return false;
+        }
 
-            if(b.getPeerProperties() == null ^ getPeerProperties() == null) {
-                return false;
-            }
-            if(b.getPeerProperties() != null && !b.getPeerProperties().equals(getPeerProperties())){ 
-                return false;
-            }
+        if(b.getIncomingLocales() == null ^ getIncomingLocales() == null) {
+            return false;
+        }
+        if(b.getIncomingLocales() != null && !b.getIncomingLocales().equals(getIncomingLocales())){ 
+            return false;
+        }
 
-            if(b.getOfferedCapabilities() == null ^ getOfferedCapabilities() == null) {
-                return false;
-            }
-            if(b.getOfferedCapabilities() != null && !b.getOfferedCapabilities().equals(getOfferedCapabilities())){ 
-                return false;
-            }
+        if(b.getPeerProperties() == null ^ getPeerProperties() == null) {
+            return false;
+        }
+        if(b.getPeerProperties() != null && !b.getPeerProperties().equals(getPeerProperties())){ 
+            return false;
+        }
 
-            if(b.getDesiredCapabilities() == null ^ getDesiredCapabilities() == null) {
-                return false;
-            }
-            if(b.getDesiredCapabilities() != null && !b.getDesiredCapabilities().equals(getDesiredCapabilities())){ 
-                return false;
-            }
-            return true;
+        if(b.getOfferedCapabilities() == null ^ getOfferedCapabilities() == null) {
+            return false;
         }
+        if(b.getOfferedCapabilities() != null && !b.getOfferedCapabilities().equals(getOfferedCapabilities())){ 
+            return false;
+        }
+
+        if(b.getDesiredCapabilities() == null ^ getDesiredCapabilities() == null) {
+            return false;
+        }
+        if(b.getDesiredCapabilities() != null && !b.getDesiredCapabilities().equals(getDesiredCapabilities())){ 
+            return false;
+        }
+        return true;
     }
 
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
+    }
+}
+
     public static class AmqpOpenBuffer extends AmqpList.AmqpListBuffer implements AmqpOpen{
 
         private AmqpOpenBean bean;
@@ -826,7 +788,7 @@
             return bean().getOptions();
         }
 
-    public void setContainerId(String containerId) {
+        public void setContainerId(String containerId) {
             bean().setContainerId(containerId);
         }
 
@@ -838,7 +800,7 @@
             return bean().getContainerId();
         }
 
-    public void setHostname(String hostname) {
+        public void setHostname(String hostname) {
             bean().setHostname(hostname);
         }
 
@@ -850,10 +812,15 @@
             return bean().getHostname();
         }
 
-    public void setMaxFrameSize(Long maxFrameSize) {
+        public void setMaxFrameSize(Long maxFrameSize) {
             bean().setMaxFrameSize(maxFrameSize);
         }
 
+        public void setMaxFrameSize(long maxFrameSize) {
+            bean().setMaxFrameSize(maxFrameSize);
+        }
+
+
         public final void setMaxFrameSize(AmqpUint maxFrameSize) {
             bean().setMaxFrameSize(maxFrameSize);
         }
@@ -862,10 +829,15 @@
             return bean().getMaxFrameSize();
         }
 
-    public void setChannelMax(Integer channelMax) {
+        public void setChannelMax(Integer channelMax) {
+            bean().setChannelMax(channelMax);
+        }
+
+        public void setChannelMax(int channelMax) {
             bean().setChannelMax(channelMax);
         }
 
+
         public final void setChannelMax(AmqpUshort channelMax) {
             bean().setChannelMax(channelMax);
         }
@@ -874,10 +846,15 @@
             return bean().getChannelMax();
         }
 
-    public void setHeartbeatInterval(Integer heartbeatInterval) {
+        public void setHeartbeatInterval(Integer heartbeatInterval) {
+            bean().setHeartbeatInterval(heartbeatInterval);
+        }
+
+        public void setHeartbeatInterval(int heartbeatInterval) {
             bean().setHeartbeatInterval(heartbeatInterval);
         }
 
+
         public final void setHeartbeatInterval(AmqpUshort heartbeatInterval) {
             bean().setHeartbeatInterval(heartbeatInterval);
         }
@@ -886,10 +863,6 @@
             return bean().getHeartbeatInterval();
         }
 
-    public void setOutgoingLocales(IAmqpList outgoingLocales) {
-            bean().setOutgoingLocales(outgoingLocales);
-        }
-
         public final void setOutgoingLocales(AmqpList outgoingLocales) {
             bean().setOutgoingLocales(outgoingLocales);
         }
@@ -898,10 +871,6 @@
             return bean().getOutgoingLocales();
         }
 
-    public void setIncomingLocales(IAmqpList incomingLocales) {
-            bean().setIncomingLocales(incomingLocales);
-        }
-
         public final void setIncomingLocales(AmqpList incomingLocales) {
             bean().setIncomingLocales(incomingLocales);
         }
@@ -910,22 +879,14 @@
             return bean().getIncomingLocales();
         }
 
-    public void setPeerProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> peerProperties) {
-            bean().setPeerProperties(peerProperties);
-        }
-
         public final void setPeerProperties(AmqpMap peerProperties) {
             bean().setPeerProperties(peerProperties);
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getPeerProperties() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getPeerProperties() {
             return bean().getPeerProperties();
         }
 
-    public void setOfferedCapabilities(IAmqpList offeredCapabilities) {
-            bean().setOfferedCapabilities(offeredCapabilities);
-        }
-
         public final void setOfferedCapabilities(AmqpList offeredCapabilities) {
             bean().setOfferedCapabilities(offeredCapabilities);
         }
@@ -934,10 +895,6 @@
             return bean().getOfferedCapabilities();
         }
 
-    public void setDesiredCapabilities(IAmqpList desiredCapabilities) {
-            bean().setDesiredCapabilities(desiredCapabilities);
-        }
-
         public final void setDesiredCapabilities(AmqpList desiredCapabilities) {
             bean().setDesiredCapabilities(desiredCapabilities);
         }
@@ -982,8 +939,16 @@
             handler.handleOpen(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpOpen o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpOpen.AmqpOpenBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpOptions.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpOptions.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/AmqpOptions.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpOptions.java Fri Feb 12 04:25:25 2010
@@ -20,11 +20,14 @@
 import java.io.DataOutput;
 import java.io.IOException;
 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.AmqpMap;
 import org.apache.activemq.amqp.protocol.types.AmqpOptions;
+import org.apache.activemq.amqp.protocol.types.IAmqpMap;
 import org.apache.activemq.util.buffer.Buffer;
 
 /**
@@ -41,16 +44,17 @@
 
         private AmqpOptionsBuffer buffer;
         private AmqpOptionsBean bean = this;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        protected AmqpOptionsBean() {
+        AmqpOptionsBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpOptionsBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpOptionsBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpOptionsBean(AmqpOptions.AmqpOptionsBean other) {
+        AmqpOptionsBean(AmqpOptions.AmqpOptionsBean other) {
             this.bean = other;
         }
 
@@ -70,14 +74,23 @@
         }
 
         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;
         }
 
@@ -96,28 +109,24 @@
             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 AmqpOptions)) {
+            if(o == null || !(o instanceof AmqpOptions)) {
                 return false;
             }
 
-            return equivalent((AmqpOptions) t);
+            return equals((AmqpOptions) o);
         }
 
-        public boolean equivalent(AmqpOptions b) {
-            if(b == null) {
-                return false;
-            }
-
-            if(b.getValue() == null ^ getValue() == null) {
-                return false;
-            }
+        public boolean equals(AmqpOptions b) {
+            return AbstractAmqpMap.checkEqual(this, b);
+        }
 
-            return b.getValue() == null || b.getValue().equals(getValue());
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
         }
     }
 
@@ -129,18 +138,26 @@
             super();
         }
 
-        protected AmqpOptionsBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpOptionsBuffer(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             super(encoded);
         }
         public void put(AmqpType<?, ?> key, AmqpType<?, ?> value) {
             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();
         }
 
@@ -156,11 +173,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpOptions o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpOptions.AmqpOptionsBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpOptions.AmqpOptionsBuffer create(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpProperties.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpProperties.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/AmqpProperties.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpProperties.java Fri Feb 12 04:25:25 2010
@@ -213,6 +213,11 @@
      * the originating client. As per RFC-2046 this may contain a charset parameter defining
      * the character encoding used: e.g. 'text/plain; charset="utf-8"'.
      * </p>
+     * <p>
+     * Symbols are values from a constrained domain. Although the set of possible domains is
+     * open-ended, typically the both number and size of symbols in use for any given application
+     * will be small, e.g. small enough that it is reasonable to cache all the distinct values.
+     * </p>
      */
     public void setContentType(String contentType);
 
@@ -223,6 +228,11 @@
      * the originating client. As per RFC-2046 this may contain a charset parameter defining
      * the character encoding used: e.g. 'text/plain; charset="utf-8"'.
      * </p>
+     * <p>
+     * Symbols are values from a constrained domain. Although the set of possible domains is
+     * open-ended, typically the both number and size of symbols in use for any given application
+     * will be small, e.g. small enough that it is reasonable to cache all the distinct values.
+     * </p>
      */
     public void setContentType(AmqpSymbol contentType);
 
@@ -233,6 +243,11 @@
      * the originating client. As per RFC-2046 this may contain a charset parameter defining
      * the character encoding used: e.g. 'text/plain; charset="utf-8"'.
      * </p>
+     * <p>
+     * Symbols are values from a constrained domain. Although the set of possible domains is
+     * open-ended, typically the both number and size of symbols in use for any given application
+     * will be small, e.g. small enough that it is reasonable to cache all the distinct values.
+     * </p>
      */
     public String getContentType();
 
@@ -248,298 +263,295 @@
         private AmqpUlong contentLength;
         private AmqpSymbol contentType;
 
-        public AmqpPropertiesBean() {
+        AmqpPropertiesBean() {
         }
 
-        public AmqpPropertiesBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpPropertiesBean(IAmqpList value) {
 
-        public AmqpPropertiesBean(AmqpProperties.AmqpPropertiesBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpPropertiesBean copy() {
-            return new AmqpProperties.AmqpPropertiesBean(bean);
-        }
+    AmqpPropertiesBean(AmqpProperties.AmqpPropertiesBean other) {
+        this.bean = other;
+    }
 
-        public final AmqpProperties.AmqpPropertiesBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpPropertiesBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final AmqpPropertiesBean copy() {
+        return new AmqpProperties.AmqpPropertiesBean(bean);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpProperties.AmqpPropertiesBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpPropertiesBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public void setMessageId(Buffer messageId) {
-            setMessageId(new AmqpBinary.AmqpBinaryBean(messageId));
-        }
 
+    public void setMessageId(Buffer messageId) {
+        setMessageId(TypeFactory.createAmqpBinary(messageId));
+    }
 
-        public final void setMessageId(AmqpBinary messageId) {
-            copyCheck();
-            bean.messageId = messageId;
-        }
 
-        public final Buffer getMessageId() {
-            return bean.messageId.getValue();
-        }
+    public final void setMessageId(AmqpBinary messageId) {
+        copyCheck();
+        bean.messageId = messageId;
+    }
 
-        public void setUserId(Buffer userId) {
-            setUserId(new AmqpBinary.AmqpBinaryBean(userId));
-        }
+    public final Buffer getMessageId() {
+        return bean.messageId.getValue();
+    }
 
+    public void setUserId(Buffer userId) {
+        setUserId(TypeFactory.createAmqpBinary(userId));
+    }
 
-        public final void setUserId(AmqpBinary userId) {
-            copyCheck();
-            bean.userId = userId;
-        }
 
-        public final Buffer getUserId() {
-            return bean.userId.getValue();
-        }
+    public final void setUserId(AmqpBinary userId) {
+        copyCheck();
+        bean.userId = userId;
+    }
 
-        public void setTo(String to) {
-            setTo(new AmqpString.AmqpStringBean(to));
-        }
+    public final Buffer getUserId() {
+        return bean.userId.getValue();
+    }
 
+    public void setTo(String to) {
+        setTo(TypeFactory.createAmqpString(to));
+    }
 
-        public final void setTo(AmqpString to) {
-            copyCheck();
-            bean.to = to;
-        }
 
-        public final String getTo() {
-            return bean.to.getValue();
-        }
+    public final void setTo(AmqpString to) {
+        copyCheck();
+        bean.to = to;
+    }
 
-        public void setReplyTo(String replyTo) {
-            setReplyTo(new AmqpString.AmqpStringBean(replyTo));
-        }
+    public final String getTo() {
+        return bean.to.getValue();
+    }
 
+    public void setReplyTo(String replyTo) {
+        setReplyTo(TypeFactory.createAmqpString(replyTo));
+    }
 
-        public final void setReplyTo(AmqpString replyTo) {
-            copyCheck();
-            bean.replyTo = replyTo;
-        }
 
-        public final String getReplyTo() {
-            return bean.replyTo.getValue();
-        }
+    public final void setReplyTo(AmqpString replyTo) {
+        copyCheck();
+        bean.replyTo = replyTo;
+    }
 
-        public void setCorrelationId(Buffer correlationId) {
-            setCorrelationId(new AmqpBinary.AmqpBinaryBean(correlationId));
-        }
+    public final String getReplyTo() {
+        return bean.replyTo.getValue();
+    }
 
+    public void setCorrelationId(Buffer correlationId) {
+        setCorrelationId(TypeFactory.createAmqpBinary(correlationId));
+    }
 
-        public final void setCorrelationId(AmqpBinary correlationId) {
-            copyCheck();
-            bean.correlationId = correlationId;
-        }
 
-        public final Buffer getCorrelationId() {
-            return bean.correlationId.getValue();
-        }
+    public final void setCorrelationId(AmqpBinary correlationId) {
+        copyCheck();
+        bean.correlationId = correlationId;
+    }
 
-        public void setContentLength(BigInteger contentLength) {
-            setContentLength(new AmqpUlong.AmqpUlongBean(contentLength));
-        }
+    public final Buffer getCorrelationId() {
+        return bean.correlationId.getValue();
+    }
 
+    public void setContentLength(BigInteger contentLength) {
+        setContentLength(TypeFactory.createAmqpUlong(contentLength));
+    }
 
-        public final void setContentLength(AmqpUlong contentLength) {
-            copyCheck();
-            bean.contentLength = contentLength;
-        }
 
-        public final BigInteger getContentLength() {
-            return bean.contentLength.getValue();
-        }
+    public final void setContentLength(AmqpUlong contentLength) {
+        copyCheck();
+        bean.contentLength = contentLength;
+    }
 
-        public void setContentType(String contentType) {
-            setContentType(new AmqpSymbol.AmqpSymbolBean(contentType));
-        }
+    public final BigInteger getContentLength() {
+        return bean.contentLength.getValue();
+    }
 
+    public void setContentType(String contentType) {
+        setContentType(TypeFactory.createAmqpSymbol(contentType));
+    }
 
-        public final void setContentType(AmqpSymbol contentType) {
-            copyCheck();
-            bean.contentType = contentType;
-        }
 
-        public final String getContentType() {
-            return bean.contentType.getValue();
-        }
+    public final void setContentType(AmqpSymbol contentType) {
+        copyCheck();
+        bean.contentType = contentType;
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setMessageId((AmqpBinary) value);
-                break;
-            }
-            case 1: {
-                setUserId((AmqpBinary) value);
-                break;
-            }
-            case 2: {
-                setTo((AmqpString) value);
-                break;
-            }
-            case 3: {
-                setReplyTo((AmqpString) value);
-                break;
-            }
-            case 4: {
-                setCorrelationId((AmqpBinary) value);
-                break;
-            }
-            case 5: {
-                setContentLength((AmqpUlong) value);
-                break;
-            }
-            case 6: {
-                setContentType((AmqpSymbol) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
+    public final String getContentType() {
+        return bean.contentType.getValue();
+    }
 
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.messageId;
-            }
-            case 1: {
-                return bean.userId;
-            }
-            case 2: {
-                return bean.to;
-            }
-            case 3: {
-                return bean.replyTo;
-            }
-            case 4: {
-                return bean.correlationId;
-            }
-            case 5: {
-                return bean.contentLength;
-            }
-            case 6: {
-                return bean.contentType;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setMessageId((AmqpBinary) value);
+            break;
+        }
+        case 1: {
+            setUserId((AmqpBinary) value);
+            break;
+        }
+        case 2: {
+            setTo((AmqpString) value);
+            break;
+        }
+        case 3: {
+            setReplyTo((AmqpString) value);
+            break;
+        }
+        case 4: {
+            setCorrelationId((AmqpBinary) value);
+            break;
+        }
+        case 5: {
+            setContentLength((AmqpUlong) value);
+            break;
+        }
+        case 6: {
+            setContentType((AmqpSymbol) value);
+            break;
         }
-
-        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 AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.messageId;
+        }
+        case 1: {
+            return bean.userId;
+        }
+        case 2: {
+            return bean.to;
+        }
+        case 3: {
+            return bean.replyTo;
+        }
+        case 4: {
+            return bean.correlationId;
         }
+        case 5: {
+            return bean.contentLength;
+        }
+        case 6: {
+            return bean.contentType;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
+
+    public int getListCount() {
+        return 7;
+    }
 
+    public IAmqpList getValue() {
+        return bean;
+    }
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
-        }
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
 
-        private final void copy(AmqpProperties.AmqpPropertiesBean other) {
-            this.messageId= other.messageId;
-            this.userId= other.userId;
-            this.to= other.to;
-            this.replyTo= other.replyTo;
-            this.correlationId= other.correlationId;
-            this.contentLength= other.contentLength;
-            this.contentType= other.contentType;
-            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(AmqpProperties.AmqpPropertiesBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpProperties)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpProperties) t);
+        if(o == null || !(o instanceof AmqpProperties)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpProperties b) {
+        return equals((AmqpProperties) o);
+    }
 
-            if(b.getMessageId() == null ^ getMessageId() == null) {
-                return false;
-            }
-            if(b.getMessageId() != null && !b.getMessageId().equals(getMessageId())){ 
-                return false;
-            }
+    public boolean equals(AmqpProperties b) {
 
-            if(b.getUserId() == null ^ getUserId() == null) {
-                return false;
-            }
-            if(b.getUserId() != null && !b.getUserId().equals(getUserId())){ 
-                return false;
-            }
+        if(b.getMessageId() == null ^ getMessageId() == null) {
+            return false;
+        }
+        if(b.getMessageId() != null && !b.getMessageId().equals(getMessageId())){ 
+            return false;
+        }
 
-            if(b.getTo() == null ^ getTo() == null) {
-                return false;
-            }
-            if(b.getTo() != null && !b.getTo().equals(getTo())){ 
-                return false;
-            }
+        if(b.getUserId() == null ^ getUserId() == null) {
+            return false;
+        }
+        if(b.getUserId() != null && !b.getUserId().equals(getUserId())){ 
+            return false;
+        }
 
-            if(b.getReplyTo() == null ^ getReplyTo() == null) {
-                return false;
-            }
-            if(b.getReplyTo() != null && !b.getReplyTo().equals(getReplyTo())){ 
-                return false;
-            }
+        if(b.getTo() == null ^ getTo() == null) {
+            return false;
+        }
+        if(b.getTo() != null && !b.getTo().equals(getTo())){ 
+            return false;
+        }
 
-            if(b.getCorrelationId() == null ^ getCorrelationId() == null) {
-                return false;
-            }
-            if(b.getCorrelationId() != null && !b.getCorrelationId().equals(getCorrelationId())){ 
-                return false;
-            }
+        if(b.getReplyTo() == null ^ getReplyTo() == null) {
+            return false;
+        }
+        if(b.getReplyTo() != null && !b.getReplyTo().equals(getReplyTo())){ 
+            return false;
+        }
 
-            if(b.getContentLength() == null ^ getContentLength() == null) {
-                return false;
-            }
-            if(b.getContentLength() != null && !b.getContentLength().equals(getContentLength())){ 
-                return false;
-            }
+        if(b.getCorrelationId() == null ^ getCorrelationId() == null) {
+            return false;
+        }
+        if(b.getCorrelationId() != null && !b.getCorrelationId().equals(getCorrelationId())){ 
+            return false;
+        }
 
-            if(b.getContentType() == null ^ getContentType() == null) {
-                return false;
-            }
-            if(b.getContentType() != null && !b.getContentType().equals(getContentType())){ 
-                return false;
-            }
-            return true;
+        if(b.getContentLength() == null ^ getContentLength() == null) {
+            return false;
+        }
+        if(b.getContentLength() != null && !b.getContentLength().equals(getContentLength())){ 
+            return false;
         }
+
+        if(b.getContentType() == null ^ getContentType() == null) {
+            return false;
+        }
+        if(b.getContentType() != null && !b.getContentType().equals(getContentType())){ 
+            return false;
+        }
+        return true;
     }
 
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
+    }
+}
+
     public static class AmqpPropertiesBuffer extends AmqpList.AmqpListBuffer implements AmqpProperties{
 
         private AmqpPropertiesBean bean;
@@ -548,7 +560,7 @@
             super(encoded);
         }
 
-    public void setMessageId(Buffer messageId) {
+        public void setMessageId(Buffer messageId) {
             bean().setMessageId(messageId);
         }
 
@@ -560,7 +572,7 @@
             return bean().getMessageId();
         }
 
-    public void setUserId(Buffer userId) {
+        public void setUserId(Buffer userId) {
             bean().setUserId(userId);
         }
 
@@ -572,7 +584,7 @@
             return bean().getUserId();
         }
 
-    public void setTo(String to) {
+        public void setTo(String to) {
             bean().setTo(to);
         }
 
@@ -584,7 +596,7 @@
             return bean().getTo();
         }
 
-    public void setReplyTo(String replyTo) {
+        public void setReplyTo(String replyTo) {
             bean().setReplyTo(replyTo);
         }
 
@@ -596,7 +608,7 @@
             return bean().getReplyTo();
         }
 
-    public void setCorrelationId(Buffer correlationId) {
+        public void setCorrelationId(Buffer correlationId) {
             bean().setCorrelationId(correlationId);
         }
 
@@ -608,7 +620,7 @@
             return bean().getCorrelationId();
         }
 
-    public void setContentLength(BigInteger contentLength) {
+        public void setContentLength(BigInteger contentLength) {
             bean().setContentLength(contentLength);
         }
 
@@ -620,7 +632,7 @@
             return bean().getContentLength();
         }
 
-    public void setContentType(String contentType) {
+        public void setContentType(String contentType) {
             bean().setContentType(contentType);
         }
 
@@ -664,8 +676,16 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpProperties o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpProperties.AmqpPropertiesBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpRejected.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpRejected.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/AmqpRejected.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpRejected.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;
 
 /**
@@ -39,6 +42,16 @@
 public interface AmqpRejected extends AmqpMap {
 
 
+    /**
+     * Key for: permit truncation of the remaining transfer
+     */
+    public static final AmqpSymbol TRUNCATE_KEY = TypeFactory.createAmqpSymbol("truncate");
+    /**
+     * Key for: null
+     */
+    public static final AmqpSymbol REJECT_PROPERTIES_KEY = TypeFactory.createAmqpSymbol("reject-properties");
+
+
 
     /**
      * permit truncation of the remaining transfer
@@ -56,7 +69,7 @@
      * the Message content, and the sender is free to omit it.
      * </p>
      */
-    public void setTruncate(AmqpBoolean truncate);
+    public void setTruncate(boolean truncate);
 
     /**
      * permit truncation of the remaining transfer
@@ -65,15 +78,16 @@
      * the Message content, and the sender is free to omit it.
      * </p>
      */
-    public Boolean getTruncate();
+    public void setTruncate(AmqpBoolean truncate);
 
     /**
+     * permit truncation of the remaining transfer
      * <p>
-     * The map supplied in this field will be placed in any rejected Message headers in the
-     * message-attrs map under the key "reject-properties".
+     * 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 setRejectProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> rejectProperties);
+    public Boolean getTruncate();
 
     /**
      * <p>
@@ -89,7 +103,7 @@
      * message-attrs map under the key "reject-properties".
      * </p>
      */
-    public HashMap<AmqpType<?,?>, AmqpType<?,?>> getRejectProperties();
+    public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getRejectProperties();
 
     public static class AmqpRejectedBean implements AmqpRejected{
 
@@ -97,16 +111,17 @@
         private AmqpRejectedBean bean = this;
         private AmqpBoolean truncate;
         private AmqpMap rejectProperties;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        public AmqpRejectedBean() {
+        AmqpRejectedBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpRejectedBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpRejectedBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpRejectedBean(AmqpRejected.AmqpRejectedBean other) {
+        AmqpRejectedBean(AmqpRejected.AmqpRejectedBean other) {
             this.bean = other;
         }
 
@@ -127,7 +142,12 @@
 
 
         public void setTruncate(Boolean truncate) {
-            setTruncate(new AmqpBoolean.AmqpBooleanBean(truncate));
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
+        }
+
+
+        public void setTruncate(boolean truncate) {
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
         }
 
 
@@ -140,28 +160,32 @@
             return bean.truncate.getValue();
         }
 
-        public void setRejectProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> rejectProperties) {
-            setRejectProperties(new AmqpMap.AmqpMapBean(rejectProperties));
-        }
-
-
         public final void setRejectProperties(AmqpMap rejectProperties) {
             copyCheck();
             bean.rejectProperties = rejectProperties;
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getRejectProperties() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getRejectProperties() {
             return bean.rejectProperties.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;
         }
 
@@ -176,24 +200,22 @@
         }
 
         private final void copy(AmqpRejected.AmqpRejectedBean other) {
-            this.truncate= other.truncate;
-            this.rejectProperties= other.rejectProperties;
             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 AmqpRejected)) {
+            if(o == null || !(o instanceof AmqpRejected)) {
                 return false;
             }
 
-            return equivalent((AmqpRejected) t);
+            return equals((AmqpRejected) o);
         }
 
-        public boolean equivalent(AmqpRejected b) {
+        public boolean equals(AmqpRejected b) {
 
             if(b.getTruncate() == null ^ getTruncate() == null) {
                 return false;
@@ -210,20 +232,29 @@
             }
             return true;
         }
+
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
+        }
     }
 
     public static class AmqpRejectedBuffer extends AmqpMap.AmqpMapBuffer implements AmqpRejected{
 
         private AmqpRejectedBean bean;
 
-        protected AmqpRejectedBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpRejectedBuffer(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);
         }
@@ -232,26 +263,30 @@
             return bean().getTruncate();
         }
 
-    public void setRejectProperties(HashMap<AmqpType<?,?>, AmqpType<?,?>> rejectProperties) {
-            bean().setRejectProperties(rejectProperties);
-        }
-
         public final void setRejectProperties(AmqpMap rejectProperties) {
             bean().setRejectProperties(rejectProperties);
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getRejectProperties() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getRejectProperties() {
             return bean().getRejectProperties();
         }
         public void put(AmqpType<?, ?> key, AmqpType<?, ?> value) {
             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();
         }
 
@@ -267,11 +302,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpRejected o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpRejected.AmqpRejectedBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpRejected.AmqpRejectedBuffer create(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpReleased.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpReleased.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/AmqpReleased.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpReleased.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;
 
 /**
@@ -39,6 +42,28 @@
 public interface AmqpReleased extends AmqpMap {
 
 
+    /**
+     * Key for: permit truncation of the remaining transfer
+     */
+    public static final AmqpSymbol TRUNCATE_KEY = TypeFactory.createAmqpSymbol("truncate");
+    /**
+     * Key for: count the transfer as an unsuccessful delivery attempt
+     */
+    public static final AmqpSymbol DELIVERY_FAILED_KEY = TypeFactory.createAmqpSymbol("delivery-failed");
+    /**
+     * Key for: prevent redelivery
+     */
+    public static final AmqpSymbol DELIVER_ELSEWHERE_KEY = TypeFactory.createAmqpSymbol("deliver-elsewhere");
+    /**
+     * Key for: message attributes
+     */
+    public static final AmqpSymbol MESSAGE_ATTRS_KEY = TypeFactory.createAmqpSymbol("message-attrs");
+    /**
+     * Key for: delivery attributes
+     */
+    public static final AmqpSymbol DELIVERY_ATTRS_KEY = TypeFactory.createAmqpSymbol("delivery-attrs");
+
+
 
     /**
      * permit truncation of the remaining transfer
@@ -56,6 +81,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);
 
     /**
@@ -83,6 +117,15 @@
      * delivery-failures count incremented.
      * </p>
      */
+    public void setDeliveryFailed(boolean deliveryFailed);
+
+    /**
+     * count the transfer as an unsuccessful delivery attempt
+     * <p>
+     * If the delivery-failed flag is set, any Messages released MUST have their
+     * delivery-failures count incremented.
+     * </p>
+     */
     public void setDeliveryFailed(AmqpBoolean deliveryFailed);
 
     /**
@@ -110,6 +153,15 @@
      * the releasing Link Endpoint.
      * </p>
      */
+    public void setDeliverElsewhere(boolean deliverElsewhere);
+
+    /**
+     * prevent redelivery
+     * <p>
+     * If the deliver-elsewhere is set, then any Messages released MUST NOT be redelivered to
+     * the releasing Link Endpoint.
+     * </p>
+     */
     public void setDeliverElsewhere(AmqpBoolean deliverElsewhere);
 
     /**
@@ -178,16 +230,17 @@
         private AmqpBoolean deliverElsewhere;
         private AmqpMessageAttributes messageAttrs;
         private AmqpMessageAttributes deliveryAttrs;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        public AmqpReleasedBean() {
+        AmqpReleasedBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpReleasedBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpReleasedBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpReleasedBean(AmqpReleased.AmqpReleasedBean other) {
+        AmqpReleasedBean(AmqpReleased.AmqpReleasedBean other) {
             this.bean = other;
         }
 
@@ -208,7 +261,12 @@
 
 
         public void setTruncate(Boolean truncate) {
-            setTruncate(new AmqpBoolean.AmqpBooleanBean(truncate));
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
+        }
+
+
+        public void setTruncate(boolean truncate) {
+            setTruncate(TypeFactory.createAmqpBoolean(truncate));
         }
 
 
@@ -222,7 +280,12 @@
         }
 
         public void setDeliveryFailed(Boolean deliveryFailed) {
-            setDeliveryFailed(new AmqpBoolean.AmqpBooleanBean(deliveryFailed));
+            setDeliveryFailed(TypeFactory.createAmqpBoolean(deliveryFailed));
+        }
+
+
+        public void setDeliveryFailed(boolean deliveryFailed) {
+            setDeliveryFailed(TypeFactory.createAmqpBoolean(deliveryFailed));
         }
 
 
@@ -236,7 +299,12 @@
         }
 
         public void setDeliverElsewhere(Boolean deliverElsewhere) {
-            setDeliverElsewhere(new AmqpBoolean.AmqpBooleanBean(deliverElsewhere));
+            setDeliverElsewhere(TypeFactory.createAmqpBoolean(deliverElsewhere));
+        }
+
+
+        public void setDeliverElsewhere(boolean deliverElsewhere) {
+            setDeliverElsewhere(TypeFactory.createAmqpBoolean(deliverElsewhere));
         }
 
 
@@ -267,14 +335,23 @@
             return bean.deliveryAttrs;
         }
         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;
         }
 
@@ -289,27 +366,22 @@
         }
 
         private final void copy(AmqpReleased.AmqpReleasedBean other) {
-            this.truncate= other.truncate;
-            this.deliveryFailed= other.deliveryFailed;
-            this.deliverElsewhere= other.deliverElsewhere;
-            this.messageAttrs= other.messageAttrs;
-            this.deliveryAttrs= other.deliveryAttrs;
             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 AmqpReleased)) {
+            if(o == null || !(o instanceof AmqpReleased)) {
                 return false;
             }
 
-            return equivalent((AmqpReleased) t);
+            return equals((AmqpReleased) o);
         }
 
-        public boolean equivalent(AmqpReleased b) {
+        public boolean equals(AmqpReleased b) {
 
             if(b.getTruncate() == null ^ getTruncate() == null) {
                 return false;
@@ -347,20 +419,29 @@
             }
             return true;
         }
+
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
+        }
     }
 
     public static class AmqpReleasedBuffer extends AmqpMap.AmqpMapBuffer implements AmqpReleased{
 
         private AmqpReleasedBean bean;
 
-        protected AmqpReleasedBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpReleasedBuffer(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);
         }
@@ -369,10 +450,15 @@
             return bean().getTruncate();
         }
 
-    public void setDeliveryFailed(Boolean deliveryFailed) {
+        public void setDeliveryFailed(Boolean deliveryFailed) {
             bean().setDeliveryFailed(deliveryFailed);
         }
 
+        public void setDeliveryFailed(boolean deliveryFailed) {
+            bean().setDeliveryFailed(deliveryFailed);
+        }
+
+
         public final void setDeliveryFailed(AmqpBoolean deliveryFailed) {
             bean().setDeliveryFailed(deliveryFailed);
         }
@@ -381,10 +467,15 @@
             return bean().getDeliveryFailed();
         }
 
-    public void setDeliverElsewhere(Boolean deliverElsewhere) {
+        public void setDeliverElsewhere(Boolean deliverElsewhere) {
+            bean().setDeliverElsewhere(deliverElsewhere);
+        }
+
+        public void setDeliverElsewhere(boolean deliverElsewhere) {
             bean().setDeliverElsewhere(deliverElsewhere);
         }
 
+
         public final void setDeliverElsewhere(AmqpBoolean deliverElsewhere) {
             bean().setDeliverElsewhere(deliverElsewhere);
         }
@@ -412,11 +503,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();
         }
 
@@ -432,11 +531,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpReleased o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpReleased.AmqpReleasedBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpReleased.AmqpReleasedBuffer create(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }



Mime
View raw message