qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1574235 [1/2] - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/binding/ broker-core/src/main/java/org/apache/qpid/server/exchange/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/jav...
Date Tue, 04 Mar 2014 22:52:06 GMT
Author: rgodfrey
Date: Tue Mar  4 22:52:05 2014
New Revision: 1574235

URL: http://svn.apache.org/r1574235
Log:
QPID-5601 : [Java Broker] The 0-x "default exchange" should not actually be modelled as an Exchange

Added:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultDestination.java
      - copied, changed from r1572499, qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
Removed:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/BindingImpl.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeImpl.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/NonDefaultExchange.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeleteHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/BrokerTestHelper_0_8.java
    qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/BindingImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/BindingImpl.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/BindingImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/binding/BindingImpl.java Tue Mar  4 22:52:05 2014
@@ -21,7 +21,6 @@
 package org.apache.qpid.server.binding;
 
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.BindingMessages;
 import org.apache.qpid.server.logging.subjects.BindingLogSubject;
@@ -51,7 +50,7 @@ public class BindingImpl
 {
     private final String _bindingKey;
     private final AMQQueue _queue;
-    private final NonDefaultExchange _exchange;
+    private final ExchangeImpl _exchange;
     private final Map<String, Object> _arguments;
     private final UUID _id;
     private final AtomicLong _matches = new AtomicLong();
@@ -65,7 +64,7 @@ public class BindingImpl
     public BindingImpl(UUID id,
                        final String bindingKey,
                        final AMQQueue queue,
-                       final NonDefaultExchange exchange,
+                       final ExchangeImpl exchange,
                        final Map<String, Object> arguments)
     {
         this(id, convertToAttributes(bindingKey, arguments), queue, exchange);
@@ -82,7 +81,7 @@ public class BindingImpl
         return attributes;
     }
 
-    public BindingImpl(UUID id, Map<String, Object> attributes, AMQQueue queue, NonDefaultExchange exchange)
+    public BindingImpl(UUID id, Map<String, Object> attributes, AMQQueue queue, ExchangeImpl exchange)
     {
         super(id,Collections.EMPTY_MAP,attributes,queue.getVirtualHost().getTaskExecutor());
         _id = id;
@@ -120,7 +119,7 @@ public class BindingImpl
     }
 
     @Override
-    public NonDefaultExchange getExchange()
+    public ExchangeImpl getExchange()
     {
         return _exchange;
     }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Tue Mar  4 22:52:05 2014
@@ -24,7 +24,6 @@ import java.security.AccessControlExcept
 import java.util.ArrayList;
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.binding.BindingImpl;
-import org.apache.qpid.server.consumer.Consumer;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.ExchangeMessages;
@@ -33,7 +32,6 @@ import org.apache.qpid.server.message.In
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.MessageReference;
 import org.apache.qpid.server.message.ServerMessage;
-import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Publisher;
@@ -68,13 +66,13 @@ import java.util.concurrent.atomic.Atomi
 
 public abstract class AbstractExchange<T extends AbstractExchange<T>>
         extends AbstractConfiguredObject<T>
-        implements NonDefaultExchange<T>
+        implements ExchangeImpl<T>
 {
     private static final Logger _logger = Logger.getLogger(AbstractExchange.class);
     private final LifetimePolicy _lifetimePolicy;
     private final AtomicBoolean _closed = new AtomicBoolean();
 
-    private NonDefaultExchange _alternateExchange;
+    private ExchangeImpl _alternateExchange;
 
     private boolean _durable;
 
@@ -329,12 +327,12 @@ public abstract class AbstractExchange<T
         return !_bindings.isEmpty();
     }
 
-    public NonDefaultExchange getAlternateExchange()
+    public ExchangeImpl getAlternateExchange()
     {
         return _alternateExchange;
     }
 
-    public void setAlternateExchange(NonDefaultExchange exchange)
+    public void setAlternateExchange(ExchangeImpl exchange)
     {
         if(_alternateExchange != null)
         {
@@ -836,13 +834,6 @@ public abstract class AbstractExchange<T
     }
 
     @Override
-    public void setAlternateExchange(final ExchangeImpl exchange)
-    {
-        // todo
-        _alternateExchange = (NonDefaultExchange) exchange;
-    }
-
-    @Override
     public org.apache.qpid.server.model.Binding createBinding(final String bindingKey,
                                                               final Queue queue,
                                                               final Map<String, Object> bindingArguments,

Copied: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultDestination.java (from r1572499, qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultDestination.java?p2=qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultDestination.java&p1=qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java&r1=1572499&r2=1574235&rev=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultDestination.java Tue Mar  4 22:52:05 2014
@@ -18,46 +18,28 @@
  */
 package org.apache.qpid.server.exchange;
 
-import java.security.AccessControlException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
 import org.apache.log4j.Logger;
 import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.server.binding.BindingImpl;
-import org.apache.qpid.server.consumer.Consumer;
 import org.apache.qpid.server.message.InstanceProperties;
+import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.MessageReference;
 import org.apache.qpid.server.message.ServerMessage;
-import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.store.StorableMessageMetaData;
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.util.Action;
-import org.apache.qpid.server.util.StateChangeListener;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-public class DefaultExchange implements ExchangeImpl<DirectExchange>
+public class DefaultDestination implements MessageDestination
 {
 
-    private final QueueRegistry _queueRegistry;
-    private UUID _id;
     private VirtualHost _virtualHost;
-    private static final Logger _logger = Logger.getLogger(DefaultExchange.class);
-
-    private Map<ExchangeReferrer,Object> _referrers = new ConcurrentHashMap<ExchangeReferrer,Object>();
+    private static final Logger _logger = Logger.getLogger(DefaultDestination.class);
 
-    public DefaultExchange(VirtualHost virtualHost, QueueRegistry queueRegistry, UUID id)
+    public DefaultDestination(VirtualHost virtualHost)
     {
         _virtualHost =  virtualHost;
-        _queueRegistry = queueRegistry;
-        _id = id;
     }
 
     @Override
@@ -66,162 +48,6 @@ public class DefaultExchange implements 
         return ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
     }
 
-    @Override
-    public ExchangeType<DirectExchange> getExchangeType()
-    {
-        return DirectExchange.TYPE;
-    }
-
-
-    @Override
-    public boolean addBinding(String bindingKey, AMQQueue queue, Map<String, Object> arguments)
-    {
-        throw new AccessControlException("Cannot add bindings to the default exchange");
-    }
-
-    @Override
-    public boolean deleteBinding(final String bindingKey, final AMQQueue queue)
-    {
-        throw new AccessControlException("Cannot delete bindings from the default exchange");
-    }
-
-    @Override
-    public boolean hasBinding(final String bindingKey, final AMQQueue queue)
-    {
-        return false;
-    }
-
-    @Override
-    public boolean replaceBinding(String bindingKey, AMQQueue queue, Map<String, Object> arguments)
-    {
-        throw new AccessControlException("Cannot replace bindings on the default exchange");
-    }
-
-    @Override
-    public void restoreBinding(UUID id, String bindingKey, AMQQueue queue, Map<String, Object> argumentMap)
-    {
-        _logger.warn("Bindings to the default exchange should not be stored in the configuration store");
-    }
-
-    @Override
-    public String getTypeName()
-    {
-        return getExchangeType().getType();
-    }
-
-    @Override
-    public boolean isDurable()
-    {
-        return false;
-    }
-
-    @Override
-    public boolean isAutoDelete()
-    {
-        return false;
-    }
-
-    @Override
-    public void close()
-    {
-        throw new AccessControlException("Cannot close the default exchange");
-    }
-
-    @Override
-    public boolean isBound(AMQQueue queue)
-    {
-        return _virtualHost.getQueue(queue.getName()) == queue;
-    }
-
-    @Override
-    public boolean hasBindings()
-    {
-        return !_virtualHost.getQueues().isEmpty();
-    }
-
-    @Override
-    public boolean isBound(String bindingKey, AMQQueue queue)
-    {
-        return isBound(queue) && queue.getName().equals(bindingKey);
-    }
-
-    @Override
-    public boolean isBound(String bindingKey, Map<String, Object> arguments, AMQQueue queue)
-    {
-        return isBound(bindingKey, queue) && (arguments == null || arguments.isEmpty());
-    }
-
-    @Override
-    public boolean isBound(Map<String, Object> arguments, AMQQueue queue)
-    {
-        return (arguments == null || arguments.isEmpty()) && isBound(queue);
-    }
-
-    @Override
-    public boolean isBound(String bindingKey, Map<String, Object> arguments)
-    {
-        return (arguments == null || arguments.isEmpty()) && isBound(bindingKey);
-    }
-
-    @Override
-    public boolean isBound(Map<String, Object> arguments)
-    {
-        return (arguments == null || arguments.isEmpty()) && hasBindings();
-    }
-
-    @Override
-    public boolean isBound(String bindingKey)
-    {
-        return _virtualHost.getQueue(bindingKey) != null;
-    }
-
-    @Override
-    public ExchangeImpl getAlternateExchange()
-    {
-        return null;
-    }
-
-    @Override
-    public void setAlternateExchange(ExchangeImpl exchange)
-    {
-        _logger.warn("Cannot set the alternate exchange for the default exchange");
-    }
-
-    @Override
-    public void removeReference(ExchangeReferrer exchange)
-    {
-        _referrers.remove(exchange);
-    }
-
-    @Override
-    public void addReference(ExchangeReferrer exchange)
-    {
-        _referrers.put(exchange, Boolean.TRUE);
-    }
-
-    @Override
-    public boolean hasReferrers()
-    {
-        return !_referrers.isEmpty();
-    }
-
-    @Override
-    public void addBindingListener(BindingListener listener)
-    {
-
-    }
-
-    @Override
-    public void removeBindingListener(BindingListener listener)
-    {
-        // TODO
-    }
-
-    @Override
-    public UUID getId()
-    {
-        return _id;
-    }
 
     public final  <M extends ServerMessage<? extends StorableMessageMetaData>> int send(final M message,
                           final InstanceProperties instanceProperties,
@@ -260,16 +86,4 @@ public class DefaultExchange implements 
         }
     }
 
-    private static final StateChangeListener<BindingImpl, State> STATE_CHANGE_LISTENER =
-            new StateChangeListener<BindingImpl, State>()
-            {
-                @Override
-                public void stateChanged(final BindingImpl object, final State oldState, final State newState)
-                {
-                    if(newState == State.DELETED)
-                    {
-                        throw new AccessControlException("Cannot remove bindings to the default exchange");
-                    }
-                }
-            };
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java Tue Mar  4 22:52:05 2014
@@ -96,7 +96,7 @@ public class DefaultExchangeFactory impl
     }
 
     @Override
-    public NonDefaultExchange createExchange(final Map<String, Object> attributes)
+    public ExchangeImpl createExchange(final Map<String, Object> attributes)
             throws AMQUnknownExchangeType, UnknownExchangeException
     {
         String type = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Exchange.TYPE, attributes);
@@ -109,7 +109,7 @@ public class DefaultExchangeFactory impl
     }
 
     @Override
-    public NonDefaultExchange restoreExchange(Map<String,Object> attributes)
+    public ExchangeImpl restoreExchange(Map<String,Object> attributes)
             throws AMQUnknownExchangeType, UnknownExchangeException
     {
         return createExchange(attributes);

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java Tue Mar  4 22:52:05 2014
@@ -22,6 +22,7 @@ package org.apache.qpid.server.exchange;
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.QueueRegistry;
@@ -46,9 +47,9 @@ public class DefaultExchangeRegistry imp
     /**
      * Maps from exchange name to exchange instance
      */
-    private ConcurrentMap<String, ExchangeImpl> _exchangeMap = new ConcurrentHashMap<String, ExchangeImpl>();
+    private ConcurrentMap<String, ExchangeImpl<?>> _exchangeMap = new ConcurrentHashMap<String, ExchangeImpl<?>>();
 
-    private ExchangeImpl _defaultExchange;
+    private MessageDestination _defaultExchange;
 
     private final VirtualHost _host;
     private final QueueRegistry _queueRegistry;
@@ -68,9 +69,8 @@ public class DefaultExchangeRegistry imp
         initialiseExchanges(exchangeFactory, getDurableConfigurationStore());
 
         _defaultExchange =
-                new DefaultExchange(_host, _queueRegistry,
-                                    UUIDGenerator.generateExchangeUUID(ExchangeDefaults.DEFAULT_EXCHANGE_NAME,
-                                                                       _host.getName()));
+                new DefaultDestination(_host
+                );
 
 
     }
@@ -96,7 +96,7 @@ public class DefaultExchangeRegistry imp
                 attributes.put(org.apache.qpid.server.model.Exchange.NAME, name);
                 attributes.put(org.apache.qpid.server.model.Exchange.TYPE, type);
                 attributes.put(org.apache.qpid.server.model.Exchange.DURABLE, true);
-                ExchangeImpl exchange = f.createExchange(attributes);
+                ExchangeImpl<?> exchange = f.createExchange(attributes);
                 registerExchange(exchange);
                 if(exchange.isDurable())
                 {
@@ -135,7 +135,7 @@ public class DefaultExchangeRegistry imp
         }
     }
 
-    public ExchangeImpl getDefaultExchange()
+    public MessageDestination getDefaultExchange()
     {
         return _defaultExchange;
     }
@@ -170,17 +170,9 @@ public class DefaultExchangeRegistry imp
 
     }
 
-    public Collection<ExchangeImpl> getExchanges()
+    public Collection<ExchangeImpl<?>> getExchanges()
     {
-        return new ArrayList<ExchangeImpl>(_exchangeMap.values());
-    }
-
-    @Override
-    public Collection<NonDefaultExchange> getExchangesExceptDefault()
-    {
-        Collection allExchanges = getExchanges();
-        allExchanges.remove(_defaultExchange);
-        return allExchanges;
+        return new ArrayList<ExchangeImpl<?>>(_exchangeMap.values());
     }
 
     public void addRegistryChangeListener(RegistryChangeListener listener)
@@ -188,22 +180,15 @@ public class DefaultExchangeRegistry imp
         _listeners.add(listener);
     }
 
-    public ExchangeImpl getExchange(String name)
+    public ExchangeImpl<?> getExchange(String name)
     {
-        if ((name == null) || name.length() == 0)
-        {
-            return getDefaultExchange();
-        }
-        else
-        {
-            return _exchangeMap.get(name);
-        }
+        return _exchangeMap.get(name);
     }
 
     @Override
     public void clearAndUnregisterMbeans()
     {
-        for (final ExchangeImpl exchange : getExchanges())
+        for (final ExchangeImpl<?> exchange : getExchanges())
         {
             //TODO: this is a bit of a hack, what if the listeners aren't aware
             //that we are just unregistering the MBean because of HA, and aren't
@@ -220,24 +205,18 @@ public class DefaultExchangeRegistry imp
     }
 
     @Override
-    public synchronized ExchangeImpl getExchange(UUID exchangeId)
+    public synchronized ExchangeImpl<?> getExchange(UUID exchangeId)
     {
-        if (exchangeId == null)
-        {
-            return getDefaultExchange();
-        }
-        else
+        Collection<ExchangeImpl<?>> exchanges = _exchangeMap.values();
+        for (ExchangeImpl<?> exchange : exchanges)
         {
-            Collection<ExchangeImpl> exchanges = _exchangeMap.values();
-            for (ExchangeImpl exchange : exchanges)
+            if (exchange.getId().equals(exchangeId))
             {
-                if (exchange.getId().equals(exchangeId))
-                {
-                    return exchange;
-                }
+                return exchange;
             }
-            return null;
         }
+        return null;
+
     }
 
     public boolean isReservedExchangeName(String name)

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java Tue Mar  4 22:52:05 2014
@@ -32,8 +32,8 @@ public interface ExchangeFactory
 
     Collection<ExchangeType<? extends ExchangeImpl>> getRegisteredTypes();
 
-    NonDefaultExchange createExchange(Map<String,Object> attributes) throws AMQUnknownExchangeType, UnknownExchangeException;
+    ExchangeImpl createExchange(Map<String,Object> attributes) throws AMQUnknownExchangeType, UnknownExchangeException;
 
-    NonDefaultExchange restoreExchange(Map<String,Object> attributes) throws AMQUnknownExchangeType, UnknownExchangeException;
+    ExchangeImpl restoreExchange(Map<String,Object> attributes) throws AMQUnknownExchangeType, UnknownExchangeException;
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeImpl.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeImpl.java Tue Mar  4 22:52:05 2014
@@ -22,13 +22,14 @@ package org.apache.qpid.server.exchange;
 
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.message.MessageDestination;
+import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.AMQQueue;
 
 import java.util.Map;
 import java.util.UUID;
 
-public interface ExchangeImpl<T extends NonDefaultExchange> extends ExchangeReferrer, MessageDestination
+public interface ExchangeImpl<T extends ExchangeImpl<T>> extends Exchange<T>, ExchangeReferrer, MessageDestination
 {
 
     UUID getId();
@@ -46,7 +47,7 @@ public interface ExchangeImpl<T extends 
      */
     boolean isAutoDelete();
 
-    <X extends NonDefaultExchange<X>> ExchangeImpl<X> getAlternateExchange();
+    ExchangeImpl getAlternateExchange();
 
     void setAlternateExchange(ExchangeImpl exchange);
 
@@ -110,6 +111,7 @@ public interface ExchangeImpl<T extends 
 
     boolean hasReferrers();
 
+    BindingImpl getBinding(String bindingName, AMQQueue queue);
 
 
     public interface BindingListener

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java Tue Mar  4 22:52:05 2014
@@ -20,19 +20,21 @@
  */
 package org.apache.qpid.server.exchange;
 
+import org.apache.qpid.server.message.MessageDestination;
+
 import java.util.Collection;
 import java.util.UUID;
 
 
 public interface ExchangeRegistry
 {
-    void registerExchange(ExchangeImpl exchange);
+    void registerExchange(ExchangeImpl<?> exchange);
 
-    ExchangeImpl getDefaultExchange();
+    MessageDestination getDefaultExchange();
 
     void initialise(ExchangeFactory exchangeFactory);
 
-    ExchangeImpl getExchange(String exchangeName);
+    ExchangeImpl<?> getExchange(String exchangeName);
 
     /**
      * Unregister an exchange
@@ -43,11 +45,9 @@ public interface ExchangeRegistry
 
     void clearAndUnregisterMbeans();
 
-    ExchangeImpl getExchange(UUID exchangeId);
-
-    Collection<ExchangeImpl> getExchanges();
+    ExchangeImpl<?> getExchange(UUID exchangeId);
 
-    Collection<NonDefaultExchange> getExchangesExceptDefault();
+    Collection<ExchangeImpl<?>> getExchanges();
 
     void addRegistryChangeListener(RegistryChangeListener listener);
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/NonDefaultExchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/NonDefaultExchange.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/NonDefaultExchange.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/NonDefaultExchange.java Tue Mar  4 22:52:05 2014
@@ -26,7 +26,4 @@ import org.apache.qpid.server.queue.AMQQ
 
 public interface NonDefaultExchange<T extends NonDefaultExchange<T>> extends Exchange<T>, ExchangeImpl<T>
 {
-    NonDefaultExchange getAlternateExchange();
-
-    BindingImpl getBinding(String bindingName, AMQQueue queue);
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java Tue Mar  4 22:52:05 2014
@@ -36,7 +36,7 @@ public interface Exchange<X extends Exch
     // Attributes
 
     @ManagedAttribute
-    <T extends Exchange<T>> Exchange<T> getAlternateExchange();
+    Exchange<?> getAlternateExchange();
 
     //children
     Collection<? extends Binding> getBindings();

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java Tue Mar  4 22:52:05 2014
@@ -41,7 +41,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.configuration.XmlConfigurationUtilities.MyConfiguration;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.model.*;
@@ -49,7 +48,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.protocol.AMQConnectionModel;
 import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AbstractQueue;
 import org.apache.qpid.server.queue.ConflationQueue;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.access.Operation;
@@ -192,7 +190,7 @@ public final class VirtualHostAdapter ex
 
     public Collection<Exchange> getExchanges()
     {
-        return _virtualHost == null ? Collections.<Exchange>emptyList() : new ArrayList<Exchange>(_virtualHost.getExchangesExceptDefault());
+        return _virtualHost == null ? Collections.<Exchange>emptyList() : new ArrayList<Exchange>(_virtualHost.getExchanges());
     }
 
 
@@ -290,7 +288,7 @@ public final class VirtualHostAdapter ex
                             lifetime != null && lifetime != LifetimePolicy.PERMANENT
                                     ? LifetimePolicy.DELETE_ON_NO_LINKS : LifetimePolicy.PERMANENT);
             attributes1.put(Exchange.ALTERNATE_EXCHANGE, alternateExchange);
-            NonDefaultExchange exchange = _virtualHost.createExchange(attributes1);
+            ExchangeImpl exchange = _virtualHost.createExchange(attributes1);
             return exchange;
 
         }
@@ -503,13 +501,13 @@ public final class VirtualHostAdapter ex
 
     public void exchangeRegistered(ExchangeImpl exchange)
     {
-        childAdded((NonDefaultExchange)exchange);
+        childAdded(exchange);
     }
 
 
     public void exchangeUnregistered(ExchangeImpl exchange)
     {
-        childRemoved((NonDefaultExchange)exchange);
+        childRemoved(exchange);
     }
 
     public void queueRegistered(AMQQueue queue)

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/ExchangeType.java Tue Mar  4 22:52:05 2014
@@ -23,11 +23,10 @@ package org.apache.qpid.server.plugin;
 import java.util.Map;
 
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.virtualhost.UnknownExchangeException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-public interface ExchangeType<T extends NonDefaultExchange> extends Pluggable
+public interface ExchangeType<T extends ExchangeImpl<T>> extends Pluggable
 {
     public String getType();
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java Tue Mar  4 22:52:05 2014
@@ -23,7 +23,6 @@ package org.apache.qpid.server.queue;
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.exchange.ExchangeReferrer;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.message.MessageSource;
@@ -32,11 +31,9 @@ import org.apache.qpid.server.model.Life
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.QueueNotificationListener;
 import org.apache.qpid.server.protocol.CapacityChecker;
-import org.apache.qpid.server.consumer.Consumer;
 import org.apache.qpid.server.util.Deletable;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-import javax.management.NotificationListener;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
@@ -174,9 +171,9 @@ public interface AMQQueue<X extends AMQQ
 
     void stop();
 
-    NonDefaultExchange getAlternateExchange();
+    ExchangeImpl getAlternateExchange();
 
-    void setAlternateExchange(NonDefaultExchange exchange);
+    void setAlternateExchange(ExchangeImpl exchange);
 
     Collection<String> getAvailableAttributes();
     Object getAttribute(String attrName);

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java Tue Mar  4 22:52:05 2014
@@ -26,7 +26,6 @@ import java.util.UUID;
 
 import org.apache.qpid.server.exchange.AMQUnknownExchangeType;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.model.ExclusivityPolicy;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.exchange.ExchangeDefaults;
@@ -154,14 +153,14 @@ public class AMQQueueFactory implements 
         {
 
             final String altExchangeAttr = (String) attributes.get(Queue.ALTERNATE_EXCHANGE);
-            NonDefaultExchange altExchange;
+            ExchangeImpl altExchange;
             try
             {
-                altExchange = (NonDefaultExchange) _virtualHost.getExchange(UUID.fromString(altExchangeAttr));
+                altExchange = _virtualHost.getExchange(UUID.fromString(altExchangeAttr));
             }
             catch(IllegalArgumentException e)
             {
-                altExchange = (NonDefaultExchange) _virtualHost.getExchange(altExchangeAttr);
+                altExchange = _virtualHost.getExchange(altExchangeAttr);
             }
             queue.setAlternateExchange(altExchange);
         }
@@ -183,7 +182,7 @@ public class AMQQueueFactory implements 
         final String dlExchangeName = getDeadLetterExchangeName(queueName);
         final String dlQueueName = getDeadLetterQueueName(queueName);
 
-        NonDefaultExchange dlExchange = null;
+        ExchangeImpl dlExchange = null;
         final UUID dlExchangeId = UUIDGenerator.generateExchangeUUID(dlExchangeName, _virtualHost.getName());
 
         try
@@ -202,7 +201,7 @@ public class AMQQueueFactory implements 
         catch(ExchangeExistsException e)
         {
             // We're ok if the exchange already exists
-            dlExchange = (NonDefaultExchange) e.getExistingExchange();
+            dlExchange = e.getExistingExchange();
         }
         catch (ReservedExchangeNameException e)
         {

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java Tue Mar  4 22:52:05 2014
@@ -35,7 +35,7 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.connection.SessionPrincipal;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
+import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.model.Queue;
@@ -106,7 +106,7 @@ public abstract class AbstractQueue
 
     private final boolean _durable;
 
-    private NonDefaultExchange _alternateExchange;
+    private ExchangeImpl _alternateExchange;
 
 
     private final QueueEntryList _entries;
@@ -516,12 +516,12 @@ public abstract class AbstractQueue
         return _exclusivityPolicy != ExclusivityPolicy.NONE;
     }
 
-    public NonDefaultExchange getAlternateExchange()
+    public ExchangeImpl getAlternateExchange()
     {
         return _alternateExchange;
     }
 
-    public void setAlternateExchange(NonDefaultExchange exchange)
+    public void setAlternateExchange(ExchangeImpl exchange)
     {
         if(_alternateExchange != null)
         {
@@ -2853,7 +2853,7 @@ public abstract class AbstractQueue
         if(childClass == Binding.class && otherParents.length == 1 && otherParents[0] instanceof Exchange)
         {
             final String bindingKey = (String) attributes.get("name");
-            ((NonDefaultExchange)otherParents[0]).addBinding(bindingKey, this, attributes);
+            ((ExchangeImpl)otherParents[0]).addBinding(bindingKey, this, attributes);
             for(Binding binding : _bindings)
             {
                 if(binding.getExchange() == otherParents[0] && binding.getName().equals(bindingKey))
@@ -2899,7 +2899,7 @@ public abstract class AbstractQueue
             else if(ALTERNATE_EXCHANGE.equals(name))
             {
                 // In future we may want to accept a UUID as an alternative way to identifying the exchange
-                NonDefaultExchange alternateExchange = (NonDefaultExchange) desired;
+                ExchangeImpl alternateExchange = (ExchangeImpl) desired;
                 setAlternateExchange(alternateExchange);
                 return true;
             }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Tue Mar  4 22:52:05 2014
@@ -37,7 +37,6 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.exchange.AMQUnknownExchangeType;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.configuration.ExchangeConfiguration;
@@ -55,7 +54,6 @@ import org.apache.qpid.server.message.Me
 import org.apache.qpid.server.message.MessageNode;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.adapter.VirtualHostAdapter;
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.plugin.QpidServiceLoader;
 import org.apache.qpid.server.plugin.SystemNodeCreator;
@@ -380,44 +378,44 @@ public abstract class AbstractVirtualHos
             DurableConfigurationStoreHelper.createQueue(getDurableConfigurationStore(), queue);
         }
 
-        //get the exchange name (returns default exchange name if none was specified)
+        //get the exchange name (returns empty String if none was specified)
         String exchangeName = queueConfiguration.getExchange();
 
-        ExchangeImpl exchange = _exchangeRegistry.getExchange(exchangeName);
-        if (exchange == null)
+
+        if("".equals(exchangeName))
         {
-            throw new ConfigurationException("Attempt to bind queue '" + queueName + "' to unknown exchange:" + exchangeName);
+            //get routing keys in configuration (returns empty list if none are defined)
+            List<?> routingKeys = queueConfiguration.getRoutingKeys();
+            if(!(routingKeys.isEmpty() || (routingKeys.size()==1 && routingKeys.contains(queueName))))
+            {
+                throw new ConfigurationException("Attempt to bind queue '" + queueName + "' with binding key(s) " +
+                                                 routingKeys + " without specifying an exchange");
+            }
         }
-
-        ExchangeImpl defaultExchange = _exchangeRegistry.getDefaultExchange();
-
-        //get routing keys in configuration (returns empty list if none are defined)
-        List<?> routingKeys = queueConfiguration.getRoutingKeys();
-
-        for (Object routingKeyNameObj : routingKeys)
+        else
         {
-            String routingKey = String.valueOf(routingKeyNameObj);
-
-            if (exchange.equals(defaultExchange))
+            ExchangeImpl exchange = _exchangeRegistry.getExchange(exchangeName);
+            if (exchange == null)
             {
-                if(!queueName.equals(routingKey))
-                {
-                    throw new ConfigurationException("Illegal attempt to bind queue '" + queueName +
-                                                     "' to the default exchange with a key other than the queue name: " + routingKey);
-                }
+                throw new ConfigurationException("Attempt to bind queue '" + queueName + "' to unknown exchange:" + exchangeName);
             }
-            else
+
+            //get routing keys in configuration (returns empty list if none are defined)
+            List<?> routingKeys = queueConfiguration.getRoutingKeys();
+
+            for (Object routingKeyNameObj : routingKeys)
             {
+                String routingKey = String.valueOf(routingKeyNameObj);
+
                 configureBinding(queue, exchange, routingKey, (Map) queueConfiguration.getBindingArguments(routingKey));
             }
-        }
 
-        if (!exchange.equals(defaultExchange) && !routingKeys.contains(queueName))
-        {
-            //bind the queue to the named exchange using its name
-            configureBinding(queue, exchange, queueName, null);
+            if (!routingKeys.contains(queueName))
+            {
+                //bind the queue to the named exchange using its name
+                configureBinding(queue, exchange, queueName, null);
+            }
         }
-
     }
 
     private void configureBinding(AMQQueue queue, ExchangeImpl exchange, String routingKey, Map<String,Object> arguments)
@@ -605,31 +603,25 @@ public abstract class AbstractVirtualHos
     }
 
     @Override
-    public ExchangeImpl getDefaultExchange()
+    public MessageDestination getDefaultDestination()
     {
         return _exchangeRegistry.getDefaultExchange();
     }
 
     @Override
-    public Collection<ExchangeImpl> getExchanges()
+    public Collection<ExchangeImpl<?>> getExchanges()
     {
         return Collections.unmodifiableCollection(_exchangeRegistry.getExchanges());
     }
 
     @Override
-    public Collection<NonDefaultExchange> getExchangesExceptDefault()
-    {
-        return Collections.unmodifiableCollection(_exchangeRegistry.getExchangesExceptDefault());
-    }
-
-    @Override
     public Collection<ExchangeType<? extends ExchangeImpl>> getExchangeTypes()
     {
         return _exchangeFactory.getRegisteredTypes();
     }
 
     @Override
-    public NonDefaultExchange createExchange(Map<String,Object> attributes)
+    public ExchangeImpl createExchange(Map<String,Object> attributes)
             throws ExchangeExistsException, ReservedExchangeNameException,
                    UnknownExchangeException, AMQUnknownExchangeType
     {
@@ -658,7 +650,7 @@ public abstract class AbstractVirtualHos
                                UUIDGenerator.generateExchangeUUID(name, getName()));
             }
 
-            NonDefaultExchange exchange = _exchangeFactory.createExchange(attributes);
+            ExchangeImpl exchange = _exchangeFactory.createExchange(attributes);
 
             _exchangeRegistry.registerExchange(exchange);
             if(durable)

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java Tue Mar  4 22:52:05 2014
@@ -28,7 +28,6 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.store.AbstractDurableConfiguredObjectRecoverer;
@@ -114,7 +113,7 @@ public class BindingRecoverer extends Ab
 
                 _exchange.restoreBinding(_bindingId, _bindingName, _queue, _bindingArgumentsMap);
             }
-            return ((NonDefaultExchange)_exchange).getBinding(_bindingName, _queue);
+            return (_exchange).getBinding(_bindingName, _queue);
         }
 
         private class QueueDependency implements UnresolvedDependency<AMQQueue>

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java Tue Mar  4 22:52:05 2014
@@ -59,7 +59,7 @@ public class ExchangeRecoverer extends A
 
     private class UnresolvedExchange implements UnresolvedObject<ExchangeImpl>
     {
-        private ExchangeImpl _exchange;
+        private ExchangeImpl<?> _exchange;
 
         public UnresolvedExchange(final UUID id,
                                   final Map<String, Object> attributeMap)

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Tue Mar  4 22:52:05 2014
@@ -31,7 +31,6 @@ import org.apache.qpid.common.Closeable;
 import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.connection.IConnectionRegistry;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.plugin.ExchangeType;
@@ -62,7 +61,7 @@ public interface VirtualHost extends Dur
 
     AMQQueue createQueue(Map<String, Object> arguments) throws QueueExistsException;
 
-    NonDefaultExchange createExchange(Map<String,Object> attributes)
+    ExchangeImpl createExchange(Map<String,Object> attributes)
             throws ExchangeExistsException, ReservedExchangeNameException,
                    UnknownExchangeException, AMQUnknownExchangeType;
 
@@ -75,9 +74,9 @@ public interface VirtualHost extends Dur
     ExchangeImpl getExchange(UUID id);
 
 
-    ExchangeImpl getDefaultExchange();
+    MessageDestination getDefaultDestination();
 
-    Collection<ExchangeImpl> getExchanges();
+    Collection<ExchangeImpl<?>> getExchanges();
 
     Collection<ExchangeType<? extends ExchangeImpl>> getExchangeTypes();
 
@@ -137,7 +136,5 @@ public interface VirtualHost extends Dur
 
     TaskExecutor getTaskExecutor();
 
-    Collection<NonDefaultExchange> getExchangesExceptDefault();
-
     org.apache.qpid.server.model.VirtualHost getModel();
 }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java Tue Mar  4 22:52:05 2014
@@ -168,26 +168,7 @@ public class DefaultExchangeFactoryTest 
 
     public void testCreateDefaultExchangeFactoryWithCustomExchangeType()
     {
-        ExchangeType<?> customExchangeType = new ExchangeType<NonDefaultExchange>()
-        {
-            @Override
-            public String getType()
-            {
-                return "my-custom-exchange";
-            }
-
-            @Override
-            public NonDefaultExchange newInstance(VirtualHost host, Map<String,Object> attributes)
-            {
-                return null;
-            }
-
-            @Override
-            public String getDefaultExchangeName()
-            {
-                return null;
-            }
-        };
+        ExchangeType<?> customExchangeType = new CustomExchangeType();
 
         _stubbedExchangeTypes.add(customExchangeType);
         _stubbedExchangeTypes.add(_directExchangeType);
@@ -206,6 +187,31 @@ public class DefaultExchangeFactoryTest 
         assertTrue("Custom exchange type is not found", registeredTypes.contains(customExchangeType));
     }
 
+    public static abstract class CustomExchange implements ExchangeImpl<CustomExchange>
+    {
+    }
+
+    private static class CustomExchangeType implements ExchangeType<CustomExchange>
+    {
+        @Override
+        public String getType()
+        {
+            return "my-custom-exchange";
+        }
+
+        @Override
+        public CustomExchange newInstance(VirtualHost host, Map<String,Object> attributes)
+        {
+            return null;
+        }
+
+        @Override
+        public String getDefaultExchangeName()
+        {
+            return null;
+        }
+    }
+
     private final class TestExchangeFactory extends DefaultExchangeFactory
     {
         private TestExchangeFactory()

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java Tue Mar  4 22:52:05 2014
@@ -139,7 +139,7 @@ public class HeadersBindingTest extends 
     private MockHeader matchHeaders = new MockHeader();
     private int _count = 0;
     private AMQQueue _queue;
-    private NonDefaultExchange _exchange;
+    private ExchangeImpl _exchange;
 
     protected void setUp()
     {
@@ -149,7 +149,7 @@ public class HeadersBindingTest extends 
         when(_queue.getVirtualHost()).thenReturn(vhost);
         when(vhost.getSecurityManager()).thenReturn(mock(org.apache.qpid.server.security.SecurityManager.class));
         CurrentActor.set(mock(LogActor.class));
-        _exchange = mock(NonDefaultExchange.class);
+        _exchange = mock(ExchangeImpl.class);
         when(_exchange.getExchangeType()).thenReturn(mock(ExchangeType.class));
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java Tue Mar  4 22:52:05 2014
@@ -37,7 +37,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.DefaultExchangeFactory;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.RootMessageLogger;
 import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -150,7 +149,7 @@ public class AMQQueueFactoryTest extends
                         final String name = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Exchange.NAME, attributeValues);
                         final UUID id = MapValueConverter.getUUIDAttribute(org.apache.qpid.server.model.Exchange.ID, attributeValues);
 
-                        final NonDefaultExchange exchange = mock(NonDefaultExchange.class);
+                        final ExchangeImpl exchange = mock(ExchangeImpl.class);
                         ExchangeType exType = mock(ExchangeType.class);
 
                         when(exchange.getName()).thenReturn(name);

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java Tue Mar  4 22:52:05 2014
@@ -40,7 +40,6 @@ import org.apache.commons.configuration.
 import org.apache.qpid.common.AMQPFilterTypes;
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.message.EnqueueableMessage;
@@ -81,7 +80,7 @@ public abstract class AbstractDurableCon
     private TransactionLogRecoveryHandler.QueueEntryRecoveryHandler _queueEntryRecoveryHandler;
     private TransactionLogRecoveryHandler.DtxRecordRecoveryHandler _dtxRecordRecoveryHandler;
 
-    private NonDefaultExchange _exchange = mock(NonDefaultExchange.class);
+    private ExchangeImpl _exchange = mock(ExchangeImpl.class);
     private static final String ROUTING_KEY = "routingKey";
     private static final String QUEUE_NAME = "queueName";
     private Map<String,Object> _bindingArgs;
@@ -258,7 +257,7 @@ public abstract class AbstractDurableCon
 
     public void testCreateQueueAMQQueueWithAlternateExchange() throws Exception
     {
-        NonDefaultExchange alternateExchange = createTestAlternateExchange();
+        ExchangeImpl alternateExchange = createTestAlternateExchange();
 
         AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true, alternateExchange, null);
         DurableConfigurationStoreHelper.createQueue(_configStore, queue);
@@ -274,10 +273,10 @@ public abstract class AbstractDurableCon
         verify(_recoveryHandler).configuredObject(eq(_queueId), eq(QUEUE), eq(queueAttributes));
     }
 
-    private NonDefaultExchange createTestAlternateExchange()
+    private ExchangeImpl createTestAlternateExchange()
     {
         UUID exchUuid = UUID.randomUUID();
-        NonDefaultExchange alternateExchange = mock(NonDefaultExchange.class);
+        ExchangeImpl alternateExchange = mock(ExchangeImpl.class);
         when(alternateExchange.getId()).thenReturn(exchUuid);
         return alternateExchange;
     }
@@ -318,7 +317,7 @@ public abstract class AbstractDurableCon
         DurableConfigurationStoreHelper.createQueue(_configStore, queue);
 
         // update the queue to have exclusive=false
-        NonDefaultExchange alternateExchange = createTestAlternateExchange();
+        ExchangeImpl alternateExchange = createTestAlternateExchange();
         queue = createTestQueue(getName(), getName() + "Owner", false, alternateExchange, attributes);
 
         DurableConfigurationStoreHelper.updateQueue(_configStore, queue);
@@ -362,7 +361,7 @@ public abstract class AbstractDurableCon
     private AMQQueue createTestQueue(String queueName,
                                      String queueOwner,
                                      boolean exclusive,
-                                     NonDefaultExchange alternateExchange,
+                                     ExchangeImpl alternateExchange,
                                      final Map<String, Object> arguments) throws StoreException
     {
         AMQQueue<?> queue = mock(AMQQueue.class);

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java Tue Mar  4 22:52:05 2014
@@ -28,7 +28,7 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.qpid.server.exchange.NonDefaultExchange;
+import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.exchange.DirectExchange;
@@ -70,8 +70,8 @@ public class DurableConfigurationRecover
     private static final String CUSTOM_EXCHANGE_NAME = "customExchange";
 
     private DurableConfigurationRecoverer _durableConfigurationRecoverer;
-    private NonDefaultExchange _directExchange;
-    private NonDefaultExchange _topicExchange;
+    private ExchangeImpl _directExchange;
+    private ExchangeImpl _topicExchange;
     private VirtualHost _vhost;
     private DurableConfigurationStore _store;
     private ExchangeFactory _exchangeFactory;
@@ -84,11 +84,11 @@ public class DurableConfigurationRecover
         super.setUp();
 
 
-        _directExchange = mock(NonDefaultExchange.class);
+        _directExchange = mock(ExchangeImpl.class);
         when(_directExchange.getExchangeType()).thenReturn(DirectExchange.TYPE);
 
 
-        _topicExchange = mock(NonDefaultExchange.class);
+        _topicExchange = mock(ExchangeImpl.class);
         when(_topicExchange.getExchangeType()).thenReturn(TopicExchange.TYPE);
 
         AMQQueue queue = mock(AMQQueue.class);
@@ -101,14 +101,14 @@ public class DurableConfigurationRecover
 
         when(_vhost.getQueue(eq(QUEUE_ID))).thenReturn(queue);
 
-        final ArgumentCaptor<NonDefaultExchange> registeredExchange = ArgumentCaptor.forClass(NonDefaultExchange.class);
+        final ArgumentCaptor<ExchangeImpl> registeredExchange = ArgumentCaptor.forClass(ExchangeImpl.class);
         doAnswer(new Answer()
         {
 
             @Override
             public Object answer(final InvocationOnMock invocation) throws Throwable
             {
-                NonDefaultExchange exchange = registeredExchange.getValue();
+                ExchangeImpl exchange = registeredExchange.getValue();
                 when(_exchangeRegistry.getExchange(eq(exchange.getId()))).thenReturn(exchange);
                 when(_exchangeRegistry.getExchange(eq(exchange.getName()))).thenReturn(exchange);
                 return null;
@@ -139,14 +139,14 @@ public class DurableConfigurationRecover
                         when(_vhost.getQueue(eq(queueName))).thenReturn(queue);
                         when(_vhost.getQueue(eq(queueId))).thenReturn(queue);
 
-                        final ArgumentCaptor<NonDefaultExchange> altExchangeArg = ArgumentCaptor.forClass(NonDefaultExchange.class);
+                        final ArgumentCaptor<ExchangeImpl> altExchangeArg = ArgumentCaptor.forClass(ExchangeImpl.class);
                         doAnswer(
                                 new Answer()
                                 {
                                     @Override
                                     public Object answer(InvocationOnMock invocation) throws Throwable
                                     {
-                                        final NonDefaultExchange value = altExchangeArg.getValue();
+                                        final ExchangeImpl value = altExchangeArg.getValue();
                                         when(queue.getAlternateExchange()).thenReturn(value);
                                         return null;
                                     }
@@ -157,8 +157,8 @@ public class DurableConfigurationRecover
                         if (args.containsKey(Queue.ALTERNATE_EXCHANGE))
                         {
                             final UUID exchangeId = UUID.fromString(args.get(Queue.ALTERNATE_EXCHANGE).toString());
-                            final NonDefaultExchange exchange =
-                                    (NonDefaultExchange) _exchangeRegistry.getExchange(exchangeId);
+                            final ExchangeImpl exchange =
+                                    (ExchangeImpl) _exchangeRegistry.getExchange(exchangeId);
                             queue.setAlternateExchange(exchange);
                         }
                         return queue;
@@ -267,13 +267,13 @@ public class DurableConfigurationRecover
                                                            "org.apache.qpid.server.model.Exchange",
                                                            createExchange(CUSTOM_EXCHANGE_NAME, HeadersExchange.TYPE));
 
-        final NonDefaultExchange customExchange = mock(NonDefaultExchange.class);
+        final ExchangeImpl customExchange = mock(ExchangeImpl.class);
 
         final ArgumentCaptor<Map> attributesCaptor = ArgumentCaptor.forClass(Map.class);
-        when(_exchangeFactory.restoreExchange(attributesCaptor.capture())).thenAnswer(new Answer<NonDefaultExchange>()
+        when(_exchangeFactory.restoreExchange(attributesCaptor.capture())).thenAnswer(new Answer<ExchangeImpl>()
         {
             @Override
-            public NonDefaultExchange answer(final InvocationOnMock invocation) throws Throwable
+            public ExchangeImpl answer(final InvocationOnMock invocation) throws Throwable
             {
                 Map arguments = attributesCaptor.getValue();
                 if(CUSTOM_EXCHANGE_NAME.equals(arguments.get(org.apache.qpid.server.model.Exchange.NAME))
@@ -397,17 +397,17 @@ public class DurableConfigurationRecover
         final UUID queueId = new UUID(1, 0);
         final UUID exchangeId = new UUID(2, 0);
 
-        final NonDefaultExchange customExchange = mock(NonDefaultExchange.class);
+        final ExchangeImpl customExchange = mock(ExchangeImpl.class);
 
         when(customExchange.getId()).thenReturn(exchangeId);
         when(customExchange.getName()).thenReturn(CUSTOM_EXCHANGE_NAME);
 
         final ArgumentCaptor<Map> attributesCaptor = ArgumentCaptor.forClass(Map.class);
 
-        when(_exchangeFactory.restoreExchange(attributesCaptor.capture())).thenAnswer(new Answer<NonDefaultExchange>()
+        when(_exchangeFactory.restoreExchange(attributesCaptor.capture())).thenAnswer(new Answer<ExchangeImpl>()
         {
             @Override
-            public NonDefaultExchange answer(final InvocationOnMock invocation) throws Throwable
+            public ExchangeImpl answer(final InvocationOnMock invocation) throws Throwable
             {
                 Map arguments = attributesCaptor.getValue();
                 if(CUSTOM_EXCHANGE_NAME.equals(arguments.get(org.apache.qpid.server.model.Exchange.NAME))

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java Tue Mar  4 22:52:05 2014
@@ -27,7 +27,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.connection.IConnectionRegistry;
 import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.exchange.NonDefaultExchange;
 import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.plugin.ExchangeType;
@@ -160,7 +159,7 @@ public class MockVirtualHost implements 
     }
 
     @Override
-    public NonDefaultExchange createExchange(Map<String,Object> attributes)
+    public ExchangeImpl createExchange(Map<String,Object> attributes)
     {
         return null;
     }
@@ -189,13 +188,13 @@ public class MockVirtualHost implements 
     }
 
     @Override
-    public ExchangeImpl getDefaultExchange()
+    public ExchangeImpl getDefaultDestination()
     {
         return null;
     }
 
     @Override
-    public Collection<ExchangeImpl> getExchanges()
+    public Collection<ExchangeImpl<?>> getExchanges()
     {
         return null;
     }
@@ -360,12 +359,6 @@ public class MockVirtualHost implements 
     }
 
     @Override
-    public Collection<NonDefaultExchange> getExchangesExceptDefault()
-    {
-        return null;
-    }
-
-    @Override
     public org.apache.qpid.server.model.VirtualHost getModel()
     {
         return null;

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java?rev=1574235&r1=1574234&r2=1574235&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java Tue Mar  4 22:52:05 2014
@@ -117,7 +117,7 @@ public class StandardVirtualHostTest ext
         {
             Throwable cause = e.getCause();
             assertNotNull(cause);
-            assertEquals("Illegal attempt to bind queue '" + queueName + "' to the default exchange with a key other than the queue name: " + customBinding, cause.getMessage());
+            assertEquals("Attempt to bind queue '" + queueName + "' with binding key(s) [" + customBinding + "] without specifying an exchange", cause.getMessage());
         }
     }
 
@@ -253,9 +253,6 @@ public class StandardVirtualHostTest ext
         AMQQueue queue = vhost.getQueue(queueName);
         assertNotNull("queue should exist", queue);
 
-        ExchangeImpl defaultExch = vhost.getDefaultExchange();
-        assertTrue("queue should have been bound to default exchange with its name", defaultExch.isBound(queueName, queue));
-
         ExchangeImpl exch = vhost.getExchange(exchangeName);
         assertTrue("queue should have been bound to " + exchangeName + " with its name", exch.isBound(queueName, queue));
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message