activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmacn...@apache.org
Subject svn commit: r909704 [10/10] - 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/protoc...
Date Sat, 13 Feb 2010 03:20:18 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=909704&r1=909703&r2=909704&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
Sat Feb 13 03:20:16 2010
@@ -151,194 +151,194 @@
         AmqpTxnBean() {
         }
 
-        AmqpTxnBean(IAmqpList value) {
+        AmqpTxnBean(IAmqpList<AmqpType<?, ?>> value) {
 
-        for(int i = 0; i < value.getListCount(); i++) {
-            set(i, value.get(i));
+            for(int i = 0; i < value.getListCount(); i++) {
+                set(i, value.get(i));
+            }
         }
-    }
-
-    AmqpTxnBean(AmqpTxn.AmqpTxnBean other) {
-        this.bean = other;
-    }
 
-    public final AmqpTxnBean copy() {
-        return new AmqpTxn.AmqpTxnBean(bean);
-    }
-
-    public final void handle(AmqpCommandHandler handler) throws Exception {
-        handler.handleTxn(this);
-    }
+        AmqpTxnBean(AmqpTxn.AmqpTxnBean other) {
+            this.bean = other;
+        }
 
-    public final AmqpTxn.AmqpTxnBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-        if(buffer == null) {
-            buffer = new AmqpTxnBuffer(marshaller.encode(this));
+        public final AmqpTxnBean copy() {
+            return new AmqpTxn.AmqpTxnBean(bean);
         }
-        return buffer;
-    }
 
-    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
-        getBuffer(marshaller).marshal(out, marshaller);
-    }
+        public final void handle(AmqpCommandHandler handler) throws Exception {
+            handler.handleTxn(this);
+        }
 
+        public final AmqpTxn.AmqpTxnBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+            if(buffer == null) {
+                buffer = new AmqpTxnBuffer(marshaller.encode(this));
+            }
+            return buffer;
+        }
 
-    public final void setOptions(AmqpOptions options) {
-        copyCheck();
-        bean.options = options;
-    }
+        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
+            getBuffer(marshaller).marshal(out, marshaller);
+        }
 
-    public final AmqpOptions getOptions() {
-        return bean.options;
-    }
 
-    public void setFail(Boolean fail) {
-        setFail(TypeFactory.createAmqpBoolean(fail));
-    }
+        public final void setOptions(AmqpOptions options) {
+            copyCheck();
+            bean.options = options;
+        }
 
+        public final AmqpOptions getOptions() {
+            return bean.options;
+        }
 
-    public void setFail(boolean fail) {
-        setFail(TypeFactory.createAmqpBoolean(fail));
-    }
+        public void setFail(Boolean fail) {
+            setFail(TypeFactory.createAmqpBoolean(fail));
+        }
 
 
-    public final void setFail(AmqpBoolean fail) {
-        copyCheck();
-        bean.fail = fail;
-    }
+        public void setFail(boolean fail) {
+            setFail(TypeFactory.createAmqpBoolean(fail));
+        }
 
-    public final Boolean getFail() {
-        return bean.fail.getValue();
-    }
 
-    public void setSuspend(Boolean suspend) {
-        setSuspend(TypeFactory.createAmqpBoolean(suspend));
-    }
+        public final void setFail(AmqpBoolean fail) {
+            copyCheck();
+            bean.fail = fail;
+        }
 
+        public final Boolean getFail() {
+            return bean.fail.getValue();
+        }
 
-    public void setSuspend(boolean suspend) {
-        setSuspend(TypeFactory.createAmqpBoolean(suspend));
-    }
+        public void setSuspend(Boolean suspend) {
+            setSuspend(TypeFactory.createAmqpBoolean(suspend));
+        }
 
 
-    public final void setSuspend(AmqpBoolean suspend) {
-        copyCheck();
-        bean.suspend = suspend;
-    }
+        public void setSuspend(boolean suspend) {
+            setSuspend(TypeFactory.createAmqpBoolean(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 final void setSuspend(AmqpBoolean suspend) {
+            copyCheck();
+            bean.suspend = suspend;
         }
-    }
 
-    public AmqpType<?, ?> get(int index) {
-        switch(index) {
-        case 0: {
-            return bean.options;
-        }
-        case 1: {
-            return bean.fail;
-        }
-        case 2: {
-            return bean.suspend;
+        public final Boolean getSuspend() {
+            return bean.suspend.getValue();
         }
-        default : {
-            throw new IndexOutOfBoundsException(String.valueOf(index));
+
+        public void set(int index, AmqpType<?, ?> value) {
+            switch(index) {
+            case 0: {
+                setOptions((AmqpOptions) value);
+                break;
+            }
+            case 1: {
+                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 int getListCount() {
-        return 3;
-    }
+        public int getListCount() {
+            return 3;
+        }
 
-    public IAmqpList getValue() {
-        return bean;
-    }
+        public IAmqpList<AmqpType<?, ?>> getValue() {
+            return bean;
+        }
 
-    public Iterator<AmqpType<?, ?>> iterator() {
-        return new AmqpListIterator(bean);
-    }
+        public Iterator<AmqpType<?, ?>> iterator() {
+            return new AmqpListIterator<AmqpType<?, ?>>(bean);
+        }
 
 
-    private final void copyCheck() {
-        if(buffer != null) {;
-            throw new IllegalStateException("unwriteable");
+        private final void copyCheck() {
+            if(buffer != null) {;
+                throw new IllegalStateException("unwriteable");
+            }
+            if(bean != this) {;
+                copy(bean);
+            }
         }
-        if(bean != this) {;
-            copy(bean);
+
+        private final void copy(AmqpTxn.AmqpTxnBean other) {
+            bean = this;
         }
-    }
 
-    private final void copy(AmqpTxn.AmqpTxnBean other) {
-        bean = this;
-    }
+        public boolean equals(Object o){
+            if(this == o) {
+                return true;
+            }
 
-    public boolean equals(Object o){
-        if(this == o) {
-            return true;
-        }
+            if(o == null || !(o instanceof AmqpTxn)) {
+                return false;
+            }
 
-        if(o == null || !(o instanceof AmqpTxn)) {
-            return false;
+            return equals((AmqpTxn) o);
         }
 
-        return equals((AmqpTxn) o);
-    }
+        public boolean equals(AmqpTxn b) {
 
-    public boolean equals(AmqpTxn b) {
+            if(b.getOptions() == null ^ getOptions() == null) {
+                return false;
+            }
+            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+                return false;
+            }
 
-        if(b.getOptions() == null ^ getOptions() == null) {
-            return false;
-        }
-        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-            return false;
-        }
+            if(b.getFail() == null ^ getFail() == null) {
+                return false;
+            }
+            if(b.getFail() != null && !b.getFail().equals(getFail())){ 
+                return false;
+            }
 
-        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;
         }
 
-        if(b.getSuspend() == null ^ getSuspend() == null) {
-            return false;
-        }
-        if(b.getSuspend() != null && !b.getSuspend().equals(getSuspend())){ 
-            return false;
+        public int hashCode() {
+            return AbstractAmqpList.hashCodeFor(this);
         }
-        return true;
-    }
-
-    public int hashCode() {
-        return AbstractAmqpList.hashCodeFor(this);
     }
-}
 
     public static class AmqpTxnBuffer extends AmqpList.AmqpListBuffer implements AmqpTxn{
 
         private AmqpTxnBean bean;
 
-        protected AmqpTxnBuffer(Encoded<IAmqpList> encoded) {
+        protected AmqpTxnBuffer(Encoded<IAmqpList<AmqpType<?, ?>>> encoded)
{
             super(encoded);
         }
 
@@ -400,10 +400,6 @@
             return bean().iterator();
         }
 
-        public IAmqpList getValue() {
-            return bean().getValue();
-        }
-
         public AmqpTxn.AmqpTxnBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
             return this;
         }
@@ -432,7 +428,7 @@
             return bean().hashCode();
         }
 
-        public static AmqpTxn.AmqpTxnBuffer create(Encoded<IAmqpList> encoded) {
+        public static AmqpTxn.AmqpTxnBuffer create(Encoded<IAmqpList<AmqpType<?,
?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }

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=909704&r1=909703&r2=909704&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
Sat Feb 13 03:20:16 2010
@@ -121,184 +121,184 @@
         AmqpUnlinkBean() {
         }
 
-        AmqpUnlinkBean(IAmqpList value) {
+        AmqpUnlinkBean(IAmqpList<AmqpType<?, ?>> value) {
 
-        for(int i = 0; i < value.getListCount(); i++) {
-            set(i, value.get(i));
+            for(int i = 0; i < value.getListCount(); i++) {
+                set(i, value.get(i));
+            }
         }
-    }
-
-    AmqpUnlinkBean(AmqpUnlink.AmqpUnlinkBean other) {
-        this.bean = other;
-    }
 
-    public final AmqpUnlinkBean copy() {
-        return new AmqpUnlink.AmqpUnlinkBean(bean);
-    }
-
-    public final void handle(AmqpCommandHandler handler) throws Exception {
-        handler.handleUnlink(this);
-    }
-
-    public final AmqpUnlink.AmqpUnlinkBuffer getBuffer(AmqpMarshaller marshaller) throws
AmqpEncodingError{
-        if(buffer == null) {
-            buffer = new AmqpUnlinkBuffer(marshaller.encode(this));
+        AmqpUnlinkBean(AmqpUnlink.AmqpUnlinkBean other) {
+            this.bean = other;
         }
-        return buffer;
-    }
-
-    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
-        getBuffer(marshaller).marshal(out, marshaller);
-    }
 
+        public final AmqpUnlinkBean copy() {
+            return new AmqpUnlink.AmqpUnlinkBean(bean);
+        }
 
-    public final void setOptions(AmqpOptions options) {
-        copyCheck();
-        bean.options = options;
-    }
+        public final void handle(AmqpCommandHandler handler) throws Exception {
+            handler.handleUnlink(this);
+        }
 
-    public final AmqpOptions getOptions() {
-        return bean.options;
-    }
+        public final AmqpUnlink.AmqpUnlinkBuffer getBuffer(AmqpMarshaller marshaller) throws
AmqpEncodingError{
+            if(buffer == null) {
+                buffer = new AmqpUnlinkBuffer(marshaller.encode(this));
+            }
+            return buffer;
+        }
 
-    public void setHandle(Long handle) {
-        setHandle(TypeFactory.createAmqpHandle(handle));
-    }
+        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
+            getBuffer(marshaller).marshal(out, marshaller);
+        }
 
 
-    public void setHandle(long handle) {
-        setHandle(TypeFactory.createAmqpHandle(handle));
-    }
+        public final void setOptions(AmqpOptions options) {
+            copyCheck();
+            bean.options = options;
+        }
 
+        public final AmqpOptions getOptions() {
+            return bean.options;
+        }
 
-    public final void setHandle(AmqpHandle handle) {
-        copyCheck();
-        bean.handle = handle;
-    }
+        public void setHandle(Long handle) {
+            setHandle(TypeFactory.createAmqpHandle(handle));
+        }
 
-    public final AmqpHandle getHandle() {
-        return bean.handle;
-    }
 
-    public final void setException(AmqpLinkError exception) {
-        copyCheck();
-        bean.exception = exception;
-    }
+        public void setHandle(long handle) {
+            setHandle(TypeFactory.createAmqpHandle(handle));
+        }
 
-    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 void setHandle(AmqpHandle handle) {
+            copyCheck();
+            bean.handle = handle;
         }
-    }
 
-    public AmqpType<?, ?> get(int index) {
-        switch(index) {
-        case 0: {
-            return bean.options;
-        }
-        case 1: {
+        public final AmqpHandle getHandle() {
             return bean.handle;
         }
-        case 2: {
+
+        public final void setException(AmqpLinkError exception) {
+            copyCheck();
+            bean.exception = exception;
+        }
+
+        public final AmqpLinkError getException() {
             return bean.exception;
         }
-        default : {
-            throw new IndexOutOfBoundsException(String.valueOf(index));
+
+        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 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<AmqpType<?, ?>> getValue() {
+            return bean;
+        }
 
-    public Iterator<AmqpType<?, ?>> iterator() {
-        return new AmqpListIterator(bean);
-    }
+        public Iterator<AmqpType<?, ?>> iterator() {
+            return new AmqpListIterator<AmqpType<?, ?>>(bean);
+        }
 
 
-    private final void copyCheck() {
-        if(buffer != null) {;
-            throw new IllegalStateException("unwriteable");
+        private final void copyCheck() {
+            if(buffer != null) {;
+                throw new IllegalStateException("unwriteable");
+            }
+            if(bean != this) {;
+                copy(bean);
+            }
         }
-        if(bean != this) {;
-            copy(bean);
+
+        private final void copy(AmqpUnlink.AmqpUnlinkBean other) {
+            bean = this;
         }
-    }
 
-    private final void copy(AmqpUnlink.AmqpUnlinkBean other) {
-        bean = this;
-    }
+        public boolean equals(Object o){
+            if(this == o) {
+                return true;
+            }
 
-    public boolean equals(Object o){
-        if(this == o) {
-            return true;
-        }
+            if(o == null || !(o instanceof AmqpUnlink)) {
+                return false;
+            }
 
-        if(o == null || !(o instanceof AmqpUnlink)) {
-            return false;
+            return equals((AmqpUnlink) o);
         }
 
-        return equals((AmqpUnlink) o);
-    }
+        public boolean equals(AmqpUnlink b) {
 
-    public boolean equals(AmqpUnlink b) {
+            if(b.getOptions() == null ^ getOptions() == null) {
+                return false;
+            }
+            if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
+                return false;
+            }
 
-        if(b.getOptions() == null ^ getOptions() == null) {
-            return false;
-        }
-        if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ 
-            return false;
-        }
+            if(b.getHandle() == null ^ getHandle() == null) {
+                return false;
+            }
+            if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ 
+                return false;
+            }
 
-        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;
         }
 
-        if(b.getException() == null ^ getException() == null) {
-            return false;
-        }
-        if(b.getException() != null && !b.getException().equals(getException())){

-            return false;
+        public int hashCode() {
+            return AbstractAmqpList.hashCodeFor(this);
         }
-        return true;
-    }
-
-    public int hashCode() {
-        return AbstractAmqpList.hashCodeFor(this);
     }
-}
 
     public static class AmqpUnlinkBuffer extends AmqpList.AmqpListBuffer implements AmqpUnlink{
 
         private AmqpUnlinkBean bean;
 
-        protected AmqpUnlinkBuffer(Encoded<IAmqpList> encoded) {
+        protected AmqpUnlinkBuffer(Encoded<IAmqpList<AmqpType<?, ?>>> encoded)
{
             super(encoded);
         }
 
@@ -351,10 +351,6 @@
             return bean().iterator();
         }
 
-        public IAmqpList getValue() {
-            return bean().getValue();
-        }
-
         public AmqpUnlink.AmqpUnlinkBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
             return this;
         }
@@ -383,7 +379,7 @@
             return bean().hashCode();
         }
 
-        public static AmqpUnlink.AmqpUnlinkBuffer create(Encoded<IAmqpList> encoded)
{
+        public static AmqpUnlink.AmqpUnlinkBuffer create(Encoded<IAmqpList<AmqpType<?,
?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }

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=909704&r1=909703&r2=909704&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
Sat Feb 13 03:20:16 2010
@@ -98,190 +98,190 @@
         AmqpXidBean() {
         }
 
-        AmqpXidBean(IAmqpList value) {
+        AmqpXidBean(IAmqpList<AmqpType<?, ?>> value) {
 
-        for(int i = 0; i < value.getListCount(); i++) {
-            set(i, value.get(i));
+            for(int i = 0; i < value.getListCount(); i++) {
+                set(i, value.get(i));
+            }
         }
-    }
-
-    AmqpXidBean(AmqpXid.AmqpXidBean other) {
-        this.bean = other;
-    }
-
-    public final AmqpXidBean copy() {
-        return new AmqpXid.AmqpXidBean(bean);
-    }
 
-    public final AmqpXid.AmqpXidBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
-        if(buffer == null) {
-            buffer = new AmqpXidBuffer(marshaller.encode(this));
+        AmqpXidBean(AmqpXid.AmqpXidBean other) {
+            this.bean = other;
         }
-        return buffer;
-    }
 
-    public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
-        getBuffer(marshaller).marshal(out, marshaller);
-    }
+        public final AmqpXidBean copy() {
+            return new AmqpXid.AmqpXidBean(bean);
+        }
 
+        public final AmqpXid.AmqpXidBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
+            if(buffer == null) {
+                buffer = new AmqpXidBuffer(marshaller.encode(this));
+            }
+            return buffer;
+        }
 
-    public void setFormat(Long format) {
-        setFormat(TypeFactory.createAmqpUint(format));
-    }
+        public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException,
AmqpEncodingError{
+            getBuffer(marshaller).marshal(out, marshaller);
+        }
 
 
-    public void setFormat(long format) {
-        setFormat(TypeFactory.createAmqpUint(format));
-    }
+        public void setFormat(Long format) {
+            setFormat(TypeFactory.createAmqpUint(format));
+        }
 
 
-    public final void setFormat(AmqpUint format) {
-        copyCheck();
-        bean.format = format;
-    }
+        public void setFormat(long format) {
+            setFormat(TypeFactory.createAmqpUint(format));
+        }
 
-    public final Long getFormat() {
-        return bean.format.getValue();
-    }
 
-    public void setGlobalId(Buffer globalId) {
-        setGlobalId(TypeFactory.createAmqpBinary(globalId));
-    }
+        public final void setFormat(AmqpUint format) {
+            copyCheck();
+            bean.format = format;
+        }
 
+        public final Long getFormat() {
+            return bean.format.getValue();
+        }
 
-    public final void setGlobalId(AmqpBinary globalId) {
-        copyCheck();
-        bean.globalId = globalId;
-    }
+        public void setGlobalId(Buffer globalId) {
+            setGlobalId(TypeFactory.createAmqpBinary(globalId));
+        }
 
-    public final Buffer getGlobalId() {
-        return bean.globalId.getValue();
-    }
 
-    public void setBranchId(Buffer branchId) {
-        setBranchId(TypeFactory.createAmqpBinary(branchId));
-    }
+        public final void setGlobalId(AmqpBinary globalId) {
+            copyCheck();
+            bean.globalId = globalId;
+        }
 
+        public final Buffer getGlobalId() {
+            return bean.globalId.getValue();
+        }
 
-    public final void setBranchId(AmqpBinary branchId) {
-        copyCheck();
-        bean.branchId = branchId;
-    }
+        public void setBranchId(Buffer branchId) {
+            setBranchId(TypeFactory.createAmqpBinary(branchId));
+        }
 
-    public final Buffer getBranchId() {
-        return bean.branchId.getValue();
-    }
 
-    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 final void setBranchId(AmqpBinary branchId) {
+            copyCheck();
+            bean.branchId = branchId;
         }
-    }
 
-    public AmqpType<?, ?> get(int index) {
-        switch(index) {
-        case 0: {
-            return bean.format;
-        }
-        case 1: {
-            return bean.globalId;
-        }
-        case 2: {
-            return bean.branchId;
+        public final Buffer getBranchId() {
+            return bean.branchId.getValue();
         }
-        default : {
-            throw new IndexOutOfBoundsException(String.valueOf(index));
+
+        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 int getListCount() {
-        return 3;
-    }
+        public int getListCount() {
+            return 3;
+        }
 
-    public IAmqpList getValue() {
-        return bean;
-    }
+        public IAmqpList<AmqpType<?, ?>> getValue() {
+            return bean;
+        }
 
-    public Iterator<AmqpType<?, ?>> iterator() {
-        return new AmqpListIterator(bean);
-    }
+        public Iterator<AmqpType<?, ?>> iterator() {
+            return new AmqpListIterator<AmqpType<?, ?>>(bean);
+        }
 
 
-    private final void copyCheck() {
-        if(buffer != null) {;
-            throw new IllegalStateException("unwriteable");
+        private final void copyCheck() {
+            if(buffer != null) {;
+                throw new IllegalStateException("unwriteable");
+            }
+            if(bean != this) {;
+                copy(bean);
+            }
         }
-        if(bean != this) {;
-            copy(bean);
+
+        private final void copy(AmqpXid.AmqpXidBean other) {
+            bean = this;
         }
-    }
 
-    private final void copy(AmqpXid.AmqpXidBean other) {
-        bean = this;
-    }
+        public boolean equals(Object o){
+            if(this == o) {
+                return true;
+            }
 
-    public boolean equals(Object o){
-        if(this == o) {
-            return true;
-        }
+            if(o == null || !(o instanceof AmqpXid)) {
+                return false;
+            }
 
-        if(o == null || !(o instanceof AmqpXid)) {
-            return false;
+            return equals((AmqpXid) o);
         }
 
-        return equals((AmqpXid) o);
-    }
+        public boolean equals(AmqpXid b) {
 
-    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;
+        public int hashCode() {
+            return AbstractAmqpList.hashCodeFor(this);
         }
-        return true;
-    }
-
-    public int hashCode() {
-        return AbstractAmqpList.hashCodeFor(this);
     }
-}
 
     public static class AmqpXidBuffer extends AmqpList.AmqpListBuffer implements AmqpXid{
 
         private AmqpXidBean bean;
 
-        protected AmqpXidBuffer(Encoded<IAmqpList> encoded) {
+        protected AmqpXidBuffer(Encoded<IAmqpList<AmqpType<?, ?>>> encoded)
{
             super(encoded);
         }
 
@@ -342,10 +342,6 @@
             return bean().iterator();
         }
 
-        public IAmqpList getValue() {
-            return bean().getValue();
-        }
-
         public AmqpXid.AmqpXidBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{
             return this;
         }
@@ -370,7 +366,7 @@
             return bean().hashCode();
         }
 
-        public static AmqpXid.AmqpXidBuffer create(Encoded<IAmqpList> encoded) {
+        public static AmqpXid.AmqpXidBuffer create(Encoded<IAmqpList<AmqpType<?,
?>>> encoded) {
             if(encoded.isNull()) {
                 return null;
             }

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=909704&r1=909703&r2=909704&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
Sat Feb 13 03:20:16 2010
@@ -19,22 +19,19 @@
 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<E extends AmqpType<?, ?>> extends Iterable<E>
{
 
-public interface IAmqpList extends Iterable<AmqpType<?, ?>> {
+    public E get(int index);
 
-    public AmqpType<?, ?> get(int index);
-
-    public void set(int index, AmqpType<?, ?> value);
+    public void set(int index, E value);
 
     public int getListCount();
 
-    public static class AmqpListIterator implements Iterator<AmqpType<?, ?>>
{
+    public static class AmqpListIterator<E extends AmqpType<?, ?>> implements
Iterator<E> {
         int next = 0;
-        final IAmqpList list;
+        final IAmqpList<E> list;
 
-        public AmqpListIterator(IAmqpList list) {
+        public AmqpListIterator(IAmqpList<E> list) {
             this.list = list;
         }
 
@@ -42,7 +39,7 @@
             return next < list.getListCount();
         }
 
-        public AmqpType<?, ?> next() {
+        public E next() {
             return list.get(next++);
         }
 
@@ -51,16 +48,16 @@
         }
     }
 
-    public static abstract class AbstractAmqpList implements IAmqpList {
-        public static final int hashCodeFor(IAmqpList l) {
+    public static abstract class AbstractAmqpList<E extends AmqpType<?, ?>> implements
IAmqpList<E> {
+        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) {
+
+        public static final boolean checkEqual(IAmqpList<?> l1, IAmqpList<?>
l2) {
             if (l1 == null ^ l2 == null) {
                 return false;
             }
@@ -86,14 +83,14 @@
         }
     }
 
-    public static class AmqpWrapperList extends AbstractAmqpList {
-        private final List<AmqpType<?, ?>> list;
+    public static class AmqpWrapperList<E extends AmqpType<?, ?>> extends AbstractAmqpList<E>
{
+        private final List<E> list;
 
-        public AmqpWrapperList(List<AmqpType<?, ?>> list) {
+        public AmqpWrapperList(List<E> list) {
             this.list = list;
         }
 
-        public AmqpType<?, ?> get(int index) {
+        public E get(int index) {
             return list.get(index);
         }
 
@@ -101,11 +98,11 @@
             return list.size();
         }
 
-        public void set(int index, AmqpType<?, ?> value) {
+        public void set(int index, E value) {
             list.set(index, value);
         }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
+        public Iterator<E> iterator() {
             return list.iterator();
         }
 
@@ -114,13 +111,13 @@
                 return false;
             }
 
-            if (o instanceof IAmqpList) {
-                return equals((IAmqpList) o);
+            if (o instanceof IAmqpList<?>) {
+                return equals((IAmqpList<?>) o);
             }
             return false;
         }
 
-        public boolean equals(IAmqpList l) {
+        public boolean equals(IAmqpList<?> l) {
             return checkEqual(this, l);
         }
 
@@ -129,14 +126,14 @@
         }
     }
 
-    public static class ArrayBackedList extends AbstractAmqpList {
-        AmqpType<?, ?>[] list;
+    public static class ArrayBackedList<E extends AmqpType<?, ?>> extends AbstractAmqpList<E>
{
+        E[] list;
 
-        ArrayBackedList(int size) {
-            list = new AmqpType<?, ?>[size];
+        public ArrayBackedList(E[] list) {
+            this.list = list;
         }
 
-        public AmqpType<?, ?> get(int index) {
+        public E get(int index) {
             return list[index];
         }
 
@@ -144,12 +141,12 @@
             return list.length;
         }
 
-        public void set(int index, AmqpType<?, ?> value) {
+        public void set(int index, E value) {
             list[index] = value;
         }
 
-        public Iterator<AmqpType<?, ?>> iterator() {
-            return new AmqpListIterator(this);
+        public Iterator<E> iterator() {
+            return new AmqpListIterator<E>(this);
         }
 
         public boolean equals(Object o) {
@@ -157,13 +154,13 @@
                 return false;
             }
 
-            if (o instanceof IAmqpList) {
-                return equals((IAmqpList) o);
+            if (o instanceof IAmqpList<?>) {
+                return equals((IAmqpList<?>) o);
             }
             return false;
         }
 
-        public boolean equals(IAmqpList l) {
+        public boolean equals(IAmqpList<?> l) {
             return checkEqual(this, l);
         }
 

Modified: 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=909704&r1=909703&r2=909704&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/TypeFactory.java
Sat Feb 13 03:20:16 2010
@@ -455,7 +455,7 @@
     /**
      * Creates a AmqpList
      */
-    public static final AmqpList createAmqpList(IAmqpList val) {
+    public static final AmqpList createAmqpList(IAmqpList<AmqpType<?, ?>> val)
{
         return new AmqpList.AmqpListBean(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=909704&r1=909703&r2=909704&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
Sat Feb 13 03:20:16 2010
@@ -25,16 +25,18 @@
         AmqpSequenceNo val2 = createAmqpSequenceNo(10);
         assertTrue(val1.equals(val2));
     }
-    
+
     public void testAmqpFlow() throws Exception {
         AmqpFlow flow = createAmqpFlow();
         flow.setHandle(1);
         flow.setOptions(createAmqpOptions());
-        
+        flow.getOptions().put(createAmqpString("Hello"), createAmqpUint(20));
+        flow.setLimit(2);
+
         AmqpFlow read = marshalUnmarshal(flow);
-                
+
         assertTrue(flow.equals(read));
-        System.out.println("Value: " + read.getValue());
+        System.out.println("Value: " + read);
     }
 
     private <T extends AmqpType<?, ?>> T marshalUnmarshal(T type) throws IOException,
AmqpEncodingError {



Mime
View raw message