activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r909224 [8/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/AmqpSessionError.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSessionError.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/AmqpSessionError.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSessionError.java Fri Feb 12 04:25:25 2010
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.lang.Short;
 import java.lang.String;
-import java.util.HashMap;
 import java.util.Iterator;
 import org.apache.activemq.amqp.protocol.marshaller.AmqpEncodingError;
 import org.apache.activemq.amqp.protocol.marshaller.AmqpMarshaller;
@@ -56,6 +55,36 @@
      * The command-id of the command which caused the exception. If the exception was not
      * caused by a specific command, this value is not set.
      * </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 setCommandId(Long commandId);
+
+    /**
+     * exceptional command
+     * <p>
+     * The command-id of the command which caused the exception. If the exception was not
+     * caused by a specific command, this value is not set.
+     * </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 setCommandId(long commandId);
+
+    /**
+     * exceptional command
+     * <p>
+     * The command-id of the command which caused the exception. If the exception was not
+     * caused by a specific command, this value is not set.
+     * </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 setCommandId(AmqpSequenceNo commandId);
 
@@ -65,6 +94,10 @@
      * The command-id of the command which caused the exception. If the exception was not
      * caused by a specific command, this value is not set.
      * </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 getCommandId();
 
@@ -76,6 +109,11 @@
     /**
      * the class code of the command whose execution gave rise to the error (if appropriate)
      */
+    public void setCommandCode(short commandCode);
+
+    /**
+     * the class code of the command whose execution gave rise to the error (if appropriate)
+     */
     public void setCommandCode(AmqpUbyte commandCode);
 
     /**
@@ -99,6 +137,15 @@
      * command. If the exception was not caused by a specific field, this value is not set.
      * </p>
      */
+    public void setFieldIndex(short fieldIndex);
+
+    /**
+     * index of the exceptional field
+     * <p>
+     * The zero based index of the exceptional field within the arguments to the exceptional
+     * command. If the exception was not caused by a specific field, this value is not set.
+     * </p>
+     */
     public void setFieldIndex(AmqpUbyte fieldIndex);
 
     /**
@@ -143,17 +190,12 @@
     /**
      * map to carry additional information about the error
      */
-    public void setErrorInfo(HashMap<AmqpType<?,?>, AmqpType<?,?>> errorInfo);
-
-    /**
-     * map to carry additional information about the error
-     */
     public void setErrorInfo(AmqpMap errorInfo);
 
     /**
      * map to carry additional information about the error
      */
-    public HashMap<AmqpType<?,?>, AmqpType<?,?>> getErrorInfo();
+    public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getErrorInfo();
 
     public static class AmqpSessionErrorBean implements AmqpSessionError{
 
@@ -166,261 +208,274 @@
         private AmqpString description;
         private AmqpMap errorInfo;
 
-        public AmqpSessionErrorBean() {
+        AmqpSessionErrorBean() {
         }
 
-        public AmqpSessionErrorBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpSessionErrorBean(IAmqpList value) {
 
-        public AmqpSessionErrorBean(AmqpSessionError.AmqpSessionErrorBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpSessionErrorBean copy() {
-            return new AmqpSessionError.AmqpSessionErrorBean(bean);
-        }
+    AmqpSessionErrorBean(AmqpSessionError.AmqpSessionErrorBean other) {
+        this.bean = other;
+    }
 
-        public final AmqpSessionError.AmqpSessionErrorBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpSessionErrorBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final AmqpSessionErrorBean copy() {
+        return new AmqpSessionError.AmqpSessionErrorBean(bean);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpSessionError.AmqpSessionErrorBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpSessionErrorBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public final void setErrorCode(AmqpSessionErrorCode errorCode) {
-            copyCheck();
-            bean.errorCode = errorCode;
-        }
 
-        public final AmqpSessionErrorCode getErrorCode() {
-            return bean.errorCode;
-        }
+    public final void setErrorCode(AmqpSessionErrorCode errorCode) {
+        copyCheck();
+        bean.errorCode = errorCode;
+    }
 
-        public final void setCommandId(AmqpSequenceNo commandId) {
-            copyCheck();
-            bean.commandId = commandId;
-        }
+    public final AmqpSessionErrorCode getErrorCode() {
+        return bean.errorCode;
+    }
 
-        public final AmqpSequenceNo getCommandId() {
-            return bean.commandId;
-        }
+    public void setCommandId(Long commandId) {
+        setCommandId(TypeFactory.createAmqpSequenceNo(commandId));
+    }
 
-        public void setCommandCode(Short commandCode) {
-            setCommandCode(new AmqpUbyte.AmqpUbyteBean(commandCode));
-        }
 
+    public void setCommandId(long commandId) {
+        setCommandId(TypeFactory.createAmqpSequenceNo(commandId));
+    }
 
-        public final void setCommandCode(AmqpUbyte commandCode) {
-            copyCheck();
-            bean.commandCode = commandCode;
-        }
 
-        public final Short getCommandCode() {
-            return bean.commandCode.getValue();
-        }
+    public final void setCommandId(AmqpSequenceNo commandId) {
+        copyCheck();
+        bean.commandId = commandId;
+    }
 
-        public void setFieldIndex(Short fieldIndex) {
-            setFieldIndex(new AmqpUbyte.AmqpUbyteBean(fieldIndex));
-        }
+    public final AmqpSequenceNo getCommandId() {
+        return bean.commandId;
+    }
 
+    public void setCommandCode(Short commandCode) {
+        setCommandCode(TypeFactory.createAmqpUbyte(commandCode));
+    }
 
-        public final void setFieldIndex(AmqpUbyte fieldIndex) {
-            copyCheck();
-            bean.fieldIndex = fieldIndex;
-        }
 
-        public final Short getFieldIndex() {
-            return bean.fieldIndex.getValue();
-        }
+    public void setCommandCode(short commandCode) {
+        setCommandCode(TypeFactory.createAmqpUbyte(commandCode));
+    }
 
-        public void setDescription(String description) {
-            setDescription(new AmqpString.AmqpStringBean(description));
-        }
 
+    public final void setCommandCode(AmqpUbyte commandCode) {
+        copyCheck();
+        bean.commandCode = commandCode;
+    }
 
-        public final void setDescription(AmqpString description) {
-            copyCheck();
-            bean.description = description;
-        }
+    public final Short getCommandCode() {
+        return bean.commandCode.getValue();
+    }
 
-        public final String getDescription() {
-            return bean.description.getValue();
-        }
+    public void setFieldIndex(Short fieldIndex) {
+        setFieldIndex(TypeFactory.createAmqpUbyte(fieldIndex));
+    }
 
-        public void setErrorInfo(HashMap<AmqpType<?,?>, AmqpType<?,?>> errorInfo) {
-            setErrorInfo(new AmqpMap.AmqpMapBean(errorInfo));
-        }
 
+    public void setFieldIndex(short fieldIndex) {
+        setFieldIndex(TypeFactory.createAmqpUbyte(fieldIndex));
+    }
 
-        public final void setErrorInfo(AmqpMap errorInfo) {
-            copyCheck();
-            bean.errorInfo = errorInfo;
-        }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getErrorInfo() {
-            return bean.errorInfo.getValue();
-        }
+    public final void setFieldIndex(AmqpUbyte fieldIndex) {
+        copyCheck();
+        bean.fieldIndex = fieldIndex;
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setErrorCode(AmqpSessionErrorCode.get((AmqpUshort)value));
-                break;
-            }
-            case 1: {
-                setCommandId((AmqpSequenceNo) value);
-                break;
-            }
-            case 2: {
-                setCommandCode((AmqpUbyte) value);
-                break;
-            }
-            case 3: {
-                setFieldIndex((AmqpUbyte) value);
-                break;
-            }
-            case 4: {
-                setDescription((AmqpString) value);
-                break;
-            }
-            case 5: {
-                setErrorInfo((AmqpMap) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+    public final Short getFieldIndex() {
+        return bean.fieldIndex.getValue();
+    }
+
+    public void setDescription(String description) {
+        setDescription(TypeFactory.createAmqpString(description));
+    }
+
+
+    public final void setDescription(AmqpString description) {
+        copyCheck();
+        bean.description = description;
+    }
+
+    public final String getDescription() {
+        return bean.description.getValue();
+    }
+
+    public final void setErrorInfo(AmqpMap errorInfo) {
+        copyCheck();
+        bean.errorInfo = errorInfo;
+    }
+
+    public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getErrorInfo() {
+        return bean.errorInfo.getValue();
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setErrorCode(AmqpSessionErrorCode.get((AmqpUshort)value));
+            break;
+        }
+        case 1: {
+            setCommandId((AmqpSequenceNo) value);
+            break;
+        }
+        case 2: {
+            setCommandCode((AmqpUbyte) value);
+            break;
+        }
+        case 3: {
+            setFieldIndex((AmqpUbyte) value);
+            break;
+        }
+        case 4: {
+            setDescription((AmqpString) value);
+            break;
+        }
+        case 5: {
+            setErrorInfo((AmqpMap) value);
+            break;
         }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
 
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                if(errorCode == null) {
-                    return null;
-                }
-                return errorCode.getValue();
-            }
-            case 1: {
-                return bean.commandId;
-            }
-            case 2: {
-                return bean.commandCode;
-            }
-            case 3: {
-                return bean.fieldIndex;
-            }
-            case 4: {
-                return bean.description;
-            }
-            case 5: {
-                return bean.errorInfo;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            if(errorCode == null) {
+                return null;
             }
+            return errorCode.getValue();
         }
-
-        public int getListCount() {
-            return 6;
+        case 1: {
+            return bean.commandId;
         }
-
-        public IAmqpList getValue() {
-            return bean;
+        case 2: {
+            return bean.commandCode;
         }
-
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
+        case 3: {
+            return bean.fieldIndex;
+        }
+        case 4: {
+            return bean.description;
+        }
+        case 5: {
+            return bean.errorInfo;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
+        }
+    }
 
+    public int getListCount() {
+        return 6;
+    }
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
-        }
+    public IAmqpList getValue() {
+        return bean;
+    }
 
-        private final void copy(AmqpSessionError.AmqpSessionErrorBean other) {
-            this.errorCode= other.errorCode;
-            this.commandId= other.commandId;
-            this.commandCode= other.commandCode;
-            this.fieldIndex= other.fieldIndex;
-            this.description= other.description;
-            this.errorInfo= other.errorInfo;
-            bean = this;
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
+
+
+    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(AmqpSessionError.AmqpSessionErrorBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpSessionError)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpSessionError) t);
+        if(o == null || !(o instanceof AmqpSessionError)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpSessionError b) {
+        return equals((AmqpSessionError) o);
+    }
 
-            if(b.getErrorCode() == null ^ getErrorCode() == null) {
-                return false;
-            }
-            if(b.getErrorCode() != null && !b.getErrorCode().equals(getErrorCode())){ 
-                return false;
-            }
+    public boolean equals(AmqpSessionError b) {
 
-            if(b.getCommandId() == null ^ getCommandId() == null) {
-                return false;
-            }
-            if(b.getCommandId() != null && !b.getCommandId().equals(getCommandId())){ 
-                return false;
-            }
+        if(b.getErrorCode() == null ^ getErrorCode() == null) {
+            return false;
+        }
+        if(b.getErrorCode() != null && !b.getErrorCode().equals(getErrorCode())){ 
+            return false;
+        }
 
-            if(b.getCommandCode() == null ^ getCommandCode() == null) {
-                return false;
-            }
-            if(b.getCommandCode() != null && !b.getCommandCode().equals(getCommandCode())){ 
-                return false;
-            }
+        if(b.getCommandId() == null ^ getCommandId() == null) {
+            return false;
+        }
+        if(b.getCommandId() != null && !b.getCommandId().equals(getCommandId())){ 
+            return false;
+        }
 
-            if(b.getFieldIndex() == null ^ getFieldIndex() == null) {
-                return false;
-            }
-            if(b.getFieldIndex() != null && !b.getFieldIndex().equals(getFieldIndex())){ 
-                return false;
-            }
+        if(b.getCommandCode() == null ^ getCommandCode() == null) {
+            return false;
+        }
+        if(b.getCommandCode() != null && !b.getCommandCode().equals(getCommandCode())){ 
+            return false;
+        }
 
-            if(b.getDescription() == null ^ getDescription() == null) {
-                return false;
-            }
-            if(b.getDescription() != null && !b.getDescription().equals(getDescription())){ 
-                return false;
-            }
+        if(b.getFieldIndex() == null ^ getFieldIndex() == null) {
+            return false;
+        }
+        if(b.getFieldIndex() != null && !b.getFieldIndex().equals(getFieldIndex())){ 
+            return false;
+        }
 
-            if(b.getErrorInfo() == null ^ getErrorInfo() == null) {
-                return false;
-            }
-            if(b.getErrorInfo() != null && !b.getErrorInfo().equals(getErrorInfo())){ 
-                return false;
-            }
-            return true;
+        if(b.getDescription() == null ^ getDescription() == null) {
+            return false;
+        }
+        if(b.getDescription() != null && !b.getDescription().equals(getDescription())){ 
+            return false;
         }
+
+        if(b.getErrorInfo() == null ^ getErrorInfo() == null) {
+            return false;
+        }
+        if(b.getErrorInfo() != null && !b.getErrorInfo().equals(getErrorInfo())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpSessionErrorBuffer extends AmqpList.AmqpListBuffer implements AmqpSessionError{
 
@@ -438,6 +493,15 @@
             return bean().getErrorCode();
         }
 
+        public void setCommandId(Long commandId) {
+            bean().setCommandId(commandId);
+        }
+
+        public void setCommandId(long commandId) {
+            bean().setCommandId(commandId);
+        }
+
+
         public final void setCommandId(AmqpSequenceNo commandId) {
             bean().setCommandId(commandId);
         }
@@ -446,10 +510,15 @@
             return bean().getCommandId();
         }
 
-    public void setCommandCode(Short commandCode) {
+        public void setCommandCode(Short commandCode) {
             bean().setCommandCode(commandCode);
         }
 
+        public void setCommandCode(short commandCode) {
+            bean().setCommandCode(commandCode);
+        }
+
+
         public final void setCommandCode(AmqpUbyte commandCode) {
             bean().setCommandCode(commandCode);
         }
@@ -458,10 +527,15 @@
             return bean().getCommandCode();
         }
 
-    public void setFieldIndex(Short fieldIndex) {
+        public void setFieldIndex(Short fieldIndex) {
             bean().setFieldIndex(fieldIndex);
         }
 
+        public void setFieldIndex(short fieldIndex) {
+            bean().setFieldIndex(fieldIndex);
+        }
+
+
         public final void setFieldIndex(AmqpUbyte fieldIndex) {
             bean().setFieldIndex(fieldIndex);
         }
@@ -470,7 +544,7 @@
             return bean().getFieldIndex();
         }
 
-    public void setDescription(String description) {
+        public void setDescription(String description) {
             bean().setDescription(description);
         }
 
@@ -482,15 +556,11 @@
             return bean().getDescription();
         }
 
-    public void setErrorInfo(HashMap<AmqpType<?,?>, AmqpType<?,?>> errorInfo) {
-            bean().setErrorInfo(errorInfo);
-        }
-
         public final void setErrorInfo(AmqpMap errorInfo) {
             bean().setErrorInfo(errorInfo);
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getErrorInfo() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getErrorInfo() {
             return bean().getErrorInfo();
         }
 
@@ -526,8 +596,16 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpSessionError o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpSessionError.AmqpSessionErrorBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSessionName.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSessionName.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/AmqpSessionName.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSessionName.java Fri Feb 12 04:25:25 2010
@@ -42,14 +42,11 @@
         private AmqpSessionNameBean bean = this;
         private Buffer value;
 
-        protected AmqpSessionNameBean() {
-        }
-
-        public AmqpSessionNameBean(Buffer value) {
+        AmqpSessionNameBean(Buffer value) {
             this.value = value;
         }
 
-        public AmqpSessionNameBean(AmqpSessionName.AmqpSessionNameBean other) {
+        AmqpSessionNameBean(AmqpSessionName.AmqpSessionNameBean other) {
             this.bean = other;
         }
 
@@ -83,29 +80,10 @@
                 return false;
             }
 
-            return equivalent((AmqpSessionName) o);
-        }
-
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpSessionName.AmqpSessionNameBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpSessionName)) {
-                return false;
-            }
-
-            return equivalent((AmqpSessionName) t);
+            return equals((AmqpSessionName) o);
         }
 
-        public boolean equivalent(AmqpSessionName b) {
+        public boolean equals(AmqpSessionName b) {
             if(b == null) {
                 return false;
             }
@@ -116,6 +94,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpSessionName.AmqpSessionNameBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpSessionNameBuffer extends AmqpBinary.AmqpBinaryBuffer implements AmqpSessionName{
@@ -146,8 +131,16 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpSessionName o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpSessionName.AmqpSessionNameBuffer create(Encoded<Buffer> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpShort.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpShort.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/AmqpShort.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpShort.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpShortBean bean = this;
         private Short value;
 
-        protected AmqpShortBean() {
-        }
-
-        public AmqpShortBean(Short value) {
+        AmqpShortBean(Short value) {
             this.value = value;
         }
 
-        public AmqpShortBean(AmqpShort.AmqpShortBean other) {
+        AmqpShortBean(AmqpShort.AmqpShortBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpShort) o);
+            return equals((AmqpShort) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpShort.AmqpShortBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpShort)) {
-                return false;
-            }
-
-            return equivalent((AmqpShort) t);
-        }
-
-        public boolean equivalent(AmqpShort b) {
+        public boolean equals(AmqpShort 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 AmqpShort.AmqpShortBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpShortBuffer implements AmqpShort, AmqpBuffer< Short> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpShort o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpShort.AmqpShortBuffer create(Encoded<Short> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSource.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSource.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/AmqpSource.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSource.java Fri Feb 12 04:25:25 2010
@@ -22,14 +22,47 @@
 import java.lang.Boolean;
 import java.lang.Long;
 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;
 
 public interface AmqpSource extends AmqpMap {
 
 
+    /**
+     * Key for: the address of the source
+     */
+    public static final AmqpSymbol ADDRESS_KEY = TypeFactory.createAmqpSymbol("address");
+    /**
+     * Key for: request creation of a remote Node
+     */
+    public static final AmqpSymbol CREATE_KEY = TypeFactory.createAmqpSymbol("create");
+    /**
+     * Key for: the source timeout
+     */
+    public static final AmqpSymbol TIMEOUT_KEY = TypeFactory.createAmqpSymbol("timeout");
+    /**
+     * Key for: the distribution mode of the Link
+     */
+    public static final AmqpSymbol DISTRIBUTION_MODE_KEY = TypeFactory.createAmqpSymbol("distribution-mode");
+    /**
+     * Key for: a set of predicate to filter the Messages admitted onto the Link
+     */
+    public static final AmqpSymbol FILTER_KEY = TypeFactory.createAmqpSymbol("filter");
+    /**
+     * Key for: states of messages to be considered for sending from the source
+     */
+    public static final AmqpSymbol MESSAGE_STATES_KEY = TypeFactory.createAmqpSymbol("message-states");
+    /**
+     * Key for: disposition for unacked Messages
+     */
+    public static final AmqpSymbol ORPHAN_DISPOSITION_KEY = TypeFactory.createAmqpSymbol("orphan-disposition");
+
+
 
     /**
      * the address of the source
@@ -41,6 +74,29 @@
      * address MUST be set unless the create flag is set, in which case the address MUST NOT be
      * set.
      * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
+     */
+    public void setAddress(Buffer address);
+
+    /**
+     * the address of the source
+     * <p>
+     * The address is resolved to a Node in the Container of the sending Link Endpoint.
+     * </p>
+     * <p>
+     * command sent by the sending Link Endpoint. When sent by the receiving Link Endpoint the
+     * address MUST be set unless the create flag is set, in which case the address MUST NOT be
+     * set.
+     * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
      */
     public void setAddress(AmqpAddress address);
 
@@ -54,6 +110,11 @@
      * address MUST be set unless the create flag is set, in which case the address MUST NOT be
      * set.
      * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
      */
     public AmqpAddress getAddress();
 
@@ -87,6 +148,22 @@
      * client-id in some recognizable form for ease of traceability.
      * </p>
      */
+    public void setCreate(boolean create);
+
+    /**
+     * request creation of a remote Node
+     * <p>
+     * sent by the outgoing Link Endpoint.
+     * </p>
+     * <p>
+     * The algorithm used to produce the address from the Link name, must produce repeatable
+     * results. If the Link is durable, generating an address from a given Link name within a
+     * given client-id MUST always produce the same result. If the Link is not durable,
+     * generating an address from a given Link name within a given Session MUST always produce
+     * the same result. The generated address SHOULD include the Link name and Session-name or
+     * client-id in some recognizable form for ease of traceability.
+     * </p>
+     */
     public void setCreate(AmqpBoolean create);
 
     /**
@@ -125,6 +202,17 @@
      * which will be used.
      * </p>
      */
+    public void setTimeout(long timeout);
+
+    /**
+     * the source timeout
+     * <p>
+     * The minimum length of time (in milliseconds) after the Session has been destroyed before
+     * the source is destroyed. The value set by the receiving Link endpoint is indicative of
+     * the timeout it desires, the value set by the sending Link endpoint defines the timeout
+     * which will be used.
+     * </p>
+     */
     public void setTimeout(AmqpUint timeout);
 
     /**
@@ -170,14 +258,6 @@
      * state.
      * </p>
      */
-    public void setMessageStates(IAmqpList messageStates);
-
-    /**
-     * states of messages to be considered for sending from the source
-     * <p>
-     * state.
-     * </p>
-     */
     public void setMessageStates(AmqpList messageStates);
 
     /**
@@ -194,14 +274,6 @@
      * value).
      * </p>
      */
-    public void setOrphanDisposition(HashMap<AmqpType<?,?>, AmqpType<?,?>> orphanDisposition);
-
-    /**
-     * disposition for unacked Messages
-     * <p>
-     * value).
-     * </p>
-     */
     public void setOrphanDisposition(AmqpMap orphanDisposition);
 
     /**
@@ -210,7 +282,7 @@
      * value).
      * </p>
      */
-    public HashMap<AmqpType<?,?>, AmqpType<?,?>> getOrphanDisposition();
+    public IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getOrphanDisposition();
 
     public static class AmqpSourceBean implements AmqpSource{
 
@@ -223,16 +295,17 @@
         private AmqpFilterSet filter;
         private AmqpList messageStates;
         private AmqpMap orphanDisposition;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        public AmqpSourceBean() {
+        AmqpSourceBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpSourceBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpSourceBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpSourceBean(AmqpSource.AmqpSourceBean other) {
+        AmqpSourceBean(AmqpSource.AmqpSourceBean other) {
             this.bean = other;
         }
 
@@ -252,6 +325,11 @@
         }
 
 
+        public void setAddress(Buffer address) {
+            setAddress(TypeFactory.createAmqpAddress(address));
+        }
+
+
         public final void setAddress(AmqpAddress address) {
             copyCheck();
             bean.address = address;
@@ -262,7 +340,12 @@
         }
 
         public void setCreate(Boolean create) {
-            setCreate(new AmqpBoolean.AmqpBooleanBean(create));
+            setCreate(TypeFactory.createAmqpBoolean(create));
+        }
+
+
+        public void setCreate(boolean create) {
+            setCreate(TypeFactory.createAmqpBoolean(create));
         }
 
 
@@ -276,7 +359,12 @@
         }
 
         public void setTimeout(Long timeout) {
-            setTimeout(new AmqpUint.AmqpUintBean(timeout));
+            setTimeout(TypeFactory.createAmqpUint(timeout));
+        }
+
+
+        public void setTimeout(long timeout) {
+            setTimeout(TypeFactory.createAmqpUint(timeout));
         }
 
 
@@ -307,11 +395,6 @@
             return bean.filter;
         }
 
-        public void setMessageStates(IAmqpList messageStates) {
-            setMessageStates(new AmqpList.AmqpListBean(messageStates));
-        }
-
-
         public final void setMessageStates(AmqpList messageStates) {
             copyCheck();
             bean.messageStates = messageStates;
@@ -321,28 +404,32 @@
             return bean.messageStates.getValue();
         }
 
-        public void setOrphanDisposition(HashMap<AmqpType<?,?>, AmqpType<?,?>> orphanDisposition) {
-            setOrphanDisposition(new AmqpMap.AmqpMapBean(orphanDisposition));
-        }
-
-
         public final void setOrphanDisposition(AmqpMap orphanDisposition) {
             copyCheck();
             bean.orphanDisposition = orphanDisposition;
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getOrphanDisposition() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getOrphanDisposition() {
             return bean.orphanDisposition.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;
         }
 
@@ -357,29 +444,22 @@
         }
 
         private final void copy(AmqpSource.AmqpSourceBean other) {
-            this.address= other.address;
-            this.create= other.create;
-            this.timeout= other.timeout;
-            this.distributionMode= other.distributionMode;
-            this.filter= other.filter;
-            this.messageStates= other.messageStates;
-            this.orphanDisposition= other.orphanDisposition;
             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 AmqpSource)) {
+            if(o == null || !(o instanceof AmqpSource)) {
                 return false;
             }
 
-            return equivalent((AmqpSource) t);
+            return equals((AmqpSource) o);
         }
 
-        public boolean equivalent(AmqpSource b) {
+        public boolean equals(AmqpSource b) {
 
             if(b.getAddress() == null ^ getAddress() == null) {
                 return false;
@@ -431,16 +511,24 @@
             }
             return true;
         }
+
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
+        }
     }
 
     public static class AmqpSourceBuffer extends AmqpMap.AmqpMapBuffer implements AmqpSource{
 
         private AmqpSourceBean bean;
 
-        protected AmqpSourceBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpSourceBuffer(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             super(encoded);
         }
 
+        public void setAddress(Buffer address) {
+            bean().setAddress(address);
+        }
+
         public final void setAddress(AmqpAddress address) {
             bean().setAddress(address);
         }
@@ -449,10 +537,15 @@
             return bean().getAddress();
         }
 
-    public void setCreate(Boolean create) {
+        public void setCreate(Boolean create) {
             bean().setCreate(create);
         }
 
+        public void setCreate(boolean create) {
+            bean().setCreate(create);
+        }
+
+
         public final void setCreate(AmqpBoolean create) {
             bean().setCreate(create);
         }
@@ -461,10 +554,15 @@
             return bean().getCreate();
         }
 
-    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);
         }
@@ -489,10 +587,6 @@
             return bean().getFilter();
         }
 
-    public void setMessageStates(IAmqpList messageStates) {
-            bean().setMessageStates(messageStates);
-        }
-
         public final void setMessageStates(AmqpList messageStates) {
             bean().setMessageStates(messageStates);
         }
@@ -501,26 +595,30 @@
             return bean().getMessageStates();
         }
 
-    public void setOrphanDisposition(HashMap<AmqpType<?,?>, AmqpType<?,?>> orphanDisposition) {
-            bean().setOrphanDisposition(orphanDisposition);
-        }
-
         public final void setOrphanDisposition(AmqpMap orphanDisposition) {
             bean().setOrphanDisposition(orphanDisposition);
         }
 
-        public final HashMap<AmqpType<?,?>, AmqpType<?,?>> getOrphanDisposition() {
+        public final IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> getOrphanDisposition() {
             return bean().getOrphanDisposition();
         }
         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();
         }
 
@@ -536,11 +634,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpSource o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpSource.AmqpSourceBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpSource.AmqpSourceBuffer 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/AmqpString.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpString.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/AmqpString.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpString.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpStringBean bean = this;
         private String value;
 
-        protected AmqpStringBean() {
-        }
-
-        public AmqpStringBean(String value) {
+        AmqpStringBean(String value) {
             this.value = value;
         }
 
-        public AmqpStringBean(AmqpString.AmqpStringBean other) {
+        AmqpStringBean(AmqpString.AmqpStringBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpString) o);
+            return equals((AmqpString) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpString.AmqpStringBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpString)) {
-                return false;
-            }
-
-            return equivalent((AmqpString) t);
-        }
-
-        public boolean equivalent(AmqpString b) {
+        public boolean equals(AmqpString 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 AmqpString.AmqpStringBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpStringBuffer implements AmqpString, AmqpBuffer< String> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpString o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpString.AmqpStringBuffer create(Encoded<String> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSymbol.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSymbol.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/AmqpSymbol.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpSymbol.java Fri Feb 12 04:25:25 2010
@@ -44,14 +44,11 @@
         private AmqpSymbolBean bean = this;
         private String value;
 
-        protected AmqpSymbolBean() {
-        }
-
-        public AmqpSymbolBean(String value) {
+        AmqpSymbolBean(String value) {
             this.value = value;
         }
 
-        public AmqpSymbolBean(AmqpSymbol.AmqpSymbolBean other) {
+        AmqpSymbolBean(AmqpSymbol.AmqpSymbolBean other) {
             this.bean = other;
         }
 
@@ -85,29 +82,10 @@
                 return false;
             }
 
-            return equivalent((AmqpSymbol) o);
+            return equals((AmqpSymbol) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpSymbol.AmqpSymbolBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpSymbol)) {
-                return false;
-            }
-
-            return equivalent((AmqpSymbol) t);
-        }
-
-        public boolean equivalent(AmqpSymbol b) {
+        public boolean equals(AmqpSymbol b) {
             if(b == null) {
                 return false;
             }
@@ -118,6 +96,13 @@
 
             return b.getValue() == null || b.getValue().equals(getValue());
         }
+
+        public int hashCode() {
+            if(getValue() == null) {
+                return AmqpSymbol.AmqpSymbolBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpSymbolBuffer implements AmqpSymbol, AmqpBuffer< String> {
@@ -160,12 +145,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpSymbol o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpSymbol.AmqpSymbolBuffer create(Encoded<String> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTarget.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTarget.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/AmqpTarget.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTarget.java Fri Feb 12 04:25:25 2010
@@ -22,14 +22,49 @@
 import java.lang.Boolean;
 import java.lang.Long;
 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;
 
 public interface AmqpTarget extends AmqpMap {
 
 
+    /**
+     * Key for: The address of the target.
+     */
+    public static final AmqpSymbol ADDRESS_KEY = TypeFactory.createAmqpSymbol("address");
+    /**
+     * Key for: request creation of a remote Node
+     */
+    public static final AmqpSymbol CREATE_KEY = TypeFactory.createAmqpSymbol("create");
+    /**
+     * Key for: the target timeout
+     */
+    public static final AmqpSymbol TIMEOUT_KEY = TypeFactory.createAmqpSymbol("timeout");
+
+
+
+    /**
+     * The address of the target.
+     * <p>
+     * The address is resolved to a Node by the Container of the receiving Link Endpoint.
+     * </p>
+     * <p>
+     * command sent by the receiving Link Endpoint. When sent by the sending Link Endpoint the
+     * address MUST be set unless the create flag is set, in which case the address MUST NOT be
+     * set.
+     * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
+     */
+    public void setAddress(Buffer address);
 
     /**
      * The address of the target.
@@ -41,6 +76,11 @@
      * address MUST be set unless the create flag is set, in which case the address MUST NOT be
      * set.
      * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
      */
     public void setAddress(AmqpAddress address);
 
@@ -54,6 +94,11 @@
      * address MUST be set unless the create flag is set, in which case the address MUST NOT be
      * set.
      * </p>
+     * <p>
+     * Specifies the name for a source or target to which Messages are to be transferred to or
+     * from. Addresses are expected to be human readable, but are intentionally considered
+     * opaque. The format of an address is not defined by this specification.
+     * </p>
      */
     public AmqpAddress getAddress();
 
@@ -87,6 +132,22 @@
      * client-id in some recognizable form for ease of traceability.
      * </p>
      */
+    public void setCreate(boolean create);
+
+    /**
+     * request creation of a remote Node
+     * <p>
+     * sent by the incoming Link Endpoint.
+     * </p>
+     * <p>
+     * The algorithm used to produce the address from the Link name, must produce repeatable
+     * results. If the Link is durable, generating an address from a given Link name within a
+     * given client-id MUST always produce the same result. If the Link is not durable,
+     * generating an address from a given Link name within a given Session MUST always produce
+     * the same result. The generated address SHOULD include the Link name and Session-name or
+     * client-id in some recognizable form for ease of traceability.
+     * </p>
+     */
     public void setCreate(AmqpBoolean create);
 
     /**
@@ -125,6 +186,17 @@
      * which will be used.
      * </p>
      */
+    public void setTimeout(long timeout);
+
+    /**
+     * the target timeout
+     * <p>
+     * The minimum length of time (in milliseconds) after the Link has been destroyed before
+     * the target is destroyed. The value set by the sending Link endpoint is indicative of
+     * the timeout it desires, the value set by the receiving Link endpoint defines the timeout
+     * which will be used.
+     * </p>
+     */
     public void setTimeout(AmqpUint timeout);
 
     /**
@@ -145,16 +217,17 @@
         private AmqpAddress address;
         private AmqpBoolean create;
         private AmqpUint timeout;
-        private HashMap<AmqpType<?,?>, AmqpType<?,?>> value;
+        private IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value;
 
-        public AmqpTargetBean() {
+        AmqpTargetBean() {
+            this.value = new IAmqpMap.AmqpWrapperMap<AmqpType<?,?>, AmqpType<?,?>>(new HashMap<AmqpType<?,?>, AmqpType<?,?>>());
         }
 
-        public AmqpTargetBean(HashMap<AmqpType<?,?>, AmqpType<?,?>> value) {
+        AmqpTargetBean(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> value) {
             this.value = value;
         }
 
-        public AmqpTargetBean(AmqpTarget.AmqpTargetBean other) {
+        AmqpTargetBean(AmqpTarget.AmqpTargetBean other) {
             this.bean = other;
         }
 
@@ -174,6 +247,11 @@
         }
 
 
+        public void setAddress(Buffer address) {
+            setAddress(TypeFactory.createAmqpAddress(address));
+        }
+
+
         public final void setAddress(AmqpAddress address) {
             copyCheck();
             bean.address = address;
@@ -184,7 +262,12 @@
         }
 
         public void setCreate(Boolean create) {
-            setCreate(new AmqpBoolean.AmqpBooleanBean(create));
+            setCreate(TypeFactory.createAmqpBoolean(create));
+        }
+
+
+        public void setCreate(boolean create) {
+            setCreate(TypeFactory.createAmqpBoolean(create));
         }
 
 
@@ -198,7 +281,12 @@
         }
 
         public void setTimeout(Long timeout) {
-            setTimeout(new AmqpUint.AmqpUintBean(timeout));
+            setTimeout(TypeFactory.createAmqpUint(timeout));
+        }
+
+
+        public void setTimeout(long timeout) {
+            setTimeout(TypeFactory.createAmqpUint(timeout));
         }
 
 
@@ -211,14 +299,23 @@
             return bean.timeout.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;
         }
 
@@ -233,25 +330,22 @@
         }
 
         private final void copy(AmqpTarget.AmqpTargetBean other) {
-            this.address= other.address;
-            this.create= other.create;
-            this.timeout= other.timeout;
             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 AmqpTarget)) {
+            if(o == null || !(o instanceof AmqpTarget)) {
                 return false;
             }
 
-            return equivalent((AmqpTarget) t);
+            return equals((AmqpTarget) o);
         }
 
-        public boolean equivalent(AmqpTarget b) {
+        public boolean equals(AmqpTarget b) {
 
             if(b.getAddress() == null ^ getAddress() == null) {
                 return false;
@@ -275,16 +369,24 @@
             }
             return true;
         }
+
+        public int hashCode() {
+            return AbstractAmqpMap.hashCodeFor(this);
+        }
     }
 
     public static class AmqpTargetBuffer extends AmqpMap.AmqpMapBuffer implements AmqpTarget{
 
         private AmqpTargetBean bean;
 
-        protected AmqpTargetBuffer(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        protected AmqpTargetBuffer(Encoded<IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>>> encoded) {
             super(encoded);
         }
 
+        public void setAddress(Buffer address) {
+            bean().setAddress(address);
+        }
+
         public final void setAddress(AmqpAddress address) {
             bean().setAddress(address);
         }
@@ -293,10 +395,15 @@
             return bean().getAddress();
         }
 
-    public void setCreate(Boolean create) {
+        public void setCreate(Boolean create) {
             bean().setCreate(create);
         }
 
+        public void setCreate(boolean create) {
+            bean().setCreate(create);
+        }
+
+
         public final void setCreate(AmqpBoolean create) {
             bean().setCreate(create);
         }
@@ -305,10 +412,15 @@
             return bean().getCreate();
         }
 
-    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);
         }
@@ -320,11 +432,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();
         }
 
@@ -340,11 +460,19 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpTarget o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
-        public static AmqpTarget.AmqpTargetBuffer create(Encoded<HashMap<AmqpType<?,?>, AmqpType<?,?>>> encoded) {
+        public static AmqpTarget.AmqpTargetBuffer 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/AmqpTimestamp.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTimestamp.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/AmqpTimestamp.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTimestamp.java Fri Feb 12 04:25:25 2010
@@ -39,14 +39,11 @@
         private AmqpTimestampBean bean = this;
         private Date value;
 
-        protected AmqpTimestampBean() {
-        }
-
-        public AmqpTimestampBean(Date value) {
+        AmqpTimestampBean(Date value) {
             this.value = value;
         }
 
-        public AmqpTimestampBean(AmqpTimestamp.AmqpTimestampBean other) {
+        AmqpTimestampBean(AmqpTimestamp.AmqpTimestampBean other) {
             this.bean = other;
         }
 
@@ -80,29 +77,10 @@
                 return false;
             }
 
-            return equivalent((AmqpTimestamp) o);
+            return equals((AmqpTimestamp) o);
         }
 
-        public int hashCode() {
-            if(getValue() == null) {
-                return AmqpTimestamp.AmqpTimestampBean.class.hashCode();
-            }
-            return getValue().hashCode();
-        }
-
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
-
-            if(t == null || !(t instanceof AmqpTimestamp)) {
-                return false;
-            }
-
-            return equivalent((AmqpTimestamp) t);
-        }
-
-        public boolean equivalent(AmqpTimestamp b) {
+        public boolean equals(AmqpTimestamp 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 AmqpTimestamp.AmqpTimestampBean.class.hashCode();
+            }
+            return getValue().hashCode();
+        }
     }
 
     public static class AmqpTimestampBuffer implements AmqpTimestamp, AmqpBuffer< Date> {
@@ -155,12 +140,12 @@
             return bean().equals(o);
         }
 
-        public int hashCode() {
-            return bean().hashCode();
+        public boolean equals(AmqpTimestamp o){
+            return bean().equals(o);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpTimestamp.AmqpTimestampBuffer create(Encoded<Date> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTransfer.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTransfer.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/AmqpTransfer.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTransfer.java Fri Feb 12 04:25:25 2010
@@ -55,6 +55,38 @@
      * <p>
      * Specifies the Link on which the Message is transferred.
      * </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 on which the Message is transferred.
+     * </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 on which the Message is transferred.
+     * </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);
 
@@ -62,6 +94,12 @@
      * <p>
      * Specifies the Link on which the Message is transferred.
      * </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();
 
@@ -70,6 +108,13 @@
      * Uniquely identifies the delivery attempt for a given Message on this Link.
      * </p>
      */
+    public void setDeliveryTag(Buffer deliveryTag);
+
+    /**
+     * <p>
+     * Uniquely identifies the delivery attempt for a given Message on this Link.
+     * </p>
+     */
     public void setDeliveryTag(AmqpDeliveryTag deliveryTag);
 
     /**
@@ -87,6 +132,11 @@
     /**
      * indicates that the Message has more content
      */
+    public void setMore(boolean more);
+
+    /**
+     * indicates that the Message has more content
+     */
     public void setMore(AmqpBoolean more);
 
     /**
@@ -108,6 +158,14 @@
      * Aborted Messages should be discarded by the recipient.
      * </p>
      */
+    public void setAborted(boolean aborted);
+
+    /**
+     * indicates that the Message is aborted
+     * <p>
+     * Aborted Messages should be discarded by the recipient.
+     * </p>
+     */
     public void setAborted(AmqpBoolean aborted);
 
     /**
@@ -118,8 +176,6 @@
      */
     public Boolean getAborted();
 
-    public void setFragments(IAmqpList fragments);
-
     public void setFragments(AmqpList fragments);
 
     public IAmqpList getFragments();
@@ -135,258 +191,276 @@
         private AmqpBoolean aborted;
         private AmqpList fragments;
 
-        public AmqpTransferBean() {
+        AmqpTransferBean() {
         }
 
-        public AmqpTransferBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpTransferBean(IAmqpList value) {
 
-        public AmqpTransferBean(AmqpTransfer.AmqpTransferBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpTransferBean copy() {
-            return new AmqpTransfer.AmqpTransferBean(bean);
-        }
+    AmqpTransferBean(AmqpTransfer.AmqpTransferBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleTransfer(this);
-        }
+    public final AmqpTransferBean copy() {
+        return new AmqpTransfer.AmqpTransferBean(bean);
+    }
 
-        public final AmqpTransfer.AmqpTransferBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpTransferBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleTransfer(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpTransfer.AmqpTransferBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpTransferBuffer(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 setDeliveryTag(AmqpDeliveryTag deliveryTag) {
-            copyCheck();
-            bean.deliveryTag = deliveryTag;
-        }
 
-        public final AmqpDeliveryTag getDeliveryTag() {
-            return bean.deliveryTag;
-        }
+    public void setHandle(long handle) {
+        setHandle(TypeFactory.createAmqpHandle(handle));
+    }
 
-        public void setMore(Boolean more) {
-            setMore(new AmqpBoolean.AmqpBooleanBean(more));
-        }
 
+    public final void setHandle(AmqpHandle handle) {
+        copyCheck();
+        bean.handle = handle;
+    }
 
-        public final void setMore(AmqpBoolean more) {
-            copyCheck();
-            bean.more = more;
-        }
+    public final AmqpHandle getHandle() {
+        return bean.handle;
+    }
 
-        public final Boolean getMore() {
-            return bean.more.getValue();
-        }
+    public void setDeliveryTag(Buffer deliveryTag) {
+        setDeliveryTag(TypeFactory.createAmqpDeliveryTag(deliveryTag));
+    }
 
-        public void setAborted(Boolean aborted) {
-            setAborted(new AmqpBoolean.AmqpBooleanBean(aborted));
-        }
 
+    public final void setDeliveryTag(AmqpDeliveryTag deliveryTag) {
+        copyCheck();
+        bean.deliveryTag = deliveryTag;
+    }
 
-        public final void setAborted(AmqpBoolean aborted) {
-            copyCheck();
-            bean.aborted = aborted;
-        }
+    public final AmqpDeliveryTag getDeliveryTag() {
+        return bean.deliveryTag;
+    }
 
-        public final Boolean getAborted() {
-            return bean.aborted.getValue();
-        }
+    public void setMore(Boolean more) {
+        setMore(TypeFactory.createAmqpBoolean(more));
+    }
 
-        public void setFragments(IAmqpList fragments) {
-            setFragments(new AmqpList.AmqpListBean(fragments));
-        }
 
+    public void setMore(boolean more) {
+        setMore(TypeFactory.createAmqpBoolean(more));
+    }
 
-        public final void setFragments(AmqpList fragments) {
-            copyCheck();
-            bean.fragments = fragments;
-        }
 
-        public final IAmqpList getFragments() {
-            return bean.fragments.getValue();
-        }
+    public final void setMore(AmqpBoolean more) {
+        copyCheck();
+        bean.more = more;
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setHandle((AmqpHandle) value);
-                break;
-            }
-            case 2: {
-                setDeliveryTag((AmqpDeliveryTag) value);
-                break;
-            }
-            case 3: {
-                setMore((AmqpBoolean) value);
-                break;
-            }
-            case 4: {
-                setAborted((AmqpBoolean) value);
-                break;
-            }
-            case 5: {
-                setFragments((AmqpList) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
+    public final Boolean getMore() {
+        return bean.more.getValue();
+    }
 
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.options;
-            }
-            case 1: {
-                return bean.handle;
-            }
-            case 2: {
-                return bean.deliveryTag;
-            }
-            case 3: {
-                return bean.more;
-            }
-            case 4: {
-                return bean.aborted;
-            }
-            case 5: {
-                return bean.fragments;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
+    public void setAborted(Boolean aborted) {
+        setAborted(TypeFactory.createAmqpBoolean(aborted));
+    }
 
-        public int getListCount() {
-            return 6;
-        }
 
-        public IAmqpList getValue() {
-            return bean;
+    public void setAborted(boolean aborted) {
+        setAborted(TypeFactory.createAmqpBoolean(aborted));
+    }
+
+
+    public final void setAborted(AmqpBoolean aborted) {
+        copyCheck();
+        bean.aborted = aborted;
+    }
+
+    public final Boolean getAborted() {
+        return bean.aborted.getValue();
+    }
+
+    public final void setFragments(AmqpList fragments) {
+        copyCheck();
+        bean.fragments = fragments;
+    }
+
+    public final IAmqpList getFragments() {
+        return bean.fragments.getValue();
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setHandle((AmqpHandle) value);
+            break;
+        }
+        case 2: {
+            setDeliveryTag((AmqpDeliveryTag) value);
+            break;
+        }
+        case 3: {
+            setMore((AmqpBoolean) value);
+            break;
+        }
+        case 4: {
+            setAborted((AmqpBoolean) value);
+            break;
+        }
+        case 5: {
+            setFragments((AmqpList) value);
+            break;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
+        }
+    }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
+        }
+        case 1: {
+            return bean.handle;
+        }
+        case 2: {
+            return bean.deliveryTag;
+        }
+        case 3: {
+            return bean.more;
+        }
+        case 4: {
+            return bean.aborted;
         }
+        case 5: {
+            return bean.fragments;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
 
+    public int getListCount() {
+        return 6;
+    }
 
-        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 copy(AmqpTransfer.AmqpTransferBean other) {
-            this.options= other.options;
-            this.handle= other.handle;
-            this.deliveryTag= other.deliveryTag;
-            this.more= other.more;
-            this.aborted= other.aborted;
-            this.fragments= other.fragments;
-            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(AmqpTransfer.AmqpTransferBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpTransfer)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpTransfer) t);
+        if(o == null || !(o instanceof AmqpTransfer)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpTransfer b) {
+        return equals((AmqpTransfer) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpTransfer 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.getDeliveryTag() == null ^ getDeliveryTag() == null) {
-                return false;
-            }
-            if(b.getDeliveryTag() != null && !b.getDeliveryTag().equals(getDeliveryTag())){ 
-                return false;
-            }
+        if(b.getHandle() == null ^ getHandle() == null) {
+            return false;
+        }
+        if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ 
+            return false;
+        }
 
-            if(b.getMore() == null ^ getMore() == null) {
-                return false;
-            }
-            if(b.getMore() != null && !b.getMore().equals(getMore())){ 
-                return false;
-            }
+        if(b.getDeliveryTag() == null ^ getDeliveryTag() == null) {
+            return false;
+        }
+        if(b.getDeliveryTag() != null && !b.getDeliveryTag().equals(getDeliveryTag())){ 
+            return false;
+        }
 
-            if(b.getAborted() == null ^ getAborted() == null) {
-                return false;
-            }
-            if(b.getAborted() != null && !b.getAborted().equals(getAborted())){ 
-                return false;
-            }
+        if(b.getMore() == null ^ getMore() == null) {
+            return false;
+        }
+        if(b.getMore() != null && !b.getMore().equals(getMore())){ 
+            return false;
+        }
 
-            if(b.getFragments() == null ^ getFragments() == null) {
-                return false;
-            }
-            if(b.getFragments() != null && !b.getFragments().equals(getFragments())){ 
-                return false;
-            }
-            return true;
+        if(b.getAborted() == null ^ getAborted() == null) {
+            return false;
+        }
+        if(b.getAborted() != null && !b.getAborted().equals(getAborted())){ 
+            return false;
         }
+
+        if(b.getFragments() == null ^ getFragments() == null) {
+            return false;
+        }
+        if(b.getFragments() != null && !b.getFragments().equals(getFragments())){ 
+            return false;
+        }
+        return true;
     }
 
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
+    }
+}
+
     public static class AmqpTransferBuffer extends AmqpList.AmqpListBuffer implements AmqpTransfer{
 
         private AmqpTransferBean bean;
@@ -403,6 +477,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);
         }
@@ -411,6 +494,10 @@
             return bean().getHandle();
         }
 
+        public void setDeliveryTag(Buffer deliveryTag) {
+            bean().setDeliveryTag(deliveryTag);
+        }
+
         public final void setDeliveryTag(AmqpDeliveryTag deliveryTag) {
             bean().setDeliveryTag(deliveryTag);
         }
@@ -419,10 +506,15 @@
             return bean().getDeliveryTag();
         }
 
-    public void setMore(Boolean more) {
+        public void setMore(Boolean more) {
             bean().setMore(more);
         }
 
+        public void setMore(boolean more) {
+            bean().setMore(more);
+        }
+
+
         public final void setMore(AmqpBoolean more) {
             bean().setMore(more);
         }
@@ -431,10 +523,15 @@
             return bean().getMore();
         }
 
-    public void setAborted(Boolean aborted) {
+        public void setAborted(Boolean aborted) {
             bean().setAborted(aborted);
         }
 
+        public void setAborted(boolean aborted) {
+            bean().setAborted(aborted);
+        }
+
+
         public final void setAborted(AmqpBoolean aborted) {
             bean().setAborted(aborted);
         }
@@ -443,10 +540,6 @@
             return bean().getAborted();
         }
 
-    public void setFragments(IAmqpList fragments) {
-            bean().setFragments(fragments);
-        }
-
         public final void setFragments(AmqpList fragments) {
             bean().setFragments(fragments);
         }
@@ -491,8 +584,16 @@
             handler.handleTransfer(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpTransfer o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpTransfer.AmqpTransferBuffer create(Encoded<IAmqpList> encoded) {



Mime
View raw message