activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [2/4] activemq-6 git commit: ACTIVEMQ6-14 - more JNDI removal
Date Wed, 31 Dec 2014 15:45:00 GMT
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
index 85e7032..5e9fa43 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerManagerImpl.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.jms.server.impl;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.transaction.xa.Xid;
 
@@ -49,7 +47,6 @@ import org.apache.activemq.core.deployers.impl.FileDeploymentManager;
 import org.apache.activemq.core.deployers.impl.XmlDeployer;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.BindingType;
-import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.core.security.Role;
@@ -70,7 +67,7 @@ import org.apache.activemq.jms.client.SelectorTranslator;
 import org.apache.activemq.jms.persistence.JMSStorageManager;
 import org.apache.activemq.jms.persistence.config.PersistedConnectionFactory;
 import org.apache.activemq.jms.persistence.config.PersistedDestination;
-import org.apache.activemq.jms.persistence.config.PersistedJNDI;
+import org.apache.activemq.jms.persistence.config.PersistedBindings;
 import org.apache.activemq.jms.persistence.config.PersistedType;
 import org.apache.activemq.jms.persistence.impl.journal.JMSJournalStorageManagerImpl;
 import org.apache.activemq.jms.persistence.impl.nullpm.NullJMSStorageManagerImpl;
@@ -93,7 +90,7 @@ import org.apache.activemq.utils.json.JSONArray;
 import org.apache.activemq.utils.json.JSONObject;
 
 /**
- * A Deployer used to create and add to JNDI queues, topics and connection
+ * A Deployer used to create and add to Bindings queues, topics and connection
  * factories. Typically this would only be used in an app server env.
  * <p>
  * JMS Connection Factories and Destinations can be configured either
@@ -120,11 +117,11 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    private final Map<String, ActiveMQConnectionFactory> connectionFactories = new HashMap<String, ActiveMQConnectionFactory>();
 
-   private final Map<String, List<String>> queueJNDI = new HashMap<String, List<String>>();
+   private final Map<String, List<String>> queueBindings = new HashMap<String, List<String>>();
 
-   private final Map<String, List<String>> topicJNDI = new HashMap<String, List<String>>();
+   private final Map<String, List<String>> topicBindings = new HashMap<String, List<String>>();
 
-   private final Map<String, List<String>> connectionFactoryJNDI = new HashMap<String, List<String>>();
+   private final Map<String, List<String>> connectionFactoryBindings = new HashMap<String, List<String>>();
 
    // We keep things cached if objects are created while the JMS is not active
    private final List<Runnable> cachedCommands = new ArrayList<Runnable>();
@@ -143,15 +140,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    private final String configFileName;
 
-   private boolean contextSet;
-
    private JMSConfiguration config;
 
    private Configuration coreConfig;
 
    private JMSStorageManager storage;
 
-   private final Map<String, List<String>> unRecoveredJndi = new HashMap<String, List<String>>();
+   private final Map<String, List<String>> unRecoveredBindings = new HashMap<String, List<String>>();
 
    public JMSServerManagerImpl(final ActiveMQServer server) throws Exception
    {
@@ -269,7 +264,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          // do not clear the cachedCommands - HORNETQ-1047
 
-         recoverJndiBindings();
+         recoverBindings();
       }
       catch (Exception e)
       {
@@ -306,11 +301,11 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                storage.stop();
             }
 
-            unbindJNDI(queueJNDI);
+            unbindBindings(queueBindings);
 
-            unbindJNDI(topicJNDI);
+            unbindBindings(topicBindings);
 
-            unbindJNDI(connectionFactoryJNDI);
+            unbindBindings(connectionFactoryBindings);
 
             for (String connectionFactory : new HashSet<String>(connectionFactories.keySet()))
             {
@@ -318,12 +313,12 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             }
 
             connectionFactories.clear();
-            connectionFactoryJNDI.clear();
+            connectionFactoryBindings.clear();
 
-            queueJNDI.clear();
+            queueBindings.clear();
             queues.clear();
 
-            topicJNDI.clear();
+            topicBindings.clear();
             topics.clear();
 
             // it could be null if a backup
@@ -352,102 +347,102 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    }
 
-   public void recoverJndiBindings(String name, PersistedType type) throws NamingException
+   public void recoverregistryBindings(String name, PersistedType type) throws NamingException
    {
-      List<String> bindings = unRecoveredJndi.get(name);
+      List<String> bindings = unRecoveredBindings.get(name);
       if ((bindings != null) && (bindings.size() > 0))
       {
-         Map<String, List<String>> mapJNDI;
+         Map<String, List<String>> mapBindings;
          Map<String, ?> objects;
 
          switch (type)
          {
             case Queue:
-               mapJNDI = queueJNDI;
+               mapBindings = queueBindings;
                objects = queues;
                break;
             case Topic:
-               mapJNDI = topicJNDI;
+               mapBindings = topicBindings;
                objects = topics;
                break;
             default:
             case ConnectionFactory:
-               mapJNDI = connectionFactoryJNDI;
+               mapBindings = connectionFactoryBindings;
                objects = connectionFactories;
                break;
          }
 
          Object objectToBind = objects.get(name);
 
-         List<String> jndiList = mapJNDI.get(name);
+         List<String> bindingsList = mapBindings.get(name);
 
          if (objectToBind == null)
          {
             return;
          }
 
-         if (jndiList == null)
+         if (bindingsList == null)
          {
-            jndiList = new ArrayList<String>();
-            mapJNDI.put(name, jndiList);
+            bindingsList = new ArrayList<String>();
+            mapBindings.put(name, bindingsList);
          }
 
-         for (String jndi : bindings)
+         for (String binding : bindings)
          {
-            jndiList.add(jndi);
-            bindToJndi(jndi, objectToBind);
+            bindingsList.add(binding);
+            bindToBindings(binding, objectToBind);
          }
 
-         unRecoveredJndi.remove(name);
+         unRecoveredBindings.remove(name);
       }
    }
 
-   private void recoverJndiBindings() throws Exception
+   private void recoverBindings() throws Exception
    {
       //now its time to add journal recovered stuff
-      List<PersistedJNDI> jndiSpace = storage.recoverPersistedJNDI();
+      List<PersistedBindings> bindingsSpace = storage.recoverPersistedBindings();
 
-      for (PersistedJNDI record : jndiSpace)
+      for (PersistedBindings record : bindingsSpace)
       {
-         Map<String, List<String>> mapJNDI;
+         Map<String, List<String>> mapBindings;
          Map<String, ?> objects;
 
          switch (record.getType())
          {
             case Queue:
-               mapJNDI = queueJNDI;
+               mapBindings = queueBindings;
                objects = queues;
                break;
             case Topic:
-               mapJNDI = topicJNDI;
+               mapBindings = topicBindings;
                objects = topics;
                break;
             default:
             case ConnectionFactory:
-               mapJNDI = connectionFactoryJNDI;
+               mapBindings = connectionFactoryBindings;
                objects = connectionFactories;
                break;
          }
 
          Object objectToBind = objects.get(record.getName());
-         List<String> jndiList = mapJNDI.get(record.getName());
+         List<String> bindingsList = mapBindings.get(record.getName());
 
          if (objectToBind == null)
          {
-            unRecoveredJndi.put(record.getName(), record.getJndi());
+            unRecoveredBindings.put(record.getName(), record.getBindings());
             continue;
          }
 
-         if (jndiList == null)
+         if (bindingsList == null)
          {
-            jndiList = new ArrayList<String>();
-            mapJNDI.put(record.getName(), jndiList);
+            bindingsList = new ArrayList<String>();
+            mapBindings.put(record.getName(), bindingsList);
          }
 
-         for (String jndi : record.getJndi())
+         for (String bindings : record.getBindings())
          {
-            jndiList.add(jndi);
-            bindToJndi(jndi, objectToBind);
+            bindingsList.add(bindings);
+            bindToBindings(bindings, objectToBind);
          }
       }
 
@@ -477,17 +472,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          return;
       }
 
-      if (registry == null)
-      {
-         if (!contextSet)
-         {
-            if (System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null)
-            {
-               registry = new JndiBindingRegistry(new InitialContext());
-            }
-         }
-      }
-
       deploymentManager = new FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());
       server.registerActivateCallback(this);
       /**
@@ -567,17 +551,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       return server.getSecurityRepository().getMatch(addressMatch);
    }
 
-   public synchronized void setContext(final Context context)
-   {
-      if (registry == null || registry instanceof JndiBindingRegistry)
-      {
-         registry = new JndiBindingRegistry(context);
-         registry.setContext(context);
-      }
-
-      contextSet = true;
-   }
-
    public synchronized String getVersion()
    {
       checkInitialised();
@@ -589,7 +562,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                            final String queueName,
                                            final String selectorString,
                                            final boolean durable,
-                                           final String... jndi) throws Exception
+                                           final String... bindings) throws Exception
    {
 
       if (active && queues.get(queueName) != null)
@@ -608,7 +581,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          @Override
          public void runException() throws Exception
          {
-            checkJNDI(jndi);
+            checkBindings(bindings);
 
             if (internalCreateQueue(queueName, selectorString, durable))
             {
@@ -620,22 +593,22 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                   throw new IllegalArgumentException("Queue does not exist");
                }
 
-               String[] usedJNDI = null;
+               String[] usedBindings = null;
 
-               if (jndi != null)
+               if (bindings != null)
                {
-                  ArrayList<String> bindings = new ArrayList<String>();
+                  ArrayList<String> bindingsToAdd = new ArrayList<String>();
 
-                  for (String jndiItem : jndi)
+                  for (String bindingsItem : bindings)
                   {
-                     if (bindToJndi(jndiItem, destination))
+                     if (bindToBindings(bindingsItem, destination))
                      {
-                        bindings.add(jndiItem);
+                        bindingsToAdd.add(bindingsItem);
                      }
                   }
 
-                  usedJNDI = bindings.toArray(new String[bindings.size()]);
-                  addToBindings(queueJNDI, queueName, usedJNDI);
+                  usedBindings = bindingsToAdd.toArray(new String[bindingsToAdd.size()]);
+                  addToBindings(queueBindings, queueName, usedBindings);
                }
 
                if (storeConfig && durable)
@@ -644,9 +617,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                                     queueName,
                                                                     selectorString,
                                                                     durable));
-                  if (usedJNDI != null)
+                  if (usedBindings != null)
                   {
-                     storage.addJNDI(PersistedType.Queue, queueName, usedJNDI);
+                     storage.addBindings(PersistedType.Queue, queueName, usedBindings);
                   }
                }
             }
@@ -657,7 +630,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       return true;
    }
 
-   public synchronized boolean createTopic(final boolean storeConfig, final String topicName, final String... jndi) throws Exception
+   public synchronized boolean createTopic(final boolean storeConfig, final String topicName, final String... bindings) throws Exception
    {
       if (active && topics.get(topicName) != null)
       {
@@ -675,7 +648,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          @Override
          public void runException() throws Exception
          {
-            checkJNDI(jndi);
+            checkBindings(bindings);
 
             if (internalCreateTopic(topicName))
             {
@@ -687,23 +660,23 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                   throw new IllegalArgumentException("Queue does not exist");
                }
 
-               ArrayList<String> bindings = new ArrayList<String>();
+               ArrayList<String> bindingsToAdd = new ArrayList<String>();
 
-               for (String jndiItem : jndi)
+               for (String bindingsItem : bindings)
                {
-                  if (bindToJndi(jndiItem, destination))
+                  if (bindToBindings(bindingsItem, destination))
                   {
-                     bindings.add(jndiItem);
+                     bindingsToAdd.add(bindingsItem);
                   }
                }
 
-               String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
-               addToBindings(topicJNDI, topicName, usedJNDI);
+               String[] usedBindings = bindingsToAdd.toArray(new String[bindingsToAdd.size()]);
+               addToBindings(topicBindings, topicName, usedBindings);
 
                if (storeConfig)
                {
                   storage.storeDestination(new PersistedDestination(PersistedType.Topic, topicName));
-                  storage.addJNDI(PersistedType.Topic, topicName, usedJNDI);
+                  storage.addBindings(PersistedType.Topic, topicName, usedBindings);
                }
             }
          }
@@ -714,11 +687,11 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    }
 
-   public boolean addTopicToJndi(final String topicName, final String jndiBinding) throws Exception
+   public boolean addTopicToBindingRegistry(final String topicName, final String registryBinding) throws Exception
    {
       checkInitialised();
 
-      checkJNDI(jndiBinding);
+      checkBindings(registryBinding);
 
       ActiveMQTopic destination = topics.get(topicName);
       if (destination == null)
@@ -729,36 +702,36 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       {
          throw new IllegalArgumentException(topicName + " is not a topic");
       }
-      boolean added = bindToJndi(jndiBinding, destination);
+      boolean added = bindToBindings(registryBinding, destination);
 
       if (added)
       {
-         addToBindings(topicJNDI, topicName, jndiBinding);
-         storage.addJNDI(PersistedType.Topic, topicName, jndiBinding);
+         addToBindings(topicBindings, topicName, registryBinding);
+         storage.addBindings(PersistedType.Topic, topicName, registryBinding);
       }
       return added;
    }
 
-   public String[] getJNDIOnQueue(String queue)
+   public String[] getBindingsOnQueue(String queue)
    {
-      return getJNDIList(queueJNDI, queue);
+      return getBindingsList(queueBindings, queue);
    }
 
-   public String[] getJNDIOnTopic(String topic)
+   public String[] getBindingsOnTopic(String topic)
    {
-      return getJNDIList(topicJNDI, topic);
+      return getBindingsList(topicBindings, topic);
    }
 
-   public String[] getJNDIOnConnectionFactory(String factoryName)
+   public String[] getBindingsOnConnectionFactory(String factoryName)
    {
-      return getJNDIList(connectionFactoryJNDI, factoryName);
+      return getBindingsList(connectionFactoryBindings, factoryName);
    }
 
-   public boolean addQueueToJndi(final String queueName, final String jndiBinding) throws Exception
+   public boolean addQueueToBindingRegistry(final String queueName, final String registryBinding) throws Exception
    {
       checkInitialised();
 
-      checkJNDI(jndiBinding);
+      checkBindings(registryBinding);
 
       ActiveMQQueue destination = queues.get(queueName);
       if (destination == null)
@@ -769,56 +742,56 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       {
          throw new IllegalArgumentException(queueName + " is not a queue");
       }
-      boolean added = bindToJndi(jndiBinding, destination);
+      boolean added = bindToBindings(registryBinding, destination);
       if (added)
       {
-         addToBindings(queueJNDI, queueName, jndiBinding);
-         storage.addJNDI(PersistedType.Queue, queueName, jndiBinding);
+         addToBindings(queueBindings, queueName, registryBinding);
+         storage.addBindings(PersistedType.Queue, queueName, registryBinding);
       }
       return added;
    }
 
-   public boolean addConnectionFactoryToJNDI(final String name, final String jndiBinding) throws Exception
+   public boolean addConnectionFactoryToBindingRegistry(final String name, final String registryBinding) throws Exception
    {
       checkInitialised();
 
-      checkJNDI(jndiBinding);
+      checkBindings(registryBinding);
 
       ActiveMQConnectionFactory factory = connectionFactories.get(name);
       if (factory == null)
       {
          throw new IllegalArgumentException("Factory does not exist");
       }
-      if (registry.lookup(jndiBinding) != null)
+      if (registry.lookup(registryBinding) != null)
       {
-         throw ActiveMQJMSServerBundle.BUNDLE.cfJndiExists(name);
+         throw ActiveMQJMSServerBundle.BUNDLE.cfBindingsExists(name);
       }
-      boolean added = bindToJndi(jndiBinding, factory);
+      boolean added = bindToBindings(registryBinding, factory);
       if (added)
       {
-         addToBindings(connectionFactoryJNDI, name, jndiBinding);
-         storage.addJNDI(PersistedType.ConnectionFactory, name, jndiBinding);
+         addToBindings(connectionFactoryBindings, name, registryBinding);
+         storage.addBindings(PersistedType.ConnectionFactory, name, registryBinding);
       }
       return added;
    }
 
    @Override
-   public boolean removeQueueFromJNDI(String name, String jndi) throws Exception
+   public boolean removeQueueFromBindingRegistry(String name, String bindings) throws Exception
    {
       checkInitialised();
 
-      boolean removed = removeFromJNDI(queueJNDI, name, jndi);
+      boolean removed = removeFromBindings(queueBindings, name, bindings);
 
       if (removed)
       {
-         storage.deleteJNDI(PersistedType.Queue, name, jndi);
+         storage.deleteBindings(PersistedType.Queue, name, bindings);
       }
 
       return removed;
    }
 
    @Override
-   public boolean removeQueueFromJNDI(final String name) throws Exception
+   public boolean removeQueueFromBindingRegistry(final String name) throws Exception
    {
       final AtomicBoolean valueReturn = new AtomicBoolean(false);
 
@@ -828,7 +801,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          @Override
          public String toString()
          {
-            return "removeQueueFromJNDI for " + name;
+            return "removeQueueFromBindings for " + name;
          }
 
          @Override
@@ -836,7 +809,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          {
             checkInitialised();
 
-            if (removeFromJNDI(queues, queueJNDI, name))
+            if (removeFromBindings(queues, queueBindings, name))
             {
                storage.deleteDestination(PersistedType.Queue, name);
                valueReturn.set(true);
@@ -848,13 +821,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    }
 
    @Override
-   public boolean removeTopicFromJNDI(String name, String jndi) throws Exception
+   public boolean removeTopicFromBindingRegistry(String name, String bindings) throws Exception
    {
       checkInitialised();
 
-      if (removeFromJNDI(topicJNDI, name, jndi))
+      if (removeFromBindings(topicBindings, name, bindings))
       {
-         storage.deleteJNDI(PersistedType.Topic, name, jndi);
+         storage.deleteBindings(PersistedType.Topic, name, bindings);
          return true;
       }
       else
@@ -864,9 +837,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    }
 
    /* (non-Javadoc)
-   * @see org.apache.activemq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
+   * @see org.apache.activemq.jms.server.JMSServerManager#removeTopicFromBindings(java.lang.String, java.lang.String)
    */
-   public boolean removeTopicFromJNDI(final String name) throws Exception
+   public boolean removeTopicFromBindingRegistry(final String name) throws Exception
    {
       final AtomicBoolean valueReturn = new AtomicBoolean(false);
 
@@ -876,7 +849,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          @Override
          public String toString()
          {
-            return "removeTopicFromJNDI for " + name;
+            return "removeTopicFromBindings for " + name;
          }
 
          @Override
@@ -884,7 +857,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          {
             checkInitialised();
 
-            if (removeFromJNDI(topics, topicJNDI, name))
+            if (removeFromBindings(topics, topicBindings, name))
             {
                storage.deleteDestination(PersistedType.Topic, name);
                valueReturn.set(true);
@@ -896,23 +869,23 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    }
 
    @Override
-   public boolean removeConnectionFactoryFromJNDI(String name, String jndi) throws Exception
+   public boolean removeConnectionFactoryFromBindingRegistry(String name, String bindings) throws Exception
    {
       checkInitialised();
 
-      removeFromJNDI(connectionFactoryJNDI, name, jndi);
+      removeFromBindings(connectionFactoryBindings, name, bindings);
 
-      storage.deleteJNDI(PersistedType.ConnectionFactory, name, jndi);
+      storage.deleteBindings(PersistedType.ConnectionFactory, name, bindings);
 
       return true;
    }
 
    @Override
-   public boolean removeConnectionFactoryFromJNDI(String name) throws Exception
+   public boolean removeConnectionFactoryFromBindingRegistry(String name) throws Exception
    {
       checkInitialised();
 
-      removeFromJNDI(connectionFactories, connectionFactoryJNDI, name);
+      removeFromBindings(connectionFactories, connectionFactoryBindings, name);
 
       storage.deleteConnectionFactory(name);
 
@@ -931,13 +904,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       server.destroyQueue(ActiveMQDestination.createQueueAddressFromName(name), null, !removeConsumers, removeConsumers);
 
       // if the queue has consumers and 'removeConsumers' is false then the queue won't actually be removed
-      // therefore only remove the queue from JNDI, etc. if the queue is actually removed
+      // therefore only remove the queue from Bindings, etc. if the queue is actually removed
       if (this.server.getPostOffice().getBinding(ActiveMQDestination.createQueueAddressFromName(name)) == null)
       {
-         removeFromJNDI(queues, queueJNDI, name);
+         removeFromBindings(queues, queueBindings, name);
 
          queues.remove(name);
-         queueJNDI.remove(name);
+         queueBindings.remove(name);
 
          jmsManagementService.unregisterQueue(name);
 
@@ -982,10 +955,10 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          if (addressControl.getQueueNames().length == 0)
          {
-            removeFromJNDI(topics, topicJNDI, name);
+            removeFromBindings(topics, topicBindings, name);
 
             topics.remove(name);
-            topicJNDI.remove(name);
+            topicBindings.remove(name);
 
             jmsManagementService.unregisterTopic(name);
 
@@ -1009,7 +982,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final boolean ha,
                                                     final JMSFactoryType cfType,
                                                     final List<String> connectorNames,
-                                                    String... jndiBindings) throws Exception
+                                                    String... registryBindings) throws Exception
    {
       checkInitialised();
       ActiveMQConnectionFactory cf = connectionFactories.get(name);
@@ -1021,7 +994,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             .setConnectorNames(connectorNames)
             .setFactoryType(cfType);
 
-         createConnectionFactory(true, configuration, jndiBindings);
+         createConnectionFactory(true, configuration, registryBindings);
       }
    }
 
@@ -1059,7 +1032,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final int reconnectAttempts,
                                                     final boolean failoverOnInitialConnection,
                                                     final String groupId,
-                                                    String... jndiBindings) throws Exception
+                                                    String... registryBindings) throws Exception
    {
       checkInitialised();
       ActiveMQConnectionFactory cf = connectionFactories.get(name);
@@ -1100,7 +1073,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             .setFailoverOnInitialConnection(failoverOnInitialConnection)
             .setGroupID(groupId);
 
-         createConnectionFactory(true, configuration, jndiBindings);
+         createConnectionFactory(true, configuration, registryBindings);
       }
    }
 
@@ -1138,7 +1111,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final int reconnectAttempts,
                                                     final boolean failoverOnInitialConnection,
                                                     final String groupId,
-                                                    final String... jndiBindings) throws Exception
+                                                    final String... registryBindings) throws Exception
    {
       checkInitialised();
       ActiveMQConnectionFactory cf = connectionFactories.get(name);
@@ -1147,7 +1120,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
             .setName(name)
             .setHA(ha)
-            .setBindings(jndiBindings)
+            .setBindings(registryBindings)
             .setDiscoveryGroupName(discoveryGroupName)
             .setFactoryType(cfType)
             .setClientID(clientID)
@@ -1179,7 +1152,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             .setMaxRetryInterval(maxRetryInterval)
             .setReconnectAttempts(reconnectAttempts)
             .setFailoverOnInitialConnection(failoverOnInitialConnection);
-         createConnectionFactory(true, configuration, jndiBindings);
+         createConnectionFactory(true, configuration, registryBindings);
       }
    }
 
@@ -1187,7 +1160,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final boolean ha,
                                                     final JMSFactoryType cfType,
                                                     final String discoveryGroupName,
-                                                    final String... jndiBindings) throws Exception
+                                                    final String... registryBindings) throws Exception
    {
       checkInitialised();
       ActiveMQConnectionFactory cf = connectionFactories.get(name);
@@ -1196,34 +1169,34 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
             .setName(name)
             .setHA(ha)
-            .setBindings(jndiBindings)
+            .setBindings(registryBindings)
             .setDiscoveryGroupName(discoveryGroupName);
-         createConnectionFactory(true, configuration, jndiBindings);
+         createConnectionFactory(true, configuration, registryBindings);
       }
    }
 
    public synchronized ActiveMQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception
    {
-      List<String> jndi = connectionFactoryJNDI.get(name);
+      List<String> bindings = connectionFactoryBindings.get(name);
 
-      if (jndi == null)
+      if (bindings == null)
       {
          throw ActiveMQJMSServerBundle.BUNDLE.cfDoesntExist(name);
       }
 
-      String[] usedJNDI = jndi.toArray(new String[jndi.size()]);
+      String[] usedBindings = bindings.toArray(new String[bindings.size()]);
 
       ActiveMQConnectionFactory realCF = internalCreateCFPOJO(cf);
 
       if (cf.isPersisted())
       {
          storage.storeConnectionFactory(new PersistedConnectionFactory(cf));
-         storage.addJNDI(PersistedType.ConnectionFactory, cf.getName(), usedJNDI);
+         storage.addBindings(PersistedType.ConnectionFactory, cf.getName(), usedBindings);
       }
 
-      for (String jndiElement : usedJNDI)
+      for (String bindingsElement : usedBindings)
       {
-         this.bindToJndi(jndiElement, realCF);
+         this.bindToBindings(bindingsElement, realCF);
       }
 
       return realCF;
@@ -1231,7 +1204,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    public synchronized void createConnectionFactory(final boolean storeConfig,
                                                     final ConnectionFactoryConfiguration cfConfig,
-                                                    final String... jndi) throws Exception
+                                                    final String... bindings) throws Exception
    {
       runAfterActive(new WrappedRunnable()
       {
@@ -1245,30 +1218,30 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          @Override
          public void runException() throws Exception
          {
-            checkJNDI(jndi);
+            checkBindings(bindings);
 
             ActiveMQConnectionFactory cf = internalCreateCF(storeConfig, cfConfig);
 
-            ArrayList<String> bindings = new ArrayList<String>();
+            ArrayList<String> bindingsToAdd = new ArrayList<String>();
 
-            for (String jndiItem : jndi)
+            for (String bindingsItem : bindings)
             {
-               if (bindToJndi(jndiItem, cf))
+               if (bindToBindings(bindingsItem, cf))
                {
-                  bindings.add(jndiItem);
+                  bindingsToAdd.add(bindingsItem);
                }
             }
 
-            String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
-            addToBindings(connectionFactoryJNDI, cfConfig.getName(), usedJNDI);
+            String[] usedBindings = bindingsToAdd.toArray(new String[bindingsToAdd.size()]);
+            addToBindings(connectionFactoryBindings, cfConfig.getName(), usedBindings);
 
             if (storeConfig)
             {
                storage.storeConnectionFactory(new PersistedConnectionFactory(cfConfig));
-               storage.addJNDI(PersistedType.ConnectionFactory, cfConfig.getName(), usedJNDI);
+               storage.addBindings(PersistedType.ConnectionFactory, cfConfig.getName(), usedBindings);
             }
 
-            JMSServerManagerImpl.this.recoverJndiBindings(cfConfig.getName(), PersistedType.ConnectionFactory);
+            JMSServerManagerImpl.this.recoverregistryBindings(cfConfig.getName(), PersistedType.ConnectionFactory);
             sendNotification(JMSNotificationType.CONNECTION_FACTORY_CREATED, cfConfig.getName());
          }
       });
@@ -1300,7 +1273,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       this.storage = newStorage;
    }
 
-   private String[] getJNDIList(final Map<String, List<String>> map, final String name)
+   private String[] getBindingsList(final Map<String, List<String>> map, final String name)
    {
       List<String> result = map.get(name);
       if (result == null)
@@ -1341,7 +1314,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          queues.put(queueName, activeMQQueue);
 
-         this.recoverJndiBindings(queueName, PersistedType.Queue);
+         this.recoverregistryBindings(queueName, PersistedType.Queue);
 
          jmsManagementService.registerQueue(activeMQQueue, queue);
 
@@ -1379,7 +1352,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          topics.put(topicName, activeMQTopic);
 
-         this.recoverJndiBindings(topicName, PersistedType.Topic);
+         this.recoverregistryBindings(topicName, PersistedType.Topic);
 
          jmsManagementService.registerTopic(activeMQTopic);
 
@@ -1541,17 +1514,17 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    protected boolean shutdownConnectionFactory(final String name) throws Exception
    {
       checkInitialised();
-      List<String> jndiBindings = connectionFactoryJNDI.get(name);
+      List<String> registryBindings = connectionFactoryBindings.get(name);
 
       if (registry != null)
       {
-         for (String jndiBinding : jndiBindings)
+         for (String registryBinding : registryBindings)
          {
-            registry.unbind(jndiBinding);
+            registry.unbind(registryBinding);
          }
       }
 
-      connectionFactoryJNDI.remove(name);
+      connectionFactoryBindings.remove(name);
       connectionFactories.remove(name);
 
       jmsManagementService.unregisterConnectionFactory(name);
@@ -1726,7 +1699,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
    }
 
-   private void addToBindings(Map<String, List<String>> map, String name, String... jndi)
+   private void addToBindings(Map<String, List<String>> map, String name, String... bindings)
    {
       List<String> list = map.get(name);
       if (list == null)
@@ -1734,32 +1707,32 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          list = new ArrayList<String>();
          map.put(name, list);
       }
-      for (String jndiItem : jndi)
+      for (String bindingsItem : bindings)
       {
-         list.add(jndiItem);
+         list.add(bindingsItem);
       }
    }
 
-   private void checkJNDI(final String... jndiNames) throws NamingException
+   private void checkBindings(final String... bindingsNames) throws NamingException
    {
-      if (jndiNames != null)
+      if (bindingsNames != null)
       {
-         for (String jndiName : jndiNames)
+         for (String bindingsName : bindingsNames)
          {
-            if (registry != null && registry.lookup(jndiName) != null)
+            if (registry != null && registry.lookup(bindingsName) != null)
             {
-               throw new NamingException(jndiName + " already has an object bound");
+               throw new NamingException(bindingsName + " already has an object bound");
             }
          }
       }
    }
 
-   private boolean bindToJndi(final String jndiName, final Object objectToBind) throws NamingException
+   private boolean bindToBindings(final String bindingsName, final Object objectToBind) throws NamingException
    {
       if (registry != null)
       {
-         registry.unbind(jndiName);
-         registry.bind(jndiName, objectToBind);
+         registry.unbind(bindingsName);
+         registry.bind(bindingsName, objectToBind);
       }
       return true;
    }
@@ -1771,11 +1744,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          return;
       }
 
-      if (config.getContext() != null)
-      {
-         setContext(config.getContext());
-      }
-
       List<ConnectionFactoryConfiguration> connectionFactoryConfigurations = config.getConnectionFactoryConfigurations();
       for (ConnectionFactoryConfiguration cfConfig : connectionFactoryConfigurations)
       {
@@ -1798,7 +1766,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    /**
     * @param param
     */
-   private void unbindJNDI(Map<String, List<String>> param)
+   private void unbindBindings(Map<String, List<String>> param)
    {
       if (registry != null)
       {
@@ -1812,7 +1780,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                }
                catch (Exception e)
                {
-                  ActiveMQJMSServerLogger.LOGGER.jndiUnbindError(e, key);
+                  ActiveMQJMSServerLogger.LOGGER.bindingsUnbindError(e, key);
                }
             }
          }
@@ -1881,13 +1849,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       storage.start();
    }
 
-   private synchronized boolean removeFromJNDI(final Map<String, ?> keys,
-                                               final Map<String, List<String>> jndiMap,
+   private synchronized boolean removeFromBindings(final Map<String, ?> keys,
+                                               final Map<String, List<String>> bindingsMap,
                                                final String name) throws Exception
    {
       checkInitialised();
-      List<String> jndiBindings = jndiMap.remove(name);
-      if (jndiBindings == null || jndiBindings.size() == 0)
+      List<String> registryBindings = bindingsMap.remove(name);
+      if (registryBindings == null || registryBindings.size() == 0)
       {
          return false;
       }
@@ -1897,31 +1865,31 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
       if (registry != null)
       {
-         Iterator<String> iter = jndiBindings.iterator();
+         Iterator<String> iter = registryBindings.iterator();
          while (iter.hasNext())
          {
-            String jndiBinding = iter.next();
-            registry.unbind(jndiBinding);
+            String registryBinding = iter.next();
+            registry.unbind(registryBinding);
             iter.remove();
          }
       }
       return true;
    }
 
-   private synchronized boolean removeFromJNDI(final Map<String, List<String>> jndiMap,
+   private synchronized boolean removeFromBindings(final Map<String, List<String>> bindingsMap,
                                                final String name,
-                                               final String jndi) throws Exception
+                                               final String bindings) throws Exception
    {
       checkInitialised();
-      List<String> jndiBindings = jndiMap.get(name);
-      if (jndiBindings == null || jndiBindings.size() == 0)
+      List<String> registryBindings = bindingsMap.get(name);
+      if (registryBindings == null || registryBindings.size() == 0)
       {
          return false;
       }
 
-      if (jndiBindings.remove(jndi))
+      if (registryBindings.remove(bindings))
       {
-         registry.unbind(jndi);
+         registry.unbind(bindings);
          return true;
       }
       else

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ServletContextBindingRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ServletContextBindingRegistry.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ServletContextBindingRegistry.java
index 83fe4ee..4eb69aa 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ServletContextBindingRegistry.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ServletContextBindingRegistry.java
@@ -52,14 +52,4 @@ public class ServletContextBindingRegistry implements BindingRegistry
    public void close()
    {
    }
-
-   public Object getContext()
-   {
-      return servletContext;
-   }
-
-   public void setContext(Object o)
-   {
-      servletContext = (ServletContext)o;
-   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-server/src/main/java/org/apache/activemq/core/registry/JndiBindingRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/registry/JndiBindingRegistry.java b/activemq-server/src/main/java/org/apache/activemq/core/registry/JndiBindingRegistry.java
index a61e7a6..7e2382d 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/registry/JndiBindingRegistry.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/registry/JndiBindingRegistry.java
@@ -30,22 +30,6 @@ public class JndiBindingRegistry implements BindingRegistry
 {
    private Context context;
 
-   /**
-    * @return the context
-    */
-   public Object getContext()
-   {
-      return context;
-   }
-
-   /**
-    * @param context the context to set
-    */
-   public void setContext(Object context)
-   {
-      this.context = (Context)context;
-   }
-
    public JndiBindingRegistry(Context context)
    {
       this.context = context;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-server/src/main/java/org/apache/activemq/core/registry/MapBindingRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/registry/MapBindingRegistry.java b/activemq-server/src/main/java/org/apache/activemq/core/registry/MapBindingRegistry.java
index 62c0bb6..8acb371 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/registry/MapBindingRegistry.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/registry/MapBindingRegistry.java
@@ -47,15 +47,4 @@ public class MapBindingRegistry implements BindingRegistry
    public void close()
    {
    }
-
-   public Object getContext()
-   {
-      return registry;
-   }
-
-   @Override
-   public void setContext(Object ctx)
-   {
-      registry = (ConcurrentMap)ctx;
-   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-server/src/main/java/org/apache/activemq/spi/core/naming/BindingRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/spi/core/naming/BindingRegistry.java b/activemq-server/src/main/java/org/apache/activemq/spi/core/naming/BindingRegistry.java
index d727fd3..5fee359 100644
--- a/activemq-server/src/main/java/org/apache/activemq/spi/core/naming/BindingRegistry.java
+++ b/activemq-server/src/main/java/org/apache/activemq/spi/core/naming/BindingRegistry.java
@@ -24,17 +24,6 @@ package org.apache.activemq.spi.core.naming;
  */
 public interface BindingRegistry
 {
-   /** The context used by the registry.
-    *   This may be used to setup the JNDI Context on the JNDI Registry.
-    *   We keep it as an object here as the interface needs to be generic
-    *   as this could be reused by others Registries (e.g set/get the Map on MapRegistry)
-    * @return
-    */
-   // XXX Unused?
-   Object getContext();
-
-   void setContext(Object ctx);
-
    Object lookup(String name);
 
    boolean bind(String name, Object obj);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/activemq-tools/src/main/java/org/apache/activemq/tools/XmlDataExporter.java
----------------------------------------------------------------------
diff --git a/activemq-tools/src/main/java/org/apache/activemq/tools/XmlDataExporter.java b/activemq-tools/src/main/java/org/apache/activemq/tools/XmlDataExporter.java
index b6b1b62..16b90e5 100644
--- a/activemq-tools/src/main/java/org/apache/activemq/tools/XmlDataExporter.java
+++ b/activemq-tools/src/main/java/org/apache/activemq/tools/XmlDataExporter.java
@@ -81,7 +81,7 @@ import org.apache.activemq.core.settings.impl.AddressSettings;
 import org.apache.activemq.core.settings.impl.HierarchicalObjectRepository;
 import org.apache.activemq.jms.persistence.config.PersistedConnectionFactory;
 import org.apache.activemq.jms.persistence.config.PersistedDestination;
-import org.apache.activemq.jms.persistence.config.PersistedJNDI;
+import org.apache.activemq.jms.persistence.config.PersistedBindings;
 import org.apache.activemq.jms.persistence.config.PersistedType;
 import org.apache.activemq.jms.persistence.impl.journal.JMSJournalStorageManagerImpl;
 import org.apache.activemq.utils.Base64;
@@ -124,7 +124,7 @@ public final class XmlDataExporter
 
    private final Map<Pair<PersistedType, String>, PersistedDestination> jmsDestinations = new ConcurrentHashMap<>();
 
-   private final Map<Pair<PersistedType, String>, PersistedJNDI> jmsJNDI = new ConcurrentHashMap<>();
+   private final Map<Pair<PersistedType, String>, PersistedBindings> jmsJNDI = new ConcurrentHashMap<>();
 
 
    long messagesPrinted = 0L;
@@ -392,14 +392,14 @@ public final class XmlDataExporter
             ActiveMQServerLogger.LOGGER.info("Found JMS destination: " + destination.getName());
             jmsDestinations.put(new Pair<>(destination.getType(), destination.getName()), destination);
          }
-         else if (rec == JMSJournalStorageManagerImpl.JNDI_RECORD)
+         else if (rec == JMSJournalStorageManagerImpl.BINDING_RECORD)
          {
-            PersistedJNDI jndi = new PersistedJNDI();
+            PersistedBindings jndi = new PersistedBindings();
             jndi.decode(buffer);
             jndi.setId(id);
             Pair<PersistedType, String> key = new Pair<>(jndi.getType(), jndi.getName());
             StringBuilder builder = new StringBuilder();
-            for (String binding : jndi.getJndi())
+            for (String binding : jndi.getBindings())
             {
                builder.append(binding).append(" ");
             }
@@ -680,8 +680,8 @@ public final class XmlDataExporter
          xmlWriter.writeEndElement();
 
          xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRIES);
-         PersistedJNDI jndi = jmsJNDI.get(new Pair<>(PersistedType.ConnectionFactory, jmsConnectionFactory.getName()));
-         for (String jndiEntry : jndi.getJndi())
+         PersistedBindings jndi = jmsJNDI.get(new Pair<>(PersistedType.ConnectionFactory, jmsConnectionFactory.getName()));
+         for (String jndiEntry : jndi.getBindings())
          {
             xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRY);
             xmlWriter.writeCharacters(jndiEntry);
@@ -719,8 +719,8 @@ public final class XmlDataExporter
 
 
          xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRIES);
-         PersistedJNDI jndi = jmsJNDI.get(new Pair<>(jmsDestination.getType(), jmsDestination.getName()));
-         for (String jndiEntry : jndi.getJndi())
+         PersistedBindings jndi = jmsJNDI.get(new Pair<>(jmsDestination.getType(), jmsDestination.getName()));
+         for (String jndiEntry : jndi.getBindings())
          {
             xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRY);
             xmlWriter.writeCharacters(jndiEntry);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/integration/activemq-spring-integration/src/main/java/org/apache/activemq/integration/spring/SpringBindingRegistry.java
----------------------------------------------------------------------
diff --git a/integration/activemq-spring-integration/src/main/java/org/apache/activemq/integration/spring/SpringBindingRegistry.java b/integration/activemq-spring-integration/src/main/java/org/apache/activemq/integration/spring/SpringBindingRegistry.java
index f7e9a02..a5365bf 100644
--- a/integration/activemq-spring-integration/src/main/java/org/apache/activemq/integration/spring/SpringBindingRegistry.java
+++ b/integration/activemq-spring-integration/src/main/java/org/apache/activemq/integration/spring/SpringBindingRegistry.java
@@ -60,16 +60,4 @@ public class SpringBindingRegistry implements BindingRegistry
    public void close()
    {
    }
-
-   @Override
-   public Object getContext()
-   {
-      return this.factory;
-   }
-
-   @Override
-   public void setContext(Object ctx)
-   {
-      this.factory = (ConfigurableBeanFactory) ctx;
-   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/StartStopDeadlockTest.java
----------------------------------------------------------------------
diff --git a/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/StartStopDeadlockTest.java b/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/StartStopDeadlockTest.java
index e33729b..409c811 100644
--- a/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/StartStopDeadlockTest.java
+++ b/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/StartStopDeadlockTest.java
@@ -23,6 +23,7 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.core.config.ha.SharedStoreSlavePolicyConfiguration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.ActiveMQServers;
 import org.apache.activemq.jms.server.impl.JMSServerManagerImpl;
@@ -101,7 +102,7 @@ public class StartStopDeadlockTest extends ServiceTestBase
 
       final JMSServerManagerImpl jmsServer = new JMSServerManagerImpl(server);
       final InVMNamingContext context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
 
       jmsServer.start();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/FailureDeadlockTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/FailureDeadlockTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/FailureDeadlockTest.java
index af09ef8..2857969 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/FailureDeadlockTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/FailureDeadlockTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.tests.integration.client;
 import org.apache.activemq.api.core.ActiveMQNotConnectedException;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
 
@@ -71,7 +72,7 @@ public class FailureDeadlockTest extends ServiceTestBase
          .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
       server = createServer(false, conf);
       jmsServer = new JMSServerManagerImpl(server);
-      jmsServer.setContext(new NullInitialContext());
+      jmsServer.setRegistry(new JndiBindingRegistry(new NullInitialContext()));
       jmsServer.start();
 
       cf1 =

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/PagingOrderTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/PagingOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/PagingOrderTest.java
index 85f76f1..a77ee94 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/PagingOrderTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/PagingOrderTest.java
@@ -43,6 +43,7 @@ import org.apache.activemq.core.paging.PagingStore;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.Bindings;
 import org.apache.activemq.core.postoffice.impl.LocalQueueBinding;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.impl.QueueImpl;
@@ -726,7 +727,7 @@ public class PagingOrderTest extends ServiceTestBase
 
       JMSServerManagerImpl jmsServer = new JMSServerManagerImpl(server);
       InVMNamingContext context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
       jmsServer.start();
 
       jmsServer.createTopic(true, "tt", "/topic/TT");
@@ -775,7 +776,7 @@ public class PagingOrderTest extends ServiceTestBase
 
       jmsServer = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
       jmsServer.start();
 
       AddressSettings settings = server.getAddressSettingsRepository().getMatch("jms.topic.TT");
@@ -803,7 +804,7 @@ public class PagingOrderTest extends ServiceTestBase
 
       JMSServerManagerImpl jmsServer = new JMSServerManagerImpl(server);
       InVMNamingContext context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
       jmsServer.start();
 
       server.getActiveMQServerControl().addAddressSettings("jms.queue.Q1",
@@ -858,7 +859,7 @@ public class PagingOrderTest extends ServiceTestBase
 
       jmsServer = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
       jmsServer.start();
 
       AddressSettings settings = server.getAddressSettingsRepository().getMatch("jms.queue.Q1");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/FloodServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/FloodServerTest.java
index 87e6a57..4b2d9c2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/FloodServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/FloodServerTest.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.tests.integration.jms;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
 
@@ -95,7 +96,7 @@ public class FloodServerTest extends UnitTestCase
 
       serverManager = new JMSServerManagerImpl(server);
       initialContext = new InVMNamingContext();
-      serverManager.setContext(initialContext);
+      serverManager.setRegistry(new JndiBindingRegistry(initialContext));
       serverManager.start();
       serverManager.activated();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/ManualReconnectionToSingleServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
index f28733c..e7a8853 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.tests.integration.jms;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
 
@@ -160,7 +161,9 @@ public class ManualReconnectionToSingleServerTest extends ServiceTestBase
       server = createServer(false, conf);
 
       JMSConfiguration configuration = new JMSConfigurationImpl();
-      configuration.setContext(context);
+      serverManager = new JMSServerManagerImpl(server, configuration);
+      serverManager.setRegistry(new JndiBindingRegistry(context));
+
       configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl().setName(QUEUE_NAME).setBindings(QUEUE_NAME));
 
       ArrayList<TransportConfiguration> configs = new ArrayList<TransportConfiguration>();
@@ -169,10 +172,9 @@ public class ManualReconnectionToSingleServerTest extends ServiceTestBase
          .setName("cf")
          .setConnectorNames(registerConnectors(server, configs))
          .setBindings("/cf")
-         .setRetryInterval(1000)
+            .setRetryInterval(1000)
          .setReconnectAttempts(-1);
       configuration.getConnectionFactoryConfigurations().add(cfConfig);
-      serverManager = new JMSServerManagerImpl(server, configuration);
       serverManager.start();
 
       listener = new Listener();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/BridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/BridgeTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/BridgeTestBase.java
index d6ac6ed..d5dfa9c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/BridgeTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/BridgeTestBase.java
@@ -44,6 +44,7 @@ import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.api.jms.management.JMSQueueControl;
 import org.apache.activemq.api.jms.management.TopicControl;
 import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.ActiveMQServers;
@@ -122,7 +123,7 @@ public abstract class BridgeTestBase extends UnitTestCase
 
       context0 = new InVMNamingContext();
       jmsServer0 = new JMSServerManagerImpl(server0);
-      jmsServer0.setContext(context0);
+      jmsServer0.setRegistry(new JndiBindingRegistry(context0));
       jmsServer0.start();
 
       params1 = new HashMap<String, Object>();
@@ -138,7 +139,7 @@ public abstract class BridgeTestBase extends UnitTestCase
       context1 = new InVMNamingContext();
 
       jmsServer1 = new JMSServerManagerImpl(server1);
-      jmsServer1.setContext(context1);
+      jmsServer1.setRegistry(new JndiBindingRegistry(context1));
       jmsServer1.start();
 
       createQueue("sourceQueue", 0);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/ClusteredBridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/ClusteredBridgeTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/ClusteredBridgeTestBase.java
index 4d9aecf..31a094a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/ClusteredBridgeTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/ClusteredBridgeTestBase.java
@@ -43,6 +43,7 @@ import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.ha.ReplicaPolicyConfiguration;
 import org.apache.activemq.core.config.ha.ReplicatedPolicyConfiguration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.ActiveMQServers;
@@ -168,7 +169,7 @@ public abstract class ClusteredBridgeTestBase extends ServiceTestBase
 
          liveContext = new InVMContext();
          liveNode = new JMSServerManagerImpl(server0);
-         liveNode.setContext(liveContext);
+         liveNode.setRegistry(new JndiBindingRegistry(liveContext));
 
          //backup
          Configuration conf = createBasicConfig()
@@ -185,7 +186,7 @@ public abstract class ClusteredBridgeTestBase extends ServiceTestBase
          Context context = new InVMContext();
 
          backupNode = new JMSServerManagerImpl(backup);
-         backupNode.setContext(context);
+         backupNode.setRegistry(new JndiBindingRegistry(context));
       }
 
       public void start() throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/RemoteConnectionStressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/RemoteConnectionStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/RemoteConnectionStressTest.java
index ab74716..d0bbbc9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/RemoteConnectionStressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/RemoteConnectionStressTest.java
@@ -28,6 +28,7 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.ActiveMQServers;
 import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
@@ -64,7 +65,7 @@ public class RemoteConnectionStressTest extends ServiceTestBase
 
       InVMNamingContext namingContext = new InVMNamingContext();
       jmsServer = new JMSServerManagerImpl(server);
-      jmsServer.setContext(namingContext);
+      jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
 
       jmsServer.start();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/StoreConfigTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/StoreConfigTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/StoreConfigTest.java
index 2e5e89b..1823db7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/StoreConfigTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/client/StoreConfigTest.java
@@ -75,7 +75,7 @@ public class StoreConfigTest extends JMSTestBase
 
       try
       {
-         jmsServer.addConnectionFactoryToJNDI("np", "/someCF");
+         jmsServer.addConnectionFactoryToBindingRegistry("np", "/someCF");
          fail("Failure expected and the API let duplicates");
       }
       catch (NamingException expected)
@@ -100,10 +100,10 @@ public class StoreConfigTest extends JMSTestBase
 
       jmsServer.start();
 
-      jmsServer.addConnectionFactoryToJNDI("tst", "/newJNDI");
+      jmsServer.addConnectionFactoryToBindingRegistry("tst", "/newJNDI");
       try
       {
-         jmsServer.addConnectionFactoryToJNDI("tst", "/newJNDI");
+         jmsServer.addConnectionFactoryToBindingRegistry("tst", "/newJNDI");
          fail("Failure expected and the API let duplicates");
       }
       catch (NamingException expected)
@@ -176,7 +176,7 @@ public class StoreConfigTest extends JMSTestBase
       assertNullJNDI("/t2");
       assertNullJNDI("/t.2");
 
-      jmsServer.addTopicToJndi("topicOne", "/tI");
+      jmsServer.addTopicToBindingRegistry("topicOne", "/tI");
 
       jmsServer.stop();
       jmsServer.start();
@@ -189,11 +189,11 @@ public class StoreConfigTest extends JMSTestBase
       assertNullJNDI("/t.2");
 
 
-      assertTrue(jmsServer.removeTopicFromJNDI("topicOne", "/tI"));
+      assertTrue(jmsServer.removeTopicFromBindingRegistry("topicOne", "/tI"));
 
-      assertFalse(jmsServer.removeTopicFromJNDI("topicOne","nothing"));
-      assertFalse(jmsServer.removeTopicFromJNDI("nothing","nothing"));
-      assertFalse(jmsServer.removeTopicFromJNDI("nothing"));
+      assertFalse(jmsServer.removeTopicFromBindingRegistry("topicOne", "nothing"));
+      assertFalse(jmsServer.removeTopicFromBindingRegistry("nothing", "nothing"));
+      assertFalse(jmsServer.removeTopicFromBindingRegistry("nothing"));
 
       assertNullJNDI("/tI");
       checkDestination("/t1");
@@ -208,7 +208,7 @@ public class StoreConfigTest extends JMSTestBase
       checkDestination("/t.1");
 
 
-      jmsServer.removeTopicFromJNDI("topicOne");
+      jmsServer.removeTopicFromBindingRegistry("topicOne");
 
       assertTrue(jmsServer.createTopic(true, "topicOne", "/topicx.1", "/topicx.2"));
 
@@ -292,7 +292,7 @@ public class StoreConfigTest extends JMSTestBase
       assertNullJNDI("/q2");
       assertNullJNDI("/q.2");
 
-      jmsServer.addQueueToJndi("queue1", "/qI");
+      jmsServer.addQueueToBindingRegistry("queue1", "/qI");
 
       jmsServer.stop();
       jmsServer.start();
@@ -305,9 +305,9 @@ public class StoreConfigTest extends JMSTestBase
       assertNullJNDI("/q.2");
 
 
-      assertTrue(jmsServer.removeQueueFromJNDI("queue1", "/q1"));
+      assertTrue(jmsServer.removeQueueFromBindingRegistry("queue1", "/q1"));
 
-      assertFalse(jmsServer.removeQueueFromJNDI("queue1","nothing"));
+      assertFalse(jmsServer.removeQueueFromBindingRegistry("queue1", "nothing"));
 
       assertNullJNDI("/q1");
       checkDestination("/q.1");
@@ -321,7 +321,7 @@ public class StoreConfigTest extends JMSTestBase
       checkDestination("/q.1");
       checkDestination("/qI");
 
-      jmsServer.removeQueueFromJNDI("queue1");
+      jmsServer.removeQueueFromBindingRegistry("queue1");
 
 
       assertTrue(jmsServer.createQueue(true, "queue1", null, true, "/newq1", "/newq.1"));

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverListenerTest.java
index 6bfdd20..0c8d986 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverListenerTest.java
@@ -40,6 +40,7 @@ import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.core.config.ha.SharedStoreSlavePolicyConfiguration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.InVMRegistry;
 import org.apache.activemq.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.core.server.ActiveMQServer;
@@ -315,7 +316,7 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
       backupJMSService = new JMSServerManagerImpl(backupService);
 
-      backupJMSService.setContext(ctx2);
+      backupJMSService.setRegistry(new JndiBindingRegistry(ctx2));
 
       backupJMSService.getActiveMQServer().setIdentity("JMSBackup");
       log.info("Starting backup");
@@ -340,7 +341,7 @@ public class JMSFailoverListenerTest extends ServiceTestBase
 
       liveJMSService = new JMSServerManagerImpl(liveService);
 
-      liveJMSService.setContext(ctx1);
+      liveJMSService.setRegistry(new JndiBindingRegistry(ctx1));
 
       liveJMSService.getActiveMQServer().setIdentity("JMSLive");
       log.info("Starting life");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverTest.java
index b7c305f..e87c216 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/JMSFailoverTest.java
@@ -47,6 +47,7 @@ import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.core.config.ha.SharedStoreSlavePolicyConfiguration;
 import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.InVMRegistry;
 import org.apache.activemq.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.core.server.ActiveMQServer;
@@ -543,7 +544,7 @@ public class JMSFailoverTest extends ServiceTestBase
 
       backupJMSService = new JMSServerManagerImpl(backupService);
 
-      backupJMSService.setContext(ctx2);
+      backupJMSService.setRegistry(new JndiBindingRegistry(ctx2));
 
       backupJMSService.getActiveMQServer().setIdentity("JMSBackup");
       log.info("Starting backup");
@@ -569,7 +570,7 @@ public class JMSFailoverTest extends ServiceTestBase
 
       liveJMSService = new JMSServerManagerImpl(liveService);
 
-      liveJMSService.setContext(ctx1);
+      liveJMSService.setRegistry(new JndiBindingRegistry(ctx1));
 
       liveJMSService.getActiveMQServer().setIdentity("JMSLive");
       log.info("Starting life");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
index 01a0fb3..99ff34c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
@@ -19,6 +19,7 @@ package org.apache.activemq.tests.integration.jms.cluster;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.ha.ReplicaPolicyConfiguration;
 import org.apache.activemq.core.config.ha.ReplicatedPolicyConfiguration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.core.server.ActiveMQServers;
 import org.apache.activemq.jms.server.impl.JMSServerManagerImpl;
@@ -55,7 +56,7 @@ public class ReplicatedJMSFailoverTest extends JMSFailoverTest
 
       backupJMSService = new JMSServerManagerImpl(backupService);
 
-      backupJMSService.setContext(ctx2);
+      backupJMSService.setRegistry(new JndiBindingRegistry(ctx2));
 
       backupJMSService.start();
 
@@ -74,7 +75,7 @@ public class ReplicatedJMSFailoverTest extends JMSFailoverTest
 
       liveJMSService = new JMSServerManagerImpl(liveService);
 
-      liveJMSService.setContext(ctx1);
+      liveJMSService.setRegistry(new JndiBindingRegistry(ctx1));
 
       liveJMSService.start();
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/connection/ExceptionListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/connection/ExceptionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/connection/ExceptionListenerTest.java
index f3fbfe0..7dd5f5b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/connection/ExceptionListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/connection/ExceptionListenerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.tests.integration.jms.connection;
 import org.apache.activemq.api.core.ActiveMQInternalErrorException;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
 
@@ -73,7 +74,7 @@ public class ExceptionListenerTest extends UnitTestCase
          .addAcceptorConfiguration(new TransportConfiguration("org.apache.activemq.core.remoting.impl.invm.InVMAcceptorFactory"));
       server = addServer(ActiveMQServers.newActiveMQServer(conf, false));
       jmsServer = new JMSServerManagerImpl(server);
-      jmsServer.setContext(new NullInitialContext());
+      jmsServer.setRegistry(new JndiBindingRegistry(new NullInitialContext()));
       jmsServer.start();
       jmsServer.createQueue(false, ExceptionListenerTest.Q_NAME, null, true, ExceptionListenerTest.Q_NAME);
       cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory"));

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
index bede98b..ba00340 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
@@ -26,6 +26,7 @@ import org.apache.activemq.api.core.UDPBroadcastGroupConfiguration;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.deployers.DeploymentManager;
 import org.apache.activemq.core.deployers.impl.FileDeploymentManager;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.jms.server.JMSServerManager;
@@ -157,7 +158,7 @@ public class JMSServerDeployerTest extends ServiceTestBase
 
       jmsServer = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();
-      jmsServer.setContext(context);
+      jmsServer.setRegistry(new JndiBindingRegistry(context));
       jmsServer.start();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerStartStopTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerStartStopTest.java
index 4a605ef..01815e7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerStartStopTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerStartStopTest.java
@@ -210,7 +210,7 @@ public class JMSServerStartStopTest extends UnitTestCase
 
       liveJMSServer = new JMSServerManagerImpl(liveServer, "server-start-stop-jms-config1.xml");
       addActiveMQComponent(liveJMSServer);
-      liveJMSServer.setContext(null);
+      liveJMSServer.setRegistry(null);
 
       liveJMSServer.start();
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSConfigurationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSConfigurationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSConfigurationTest.java
index 671f4fe..fa5409d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSConfigurationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSConfigurationTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.tests.integration.jms.server.config;
 
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -66,7 +67,6 @@ public class JMSConfigurationTest extends ServiceTestBase
       ActiveMQServer coreServer = new ActiveMQServerImpl(coreConfiguration);
 
       JMSConfiguration jmsConfiguration = new JMSConfigurationImpl();
-      jmsConfiguration.setContext(context);
       TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName());
       List<TransportConfiguration> transportConfigs = new ArrayList<TransportConfiguration>();
       transportConfigs.add(connectorConfig);
@@ -92,6 +92,8 @@ public class JMSConfigurationTest extends ServiceTestBase
       jmsConfiguration.getTopicConfigurations().add(topicConfig);
 
       JMSServerManager server = new JMSServerManagerImpl(coreServer, jmsConfiguration);
+
+      server.setRegistry(new JndiBindingRegistry(context));
       server.start();
 
       for (String binding : cfConfig.getBindings())

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/ConnectionFactoryControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
index 686a5e7..c0b6ae9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/ConnectionFactoryControlTest.java
@@ -20,6 +20,7 @@ import java.util.List;
 
 import javax.management.Notification;
 
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.junit.Before;
 import org.junit.After;
 import org.junit.Test;
@@ -171,7 +172,7 @@ public class ConnectionFactoryControlTest extends ManagementTestBase
 
       ctx = new InVMNamingContext();
 
-      serverManager.setContext(ctx);
+      serverManager.setRegistry(new JndiBindingRegistry(ctx));
       serverManager.activated();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java
index cfab79b..4f94ee4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlTest.java
@@ -45,6 +45,7 @@ import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.api.jms.management.JMSQueueControl;
 import org.apache.activemq.api.jms.management.JMSServerControl;
 import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
@@ -1229,7 +1230,7 @@ public class JMSQueueControlTest extends ManagementTestBase
       ActiveMQQueue testQueue = (ActiveMQQueue) ActiveMQJMSClient.createQueue(testQueueName);
 
       JMSQueueControl queueControl = createManagementControl(testQueue);
-      String[] bindings = queueControl.getJNDIBindings();
+      String[] bindings = queueControl.getRegistryBindings();
 
       String newJndi = "newTestQueueAddJndi";
 
@@ -1237,9 +1238,9 @@ public class JMSQueueControlTest extends ManagementTestBase
       {
          assertFalse(b.equals(newJndi));
       }
-      queueControl.addJNDI(newJndi);
+      queueControl.addBinding(newJndi);
 
-      bindings = queueControl.getJNDIBindings();
+      bindings = queueControl.getRegistryBindings();
       boolean newBindingAdded = false;
       for (String b : bindings)
       {
@@ -1258,7 +1259,7 @@ public class JMSQueueControlTest extends ManagementTestBase
 
       queueControl = createManagementControl(testQueue);
 
-      bindings = queueControl.getJNDIBindings();
+      bindings = queueControl.getRegistryBindings();
       newBindingAdded = false;
       for (String b : bindings)
       {
@@ -1327,7 +1328,7 @@ public class JMSQueueControlTest extends ManagementTestBase
 
       serverManager = new JMSServerManagerImpl(server);
       context = new InVMNamingContext();
-      serverManager.setContext(context);
+      serverManager.setRegistry(new JndiBindingRegistry(context));
       serverManager.start();
       serverManager.activated();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/25146112/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
index 7677786..3921cb1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
@@ -293,13 +293,13 @@ public class JMSQueueControlUsingJMSTest extends JMSQueueControlTest
             return (String)proxy.retrieveAttributeValue("selector");
          }
 
-         public void addJNDI(String jndi) throws Exception
+         public void addBinding(String jndi) throws Exception
          {
             // TODO: Add a test for this
-            proxy.invokeOperation("addJNDI", jndi);
+            proxy.invokeOperation("addBindings", jndi);
          }
 
-         public String[] getJNDIBindings()
+         public String[] getRegistryBindings()
          {
             // TODO: Add a test for this
             return null;


Mime
View raw message