activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r909224 [9/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/AmqpTxn.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTxn.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/AmqpTxn.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpTxn.java Fri Feb 12 04:25:25 2010
@@ -74,6 +74,18 @@
      * rollback-only and the end result SHOULD have the xa-rbrollback status set.
      * </p>
      */
+    public void setFail(boolean fail);
+
+    /**
+     * Failure flag
+     * <p>
+     * If set, indicates that this portion of work has failed; otherwise this portion of work
+     * has completed successfully. An implementation MAY elect to roll a transaction back if
+     * this failure notification is received. Should an implementation elect to implement this
+     * behavior, and this bit is set, then then the transaction branch SHOULD be marked as
+     * rollback-only and the end result SHOULD have the xa-rbrollback status set.
+     * </p>
+     */
     public void setFail(AmqpBoolean fail);
 
     /**
@@ -106,6 +118,16 @@
      * command with resume specified.
      * </p>
      */
+    public void setSuspend(boolean suspend);
+
+    /**
+     * Temporary suspension flag
+     * <p>
+     * Indicates that the transaction branch is temporarily suspended in an incomplete state.
+     * The transaction context is in a suspended state and must be resumed via the enlist
+     * command with resume specified.
+     * </p>
+     */
     public void setSuspend(AmqpBoolean suspend);
 
     /**
@@ -126,181 +148,192 @@
         private AmqpBoolean fail;
         private AmqpBoolean suspend;
 
-        public AmqpTxnBean() {
+        AmqpTxnBean() {
         }
 
-        public AmqpTxnBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpTxnBean(IAmqpList value) {
 
-        public AmqpTxnBean(AmqpTxn.AmqpTxnBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpTxnBean copy() {
-            return new AmqpTxn.AmqpTxnBean(bean);
-        }
+    AmqpTxnBean(AmqpTxn.AmqpTxnBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleTxn(this);
-        }
+    public final AmqpTxnBean copy() {
+        return new AmqpTxn.AmqpTxnBean(bean);
+    }
 
-        public final AmqpTxn.AmqpTxnBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpTxnBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleTxn(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpTxn.AmqpTxnBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpTxnBuffer(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 void setFail(Boolean fail) {
-            setFail(new AmqpBoolean.AmqpBooleanBean(fail));
-        }
+    public final AmqpOptions getOptions() {
+        return bean.options;
+    }
 
+    public void setFail(Boolean fail) {
+        setFail(TypeFactory.createAmqpBoolean(fail));
+    }
 
-        public final void setFail(AmqpBoolean fail) {
-            copyCheck();
-            bean.fail = fail;
-        }
 
-        public final Boolean getFail() {
-            return bean.fail.getValue();
-        }
+    public void setFail(boolean fail) {
+        setFail(TypeFactory.createAmqpBoolean(fail));
+    }
 
-        public void setSuspend(Boolean suspend) {
-            setSuspend(new AmqpBoolean.AmqpBooleanBean(suspend));
-        }
 
+    public final void setFail(AmqpBoolean fail) {
+        copyCheck();
+        bean.fail = fail;
+    }
 
-        public final void setSuspend(AmqpBoolean suspend) {
-            copyCheck();
-            bean.suspend = suspend;
-        }
+    public final Boolean getFail() {
+        return bean.fail.getValue();
+    }
 
-        public final Boolean getSuspend() {
-            return bean.suspend.getValue();
-        }
+    public void setSuspend(Boolean suspend) {
+        setSuspend(TypeFactory.createAmqpBoolean(suspend));
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setFail((AmqpBoolean) value);
-                break;
-            }
-            case 2: {
-                setSuspend((AmqpBoolean) 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.fail;
-            }
-            case 2: {
-                return bean.suspend;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
+    public void setSuspend(boolean suspend) {
+        setSuspend(TypeFactory.createAmqpBoolean(suspend));
+    }
 
-        public int getListCount() {
-            return 3;
-        }
 
-        public IAmqpList getValue() {
-            return bean;
+    public final void setSuspend(AmqpBoolean suspend) {
+        copyCheck();
+        bean.suspend = suspend;
+    }
+
+    public final Boolean getSuspend() {
+        return bean.suspend.getValue();
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setFail((AmqpBoolean) value);
+            break;
+        }
+        case 2: {
+            setSuspend((AmqpBoolean) 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.fail;
+        }
+        case 2: {
+            return bean.suspend;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
 
+    public int getListCount() {
+        return 3;
+    }
+
+    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(AmqpTxn.AmqpTxnBean other) {
-            this.options= other.options;
-            this.fail= other.fail;
-            this.suspend= other.suspend;
-            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(AmqpTxn.AmqpTxnBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpTxn)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpTxn) t);
+        if(o == null || !(o instanceof AmqpTxn)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpTxn b) {
+        return equals((AmqpTxn) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpTxn b) {
 
-            if(b.getFail() == null ^ getFail() == null) {
-                return false;
-            }
-            if(b.getFail() != null && !b.getFail().equals(getFail())){ 
-                return false;
-            }
+        if(b.getOptions() == null ^ getOptions() == null) {
+            return false;
+        }
+        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+            return false;
+        }
 
-            if(b.getSuspend() == null ^ getSuspend() == null) {
-                return false;
-            }
-            if(b.getSuspend() != null && !b.getSuspend().equals(getSuspend())){ 
-                return false;
-            }
-            return true;
+        if(b.getFail() == null ^ getFail() == null) {
+            return false;
+        }
+        if(b.getFail() != null && !b.getFail().equals(getFail())){ 
+            return false;
         }
+
+        if(b.getSuspend() == null ^ getSuspend() == null) {
+            return false;
+        }
+        if(b.getSuspend() != null && !b.getSuspend().equals(getSuspend())){ 
+            return false;
+        }
+        return true;
     }
 
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
+    }
+}
+
     public static class AmqpTxnBuffer extends AmqpList.AmqpListBuffer implements AmqpTxn{
 
         private AmqpTxnBean bean;
@@ -317,10 +350,15 @@
             return bean().getOptions();
         }
 
-    public void setFail(Boolean fail) {
+        public void setFail(Boolean fail) {
             bean().setFail(fail);
         }
 
+        public void setFail(boolean fail) {
+            bean().setFail(fail);
+        }
+
+
         public final void setFail(AmqpBoolean fail) {
             bean().setFail(fail);
         }
@@ -329,10 +367,15 @@
             return bean().getFail();
         }
 
-    public void setSuspend(Boolean suspend) {
+        public void setSuspend(Boolean suspend) {
             bean().setSuspend(suspend);
         }
 
+        public void setSuspend(boolean suspend) {
+            bean().setSuspend(suspend);
+        }
+
+
         public final void setSuspend(AmqpBoolean suspend) {
             bean().setSuspend(suspend);
         }
@@ -377,8 +420,16 @@
             handler.handleTxn(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpTxn o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpTxn.AmqpTxnBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpType.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpType.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/AmqpType.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpType.java Fri Feb 12 04:25:25 2010
@@ -26,6 +26,4 @@
     public EncodedBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError;
     
     public void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError;
-    
-    public boolean equivalent(AmqpType<?,?> t);
 }

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

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

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

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpUnlink.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpUnlink.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/AmqpUnlink.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpUnlink.java Fri Feb 12 04:25:25 2010
@@ -50,11 +50,45 @@
 
     /**
      * identifies the Link
+     * <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);
+
+    /**
+     * identifies the Link
+     * <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);
+
+    /**
+     * identifies the Link
+     * <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);
 
     /**
      * identifies the Link
+     * <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();
 
@@ -84,170 +118,181 @@
         private AmqpHandle handle;
         private AmqpLinkError exception;
 
-        public AmqpUnlinkBean() {
+        AmqpUnlinkBean() {
         }
 
-        public AmqpUnlinkBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpUnlinkBean(IAmqpList value) {
 
-        public AmqpUnlinkBean(AmqpUnlink.AmqpUnlinkBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpUnlinkBean copy() {
-            return new AmqpUnlink.AmqpUnlinkBean(bean);
-        }
+    AmqpUnlinkBean(AmqpUnlink.AmqpUnlinkBean other) {
+        this.bean = other;
+    }
 
-        public final void handle(AmqpCommandHandler handler) throws Exception {
-            handler.handleUnlink(this);
-        }
+    public final AmqpUnlinkBean copy() {
+        return new AmqpUnlink.AmqpUnlinkBean(bean);
+    }
 
-        public final AmqpUnlink.AmqpUnlinkBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpUnlinkBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final void handle(AmqpCommandHandler handler) throws Exception {
+        handler.handleUnlink(this);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpUnlink.AmqpUnlinkBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpUnlinkBuffer(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 setException(AmqpLinkError exception) {
-            copyCheck();
-            bean.exception = exception;
+
+    public void setHandle(long handle) {
+        setHandle(TypeFactory.createAmqpHandle(handle));
+    }
+
+
+    public final void setHandle(AmqpHandle handle) {
+        copyCheck();
+        bean.handle = handle;
+    }
+
+    public final AmqpHandle getHandle() {
+        return bean.handle;
+    }
+
+    public final void setException(AmqpLinkError exception) {
+        copyCheck();
+        bean.exception = exception;
+    }
+
+    public final AmqpLinkError getException() {
+        return bean.exception;
+    }
+
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setOptions((AmqpOptions) value);
+            break;
+        }
+        case 1: {
+            setHandle((AmqpHandle) value);
+            break;
+        }
+        case 2: {
+            setException((AmqpLinkError) value);
+            break;
         }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
 
-        public final AmqpLinkError getException() {
+    public AmqpType<?, ?> get(int index) {
+        switch(index) {
+        case 0: {
+            return bean.options;
+        }
+        case 1: {
+            return bean.handle;
+        }
+        case 2: {
             return bean.exception;
         }
-
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setOptions((AmqpOptions) value);
-                break;
-            }
-            case 1: {
-                setHandle((AmqpHandle) value);
-                break;
-            }
-            case 2: {
-                setException((AmqpLinkError) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
         }
-
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.options;
-            }
-            case 1: {
-                return bean.handle;
-            }
-            case 2: {
-                return bean.exception;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
         }
+    }
 
-        public int getListCount() {
-            return 3;
-        }
+    public int getListCount() {
+        return 3;
+    }
 
-        public IAmqpList getValue() {
-            return bean;
-        }
+    public IAmqpList getValue() {
+        return bean;
+    }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(bean);
-        }
+    public Iterator<AmqpType<?, ?>> iterator() {
+        return new AmqpListIterator(bean);
+    }
 
 
-        private final void copyCheck() {
-            if(buffer != null) {;
-                throw new IllegalStateException("unwriteable");
-            }
-            if(bean != this) {;
-                copy(bean);
-            }
+    private final void copyCheck() {
+        if(buffer != null) {;
+            throw new IllegalStateException("unwriteable");
         }
-
-        private final void copy(AmqpUnlink.AmqpUnlinkBean other) {
-            this.options= other.options;
-            this.handle= other.handle;
-            this.exception= other.exception;
-            bean = this;
+        if(bean != this) {;
+            copy(bean);
         }
+    }
 
-        public boolean equivalent(AmqpType<?,?> t){
-            if(this == t) {
-                return true;
-            }
+    private final void copy(AmqpUnlink.AmqpUnlinkBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpUnlink)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpUnlink) t);
+        if(o == null || !(o instanceof AmqpUnlink)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpUnlink b) {
+        return equals((AmqpUnlink) o);
+    }
 
-            if(b.getOptions() == null ^ getOptions() == null) {
-                return false;
-            }
-            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-                return false;
-            }
+    public boolean equals(AmqpUnlink 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.getException() == null ^ getException() == null) {
-                return false;
-            }
-            if(b.getException() != null && !b.getException().equivalent(getException())){ 
-                return false;
-            }
-            return true;
+        if(b.getHandle() == null ^ getHandle() == null) {
+            return false;
         }
+        if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ 
+            return false;
+        }
+
+        if(b.getException() == null ^ getException() == null) {
+            return false;
+        }
+        if(b.getException() != null && !b.getException().equals(getException())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpUnlinkBuffer extends AmqpList.AmqpListBuffer implements AmqpUnlink{
 
@@ -265,6 +310,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);
         }
@@ -317,8 +371,16 @@
             handler.handleUnlink(this);
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpUnlink o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpUnlink.AmqpUnlinkBuffer create(Encoded<IAmqpList> encoded) {

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

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

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpXid.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpXid.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/AmqpXid.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpXid.java Fri Feb 12 04:25:25 2010
@@ -45,6 +45,11 @@
     /**
      * implementation specific format code
      */
+    public void setFormat(long format);
+
+    /**
+     * implementation specific format code
+     */
     public void setFormat(AmqpUint format);
 
     /**
@@ -90,181 +95,187 @@
         private AmqpBinary globalId;
         private AmqpBinary branchId;
 
-        public AmqpXidBean() {
+        AmqpXidBean() {
         }
 
-        public AmqpXidBean(IAmqpList value) {
-            //TODO we should defer decoding of the described type:
-            for(int i = 0; i < value.getListCount(); i++) {
-                set(i, value.get(i));
-            }
-        }
+        AmqpXidBean(IAmqpList value) {
 
-        public AmqpXidBean(AmqpXid.AmqpXidBean other) {
-            this.bean = other;
+        for(int i = 0; i < value.getListCount(); i++) {
+            set(i, value.get(i));
         }
+    }
 
-        public final AmqpXidBean copy() {
-            return new AmqpXid.AmqpXidBean(bean);
-        }
+    AmqpXidBean(AmqpXid.AmqpXidBean other) {
+        this.bean = other;
+    }
 
-        public final AmqpXid.AmqpXidBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-            if(buffer == null) {
-                buffer = new AmqpXidBuffer(marshaller.encode(this));
-            }
-            return buffer;
-        }
+    public final AmqpXidBean copy() {
+        return new AmqpXid.AmqpXidBean(bean);
+    }
 
-        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
-            getBuffer(marshaller).marshal(out, marshaller);
+    public final AmqpXid.AmqpXidBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+        if(buffer == null) {
+            buffer = new AmqpXidBuffer(marshaller.encode(this));
         }
+        return buffer;
+    }
 
+    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{
+        getBuffer(marshaller).marshal(out, marshaller);
+    }
 
-        public void setFormat(Long format) {
-            setFormat(new AmqpUint.AmqpUintBean(format));
-        }
 
+    public void setFormat(Long format) {
+        setFormat(TypeFactory.createAmqpUint(format));
+    }
 
-        public final void setFormat(AmqpUint format) {
-            copyCheck();
-            bean.format = format;
-        }
 
-        public final Long getFormat() {
-            return bean.format.getValue();
-        }
+    public void setFormat(long format) {
+        setFormat(TypeFactory.createAmqpUint(format));
+    }
 
-        public void setGlobalId(Buffer globalId) {
-            setGlobalId(new AmqpBinary.AmqpBinaryBean(globalId));
-        }
 
+    public final void setFormat(AmqpUint format) {
+        copyCheck();
+        bean.format = format;
+    }
 
-        public final void setGlobalId(AmqpBinary globalId) {
-            copyCheck();
-            bean.globalId = globalId;
-        }
+    public final Long getFormat() {
+        return bean.format.getValue();
+    }
 
-        public final Buffer getGlobalId() {
-            return bean.globalId.getValue();
-        }
+    public void setGlobalId(Buffer globalId) {
+        setGlobalId(TypeFactory.createAmqpBinary(globalId));
+    }
 
-        public void setBranchId(Buffer branchId) {
-            setBranchId(new AmqpBinary.AmqpBinaryBean(branchId));
-        }
 
+    public final void setGlobalId(AmqpBinary globalId) {
+        copyCheck();
+        bean.globalId = globalId;
+    }
 
-        public final void setBranchId(AmqpBinary branchId) {
-            copyCheck();
-            bean.branchId = branchId;
-        }
+    public final Buffer getGlobalId() {
+        return bean.globalId.getValue();
+    }
 
-        public final Buffer getBranchId() {
-            return bean.branchId.getValue();
-        }
+    public void setBranchId(Buffer branchId) {
+        setBranchId(TypeFactory.createAmqpBinary(branchId));
+    }
 
-        public void set(int index, AmqpType<?, ?> value) {
-            switch(index) {
-            case 0: {
-                setFormat((AmqpUint) value);
-                break;
-            }
-            case 1: {
-                setGlobalId((AmqpBinary) value);
-                break;
-            }
-            case 2: {
-                setBranchId((AmqpBinary) value);
-                break;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
 
-        public AmqpType<?, ?> get(int index) {
-            switch(index) {
-            case 0: {
-                return bean.format;
-            }
-            case 1: {
-                return bean.globalId;
-            }
-            case 2: {
-                return bean.branchId;
-            }
-            default : {
-                throw new IndexOutOfBoundsException(String.valueOf(index));
-            }
-            }
-        }
+    public final void setBranchId(AmqpBinary branchId) {
+        copyCheck();
+        bean.branchId = branchId;
+    }
 
-        public int getListCount() {
-            return 3;
-        }
+    public final Buffer getBranchId() {
+        return bean.branchId.getValue();
+    }
 
-        public IAmqpList getValue() {
-            return bean;
+    public void set(int index, AmqpType<?, ?> value) {
+        switch(index) {
+        case 0: {
+            setFormat((AmqpUint) value);
+            break;
+        }
+        case 1: {
+            setGlobalId((AmqpBinary) value);
+            break;
+        }
+        case 2: {
+            setBranchId((AmqpBinary) 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.format;
         }
+        case 1: {
+            return bean.globalId;
+        }
+        case 2: {
+            return bean.branchId;
+        }
+        default : {
+            throw new IndexOutOfBoundsException(String.valueOf(index));
+        }
+        }
+    }
 
+    public int getListCount() {
+        return 3;
+    }
 
-        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(AmqpXid.AmqpXidBean other) {
-            this.format= other.format;
-            this.globalId= other.globalId;
-            this.branchId= other.branchId;
-            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(AmqpXid.AmqpXidBean other) {
+        bean = this;
+    }
 
-            if(t == null || !(t instanceof AmqpXid)) {
-                return false;
-            }
+    public boolean equals(Object o){
+        if(this == o) {
+            return true;
+        }
 
-            return equivalent((AmqpXid) t);
+        if(o == null || !(o instanceof AmqpXid)) {
+            return false;
         }
 
-        public boolean equivalent(AmqpXid b) {
+        return equals((AmqpXid) o);
+    }
+
+    public boolean equals(AmqpXid b) {
 
-            if(b.getFormat() == null ^ getFormat() == null) {
-                return false;
-            }
-            if(b.getFormat() != null && !b.getFormat().equals(getFormat())){ 
-                return false;
-            }
+        if(b.getFormat() == null ^ getFormat() == null) {
+            return false;
+        }
+        if(b.getFormat() != null && !b.getFormat().equals(getFormat())){ 
+            return false;
+        }
 
-            if(b.getGlobalId() == null ^ getGlobalId() == null) {
-                return false;
-            }
-            if(b.getGlobalId() != null && !b.getGlobalId().equals(getGlobalId())){ 
-                return false;
-            }
+        if(b.getGlobalId() == null ^ getGlobalId() == null) {
+            return false;
+        }
+        if(b.getGlobalId() != null && !b.getGlobalId().equals(getGlobalId())){ 
+            return false;
+        }
 
-            if(b.getBranchId() == null ^ getBranchId() == null) {
-                return false;
-            }
-            if(b.getBranchId() != null && !b.getBranchId().equals(getBranchId())){ 
-                return false;
-            }
-            return true;
+        if(b.getBranchId() == null ^ getBranchId() == null) {
+            return false;
         }
+        if(b.getBranchId() != null && !b.getBranchId().equals(getBranchId())){ 
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return AbstractAmqpList.hashCodeFor(this);
     }
+}
 
     public static class AmqpXidBuffer extends AmqpList.AmqpListBuffer implements AmqpXid{
 
@@ -274,10 +285,15 @@
             super(encoded);
         }
 
-    public void setFormat(Long format) {
+        public void setFormat(Long format) {
             bean().setFormat(format);
         }
 
+        public void setFormat(long format) {
+            bean().setFormat(format);
+        }
+
+
         public final void setFormat(AmqpUint format) {
             bean().setFormat(format);
         }
@@ -286,7 +302,7 @@
             return bean().getFormat();
         }
 
-    public void setGlobalId(Buffer globalId) {
+        public void setGlobalId(Buffer globalId) {
             bean().setGlobalId(globalId);
         }
 
@@ -298,7 +314,7 @@
             return bean().getGlobalId();
         }
 
-    public void setBranchId(Buffer branchId) {
+        public void setBranchId(Buffer branchId) {
             bean().setBranchId(branchId);
         }
 
@@ -342,8 +358,16 @@
             return bean;
         }
 
-        public boolean equivalent(AmqpType<?, ?> t) {
-            return bean().equivalent(t);
+        public boolean equals(Object o){
+            return bean().equals(o);
+        }
+
+        public boolean equals(AmqpXid o){
+            return bean().equals(o);
+        }
+
+        public int hashCode() {
+            return bean().hashCode();
         }
 
         public static AmqpXid.AmqpXidBuffer create(Encoded<IAmqpList> encoded) {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpList.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpList.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/IAmqpList.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpList.java Fri Feb 12 04:25:25 2010
@@ -17,6 +17,10 @@
 package org.apache.activemq.amqp.protocol.types;
 
 import java.util.Iterator;
+import java.util.List;
+
+import org.apache.activemq.amqp.protocol.types.AmqpType;
+import org.apache.activemq.amqp.protocol.types.IAmqpList;
 
 public interface IAmqpList extends Iterable<AmqpType<?, ?>> {
 
@@ -46,4 +50,125 @@
             throw new UnsupportedOperationException();
         }
     }
+
+    public static abstract class AbstractAmqpList implements IAmqpList {
+        public static final int hashCodeFor(IAmqpList l) {
+            int hashCode = 1;
+            for (Object obj : l) {
+                hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
+            }
+            return hashCode;
+        }
+        
+        public static final boolean checkEqual(IAmqpList l1, IAmqpList l2) {
+            if (l1 == null ^ l2 == null) {
+                return false;
+            }
+
+            if (l1 == null) {
+                return true;
+            }
+
+            if (l1.getListCount() != l2.getListCount()) {
+                return false;
+            }
+
+            Iterator<?> i1 = l1.iterator();
+            Iterator<?> i2 = l2.iterator();
+            while (i1.hasNext()) {
+                Object e1 = i1.next();
+                Object e2 = i2.next();
+                if (!(e1 == null ? e2 == null : e1.equals(e2))) {
+                    return false;
+                }
+            }
+            return true;
+        }
+    }
+
+    public static class AmqpWrapperList extends AbstractAmqpList {
+        private final List<AmqpType<?, ?>> list;
+
+        public AmqpWrapperList(List<AmqpType<?, ?>> list) {
+            this.list = list;
+        }
+
+        public AmqpType<?, ?> get(int index) {
+            return list.get(index);
+        }
+
+        public int getListCount() {
+            return list.size();
+        }
+
+        public void set(int index, AmqpType<?, ?> value) {
+            list.set(index, value);
+        }
+
+        public Iterator<AmqpType<?, ?>> iterator() {
+            return list.iterator();
+        }
+
+        public boolean equals(Object o) {
+            if (o == null) {
+                return false;
+            }
+
+            if (o instanceof IAmqpList) {
+                return equals((IAmqpList) o);
+            }
+            return false;
+        }
+
+        public boolean equals(IAmqpList l) {
+            return checkEqual(this, l);
+        }
+
+        public int hashCode() {
+            return hashCodeFor(this);
+        }
+    }
+
+    public static class ArrayBackedList extends AbstractAmqpList {
+        AmqpType<?, ?>[] list;
+
+        ArrayBackedList(int size) {
+            list = new AmqpType<?, ?>[size];
+        }
+
+        public AmqpType<?, ?> get(int index) {
+            return list[index];
+        }
+
+        public int getListCount() {
+            return list.length;
+        }
+
+        public void set(int index, AmqpType<?, ?> value) {
+            list[index] = value;
+        }
+
+        public Iterator<AmqpType<?, ?>> iterator() {
+            return new AmqpListIterator(this);
+        }
+
+        public boolean equals(Object o) {
+            if (o == null) {
+                return false;
+            }
+
+            if (o instanceof IAmqpList) {
+                return equals((IAmqpList) o);
+            }
+            return false;
+        }
+
+        public boolean equals(IAmqpList l) {
+            return checkEqual(this, l);
+        }
+
+        public int hashCode() {
+            return hashCodeFor(this);
+        }
+    }
 }

Added: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpMap.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpMap.java?rev=909224&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpMap.java (added)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/IAmqpMap.java Fri Feb 12 04:25:25 2010
@@ -0,0 +1,138 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with his work
+ * for additional information regarding copyright ownership. The ASF licenses
+ * this file to You under the Apache License, Version 2.0 (the "License"); you
+ * may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.activemq.amqp.protocol.types;
+
+import java.util.Iterator;
+import java.util.Map;
+
+
+public interface IAmqpMap<K extends AmqpType<?, ?>, V extends AmqpType<?, ?>> extends Iterable<Map.Entry<K, V>> {
+
+    public void put(K key, V value);
+
+    public V get(Object key);
+    
+    public int getEntryCount();
+
+//    public void put(Object key, Object V);
+//    
+//    public V get(Object o) throws AmqpEncodingError;
+
+
+    public static abstract class AbstractAmqpMap<K extends AmqpType<?, ?>, V extends AmqpType<?, ?>> implements IAmqpMap<K, V> {
+
+        public static final int hashCodeFor(IAmqpMap<?, ?> map) {
+            int hashCode = 1;
+            for (Map.Entry<?, ?> obj : map) {
+                hashCode = 31 * hashCode + (obj.getKey() == null ? 0 : obj.getKey().hashCode());
+                hashCode = 31 * hashCode + (obj.getValue() == null ? 0 : obj.getValue().hashCode());
+            }
+            return hashCode;
+        }
+
+        public static final <K extends AmqpType<?, ?>, V extends AmqpType<?,?>> boolean checkEqual(IAmqpMap<K, V> m1, IAmqpMap<?, ?> m2) {
+            if (m1 == null ^ m2 == null) {
+                return false;
+            }
+
+            if (m2 == null) {
+                return true;
+            }
+
+            if (m1.getEntryCount() != m2.getEntryCount()) {
+                return false;
+            }
+
+            Iterator<Map.Entry<K, V>> i1 = m1.iterator();
+            while (i1.hasNext()) {
+                Map.Entry<K, V> e1 = i1.next();
+                Object v2 = m2.get(e1.getKey());
+                if (v2 == null) {
+                    return false;
+                }
+                if (!(e1.getValue() == null ? v2 == null : e1.getValue().equals(v2))) {
+                    return false;
+                }
+            }
+            return true;
+        }
+    }
+
+    public static class AmqpWrapperMap<K extends AmqpType<?, ?>, V extends AmqpType<?, ?>> extends AbstractAmqpMap<K, V> {
+        private Map<K, V> map;
+
+        public AmqpWrapperMap(Map<K, V> map) {
+            this.map = map;
+        }
+
+        public V get(Object key) {
+            return map.get(key);
+        }
+
+        public Map.Entry<K, V> getEntry(final K key) {
+            final V v = get(key);
+            if (v == null) {
+                return null;
+            }
+            return new Map.Entry<K, V>() {
+
+                public K getKey() {
+                    return key;
+                }
+
+                public V getValue() {
+                    return v;
+                }
+
+                public V setValue(V value) {
+                    throw new UnsupportedOperationException();
+                }
+            };
+        }
+
+        public int getEntryCount() {
+            return map.size();
+        }
+
+        public void put(K key, V value) {
+            map.put(key, value);
+        }
+
+        public Iterator<Map.Entry<K, V>> iterator() {
+            return map.entrySet().iterator();
+        }
+
+        public boolean equals(Object o) {
+            if (o == null) {
+                return false;
+            }
+
+            if (o instanceof IAmqpMap<?, ?>) {
+                return checkEqual(this, (IAmqpMap<?, ?>) o);
+            }
+            return false;
+        }
+
+        public boolean equals(IAmqpMap<?, ?> m) {
+            return checkEqual(this, m);
+        }
+
+        public int hashCode() {
+            return hashCodeFor(this);
+        }
+    }
+}

Added: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java?rev=909224&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java (added)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java Fri Feb 12 04:25:25 2010
@@ -0,0 +1,568 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * his work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.amqp.protocol.types;
+
+import java.math.BigInteger;
+import java.util.Date;
+import java.util.UUID;
+import org.apache.activemq.util.buffer.Buffer;
+
+
+public class TypeFactory {
+
+    /**
+     * Creates a AmqpSessionError
+     */
+    public static final AmqpSessionError createAmqpSessionError() {
+        return new AmqpSessionError.AmqpSessionErrorBean();
+    };
+
+    /**
+     * Creates a AmqpHandle
+     */
+    public static final AmqpHandle createAmqpHandle(Long val) {
+        return new AmqpHandle.AmqpHandleBean(val);
+    }
+    /**
+     * Creates a AmqpHandle
+     */
+    public static final AmqpHandle createAmqpHandle(long val) {
+        return new AmqpHandle.AmqpHandleBean(val);
+    }
+
+    /**
+     * Creates a AmqpChar
+     */
+    public static final AmqpChar createAmqpChar(Integer val) {
+        return new AmqpChar.AmqpCharBean(val);
+    }
+    /**
+     * Creates a AmqpChar
+     */
+    public static final AmqpChar createAmqpChar(int val) {
+        return new AmqpChar.AmqpCharBean(val);
+    }
+
+    /**
+     * Creates a AmqpUnlink
+     */
+    public static final AmqpUnlink createAmqpUnlink() {
+        return new AmqpUnlink.AmqpUnlinkBean();
+    };
+
+    /**
+     * Creates a AmqpFlow
+     */
+    public static final AmqpFlow createAmqpFlow() {
+        return new AmqpFlow.AmqpFlowBean();
+    };
+
+    /**
+     * Creates a AmqpLong
+     */
+    public static final AmqpLong createAmqpLong(Long val) {
+        return new AmqpLong.AmqpLongBean(val);
+    }
+    /**
+     * Creates a AmqpLong
+     */
+    public static final AmqpLong createAmqpLong(long val) {
+        return new AmqpLong.AmqpLongBean(val);
+    }
+
+    /**
+     * Creates a AmqpSequenceNo
+     */
+    public static final AmqpSequenceNo createAmqpSequenceNo(Long val) {
+        return new AmqpSequenceNo.AmqpSequenceNoBean(val);
+    }
+    /**
+     * Creates a AmqpSequenceNo
+     */
+    public static final AmqpSequenceNo createAmqpSequenceNo(long val) {
+        return new AmqpSequenceNo.AmqpSequenceNoBean(val);
+    }
+
+    /**
+     * Creates a AmqpFloat
+     */
+    public static final AmqpFloat createAmqpFloat(Float val) {
+        return new AmqpFloat.AmqpFloatBean(val);
+    }
+    /**
+     * Creates a AmqpFloat
+     */
+    public static final AmqpFloat createAmqpFloat(float val) {
+        return new AmqpFloat.AmqpFloatBean(val);
+    }
+
+    /**
+     * Creates a AmqpRelink
+     */
+    public static final AmqpRelink createAmqpRelink() {
+        return new AmqpRelink.AmqpRelinkBean();
+    };
+
+    /**
+     * Creates a AmqpClose
+     */
+    public static final AmqpClose createAmqpClose() {
+        return new AmqpClose.AmqpCloseBean();
+    };
+
+    /**
+     * Creates a AmqpOpen
+     */
+    public static final AmqpOpen createAmqpOpen() {
+        return new AmqpOpen.AmqpOpenBean();
+    };
+
+    /**
+     * Creates a AmqpByte
+     */
+    public static final AmqpByte createAmqpByte(Byte val) {
+        return new AmqpByte.AmqpByteBean(val);
+    }
+    /**
+     * Creates a AmqpByte
+     */
+    public static final AmqpByte createAmqpByte(byte val) {
+        return new AmqpByte.AmqpByteBean(val);
+    }
+
+    /**
+     * Creates a AmqpRejected
+     */
+    public static final AmqpRejected createAmqpRejected() {
+        return new AmqpRejected.AmqpRejectedBean();
+    };
+
+    /**
+     * Creates a AmqpSaslOutcome
+     */
+    public static final AmqpSaslOutcome createAmqpSaslOutcome() {
+        return new AmqpSaslOutcome.AmqpSaslOutcomeBean();
+    };
+
+    /**
+     * Creates a AmqpSessionName
+     */
+    public static final AmqpSessionName createAmqpSessionName(Buffer val) {
+        return new AmqpSessionName.AmqpSessionNameBean(val);
+    }
+
+    /**
+     * Creates a AmqpBoolean
+     */
+    public static final AmqpBoolean createAmqpBoolean(Boolean val) {
+        return new AmqpBoolean.AmqpBooleanBean(val);
+    }
+    /**
+     * Creates a AmqpBoolean
+     */
+    public static final AmqpBoolean createAmqpBoolean(boolean val) {
+        return new AmqpBoolean.AmqpBooleanBean(val);
+    }
+
+    /**
+     * Creates a AmqpUlong
+     */
+    public static final AmqpUlong createAmqpUlong(BigInteger val) {
+        return new AmqpUlong.AmqpUlongBean(val);
+    }
+
+    /**
+     * Creates a AmqpTransfer
+     */
+    public static final AmqpTransfer createAmqpTransfer() {
+        return new AmqpTransfer.AmqpTransferBean();
+    };
+
+    /**
+     * Creates a AmqpDetach
+     */
+    public static final AmqpDetach createAmqpDetach() {
+        return new AmqpDetach.AmqpDetachBean();
+    };
+
+    /**
+     * Creates a AmqpSymbol
+     */
+    public static final AmqpSymbol createAmqpSymbol(String val) {
+        return new AmqpSymbol.AmqpSymbolBean(val);
+    }
+
+    /**
+     * Creates a AmqpSaslInit
+     */
+    public static final AmqpSaslInit createAmqpSaslInit() {
+        return new AmqpSaslInit.AmqpSaslInitBean();
+    };
+
+    /**
+     * Creates a AmqpInt
+     */
+    public static final AmqpInt createAmqpInt(Integer val) {
+        return new AmqpInt.AmqpIntBean(val);
+    }
+    /**
+     * Creates a AmqpInt
+     */
+    public static final AmqpInt createAmqpInt(int val) {
+        return new AmqpInt.AmqpIntBean(val);
+    }
+
+    /**
+     * Creates a AmqpDeliveryTag
+     */
+    public static final AmqpDeliveryTag createAmqpDeliveryTag(Buffer val) {
+        return new AmqpDeliveryTag.AmqpDeliveryTagBean(val);
+    }
+
+    /**
+     * Creates a AmqpEnlist
+     */
+    public static final AmqpEnlist createAmqpEnlist() {
+        return new AmqpEnlist.AmqpEnlistBean();
+    };
+
+    /**
+     * Creates a AmqpProperties
+     */
+    public static final AmqpProperties createAmqpProperties() {
+        return new AmqpProperties.AmqpPropertiesBean();
+    };
+
+    /**
+     * Creates a AmqpDouble
+     */
+    public static final AmqpDouble createAmqpDouble(Double val) {
+        return new AmqpDouble.AmqpDoubleBean(val);
+    }
+    /**
+     * Creates a AmqpDouble
+     */
+    public static final AmqpDouble createAmqpDouble(double val) {
+        return new AmqpDouble.AmqpDoubleBean(val);
+    }
+
+    /**
+     * Creates a AmqpDrain
+     */
+    public static final AmqpDrain createAmqpDrain() {
+        return new AmqpDrain.AmqpDrainBean();
+    };
+
+    /**
+     * Creates a AmqpHeader
+     */
+    public static final AmqpHeader createAmqpHeader() {
+        return new AmqpHeader.AmqpHeaderBean();
+    };
+
+    /**
+     * Creates a AmqpMessageAttributes
+     */
+    public static final AmqpMessageAttributes createAmqpMessageAttributes(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> val) {
+        return new AmqpMessageAttributes.AmqpMessageAttributesBean(val);
+    }
+    /**
+     * Creates an empty AmqpMessageAttributes
+     */
+    public static final AmqpMessageAttributes createAmqpMessageAttributes() {
+        return new AmqpMessageAttributes.AmqpMessageAttributesBean();
+    }
+
+    /**
+     * Creates a AmqpSaslMechanisms
+     */
+    public static final AmqpSaslMechanisms createAmqpSaslMechanisms() {
+        return new AmqpSaslMechanisms.AmqpSaslMechanismsBean();
+    };
+
+    /**
+     * Creates a AmqpUuid
+     */
+    public static final AmqpUuid createAmqpUuid(UUID val) {
+        return new AmqpUuid.AmqpUuidBean(val);
+    }
+
+    /**
+     * Creates a AmqpBar
+     */
+    public static final AmqpBar createAmqpBar() {
+        return new AmqpBar.AmqpBarBean();
+    };
+
+    /**
+     * Creates a AmqpFilter
+     */
+    public static final AmqpFilter createAmqpFilter() {
+        return new AmqpFilter.AmqpFilterBean();
+    };
+
+    /**
+     * Creates a AmqpBinary
+     */
+    public static final AmqpBinary createAmqpBinary(Buffer val) {
+        return new AmqpBinary.AmqpBinaryBean(val);
+    }
+
+    /**
+     * Creates a AmqpNoop
+     */
+    public static final AmqpNoop createAmqpNoop() {
+        return new AmqpNoop.AmqpNoopBean();
+    };
+
+    /**
+     * Creates a AmqpLink
+     */
+    public static final AmqpLink createAmqpLink() {
+        return new AmqpLink.AmqpLinkBean();
+    };
+
+    /**
+     * Creates a AmqpTimestamp
+     */
+    public static final AmqpTimestamp createAmqpTimestamp(Date val) {
+        return new AmqpTimestamp.AmqpTimestampBean(val);
+    }
+
+    /**
+     * Creates a AmqpShort
+     */
+    public static final AmqpShort createAmqpShort(Short val) {
+        return new AmqpShort.AmqpShortBean(val);
+    }
+    /**
+     * Creates a AmqpShort
+     */
+    public static final AmqpShort createAmqpShort(short val) {
+        return new AmqpShort.AmqpShortBean(val);
+    }
+
+    /**
+     * Creates a AmqpReleased
+     */
+    public static final AmqpReleased createAmqpReleased() {
+        return new AmqpReleased.AmqpReleasedBean();
+    };
+
+    /**
+     * Creates a AmqpTxn
+     */
+    public static final AmqpTxn createAmqpTxn() {
+        return new AmqpTxn.AmqpTxnBean();
+    };
+
+    /**
+     * Creates a AmqpMap
+     */
+    public static final AmqpMap createAmqpMap(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> val) {
+        return new AmqpMap.AmqpMapBean(val);
+    }
+    /**
+     * Creates an empty AmqpMap
+     */
+    public static final AmqpMap createAmqpMap() {
+        return new AmqpMap.AmqpMapBean();
+    }
+
+    /**
+     * Creates a AmqpLinkError
+     */
+    public static final AmqpLinkError createAmqpLinkError() {
+        return new AmqpLinkError.AmqpLinkErrorBean();
+    };
+
+    /**
+     * Creates a AmqpConnectionError
+     */
+    public static final AmqpConnectionError createAmqpConnectionError() {
+        return new AmqpConnectionError.AmqpConnectionErrorBean();
+    };
+
+    /**
+     * Creates a AmqpSaslResponse
+     */
+    public static final AmqpSaslResponse createAmqpSaslResponse() {
+        return new AmqpSaslResponse.AmqpSaslResponseBean();
+    };
+
+    /**
+     * Creates a AmqpFragment
+     */
+    public static final AmqpFragment createAmqpFragment() {
+        return new AmqpFragment.AmqpFragmentBean();
+    };
+
+    /**
+     * Creates a AmqpDisposition
+     */
+    public static final AmqpDisposition createAmqpDisposition() {
+        return new AmqpDisposition.AmqpDispositionBean();
+    };
+
+    /**
+     * Creates a AmqpNull
+     */
+    public static final AmqpNull createAmqpNull(Object val) {
+        return new AmqpNull.AmqpNullBean(val);
+    }
+
+    /**
+     * Creates a AmqpOptions
+     */
+    public static final AmqpOptions createAmqpOptions(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> val) {
+        return new AmqpOptions.AmqpOptionsBean(val);
+    }
+    /**
+     * Creates an empty AmqpOptions
+     */
+    public static final AmqpOptions createAmqpOptions() {
+        return new AmqpOptions.AmqpOptionsBean();
+    }
+
+    /**
+     * Creates a AmqpCompleted
+     */
+    public static final AmqpCompleted createAmqpCompleted() {
+        return new AmqpCompleted.AmqpCompletedBean();
+    };
+
+    /**
+     * Creates a AmqpXid
+     */
+    public static final AmqpXid createAmqpXid() {
+        return new AmqpXid.AmqpXidBean();
+    };
+
+    /**
+     * Creates a AmqpList
+     */
+    public static final AmqpList createAmqpList(IAmqpList val) {
+        return new AmqpList.AmqpListBean(val);
+    }
+    /**
+     * Creates an empty AmqpList
+     */
+    public static final AmqpList createAmqpList() {
+        return new AmqpList.AmqpListBean();
+    }
+
+    /**
+     * Creates a AmqpUshort
+     */
+    public static final AmqpUshort createAmqpUshort(Integer val) {
+        return new AmqpUshort.AmqpUshortBean(val);
+    }
+    /**
+     * Creates a AmqpUshort
+     */
+    public static final AmqpUshort createAmqpUshort(int val) {
+        return new AmqpUshort.AmqpUshortBean(val);
+    }
+
+    /**
+     * Creates a AmqpFooter
+     */
+    public static final AmqpFooter createAmqpFooter() {
+        return new AmqpFooter.AmqpFooterBean();
+    };
+
+    /**
+     * Creates a AmqpSource
+     */
+    public static final AmqpSource createAmqpSource() {
+        return new AmqpSource.AmqpSourceBean();
+    };
+
+    /**
+     * Creates a AmqpSaslChallenge
+     */
+    public static final AmqpSaslChallenge createAmqpSaslChallenge() {
+        return new AmqpSaslChallenge.AmqpSaslChallengeBean();
+    };
+
+    /**
+     * Creates a AmqpAddress
+     */
+    public static final AmqpAddress createAmqpAddress(Buffer val) {
+        return new AmqpAddress.AmqpAddressBean(val);
+    }
+
+    /**
+     * Creates a AmqpAttach
+     */
+    public static final AmqpAttach createAmqpAttach() {
+        return new AmqpAttach.AmqpAttachBean();
+    };
+
+    /**
+     * Creates a AmqpString
+     */
+    public static final AmqpString createAmqpString(String val) {
+        return new AmqpString.AmqpStringBean(val);
+    }
+
+    /**
+     * Creates a AmqpTarget
+     */
+    public static final AmqpTarget createAmqpTarget() {
+        return new AmqpTarget.AmqpTargetBean();
+    };
+
+    /**
+     * Creates a AmqpFilterSet
+     */
+    public static final AmqpFilterSet createAmqpFilterSet(IAmqpMap<AmqpType<?, ?>, AmqpType<?, ?>> val) {
+        return new AmqpFilterSet.AmqpFilterSetBean(val);
+    }
+    /**
+     * Creates an empty AmqpFilterSet
+     */
+    public static final AmqpFilterSet createAmqpFilterSet() {
+        return new AmqpFilterSet.AmqpFilterSetBean();
+    }
+
+    /**
+     * Creates a AmqpUbyte
+     */
+    public static final AmqpUbyte createAmqpUbyte(Short val) {
+        return new AmqpUbyte.AmqpUbyteBean(val);
+    }
+    /**
+     * Creates a AmqpUbyte
+     */
+    public static final AmqpUbyte createAmqpUbyte(short val) {
+        return new AmqpUbyte.AmqpUbyteBean(val);
+    }
+
+    /**
+     * Creates a AmqpUint
+     */
+    public static final AmqpUint createAmqpUint(Long val) {
+        return new AmqpUint.AmqpUintBean(val);
+    }
+    /**
+     * Creates a AmqpUint
+     */
+    public static final AmqpUint createAmqpUint(long val) {
+        return new AmqpUint.AmqpUintBean(val);
+    }
+}

Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/test/java/org/apache/activemq/amqp/protocol/AmqpProtocolTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/test/java/org/apache/activemq/amqp/protocol/AmqpProtocolTest.java?rev=909224&r1=909223&r2=909224&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/test/java/org/apache/activemq/amqp/protocol/AmqpProtocolTest.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/test/java/org/apache/activemq/amqp/protocol/AmqpProtocolTest.java Fri Feb 12 04:25:25 2010
@@ -13,28 +13,27 @@
 import org.apache.activemq.amqp.protocol.types.AmqpOptions;
 import org.apache.activemq.amqp.protocol.types.AmqpSequenceNo;
 import org.apache.activemq.amqp.protocol.types.AmqpType;
+import org.apache.activemq.amqp.protocol.types.TypeFactory;
+import static org.apache.activemq.amqp.protocol.types.TypeFactory.*;
 
 import junit.framework.TestCase;
 
 public class AmqpProtocolTest extends TestCase {
 
     public void testSequencNumber() throws Exception {
-        AmqpSequenceNo val1 = new AmqpSequenceNo.AmqpSequenceNoBean(10L);
-        AmqpSequenceNo val2 = new AmqpSequenceNo.AmqpSequenceNoBean(10L);
-        assertTrue(val1.equivalent(val2));
-        
+        AmqpSequenceNo val1 = createAmqpSequenceNo(10);
+        AmqpSequenceNo val2 = createAmqpSequenceNo(10);
+        assertTrue(val1.equals(val2));
     }
     
     public void testAmqpFlow() throws Exception {
-        AmqpFlow val = new AmqpFlow.AmqpFlowBean();
-        val.setHandle(new AmqpHandle.AmqpHandleBean(1L));
-        AmqpFlow read = marshalUnmarshal(val);
-        AmqpHandle handle = read.getHandle();
-        
-        AmqpSequenceNo seq = read.getLimit();
-        AmqpOptions options = read.getOptions();
+        AmqpFlow flow = createAmqpFlow();
+        flow.setHandle(1);
+        flow.setOptions(createAmqpOptions());
         
-        assertTrue(val.equivalent(read));
+        AmqpFlow read = marshalUnmarshal(flow);
+                
+        assertTrue(flow.equals(read));
         System.out.println("Value: " + read.getValue());
     }
 



Mime
View raw message