summaryrefslogtreecommitdiff
path: root/java/common
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2007-02-16 23:11:41 +0000
committerRobert Godfrey <rgodfrey@apache.org>2007-02-16 23:11:41 +0000
commitdd8df96fcca8f5f9dcbe91ba012cff400a38daa7 (patch)
treeee84d98ec82abd31dd486f98fea1cb6bdb526db5 /java/common
parent6213309b7c179fdddfeca0273d5c1f6592adedd7 (diff)
downloadqpid-python-dd8df96fcca8f5f9dcbe91ba012cff400a38daa7.tar.gz
QPID-375 : remove assumptions on standard exchanges (amq.direct, amq.topic, etc), allow other exchanges to be created through virtualhosts.xml
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@508649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common')
-rw-r--r--java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java6
-rw-r--r--java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java21
2 files changed, 16 insertions, 11 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java b/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
index 172f1b1790..55f9566955 100644
--- a/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
+++ b/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
@@ -24,6 +24,8 @@ import org.apache.qpid.framing.AMQShortString;
public class ExchangeDefaults
{
+ public final static AMQShortString DEFAULT_EXCHANGE_NAME = new AMQShortString("");
+
public final static AMQShortString TOPIC_EXCHANGE_NAME = new AMQShortString("amq.topic");
public final static AMQShortString TOPIC_EXCHANGE_CLASS = new AMQShortString("topic");
@@ -41,8 +43,4 @@ public class ExchangeDefaults
public final static AMQShortString FANOUT_EXCHANGE_CLASS = new AMQShortString("fanout");
- public final static AMQShortString SYSTEM_MANAGEMENT_EXCHANGE_NAME = new AMQShortString("qpid.sysmgmt");
-
- public final static AMQShortString SYSTEM_MANAGEMENT_CLASS = new AMQShortString("sysmmgmt");
-
}
diff --git a/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java b/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
index 2ee4ce21cb..d44fc3cbd5 100644
--- a/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
+++ b/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
@@ -62,7 +62,7 @@ public class AMQBindingURL implements BindingURL
if (exchangeClass == null)
{
_url = ExchangeDefaults.DIRECT_EXCHANGE_CLASS + "://" +
- ExchangeDefaults.DIRECT_EXCHANGE_NAME + "//" + _url;
+ ExchangeDefaults.DEFAULT_EXCHANGE_NAME + "//" + _url;
//URLHelper.parseError(-1, "Exchange Class not specified.", _url);
parseBindingURL();
return;
@@ -76,7 +76,14 @@ public class AMQBindingURL implements BindingURL
if (exchangeName == null)
{
- throw URLHelper.parseError(-1, "Exchange Name not specified.", _url);
+ if(getExchangeClass().equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS))
+ {
+ setExchangeName(ExchangeDefaults.DEFAULT_EXCHANGE_NAME);
+ }
+ else
+ {
+ throw URLHelper.parseError(-1, "Exchange Name not specified.", _url);
+ }
}
else
{
@@ -172,6 +179,11 @@ public class AMQBindingURL implements BindingURL
{
_exchangeClass = exchangeClass;
+ if (exchangeClass.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
+ {
+ setOption(BindingURL.OPTION_EXCLUSIVE, "true");
+ }
+
}
public AMQShortString getExchangeName()
@@ -182,11 +194,6 @@ public class AMQBindingURL implements BindingURL
private void setExchangeName(AMQShortString name)
{
_exchangeName = name;
-
- if (name.equals(ExchangeDefaults.TOPIC_EXCHANGE_NAME))
- {
- setOption(BindingURL.OPTION_EXCLUSIVE, "true");
- }
}
public AMQShortString getDestinationName()