From commits-return-13077-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Fri Feb 12 04:25:53 2010 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 93925 invoked from network); 12 Feb 2010 04:25:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Feb 2010 04:25:53 -0000 Received: (qmail 44689 invoked by uid 500); 12 Feb 2010 04:25:53 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 44605 invoked by uid 500); 12 Feb 2010 04:25:53 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 44584 invoked by uid 99); 12 Feb 2010 04:25:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 04:25:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 04:25:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CBCA423889F1; Fri, 12 Feb 2010 04:25:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r909224 [3/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 -0000 To: commits@activemq.apache.org From: cmacnaug@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100212042529.CBCA423889F1@eris.apache.org> Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpConnectionError.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpConnectionError.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/AmqpConnectionError.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpConnectionError.java Fri Feb 12 04:25:25 2010 @@ -20,7 +20,6 @@ import java.io.DataOutput; import java.io.IOException; import java.lang.String; -import java.util.HashMap; import java.util.Iterator; import org.apache.activemq.amqp.protocol.marshaller.AmqpEncodingError; import org.apache.activemq.amqp.protocol.marshaller.AmqpMarshaller; @@ -81,17 +80,12 @@ /** * map to carry additional information about the error */ - public void setErrorInfo(HashMap, AmqpType> errorInfo); - - /** - * map to carry additional information about the error - */ public void setErrorInfo(AmqpMap errorInfo); /** * map to carry additional information about the error */ - public HashMap, AmqpType> getErrorInfo(); + public IAmqpMap, AmqpType> getErrorInfo(); public static class AmqpConnectionErrorBean implements AmqpConnectionError{ @@ -101,179 +95,175 @@ private AmqpString description; private AmqpMap errorInfo; - public AmqpConnectionErrorBean() { + AmqpConnectionErrorBean() { } - public AmqpConnectionErrorBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpConnectionErrorBean(IAmqpList value) { - public AmqpConnectionErrorBean(AmqpConnectionError.AmqpConnectionErrorBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpConnectionErrorBean copy() { - return new AmqpConnectionError.AmqpConnectionErrorBean(bean); - } + AmqpConnectionErrorBean(AmqpConnectionError.AmqpConnectionErrorBean other) { + this.bean = other; + } - public final AmqpConnectionError.AmqpConnectionErrorBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpConnectionErrorBuffer(marshaller.encode(this)); - } - return buffer; - } + public final AmqpConnectionErrorBean copy() { + return new AmqpConnectionError.AmqpConnectionErrorBean(bean); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpConnectionError.AmqpConnectionErrorBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpConnectionErrorBuffer(marshaller.encode(this)); } + return buffer; + } + public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ + getBuffer(marshaller).marshal(out, marshaller); + } - public final void setErrorCode(AmqpConnectionErrorCode errorCode) { - copyCheck(); - bean.errorCode = errorCode; - } - public final AmqpConnectionErrorCode getErrorCode() { - return bean.errorCode; - } + public final void setErrorCode(AmqpConnectionErrorCode errorCode) { + copyCheck(); + bean.errorCode = errorCode; + } - public void setDescription(String description) { - setDescription(new AmqpString.AmqpStringBean(description)); - } + public final AmqpConnectionErrorCode getErrorCode() { + return bean.errorCode; + } + public void setDescription(String description) { + setDescription(TypeFactory.createAmqpString(description)); + } - public final void setDescription(AmqpString description) { - copyCheck(); - bean.description = description; - } - public final String getDescription() { - return bean.description.getValue(); - } + public final void setDescription(AmqpString description) { + copyCheck(); + bean.description = description; + } - public void setErrorInfo(HashMap, AmqpType> errorInfo) { - setErrorInfo(new AmqpMap.AmqpMapBean(errorInfo)); - } + public final String getDescription() { + return bean.description.getValue(); + } + public final void setErrorInfo(AmqpMap errorInfo) { + copyCheck(); + bean.errorInfo = errorInfo; + } - public final void setErrorInfo(AmqpMap errorInfo) { - copyCheck(); - bean.errorInfo = errorInfo; - } + public final IAmqpMap, AmqpType> getErrorInfo() { + return bean.errorInfo.getValue(); + } - public final HashMap, AmqpType> getErrorInfo() { - return bean.errorInfo.getValue(); + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setErrorCode(AmqpConnectionErrorCode.get((AmqpUshort)value)); + break; + } + case 1: { + setDescription((AmqpString) value); + break; + } + case 2: { + setErrorInfo((AmqpMap) value); + break; + } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); } - - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setErrorCode(AmqpConnectionErrorCode.get((AmqpUshort)value)); - break; - } - case 1: { - setDescription((AmqpString) value); - break; - } - case 2: { - setErrorInfo((AmqpMap) value); - break; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } } + } - public AmqpType get(int index) { - switch(index) { - case 0: { - if(errorCode == null) { - return null; - } - return errorCode.getValue(); - } - case 1: { - return bean.description; - } - case 2: { - return bean.errorInfo; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } + public AmqpType get(int index) { + switch(index) { + case 0: { + if(errorCode == null) { + return null; } + return errorCode.getValue(); } - - public int getListCount() { - return 3; + case 1: { + return bean.description; } - - public IAmqpList getValue() { - return bean; + case 2: { + return bean.errorInfo; } - - public Iterator> iterator() { - return new AmqpListIterator(bean); + 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; + } + + public Iterator> iterator() { + return new AmqpListIterator(bean); + } - private final void copy(AmqpConnectionError.AmqpConnectionErrorBean other) { - this.errorCode= other.errorCode; - this.description= other.description; - this.errorInfo= other.errorInfo; - 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(AmqpConnectionError.AmqpConnectionErrorBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpConnectionError)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpConnectionError) t); + if(o == null || !(o instanceof AmqpConnectionError)) { + return false; } - public boolean equivalent(AmqpConnectionError b) { + return equals((AmqpConnectionError) o); + } - if(b.getErrorCode() == null ^ getErrorCode() == null) { - return false; - } - if(b.getErrorCode() != null && !b.getErrorCode().equals(getErrorCode())){ - return false; - } + public boolean equals(AmqpConnectionError b) { - if(b.getDescription() == null ^ getDescription() == null) { - return false; - } - if(b.getDescription() != null && !b.getDescription().equals(getDescription())){ - return false; - } + if(b.getErrorCode() == null ^ getErrorCode() == null) { + return false; + } + if(b.getErrorCode() != null && !b.getErrorCode().equals(getErrorCode())){ + return false; + } - if(b.getErrorInfo() == null ^ getErrorInfo() == null) { - return false; - } - if(b.getErrorInfo() != null && !b.getErrorInfo().equals(getErrorInfo())){ - return false; - } - return true; + if(b.getDescription() == null ^ getDescription() == null) { + return false; + } + if(b.getDescription() != null && !b.getDescription().equals(getDescription())){ + return false; + } + + if(b.getErrorInfo() == null ^ getErrorInfo() == null) { + return false; } + if(b.getErrorInfo() != null && !b.getErrorInfo().equals(getErrorInfo())){ + return false; + } + return true; + } + + public int hashCode() { + return AbstractAmqpList.hashCodeFor(this); } +} public static class AmqpConnectionErrorBuffer extends AmqpList.AmqpListBuffer implements AmqpConnectionError{ @@ -291,7 +281,7 @@ return bean().getErrorCode(); } - public void setDescription(String description) { + public void setDescription(String description) { bean().setDescription(description); } @@ -303,15 +293,11 @@ return bean().getDescription(); } - public void setErrorInfo(HashMap, AmqpType> errorInfo) { - bean().setErrorInfo(errorInfo); - } - public final void setErrorInfo(AmqpMap errorInfo) { bean().setErrorInfo(errorInfo); } - public final HashMap, AmqpType> getErrorInfo() { + public final IAmqpMap, AmqpType> getErrorInfo() { return bean().getErrorInfo(); } @@ -347,8 +333,16 @@ return bean; } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpConnectionError o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpConnectionError.AmqpConnectionErrorBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDeliveryTag.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDeliveryTag.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/AmqpDeliveryTag.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDeliveryTag.java Fri Feb 12 04:25:25 2010 @@ -35,14 +35,11 @@ private AmqpDeliveryTagBean bean = this; private Buffer value; - protected AmqpDeliveryTagBean() { - } - - public AmqpDeliveryTagBean(Buffer value) { + AmqpDeliveryTagBean(Buffer value) { this.value = value; } - public AmqpDeliveryTagBean(AmqpDeliveryTag.AmqpDeliveryTagBean other) { + AmqpDeliveryTagBean(AmqpDeliveryTag.AmqpDeliveryTagBean other) { this.bean = other; } @@ -76,29 +73,10 @@ return false; } - return equivalent((AmqpDeliveryTag) o); - } - - public int hashCode() { - if(getValue() == null) { - return AmqpDeliveryTag.AmqpDeliveryTagBean.class.hashCode(); - } - return getValue().hashCode(); - } - - public boolean equivalent(AmqpType t){ - if(this == t) { - return true; - } - - if(t == null || !(t instanceof AmqpDeliveryTag)) { - return false; - } - - return equivalent((AmqpDeliveryTag) t); + return equals((AmqpDeliveryTag) o); } - public boolean equivalent(AmqpDeliveryTag b) { + public boolean equals(AmqpDeliveryTag b) { if(b == null) { return false; } @@ -109,6 +87,13 @@ return b.getValue() == null || b.getValue().equals(getValue()); } + + public int hashCode() { + if(getValue() == null) { + return AmqpDeliveryTag.AmqpDeliveryTagBean.class.hashCode(); + } + return getValue().hashCode(); + } } public static class AmqpDeliveryTagBuffer extends AmqpBinary.AmqpBinaryBuffer implements AmqpDeliveryTag{ @@ -139,8 +124,16 @@ return bean; } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpDeliveryTag o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpDeliveryTag.AmqpDeliveryTagBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDetach.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDetach.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/AmqpDetach.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDetach.java Fri Feb 12 04:25:25 2010 @@ -54,6 +54,22 @@ *

* Identifies the detaching Session. *

+ *

+ * The Session name uniquely identifies an interaction between two peers. It is globally + * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused. + *

+ */ + public void setName(Buffer name); + + /** + * the Session name + *

+ * Identifies the detaching Session. + *

+ *

+ * The Session name uniquely identifies an interaction between two peers. It is globally + * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused. + *

*/ public void setName(AmqpSessionName name); @@ -62,6 +78,10 @@ *

* Identifies the detaching Session. *

+ *

+ * The Session name uniquely identifies an interaction between two peers. It is globally + * unique among all open Sessions. Once a Session is cleanly closed, its name may be reused. + *

*/ public AmqpSessionName getName(); @@ -79,6 +99,14 @@ * detached. *

*/ + public void setClosing(boolean closing); + + /** + *

+ * This field, if set, indicates that the Session endpoint will be destroyed when fully + * detached. + *

+ */ public void setClosing(AmqpBoolean closing); /** @@ -116,199 +144,209 @@ private AmqpBoolean closing; private AmqpSessionError exception; - public AmqpDetachBean() { + AmqpDetachBean() { } - public AmqpDetachBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpDetachBean(IAmqpList value) { - public AmqpDetachBean(AmqpDetach.AmqpDetachBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpDetachBean copy() { - return new AmqpDetach.AmqpDetachBean(bean); - } + AmqpDetachBean(AmqpDetach.AmqpDetachBean other) { + this.bean = other; + } - public final void handle(AmqpCommandHandler handler) throws Exception { - handler.handleDetach(this); - } + public final AmqpDetachBean copy() { + return new AmqpDetach.AmqpDetachBean(bean); + } - public final AmqpDetach.AmqpDetachBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpDetachBuffer(marshaller.encode(this)); - } - return buffer; - } + public final void handle(AmqpCommandHandler handler) throws Exception { + handler.handleDetach(this); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpDetach.AmqpDetachBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpDetachBuffer(marshaller.encode(this)); } + return buffer; + } + public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ + getBuffer(marshaller).marshal(out, marshaller); + } - public final void setOptions(AmqpOptions options) { - copyCheck(); - bean.options = options; - } - public final AmqpOptions getOptions() { - return bean.options; - } + public final void setOptions(AmqpOptions options) { + copyCheck(); + bean.options = options; + } - public final void setName(AmqpSessionName name) { - copyCheck(); - bean.name = name; - } + public final AmqpOptions getOptions() { + return bean.options; + } - public final AmqpSessionName getName() { - return bean.name; - } + public void setName(Buffer name) { + setName(TypeFactory.createAmqpSessionName(name)); + } - public void setClosing(Boolean closing) { - setClosing(new AmqpBoolean.AmqpBooleanBean(closing)); - } + public final void setName(AmqpSessionName name) { + copyCheck(); + bean.name = name; + } - public final void setClosing(AmqpBoolean closing) { - copyCheck(); - bean.closing = closing; - } + public final AmqpSessionName getName() { + return bean.name; + } - public final Boolean getClosing() { - return bean.closing.getValue(); - } + public void setClosing(Boolean closing) { + setClosing(TypeFactory.createAmqpBoolean(closing)); + } - public final void setException(AmqpSessionError exception) { - copyCheck(); - bean.exception = exception; + + public void setClosing(boolean closing) { + setClosing(TypeFactory.createAmqpBoolean(closing)); + } + + + public final void setClosing(AmqpBoolean closing) { + copyCheck(); + bean.closing = closing; + } + + public final Boolean getClosing() { + return bean.closing.getValue(); + } + + public final void setException(AmqpSessionError exception) { + copyCheck(); + bean.exception = exception; + } + + public final AmqpSessionError getException() { + return bean.exception; + } + + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setOptions((AmqpOptions) value); + break; + } + case 1: { + setName((AmqpSessionName) value); + break; + } + case 2: { + setClosing((AmqpBoolean) value); + break; + } + case 3: { + setException((AmqpSessionError) value); + break; } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); + } + } + } - public final AmqpSessionError getException() { + public AmqpType get(int index) { + switch(index) { + case 0: { + return bean.options; + } + case 1: { + return bean.name; + } + case 2: { + return bean.closing; + } + case 3: { return bean.exception; } - - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setOptions((AmqpOptions) value); - break; - } - case 1: { - setName((AmqpSessionName) value); - break; - } - case 2: { - setClosing((AmqpBoolean) value); - break; - } - case 3: { - setException((AmqpSessionError) 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.name; - } - case 2: { - return bean.closing; - } - case 3: { - return bean.exception; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } } + } - public int getListCount() { - return 4; - } + public int getListCount() { + return 4; + } - public IAmqpList getValue() { - return bean; - } + public IAmqpList getValue() { + return bean; + } - public Iterator> iterator() { - return new AmqpListIterator(bean); - } + public Iterator> 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(AmqpDetach.AmqpDetachBean other) { - this.options= other.options; - this.name= other.name; - this.closing= other.closing; - 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(AmqpDetach.AmqpDetachBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpDetach)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpDetach) t); + if(o == null || !(o instanceof AmqpDetach)) { + return false; } - public boolean equivalent(AmqpDetach b) { + return equals((AmqpDetach) o); + } - if(b.getOptions() == null ^ getOptions() == null) { - return false; - } - if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ - return false; - } + public boolean equals(AmqpDetach b) { - if(b.getName() == null ^ getName() == null) { - return false; - } - if(b.getName() != null && !b.getName().equals(getName())){ - return false; - } + if(b.getOptions() == null ^ getOptions() == null) { + return false; + } + if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ + return false; + } - if(b.getClosing() == null ^ getClosing() == null) { - return false; - } - if(b.getClosing() != null && !b.getClosing().equals(getClosing())){ - return false; - } + if(b.getName() == null ^ getName() == null) { + return false; + } + if(b.getName() != null && !b.getName().equals(getName())){ + return false; + } - if(b.getException() == null ^ getException() == null) { - return false; - } - if(b.getException() != null && !b.getException().equivalent(getException())){ - return false; - } - return true; + if(b.getClosing() == null ^ getClosing() == null) { + return false; + } + if(b.getClosing() != null && !b.getClosing().equals(getClosing())){ + 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 AmqpDetachBuffer extends AmqpList.AmqpListBuffer implements AmqpDetach{ @@ -326,6 +364,10 @@ return bean().getOptions(); } + public void setName(Buffer name) { + bean().setName(name); + } + public final void setName(AmqpSessionName name) { bean().setName(name); } @@ -334,10 +376,15 @@ return bean().getName(); } - public void setClosing(Boolean closing) { + public void setClosing(Boolean closing) { bean().setClosing(closing); } + public void setClosing(boolean closing) { + bean().setClosing(closing); + } + + public final void setClosing(AmqpBoolean closing) { bean().setClosing(closing); } @@ -390,8 +437,16 @@ handler.handleDetach(this); } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpDetach o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpDetach.AmqpDetachBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDisposition.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDisposition.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/AmqpDisposition.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDisposition.java Fri Feb 12 04:25:25 2010 @@ -19,7 +19,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import java.util.HashMap; import java.util.Iterator; import org.apache.activemq.amqp.protocol.AmqpCommand; import org.apache.activemq.amqp.protocol.AmqpCommandHandler; @@ -58,6 +57,38 @@ *

* Specifies the Link to which the barrier applies. *

+ *

+ * 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. + *

+ */ + public void setHandle(Long handle); + + /** + *

+ * Specifies the Link to which the barrier applies. + *

+ *

+ * 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. + *

+ */ + public void setHandle(long handle); + + /** + *

+ * Specifies the Link to which the barrier applies. + *

+ *

+ * 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. + *

*/ public void setHandle(AmqpHandle handle); @@ -65,19 +96,27 @@ *

* Specifies the Link to which the barrier applies. *

+ *

+ * 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. + *

*/ public AmqpHandle getHandle(); - public void setDisposition(HashMap, AmqpType> disposition); - public void setDisposition(AmqpMap disposition); - public HashMap, AmqpType> getDisposition(); + public IAmqpMap, AmqpType> getDisposition(); + + public void setFirst(Buffer first); public void setFirst(AmqpDeliveryTag first); public AmqpDeliveryTag getFirst(); + public void setLast(Buffer last); + public void setLast(AmqpDeliveryTag last); public AmqpDeliveryTag getLast(); @@ -92,224 +131,238 @@ private AmqpDeliveryTag first; private AmqpDeliveryTag last; - public AmqpDispositionBean() { + AmqpDispositionBean() { } - public AmqpDispositionBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpDispositionBean(IAmqpList value) { - public AmqpDispositionBean(AmqpDisposition.AmqpDispositionBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpDispositionBean copy() { - return new AmqpDisposition.AmqpDispositionBean(bean); - } + AmqpDispositionBean(AmqpDisposition.AmqpDispositionBean other) { + this.bean = other; + } - public final void handle(AmqpCommandHandler handler) throws Exception { - handler.handleDisposition(this); - } + public final AmqpDispositionBean copy() { + return new AmqpDisposition.AmqpDispositionBean(bean); + } - public final AmqpDisposition.AmqpDispositionBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpDispositionBuffer(marshaller.encode(this)); - } - return buffer; - } + public final void handle(AmqpCommandHandler handler) throws Exception { + handler.handleDisposition(this); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpDisposition.AmqpDispositionBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpDispositionBuffer(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 void setDisposition(HashMap, AmqpType> disposition) { - setDisposition(new AmqpMap.AmqpMapBean(disposition)); - } + public void setHandle(long handle) { + setHandle(TypeFactory.createAmqpHandle(handle)); + } - public final void setDisposition(AmqpMap disposition) { - copyCheck(); - bean.disposition = disposition; - } - public final HashMap, AmqpType> getDisposition() { - return bean.disposition.getValue(); - } + public final void setHandle(AmqpHandle handle) { + copyCheck(); + bean.handle = handle; + } - public final void setFirst(AmqpDeliveryTag first) { - copyCheck(); - bean.first = first; - } + public final AmqpHandle getHandle() { + return bean.handle; + } - public final AmqpDeliveryTag getFirst() { - return bean.first; - } + public final void setDisposition(AmqpMap disposition) { + copyCheck(); + bean.disposition = disposition; + } - public final void setLast(AmqpDeliveryTag last) { - copyCheck(); - bean.last = last; + public final IAmqpMap, AmqpType> getDisposition() { + return bean.disposition.getValue(); + } + + public void setFirst(Buffer first) { + setFirst(TypeFactory.createAmqpDeliveryTag(first)); + } + + + public final void setFirst(AmqpDeliveryTag first) { + copyCheck(); + bean.first = first; + } + + public final AmqpDeliveryTag getFirst() { + return bean.first; + } + + public void setLast(Buffer last) { + setLast(TypeFactory.createAmqpDeliveryTag(last)); + } + + + public final void setLast(AmqpDeliveryTag last) { + copyCheck(); + bean.last = last; + } + + public final AmqpDeliveryTag getLast() { + return bean.last; + } + + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setOptions((AmqpOptions) value); + break; + } + case 1: { + setHandle((AmqpHandle) value); + break; + } + case 2: { + setDisposition((AmqpMap) value); + break; + } + case 3: { + setFirst((AmqpDeliveryTag) value); + break; + } + case 4: { + setLast((AmqpDeliveryTag) value); + break; + } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); + } } + } - public final AmqpDeliveryTag getLast() { + public AmqpType get(int index) { + switch(index) { + case 0: { + return bean.options; + } + case 1: { + return bean.handle; + } + case 2: { + return bean.disposition; + } + case 3: { + return bean.first; + } + case 4: { return bean.last; } - - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setOptions((AmqpOptions) value); - break; - } - case 1: { - setHandle((AmqpHandle) value); - break; - } - case 2: { - setDisposition((AmqpMap) value); - break; - } - case 3: { - setFirst((AmqpDeliveryTag) value); - break; - } - case 4: { - setLast((AmqpDeliveryTag) value); - break; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); } - - public AmqpType get(int index) { - switch(index) { - case 0: { - return bean.options; - } - case 1: { - return bean.handle; - } - case 2: { - return bean.disposition; - } - case 3: { - return bean.first; - } - case 4: { - return bean.last; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } } + } - public int getListCount() { - return 5; - } + public int getListCount() { + return 5; + } - public IAmqpList getValue() { - return bean; - } + public IAmqpList getValue() { + return bean; + } - public Iterator> iterator() { - return new AmqpListIterator(bean); - } + public Iterator> 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(AmqpDisposition.AmqpDispositionBean other) { - this.options= other.options; - this.handle= other.handle; - this.disposition= other.disposition; - this.first= other.first; - this.last= other.last; - bean = this; + if(bean != this) {; + copy(bean); } + } - public boolean equivalent(AmqpType t){ - if(this == t) { - return true; - } + private final void copy(AmqpDisposition.AmqpDispositionBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpDisposition)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpDisposition) t); + if(o == null || !(o instanceof AmqpDisposition)) { + return false; } - public boolean equivalent(AmqpDisposition b) { + return equals((AmqpDisposition) o); + } + + public boolean equals(AmqpDisposition 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.getDisposition() == null ^ getDisposition() == null) { - return false; - } - if(b.getDisposition() != null && !b.getDisposition().equals(getDisposition())){ - return false; - } + if(b.getDisposition() == null ^ getDisposition() == null) { + return false; + } + if(b.getDisposition() != null && !b.getDisposition().equals(getDisposition())){ + return false; + } - if(b.getFirst() == null ^ getFirst() == null) { - return false; - } - if(b.getFirst() != null && !b.getFirst().equals(getFirst())){ - return false; - } + if(b.getFirst() == null ^ getFirst() == null) { + return false; + } + if(b.getFirst() != null && !b.getFirst().equals(getFirst())){ + return false; + } - if(b.getLast() == null ^ getLast() == null) { - return false; - } - if(b.getLast() != null && !b.getLast().equals(getLast())){ - return false; - } - return true; + if(b.getLast() == null ^ getLast() == null) { + return false; } + if(b.getLast() != null && !b.getLast().equals(getLast())){ + return false; + } + return true; } + public int hashCode() { + return AbstractAmqpList.hashCodeFor(this); + } +} + public static class AmqpDispositionBuffer extends AmqpList.AmqpListBuffer implements AmqpDisposition{ private AmqpDispositionBean bean; @@ -326,6 +379,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); } @@ -334,18 +396,18 @@ return bean().getHandle(); } - public void setDisposition(HashMap, AmqpType> disposition) { - bean().setDisposition(disposition); - } - public final void setDisposition(AmqpMap disposition) { bean().setDisposition(disposition); } - public final HashMap, AmqpType> getDisposition() { + public final IAmqpMap, AmqpType> getDisposition() { return bean().getDisposition(); } + public void setFirst(Buffer first) { + bean().setFirst(first); + } + public final void setFirst(AmqpDeliveryTag first) { bean().setFirst(first); } @@ -354,6 +416,10 @@ return bean().getFirst(); } + public void setLast(Buffer last) { + bean().setLast(last); + } + public final void setLast(AmqpDeliveryTag last) { bean().setLast(last); } @@ -398,8 +464,16 @@ handler.handleDisposition(this); } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpDisposition o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpDisposition.AmqpDispositionBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDouble.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDouble.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/AmqpDouble.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDouble.java Fri Feb 12 04:25:25 2010 @@ -39,14 +39,11 @@ private AmqpDoubleBean bean = this; private Double value; - protected AmqpDoubleBean() { - } - - public AmqpDoubleBean(Double value) { + AmqpDoubleBean(Double value) { this.value = value; } - public AmqpDoubleBean(AmqpDouble.AmqpDoubleBean other) { + AmqpDoubleBean(AmqpDouble.AmqpDoubleBean other) { this.bean = other; } @@ -80,29 +77,10 @@ return false; } - return equivalent((AmqpDouble) o); + return equals((AmqpDouble) o); } - public int hashCode() { - if(getValue() == null) { - return AmqpDouble.AmqpDoubleBean.class.hashCode(); - } - return getValue().hashCode(); - } - - public boolean equivalent(AmqpType t){ - if(this == t) { - return true; - } - - if(t == null || !(t instanceof AmqpDouble)) { - return false; - } - - return equivalent((AmqpDouble) t); - } - - public boolean equivalent(AmqpDouble b) { + public boolean equals(AmqpDouble 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 AmqpDouble.AmqpDoubleBean.class.hashCode(); + } + return getValue().hashCode(); + } } public static class AmqpDoubleBuffer implements AmqpDouble, AmqpBuffer< Double> { @@ -155,12 +140,12 @@ return bean().equals(o); } - public int hashCode() { - return bean().hashCode(); + public boolean equals(AmqpDouble o){ + return bean().equals(o); } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public int hashCode() { + return bean().hashCode(); } public static AmqpDouble.AmqpDoubleBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDrain.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDrain.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/AmqpDrain.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpDrain.java Fri Feb 12 04:25:25 2010 @@ -57,6 +57,40 @@ *

* Identifies the Link to be drained. *

+ *

+ * 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. + *

+ */ + public void setHandle(Long handle); + + /** + * the Link handle + *

+ * Identifies the Link to be drained. + *

+ *

+ * 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. + *

+ */ + public void setHandle(long handle); + + /** + * the Link handle + *

+ * Identifies the Link to be drained. + *

+ *

+ * 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. + *

*/ public void setHandle(AmqpHandle handle); @@ -65,6 +99,12 @@ *

* Identifies the Link to be drained. *

+ *

+ * 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. + *

*/ public AmqpHandle getHandle(); @@ -75,146 +115,158 @@ private AmqpOptions options; private AmqpHandle handle; - public AmqpDrainBean() { + AmqpDrainBean() { } - public AmqpDrainBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpDrainBean(IAmqpList value) { - public AmqpDrainBean(AmqpDrain.AmqpDrainBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpDrainBean copy() { - return new AmqpDrain.AmqpDrainBean(bean); - } + AmqpDrainBean(AmqpDrain.AmqpDrainBean other) { + this.bean = other; + } - public final void handle(AmqpCommandHandler handler) throws Exception { - handler.handleDrain(this); - } + public final AmqpDrainBean copy() { + return new AmqpDrain.AmqpDrainBean(bean); + } - public final AmqpDrain.AmqpDrainBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpDrainBuffer(marshaller.encode(this)); - } - return buffer; - } + public final void handle(AmqpCommandHandler handler) throws Exception { + handler.handleDrain(this); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpDrain.AmqpDrainBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpDrainBuffer(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 void setHandle(Long handle) { + setHandle(TypeFactory.createAmqpHandle(handle)); + } + + + public void setHandle(long handle) { + setHandle(TypeFactory.createAmqpHandle(handle)); + } + + + public final void setHandle(AmqpHandle handle) { + copyCheck(); + bean.handle = handle; + } + + public final AmqpHandle getHandle() { + return bean.handle; + } + + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setOptions((AmqpOptions) value); + break; + } + case 1: { + setHandle((AmqpHandle) value); + break; } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); + } + } + } - public final AmqpHandle getHandle() { + public AmqpType get(int index) { + switch(index) { + case 0: { + return bean.options; + } + case 1: { return bean.handle; } - - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setOptions((AmqpOptions) value); - break; - } - case 1: { - setHandle((AmqpHandle) 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; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } } + } - public int getListCount() { - return 2; - } + public int getListCount() { + return 2; + } - public IAmqpList getValue() { - return bean; - } + public IAmqpList getValue() { + return bean; + } - public Iterator> iterator() { - return new AmqpListIterator(bean); - } + public Iterator> 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(AmqpDrain.AmqpDrainBean other) { - this.options= other.options; - this.handle= other.handle; - bean = this; + if(bean != this) {; + copy(bean); } + } - public boolean equivalent(AmqpType t){ - if(this == t) { - return true; - } + private final void copy(AmqpDrain.AmqpDrainBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpDrain)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpDrain) t); + if(o == null || !(o instanceof AmqpDrain)) { + return false; } - public boolean equivalent(AmqpDrain b) { + return equals((AmqpDrain) o); + } - if(b.getOptions() == null ^ getOptions() == null) { - return false; - } - if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ - return false; - } + public boolean equals(AmqpDrain b) { - if(b.getHandle() == null ^ getHandle() == null) { - return false; - } - if(b.getHandle() != null && !b.getHandle().equals(getHandle())){ - return false; - } - return true; + 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; + } + return true; + } + + public int hashCode() { + return AbstractAmqpList.hashCodeFor(this); } +} public static class AmqpDrainBuffer extends AmqpList.AmqpListBuffer implements AmqpDrain{ @@ -232,6 +284,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); } @@ -276,8 +337,16 @@ handler.handleDrain(this); } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpDrain o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpDrain.AmqpDrainBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpEnlist.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpEnlist.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/AmqpEnlist.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpEnlist.java Fri Feb 12 04:25:25 2010 @@ -90,6 +90,15 @@ * applies to joining a transaction previously seen. *

*/ + public void setJoin(boolean join); + + /** + * Join with existing xid flag + *

+ * Indicate whether this is joining an already associated xid. Indicate that the enlist + * applies to joining a transaction previously seen. + *

+ */ public void setJoin(AmqpBoolean join); /** @@ -115,6 +124,14 @@ * Indicate that the enlist applies to resuming a suspended transaction branch. *

*/ + public void setResume(boolean resume); + + /** + * Resume flag + *

+ * Indicate that the enlist applies to resuming a suspended transaction branch. + *

+ */ public void setResume(AmqpBoolean resume); /** @@ -134,205 +151,215 @@ private AmqpBoolean join; private AmqpBoolean resume; - public AmqpEnlistBean() { + AmqpEnlistBean() { } - public AmqpEnlistBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpEnlistBean(IAmqpList value) { - public AmqpEnlistBean(AmqpEnlist.AmqpEnlistBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpEnlistBean copy() { - return new AmqpEnlist.AmqpEnlistBean(bean); - } + AmqpEnlistBean(AmqpEnlist.AmqpEnlistBean other) { + this.bean = other; + } - public final void handle(AmqpCommandHandler handler) throws Exception { - handler.handleEnlist(this); - } + public final AmqpEnlistBean copy() { + return new AmqpEnlist.AmqpEnlistBean(bean); + } - public final AmqpEnlist.AmqpEnlistBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpEnlistBuffer(marshaller.encode(this)); - } - return buffer; - } + public final void handle(AmqpCommandHandler handler) throws Exception { + handler.handleEnlist(this); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpEnlist.AmqpEnlistBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpEnlistBuffer(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 setXid(AmqpXid xid) { - copyCheck(); - bean.xid = xid; - } + public final AmqpOptions getOptions() { + return bean.options; + } - public final AmqpXid getXid() { - return bean.xid; - } + public final void setXid(AmqpXid xid) { + copyCheck(); + bean.xid = xid; + } - public void setJoin(Boolean join) { - setJoin(new AmqpBoolean.AmqpBooleanBean(join)); - } + public final AmqpXid getXid() { + return bean.xid; + } + public void setJoin(Boolean join) { + setJoin(TypeFactory.createAmqpBoolean(join)); + } - public final void setJoin(AmqpBoolean join) { - copyCheck(); - bean.join = join; - } - public final Boolean getJoin() { - return bean.join.getValue(); - } + public void setJoin(boolean join) { + setJoin(TypeFactory.createAmqpBoolean(join)); + } - public void setResume(Boolean resume) { - setResume(new AmqpBoolean.AmqpBooleanBean(resume)); - } + public final void setJoin(AmqpBoolean join) { + copyCheck(); + bean.join = join; + } - public final void setResume(AmqpBoolean resume) { - copyCheck(); - bean.resume = resume; - } + public final Boolean getJoin() { + return bean.join.getValue(); + } - public final Boolean getResume() { - return bean.resume.getValue(); - } + public void setResume(Boolean resume) { + setResume(TypeFactory.createAmqpBoolean(resume)); + } - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setOptions((AmqpOptions) value); - break; - } - case 1: { - setXid((AmqpXid) value); - break; - } - case 2: { - setJoin((AmqpBoolean) value); - break; - } - case 3: { - setResume((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.xid; - } - case 2: { - return bean.join; - } - case 3: { - return bean.resume; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } - } + public void setResume(boolean resume) { + setResume(TypeFactory.createAmqpBoolean(resume)); + } - public int getListCount() { - return 4; - } - public IAmqpList getValue() { - return bean; + public final void setResume(AmqpBoolean resume) { + copyCheck(); + bean.resume = resume; + } + + public final Boolean getResume() { + return bean.resume.getValue(); + } + + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setOptions((AmqpOptions) value); + break; + } + case 1: { + setXid((AmqpXid) value); + break; + } + case 2: { + setJoin((AmqpBoolean) value); + break; + } + case 3: { + setResume((AmqpBoolean) value); + break; + } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); } + } + } - public Iterator> iterator() { - return new AmqpListIterator(bean); + public AmqpType get(int index) { + switch(index) { + case 0: { + return bean.options; + } + case 1: { + return bean.xid; } + case 2: { + return bean.join; + } + case 3: { + return bean.resume; + } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); + } + } + } + public int getListCount() { + return 4; + } - 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(AmqpEnlist.AmqpEnlistBean other) { - this.options= other.options; - this.xid= other.xid; - this.join= other.join; - this.resume= other.resume; - bean = this; + public Iterator> 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(AmqpEnlist.AmqpEnlistBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpEnlist)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpEnlist) t); + if(o == null || !(o instanceof AmqpEnlist)) { + return false; } - public boolean equivalent(AmqpEnlist b) { + return equals((AmqpEnlist) o); + } - if(b.getOptions() == null ^ getOptions() == null) { - return false; - } - if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ - return false; - } + public boolean equals(AmqpEnlist b) { - if(b.getXid() == null ^ getXid() == null) { - return false; - } - if(b.getXid() != null && !b.getXid().equivalent(getXid())){ - return false; - } + if(b.getOptions() == null ^ getOptions() == null) { + return false; + } + if(b.getOptions() != null && !b.getOptions().equals(getOptions())){ + return false; + } - if(b.getJoin() == null ^ getJoin() == null) { - return false; - } - if(b.getJoin() != null && !b.getJoin().equals(getJoin())){ - return false; - } + if(b.getXid() == null ^ getXid() == null) { + return false; + } + if(b.getXid() != null && !b.getXid().equals(getXid())){ + return false; + } - if(b.getResume() == null ^ getResume() == null) { - return false; - } - if(b.getResume() != null && !b.getResume().equals(getResume())){ - return false; - } - return true; + if(b.getJoin() == null ^ getJoin() == null) { + return false; + } + if(b.getJoin() != null && !b.getJoin().equals(getJoin())){ + return false; + } + + if(b.getResume() == null ^ getResume() == null) { + return false; + } + if(b.getResume() != null && !b.getResume().equals(getResume())){ + return false; } + return true; } + public int hashCode() { + return AbstractAmqpList.hashCodeFor(this); + } +} + public static class AmqpEnlistBuffer extends AmqpList.AmqpListBuffer implements AmqpEnlist{ private AmqpEnlistBean bean; @@ -357,10 +384,15 @@ return bean().getXid(); } - public void setJoin(Boolean join) { + public void setJoin(Boolean join) { bean().setJoin(join); } + public void setJoin(boolean join) { + bean().setJoin(join); + } + + public final void setJoin(AmqpBoolean join) { bean().setJoin(join); } @@ -369,10 +401,15 @@ return bean().getJoin(); } - public void setResume(Boolean resume) { + public void setResume(Boolean resume) { bean().setResume(resume); } + public void setResume(boolean resume) { + bean().setResume(resume); + } + + public final void setResume(AmqpBoolean resume) { bean().setResume(resume); } @@ -417,8 +454,16 @@ handler.handleEnlist(this); } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpEnlist o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpEnlist.AmqpEnlistBuffer create(Encoded encoded) { Modified: activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpFilter.java URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpFilter.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/AmqpFilter.java (original) +++ activemq/sandbox/activemq-apollo-actor/activemq-amqp/src/main/java/org/apache/activemq/amqp/protocol/types/AmqpFilter.java Fri Feb 12 04:25:25 2010 @@ -36,16 +36,31 @@ /** * the type of the filter + *

+ * Symbols are values from a constrained domain. Although the set of possible domains is + * open-ended, typically the both number and size of symbols in use for any given application + * will be small, e.g. small enough that it is reasonable to cache all the distinct values. + *

*/ public void setFilterType(String filterType); /** * the type of the filter + *

+ * Symbols are values from a constrained domain. Although the set of possible domains is + * open-ended, typically the both number and size of symbols in use for any given application + * will be small, e.g. small enough that it is reasonable to cache all the distinct values. + *

*/ public void setFilterType(AmqpSymbol filterType); /** * the type of the filter + *

+ * Symbols are values from a constrained domain. Although the set of possible domains is + * open-ended, typically the both number and size of symbols in use for any given application + * will be small, e.g. small enough that it is reasonable to cache all the distinct values. + *

*/ public String getFilterType(); @@ -66,148 +81,150 @@ private AmqpSymbol filterType; private AmqpType filter; - public AmqpFilterBean() { + AmqpFilterBean() { } - public AmqpFilterBean(IAmqpList value) { - //TODO we should defer decoding of the described type: - for(int i = 0; i < value.getListCount(); i++) { - set(i, value.get(i)); - } - } + AmqpFilterBean(IAmqpList value) { - public AmqpFilterBean(AmqpFilter.AmqpFilterBean other) { - this.bean = other; + for(int i = 0; i < value.getListCount(); i++) { + set(i, value.get(i)); } + } - public final AmqpFilterBean copy() { - return new AmqpFilter.AmqpFilterBean(bean); - } + AmqpFilterBean(AmqpFilter.AmqpFilterBean other) { + this.bean = other; + } - public final AmqpFilter.AmqpFilterBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ - if(buffer == null) { - buffer = new AmqpFilterBuffer(marshaller.encode(this)); - } - return buffer; - } + public final AmqpFilterBean copy() { + return new AmqpFilter.AmqpFilterBean(bean); + } - public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ - getBuffer(marshaller).marshal(out, marshaller); + public final AmqpFilter.AmqpFilterBuffer getBuffer(AmqpMarshaller marshaller) throws AmqpEncodingError{ + if(buffer == null) { + buffer = new AmqpFilterBuffer(marshaller.encode(this)); } + return buffer; + } + public final void marshal(DataOutput out, AmqpMarshaller marshaller) throws IOException, AmqpEncodingError{ + getBuffer(marshaller).marshal(out, marshaller); + } - public void setFilterType(String filterType) { - setFilterType(new AmqpSymbol.AmqpSymbolBean(filterType)); - } + public void setFilterType(String filterType) { + setFilterType(TypeFactory.createAmqpSymbol(filterType)); + } - public final void setFilterType(AmqpSymbol filterType) { - copyCheck(); - bean.filterType = filterType; - } - public final String getFilterType() { - return bean.filterType.getValue(); - } + public final void setFilterType(AmqpSymbol filterType) { + copyCheck(); + bean.filterType = filterType; + } - public final void setFilter(AmqpType filter) { - copyCheck(); - bean.filter = filter; + public final String getFilterType() { + return bean.filterType.getValue(); + } + + public final void setFilter(AmqpType filter) { + copyCheck(); + bean.filter = filter; + } + + public final AmqpType getFilter() { + return bean.filter; + } + + public void set(int index, AmqpType value) { + switch(index) { + case 0: { + setFilterType((AmqpSymbol) value); + break; + } + case 1: { + setFilter((AmqpType) value); + break; } + default : { + throw new IndexOutOfBoundsException(String.valueOf(index)); + } + } + } - public final AmqpType getFilter() { + public AmqpType get(int index) { + switch(index) { + case 0: { + return bean.filterType; + } + case 1: { return bean.filter; } - - public void set(int index, AmqpType value) { - switch(index) { - case 0: { - setFilterType((AmqpSymbol) value); - break; - } - case 1: { - setFilter((AmqpType) 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.filterType; - } - case 1: { - return bean.filter; - } - default : { - throw new IndexOutOfBoundsException(String.valueOf(index)); - } - } } + } - public int getListCount() { - return 2; - } + public int getListCount() { + return 2; + } - public IAmqpList getValue() { - return bean; - } + public IAmqpList getValue() { + return bean; + } - public Iterator> iterator() { - return new AmqpListIterator(bean); - } + public Iterator> 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(AmqpFilter.AmqpFilterBean other) { - this.filterType= other.filterType; - this.filter= other.filter; - bean = this; + if(bean != this) {; + copy(bean); } + } - public boolean equivalent(AmqpType t){ - if(this == t) { - return true; - } + private final void copy(AmqpFilter.AmqpFilterBean other) { + bean = this; + } - if(t == null || !(t instanceof AmqpFilter)) { - return false; - } + public boolean equals(Object o){ + if(this == o) { + return true; + } - return equivalent((AmqpFilter) t); + if(o == null || !(o instanceof AmqpFilter)) { + return false; } - public boolean equivalent(AmqpFilter b) { + return equals((AmqpFilter) o); + } - if(b.getFilterType() == null ^ getFilterType() == null) { - return false; - } - if(b.getFilterType() != null && !b.getFilterType().equals(getFilterType())){ - return false; - } + public boolean equals(AmqpFilter b) { - if(b.getFilter() == null ^ getFilter() == null) { - return false; - } - if(b.getFilter() != null && !b.getFilter().equals(getFilter())){ - return false; - } - return true; + if(b.getFilterType() == null ^ getFilterType() == null) { + return false; + } + if(b.getFilterType() != null && !b.getFilterType().equals(getFilterType())){ + return false; + } + + if(b.getFilter() == null ^ getFilter() == null) { + return false; + } + if(b.getFilter() != null && !b.getFilter().equals(getFilter())){ + return false; } + return true; } + public int hashCode() { + return AbstractAmqpList.hashCodeFor(this); + } +} + public static class AmqpFilterBuffer extends AmqpList.AmqpListBuffer implements AmqpFilter{ private AmqpFilterBean bean; @@ -216,7 +233,7 @@ super(encoded); } - public void setFilterType(String filterType) { + public void setFilterType(String filterType) { bean().setFilterType(filterType); } @@ -268,8 +285,16 @@ return bean; } - public boolean equivalent(AmqpType t) { - return bean().equivalent(t); + public boolean equals(Object o){ + return bean().equals(o); + } + + public boolean equals(AmqpFilter o){ + return bean().equals(o); + } + + public int hashCode() { + return bean().hashCode(); } public static AmqpFilter.AmqpFilterBuffer create(Encoded encoded) {