From 5dd92ba051ee9c7c794a0545dc43316720b66b71 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Fri, 20 Aug 2010 13:48:00 +0000 Subject: This is a fix for QPID-2809 This is also a workaround for QPID-2808 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@987505 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/AMQDestination.java | 71 +++++++++++- .../org/apache/qpid/client/AMQSession_0_10.java | 120 ++++++++++++--------- .../qpid/client/BasicMessageConsumer_0_10.java | 11 ++ 3 files changed, 150 insertions(+), 52 deletions(-) (limited to 'java') diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java b/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java index 0dc702dcbc..c6bc1bd622 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java @@ -62,6 +62,8 @@ public abstract class AMQDestination implements Destination, Referenceable protected boolean _isAutoDelete; private boolean _browseOnly; + + private boolean _isAddressResolved; private AMQShortString _queueName; @@ -312,6 +314,11 @@ public abstract class AMQDestination implements Destination, Referenceable return _destSyntax; } + protected void setDestSyntax(DestSyntax syntax) + { + _destSyntax = syntax; + } + public AMQShortString getEncodedName() { if(_urlAsShortString == null) @@ -736,6 +743,10 @@ public abstract class AMQDestination implements Destination, Referenceable return _address; } + protected void setAddress(Address addr) { + _address = addr; + } + public int getAddressType(){ return _addressType; } @@ -747,6 +758,10 @@ public abstract class AMQDestination implements Destination, Referenceable public String getAddressName() { return _name; } + + public void setAddressName(String name){ + _name = name; + } public String getSubject() { return _subject; @@ -763,15 +778,23 @@ public abstract class AMQDestination implements Destination, Referenceable public void setCreate(AddressOption option) { _create = option; } - + public AddressOption getAssert() { return _assert; } + public void setAssert(AddressOption option) { + _assert = option; + } + public AddressOption getDelete() { return _delete; } - + + public void setDelete(AddressOption option) { + _delete = option; + } + public Node getTargetNode() { return _targetNode; @@ -817,6 +840,16 @@ public abstract class AMQDestination implements Destination, Referenceable this._routingKey = rk; } + public boolean isAddressResolved() + { + return _isAddressResolved; + } + + public void setAddressResolved(boolean addressResolved) + { + _isAddressResolved = addressResolved; + } + private static Address createAddressFromString(String str) { return Address.parse(str); @@ -861,4 +894,38 @@ public abstract class AMQDestination implements Destination, Referenceable { return _browseOnly; } + + public void setBrowseOnly(boolean b) + { + _browseOnly = b; + } + + public AMQDestination copyDestination() + { + AMQDestination dest = + new AMQAnyDestination(_exchangeName, + _exchangeClass, + _routingKey, + _isExclusive, + _isAutoDelete, + _queueName, + _isDurable, + _bindingKeys + ); + + dest.setDestSyntax(_destSyntax); + dest.setAddress(_address); + dest.setAddressName(_name); + dest.setSubject(_subject); + dest.setCreate(_create); + dest.setAssert(_assert); + dest.setDelete(_create); + dest.setBrowseOnly(_browseOnly); + dest.setAddressType(_addressType); + dest.setTargetNode(_targetNode); + dest.setSourceNode(_sourceNode); + dest.setLink(_link); + dest.setAddressResolved(_isAddressResolved); + return dest; + } } diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java index 430a4bd9e9..0563276457 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java @@ -592,7 +592,7 @@ public class AMQSession_0_10 extends AMQSession