You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2014/11/19 00:37:54 UTC

[01/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Repository: activemq-6
Updated Branches:
  refs/heads/master 886180293 -> 3d749a431


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/ActiveMQServerImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/ActiveMQServerImpl.java
new file mode 100644
index 0000000..2b42e72
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/ActiveMQServerImpl.java
@@ -0,0 +1,2345 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.server.impl;
+
+import javax.management.MBeanServer;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.management.ManagementFactory;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.asyncio.impl.AsynchronousFileImpl;
+import org.apache.activemq.core.client.impl.ClientSessionFactoryImpl;
+import org.apache.activemq.core.config.BridgeConfiguration;
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.config.ConfigurationUtils;
+import org.apache.activemq.core.config.CoreQueueConfiguration;
+import org.apache.activemq.core.config.DivertConfiguration;
+import org.apache.activemq.core.config.impl.ConfigurationImpl;
+import org.apache.activemq.core.deployers.Deployer;
+import org.apache.activemq.core.deployers.DeploymentManager;
+import org.apache.activemq.core.deployers.impl.AddressSettingsDeployer;
+import org.apache.activemq.core.deployers.impl.BasicUserCredentialsDeployer;
+import org.apache.activemq.core.deployers.impl.FileDeploymentManager;
+import org.apache.activemq.core.deployers.impl.QueueDeployer;
+import org.apache.activemq.core.deployers.impl.SecurityDeployer;
+import org.apache.activemq.core.filter.Filter;
+import org.apache.activemq.core.filter.impl.FilterImpl;
+import org.apache.activemq.core.journal.IOCriticalErrorListener;
+import org.apache.activemq.core.journal.JournalLoadInformation;
+import org.apache.activemq.core.journal.SequentialFile;
+import org.apache.activemq.core.journal.impl.AIOSequentialFileFactory;
+import org.apache.activemq.core.journal.impl.SyncSpeedTest;
+import org.apache.activemq.core.management.impl.ActiveMQServerControlImpl;
+import org.apache.activemq.core.paging.PagingManager;
+import org.apache.activemq.core.paging.cursor.PageSubscription;
+import org.apache.activemq.core.paging.impl.PagingManagerImpl;
+import org.apache.activemq.core.paging.impl.PagingStoreFactoryNIO;
+import org.apache.activemq.core.persistence.GroupingInfo;
+import org.apache.activemq.core.persistence.OperationContext;
+import org.apache.activemq.core.persistence.QueueBindingInfo;
+import org.apache.activemq.core.persistence.StorageManager;
+import org.apache.activemq.core.persistence.config.PersistedAddressSetting;
+import org.apache.activemq.core.persistence.config.PersistedRoles;
+import org.apache.activemq.core.persistence.impl.PageCountPending;
+import org.apache.activemq.core.persistence.impl.journal.JournalStorageManager;
+import org.apache.activemq.core.persistence.impl.journal.OperationContextImpl;
+import org.apache.activemq.core.persistence.impl.nullpm.NullStorageManager;
+import org.apache.activemq.core.postoffice.Binding;
+import org.apache.activemq.core.postoffice.PostOffice;
+import org.apache.activemq.core.postoffice.QueueBinding;
+import org.apache.activemq.core.postoffice.impl.DivertBinding;
+import org.apache.activemq.core.postoffice.impl.LocalQueueBinding;
+import org.apache.activemq.core.postoffice.impl.PostOfficeImpl;
+import org.apache.activemq.core.remoting.server.RemotingService;
+import org.apache.activemq.core.remoting.server.impl.RemotingServiceImpl;
+import org.apache.activemq.core.replication.ReplicationManager;
+import org.apache.activemq.core.security.CheckType;
+import org.apache.activemq.core.security.Role;
+import org.apache.activemq.core.security.SecurityStore;
+import org.apache.activemq.core.security.impl.SecurityStoreImpl;
+import org.apache.activemq.core.server.ActivateCallback;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
+import org.apache.activemq.core.server.Bindable;
+import org.apache.activemq.core.server.Divert;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.JournalType;
+import org.apache.activemq.core.server.LargeServerMessage;
+import org.apache.activemq.core.server.MemoryManager;
+import org.apache.activemq.core.server.NodeManager;
+import org.apache.activemq.core.server.Queue;
+import org.apache.activemq.core.server.QueueFactory;
+import org.apache.activemq.core.server.ServerSession;
+import org.apache.activemq.core.server.ServerSessionFactory;
+import org.apache.activemq.core.server.cluster.BackupManager;
+import org.apache.activemq.core.server.cluster.ClusterManager;
+import org.apache.activemq.core.server.cluster.Transformer;
+import org.apache.activemq.core.server.cluster.ha.HAPolicy;
+import org.apache.activemq.core.server.group.GroupingHandler;
+import org.apache.activemq.core.server.group.impl.GroupingHandlerConfiguration;
+import org.apache.activemq.core.server.group.impl.LocalGroupingHandler;
+import org.apache.activemq.core.server.group.impl.RemoteGroupingHandler;
+import org.apache.activemq.core.server.management.ManagementService;
+import org.apache.activemq.core.server.management.impl.ManagementServiceImpl;
+import org.apache.activemq.core.settings.HierarchicalRepository;
+import org.apache.activemq.core.settings.impl.AddressSettings;
+import org.apache.activemq.core.settings.impl.HierarchicalObjectRepository;
+import org.apache.activemq.core.transaction.ResourceManager;
+import org.apache.activemq.core.transaction.impl.ResourceManagerImpl;
+import org.apache.activemq.core.version.Version;
+import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
+import org.apache.activemq.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.spi.core.protocol.SessionCallback;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
+import org.apache.activemq.utils.ClassloadingUtil;
+import org.apache.activemq.utils.ConcurrentHashSet;
+import org.apache.activemq.utils.ExecutorFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
+import org.apache.activemq.utils.OrderedExecutorFactory;
+import org.apache.activemq.utils.ReusableLatch;
+import org.apache.activemq.utils.SecurityFormatter;
+import org.apache.activemq.utils.VersionLoader;
+
+/**
+ * The ActiveMQ server implementation
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ataylor@redhat.com>Andy Taylor</a>
+ * @author <a href="mailto:mtaylor@redhat.com>Martyn Taylor</a>
+ */
+public class ActiveMQServerImpl implements ActiveMQServer
+{
+   /**
+    * JMS Topics (which are outside of the scope of the core API) will require a dumb subscription
+    * with a dummy-filter at this current version as a way to keep its existence valid and TCK
+    * tests. That subscription needs an invalid filter, however paging needs to ignore any
+    * subscription with this filter. For that reason, this filter needs to be rejected on paging or
+    * any other component on the system, and just be ignored for any purpose It's declared here as
+    * this filter is considered a global ignore
+    */
+   public static final String GENERIC_IGNORED_FILTER = "__HQX=-1";
+
+   private HAPolicy haPolicy;
+
+   enum SERVER_STATE
+   {
+      /**
+       * start() has been called but components are not initialized. The whole point of this state,
+       * is to be in a state which is different from {@link SERVER_STATE#STARTED} and
+       * {@link SERVER_STATE#STOPPED}, so that methods testing for these two values such as
+       * {@link #stop(boolean)} worked as intended.
+       */
+      STARTING,
+      /**
+       * server is started. {@code server.isStarted()} returns {@code true}, and all assumptions
+       * about it hold.
+       */
+      STARTED,
+      /**
+       * stop() was called but has not finished yet. Meant to avoids starting components while
+       * stop() is executing.
+       */
+      STOPPING,
+      /**
+       * Stopped: either stop() has been called and has finished running, or start() has never been
+       * called.
+       */
+      STOPPED;
+   }
+
+   private volatile SERVER_STATE state = SERVER_STATE.STOPPED;
+
+   private final Version version;
+
+   private final ActiveMQSecurityManager securityManager;
+
+   private final Configuration configuration;
+
+   private final MBeanServer mbeanServer;
+
+   private volatile SecurityStore securityStore;
+
+   private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
+
+   private volatile QueueFactory queueFactory;
+
+   private volatile PagingManager pagingManager;
+
+   private volatile PostOffice postOffice;
+
+   private volatile ExecutorService threadPool;
+
+   private volatile ScheduledExecutorService scheduledPool;
+
+   private volatile ExecutorFactory executorFactory;
+
+   private final HierarchicalRepository<Set<Role>> securityRepository;
+
+   private volatile ResourceManager resourceManager;
+
+   private volatile ActiveMQServerControlImpl messagingServerControl;
+
+   private volatile ClusterManager clusterManager;
+
+   private volatile BackupManager backupManager;
+
+   private volatile StorageManager storageManager;
+
+   private volatile RemotingService remotingService;
+
+   private final List<ProtocolManagerFactory> protocolManagerFactories = new ArrayList<>();
+
+   private volatile ManagementService managementService;
+
+   private volatile ConnectorsService connectorsService;
+
+   private MemoryManager memoryManager;
+
+   private volatile DeploymentManager deploymentManager;
+
+   private Deployer basicUserCredentialsDeployer;
+   private Deployer addressSettingsDeployer;
+   private Deployer queueDeployer;
+   private Deployer securityDeployer;
+
+   private final Map<String, ServerSession> sessions = new ConcurrentHashMap<String, ServerSession>();
+
+   /**
+    * This class here has the same principle of CountDownLatch but you can reuse the counters.
+    * It's based on the same super classes of {@code CountDownLatch}
+    */
+   private final ReusableLatch activationLatch = new ReusableLatch(0);
+
+   private final Set<ActivateCallback> activateCallbacks = new ConcurrentHashSet<ActivateCallback>();
+
+   private volatile GroupingHandler groupingHandler;
+
+   private NodeManager nodeManager;
+
+   // Used to identify the server on tests... useful on debugging testcases
+   private String identity;
+
+   private Thread backupActivationThread;
+
+   private Activation activation;
+
+   private Map<String, Object> activationParams = new HashMap<>();
+
+   private final ShutdownOnCriticalErrorListener shutdownOnCriticalIO = new ShutdownOnCriticalErrorListener();
+
+   private final ActiveMQServer parentServer;
+
+   //todo think about moving this to the activation
+   private final List<SimpleString> scaledDownNodeIDs = new ArrayList<>();
+
+   private boolean threadPoolSupplied = false;
+
+   private boolean scheduledPoolSupplied = false;
+
+   private ServiceRegistry serviceRegistry;
+
+   // Constructors
+   // ---------------------------------------------------------------------------------
+
+   public ActiveMQServerImpl()
+   {
+      this(null, null, null);
+   }
+
+   public ActiveMQServerImpl(final Configuration configuration)
+   {
+      this(configuration, null, null);
+   }
+
+   public ActiveMQServerImpl(final Configuration configuration, ActiveMQServer parentServer)
+   {
+      this(configuration, null, null, parentServer);
+   }
+
+   public ActiveMQServerImpl(final Configuration configuration, final MBeanServer mbeanServer)
+   {
+      this(configuration, mbeanServer, null);
+   }
+
+   public ActiveMQServerImpl(final Configuration configuration, final ActiveMQSecurityManager securityManager)
+   {
+      this(configuration, null, securityManager);
+   }
+
+   public ActiveMQServerImpl(Configuration configuration,
+                             MBeanServer mbeanServer,
+                             final ActiveMQSecurityManager securityManager)
+   {
+      this(configuration, mbeanServer, securityManager, null);
+   }
+
+   public ActiveMQServerImpl(Configuration configuration,
+                             MBeanServer mbeanServer,
+                             final ActiveMQSecurityManager securityManager,
+                             final ActiveMQServer parentServer)
+   {
+      this(configuration, mbeanServer, securityManager, parentServer, null);
+   }
+
+   public ActiveMQServerImpl(Configuration configuration,
+                             MBeanServer mbeanServer,
+                             final ActiveMQSecurityManager securityManager,
+                             final ActiveMQServer parentServer,
+                             final ServiceRegistry serviceRegistry)
+   {
+      if (configuration == null)
+      {
+         configuration = new ConfigurationImpl();
+      }
+      if (mbeanServer == null)
+      {
+         // Just use JVM mbean server
+         mbeanServer = ManagementFactory.getPlatformMBeanServer();
+      }
+
+      // We need to hard code the version information into a source file
+
+      version = VersionLoader.getVersion();
+
+      this.configuration = configuration;
+
+      this.mbeanServer = mbeanServer;
+
+      this.securityManager = securityManager;
+
+      addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>();
+
+      addressSettingsRepository.setDefault(new AddressSettings());
+
+      securityRepository = new HierarchicalObjectRepository<Set<Role>>();
+
+      securityRepository.setDefault(new HashSet<Role>());
+
+      this.parentServer = parentServer;
+
+      this.serviceRegistry = serviceRegistry == null ?  new ServiceRegistry() : serviceRegistry;
+   }
+
+   // life-cycle methods
+   // ----------------------------------------------------------------
+
+   /*
+    * Can be overridden for tests
+    */
+   protected NodeManager createNodeManager(final String directory, boolean replicatingBackup)
+   {
+      NodeManager manager;
+      if (!configuration.isPersistenceEnabled())
+      {
+         manager = new InVMNodeManager(replicatingBackup);
+      }
+      else if (configuration.getJournalType() == JournalType.ASYNCIO && AsynchronousFileImpl.isLoaded())
+      {
+         manager = new AIOFileLockNodeManager(directory, replicatingBackup, configuration.getJournalLockAcquisitionTimeout());
+      }
+      else
+      {
+         manager = new FileLockNodeManager(directory, replicatingBackup, configuration.getJournalLockAcquisitionTimeout());
+      }
+      return manager;
+   }
+
+   public final synchronized void start() throws Exception
+   {
+      if (state != SERVER_STATE.STOPPED)
+      {
+         ActiveMQServerLogger.LOGGER.debug("Server already started!");
+         return;
+      }
+
+      state = SERVER_STATE.STARTING;
+
+      if (haPolicy == null)
+      {
+         haPolicy = ConfigurationUtils.getHAPolicy(configuration.getHAPolicyConfiguration());
+      }
+
+      activationLatch.setCount(1);
+
+      ActiveMQServerLogger.LOGGER.debug("Starting server " + this);
+
+      OperationContextImpl.clearContext();
+
+      try
+      {
+         checkJournalDirectory();
+
+         nodeManager = createNodeManager(configuration.getJournalDirectory(), false);
+
+         nodeManager.start();
+
+         ActiveMQServerLogger.LOGGER.serverStarting((haPolicy.isBackup() ? "backup" : "live"), configuration);
+
+         if (configuration.isRunSyncSpeedTest())
+         {
+            SyncSpeedTest test = new SyncSpeedTest();
+
+            test.run();
+         }
+
+         final boolean wasLive = !haPolicy.isBackup();
+         if (!haPolicy.isBackup())
+         {
+            activation = haPolicy.createActivation(this, false, activationParams, shutdownOnCriticalIO);
+
+            activation.run();
+         }
+         // The activation on fail-back may change the value of isBackup, for that reason we are
+         // checking again here
+         if (haPolicy.isBackup())
+         {
+            if (haPolicy.isSharedStore())
+            {
+               activation = haPolicy.createActivation(this, false, activationParams, shutdownOnCriticalIO);
+            }
+            else
+            {
+               activation = haPolicy.createActivation(this, wasLive, activationParams, shutdownOnCriticalIO);
+            }
+
+            backupActivationThread = new Thread(activation, ActiveMQMessageBundle.BUNDLE.activationForServer(this));
+            backupActivationThread.start();
+         }
+         else
+         {
+            state = SERVER_STATE.STARTED;
+            ActiveMQServerLogger.LOGGER.serverStarted(getVersion().getFullVersion(), nodeManager.getNodeId(),
+                                                     identity != null ? identity : "");
+         }
+         // start connector service
+         connectorsService = new ConnectorsService(configuration, storageManager, scheduledPool, postOffice, serviceRegistry);
+         connectorsService.start();
+      }
+      finally
+      {
+         // this avoids embedded applications using dirty contexts from startup
+         OperationContextImpl.clearContext();
+      }
+   }
+
+   @Override
+   protected final void finalize() throws Throwable
+   {
+      if (state != SERVER_STATE.STOPPED)
+      {
+         ActiveMQServerLogger.LOGGER.serverFinalisedWIthoutBeingSTopped();
+
+         stop();
+      }
+
+      super.finalize();
+   }
+
+   public void setState(SERVER_STATE state)
+   {
+      this.state = state;
+   }
+
+   public SERVER_STATE getState()
+   {
+      return state;
+   }
+
+   public void interrupBackupThread(NodeManager nodeManagerInUse) throws InterruptedException
+   {
+      long timeout = 30000;
+
+      long start = System.currentTimeMillis();
+
+      while (backupActivationThread.isAlive() && System.currentTimeMillis() - start < timeout)
+      {
+         if (nodeManagerInUse != null)
+         {
+            nodeManagerInUse.interrupt();
+         }
+
+         backupActivationThread.interrupt();
+
+         backupActivationThread.join(1000);
+
+      }
+
+      if (System.currentTimeMillis() - start >= timeout)
+      {
+         threadDump("Timed out waiting for backup activation to exit");
+      }
+   }
+
+   public void resetNodeManager() throws Exception
+   {
+      nodeManager.stop();
+      nodeManager =
+            createNodeManager(configuration.getJournalDirectory(), true);
+   }
+
+   public Activation getActivation()
+   {
+      return activation;
+   }
+
+   @Override
+   public HAPolicy getHAPolicy()
+   {
+      return haPolicy;
+   }
+
+   @Override
+   public void setHAPolicy(HAPolicy haPolicy)
+   {
+      this.haPolicy = haPolicy;
+   }
+
+   public ExecutorService getThreadPool()
+   {
+      return threadPool;
+   }
+
+   public void setActivation(SharedNothingLiveActivation activation)
+   {
+      this.activation = activation;
+   }
+   /**
+    * Stops the server in a different thread.
+    */
+   public final void stopTheServer(final boolean criticalIOError)
+   {
+      ExecutorService executor = Executors.newSingleThreadExecutor();
+      executor.submit(new Runnable()
+      {
+         @Override
+         public void run()
+         {
+            try
+            {
+               stop(false, criticalIOError, false);
+            }
+            catch (Exception e)
+            {
+               ActiveMQServerLogger.LOGGER.errorStoppingServer(e);
+            }
+         }
+      });
+   }
+
+   public final void stop() throws Exception
+   {
+      stop(false);
+   }
+
+   public void addActivationParam(String key, Object val)
+   {
+      activationParams.put(key, val);
+   }
+   @Override
+   public boolean isAddressBound(String address) throws Exception
+   {
+      return postOffice.isAddressBound(SimpleString.toSimpleString(address));
+   }
+
+   public void threadDump(final String reason)
+   {
+      StringWriter str = new StringWriter();
+      PrintWriter out = new PrintWriter(str);
+
+      Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
+
+      out.println(ActiveMQMessageBundle.BUNDLE.generatingThreadDump(reason));
+      out.println("*******************************************************************************");
+
+      for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
+      {
+         out.println("===============================================================================");
+         out.println(ActiveMQMessageBundle.BUNDLE.threadDump(el.getKey(), el.getKey().getName(), el.getKey().getId(), el.getKey().getThreadGroup()));
+         out.println();
+         for (StackTraceElement traceEl : el.getValue())
+         {
+            out.println(traceEl);
+         }
+      }
+
+      out.println("===============================================================================");
+      out.println(ActiveMQMessageBundle.BUNDLE.endThreadDump());
+      out.println("*******************************************************************************");
+
+      ActiveMQServerLogger.LOGGER.warn(str.toString());
+   }
+
+   public final void stop(boolean failoverOnServerShutdown) throws Exception
+   {
+      stop(failoverOnServerShutdown, false, false);
+   }
+
+   /**
+    * Stops the server
+    * @param criticalIOError          whether we have encountered an IO error with the journal etc
+    */
+   void stop(boolean failoverOnServerShutdown, final boolean criticalIOError, boolean restarting) throws Exception
+   {
+      synchronized (this)
+      {
+         if (state == SERVER_STATE.STOPPED || state == SERVER_STATE.STOPPING)
+         {
+            return;
+         }
+         state = SERVER_STATE.STOPPING;
+
+         activation.sendLiveIsStopping();
+
+         stopComponent(connectorsService);
+
+         // we stop the groupingHandler before we stop the cluster manager so binding mappings
+         // aren't removed in case of failover
+         if (groupingHandler != null)
+         {
+            managementService.removeNotificationListener(groupingHandler);
+            groupingHandler.stop();
+         }
+         stopComponent(clusterManager);
+
+         freezeConnections();
+      }
+
+      activation.postConnectionFreeze();
+
+      closeAllServerSessions(criticalIOError);
+
+      // *************************************************************************************************************
+      // There's no need to sync this part of the method, since the state stopped | stopping is checked within the sync
+      //
+      // we can't synchronized the whole method here as that would cause a deadlock
+      // so stop is checking for stopped || stopping inside the lock
+      // which will be already enough to guarantee that no other thread will be accessing this method here.
+      //
+      // *************************************************************************************************************
+
+      if (storageManager != null)
+         storageManager.clearContext();
+
+      //before we stop any components deactivate any callbacks
+      callDeActiveCallbacks();
+
+      // Stop the deployers
+      if (configuration.isFileDeploymentEnabled())
+      {
+         stopComponent(basicUserCredentialsDeployer);
+         stopComponent(addressSettingsDeployer);
+         stopComponent(queueDeployer);
+         stopComponent(securityDeployer);
+         stopComponent(deploymentManager);
+      }
+
+      stopComponent(backupManager);
+      activation.preStorageClose();
+      stopComponent(pagingManager);
+
+      if (storageManager != null)
+         storageManager.stop(criticalIOError);
+
+      // We stop remotingService before otherwise we may lock the system in case of a critical IO
+      // error shutdown
+      if (remotingService != null)
+         remotingService.stop(criticalIOError);
+
+      // Stop the management service after the remoting service to ensure all acceptors are deregistered with JMX
+      if (managementService != null)
+         managementService.unregisterServer();
+      stopComponent(managementService);
+
+      stopComponent(securityManager);
+      stopComponent(resourceManager);
+
+      stopComponent(postOffice);
+
+      if (scheduledPool != null && !scheduledPoolSupplied)
+      {
+         // we just interrupt all running tasks, these are supposed to be pings and the like.
+         scheduledPool.shutdownNow();
+      }
+
+      stopComponent(memoryManager);
+
+      if (threadPool != null && !threadPoolSupplied)
+      {
+         threadPool.shutdown();
+         try
+         {
+            if (!threadPool.awaitTermination(10, TimeUnit.SECONDS))
+            {
+               ActiveMQServerLogger.LOGGER.timedOutStoppingThreadpool(threadPool);
+               for (Runnable r : threadPool.shutdownNow())
+               {
+                  ActiveMQServerLogger.LOGGER.debug("Cancelled the execution of " + r);
+               }
+            }
+         }
+         catch (InterruptedException e)
+         {
+            // Ignore
+         }
+      }
+
+      if (!threadPoolSupplied) threadPool = null;
+      if (!scheduledPoolSupplied) scheduledPool = null;
+
+      if (securityStore != null)
+         securityStore.stop();
+
+      pagingManager = null;
+      securityStore = null;
+      resourceManager = null;
+      postOffice = null;
+      queueFactory = null;
+      resourceManager = null;
+      messagingServerControl = null;
+      memoryManager = null;
+      backupManager = null;
+
+      sessions.clear();
+
+      state = SERVER_STATE.STOPPED;
+
+      activationLatch.setCount(1);
+
+      // to display in the log message
+      SimpleString tempNodeID = getNodeID();
+      if (activation != null)
+      {
+         activation.close(failoverOnServerShutdown, restarting);
+      }
+      if (backupActivationThread != null)
+      {
+
+         backupActivationThread.join(30000);
+         if (backupActivationThread.isAlive())
+         {
+            ActiveMQServerLogger.LOGGER.backupActivationDidntFinish(this);
+            backupActivationThread.interrupt();
+         }
+      }
+
+      stopComponent(nodeManager);
+
+      nodeManager = null;
+
+      addressSettingsRepository.clearListeners();
+
+      addressSettingsRepository.clearCache();
+
+      scaledDownNodeIDs.clear();
+
+      if (identity != null)
+      {
+         ActiveMQServerLogger.LOGGER.serverStopped("identity=" + identity + ",version=" + getVersion().getFullVersion(),
+                                                  tempNodeID);
+      }
+      else
+      {
+         ActiveMQServerLogger.LOGGER.serverStopped(getVersion().getFullVersion(), tempNodeID);
+      }
+   }
+
+
+
+   public boolean checkLiveIsNotColocated(String nodeId)
+   {
+      if (parentServer == null)
+      {
+         return true;
+      }
+      else
+      {
+         return !parentServer.getNodeID().toString().equals(nodeId);
+      }
+   }
+
+   /**
+    * Freeze all connections.
+    * <p/>
+    * If replicating, avoid freezing the replication connection. Helper method for
+    * {@link #stop(boolean, boolean, boolean)}.
+    */
+   private void freezeConnections()
+   {
+      activation.freezeConnections(remotingService);
+
+      // after disconnecting all the clients close all the server sessions so any messages in delivery will be cancelled back to the queue
+      for (ServerSession serverSession : sessions.values())
+      {
+         try
+         {
+            serverSession.close(true);
+         }
+         catch (Exception e)
+         {
+            e.printStackTrace();
+         }
+      }
+   }
+
+   /**
+    * We close all the exception in an attempt to let any pending IO to finish to avoid scenarios
+    * where the send or ACK got to disk but the response didn't get to the client It may still be
+    * possible to have this scenario on a real failure (without the use of XA) But at least we will
+    * do our best to avoid it on regular shutdowns
+    */
+   private void closeAllServerSessions(final boolean criticalIOError)
+   {
+      if (state != SERVER_STATE.STOPPING)
+      {
+         return;
+      }
+      for (ServerSession session : sessions.values())
+      {
+         try
+         {
+            session.close(true);
+         }
+         catch (Exception e)
+         {
+            // If anything went wrong with closing sessions.. we should ignore it
+            // such as transactions.. etc.
+            ActiveMQServerLogger.LOGGER.errorClosingSessionsWhileStoppingServer(e);
+         }
+      }
+      if (!criticalIOError)
+      {
+         for (ServerSession session : sessions.values())
+         {
+            try
+            {
+               session.waitContextCompletion();
+            }
+            catch (Exception e)
+            {
+               ActiveMQServerLogger.LOGGER.errorClosingSessionsWhileStoppingServer(e);
+            }
+         }
+      }
+
+   }
+
+   static void stopComponent(ActiveMQComponent component) throws Exception
+   {
+      if (component != null)
+         component.stop();
+   }
+
+   // ActiveMQServer implementation
+   // -----------------------------------------------------------
+
+   public String describe()
+   {
+      StringWriter str = new StringWriter();
+      PrintWriter out = new PrintWriter(str);
+
+      out.println(ActiveMQMessageBundle.BUNDLE.serverDescribe(identity, getClusterManager().describe()));
+
+      return str.toString();
+   }
+
+   public String destroyConnectionWithSessionMetadata(String metaKey, String parameterValue) throws Exception
+   {
+      StringBuffer operationsExecuted = new StringBuffer();
+
+      try
+      {
+         operationsExecuted.append("**************************************************************************************************\n");
+         operationsExecuted.append(ActiveMQMessageBundle.BUNDLE.destroyConnectionWithSessionMetadataHeader(metaKey, parameterValue) + "\n");
+
+         Set<ServerSession> allSessions = getSessions();
+
+         ServerSession sessionFound = null;
+         for (ServerSession session : allSessions)
+         {
+            try
+            {
+               String value = session.getMetaData(metaKey);
+               if (value != null && value.equals(parameterValue))
+               {
+                  sessionFound = session;
+                  operationsExecuted.append(ActiveMQMessageBundle.BUNDLE.destroyConnectionWithSessionMetadataClosingConnection(sessionFound.toString()) + "\n");
+                  RemotingConnection conn = session.getRemotingConnection();
+                  if (conn != null)
+                  {
+                     conn.fail(ActiveMQMessageBundle.BUNDLE.destroyConnectionWithSessionMetadataSendException(metaKey, parameterValue));
+                  }
+                  session.close(true);
+                  sessions.remove(session.getName());
+               }
+            }
+            catch (Throwable e)
+            {
+               ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
+            }
+         }
+
+         if (sessionFound == null)
+         {
+            operationsExecuted.append(ActiveMQMessageBundle.BUNDLE.destroyConnectionWithSessionMetadataNoSessionFound(metaKey, parameterValue) + "\n");
+         }
+
+         operationsExecuted.append("**************************************************************************************************");
+
+         return operationsExecuted.toString();
+      }
+      finally
+      {
+         // This operation is critical for the knowledge of the admin, so we need to add info logs for later knowledge
+         ActiveMQServerLogger.LOGGER.info(operationsExecuted.toString());
+      }
+
+   }
+
+   public void setIdentity(String identity)
+   {
+      this.identity = identity;
+   }
+
+   public String getIdentity()
+   {
+      return identity;
+   }
+
+   public ScheduledExecutorService getScheduledPool()
+   {
+      return scheduledPool;
+   }
+
+   public Configuration getConfiguration()
+   {
+      return configuration;
+   }
+
+   public PagingManager getPagingManager()
+   {
+      return pagingManager;
+   }
+
+   public RemotingService getRemotingService()
+   {
+      return remotingService;
+   }
+
+   public StorageManager getStorageManager()
+   {
+      return storageManager;
+   }
+
+   public ActiveMQSecurityManager getSecurityManager()
+   {
+      return securityManager;
+   }
+
+   public ManagementService getManagementService()
+   {
+      return managementService;
+   }
+
+   public HierarchicalRepository<Set<Role>> getSecurityRepository()
+   {
+      return securityRepository;
+   }
+
+   public NodeManager getNodeManager()
+   {
+      return nodeManager;
+   }
+
+   public HierarchicalRepository<AddressSettings> getAddressSettingsRepository()
+   {
+      return addressSettingsRepository;
+   }
+
+   public DeploymentManager getDeploymentManager()
+   {
+      return deploymentManager;
+   }
+
+   public ResourceManager getResourceManager()
+   {
+      return resourceManager;
+   }
+
+   public Version getVersion()
+   {
+      return version;
+   }
+
+   public boolean isStarted()
+   {
+      return state == SERVER_STATE.STARTED;
+   }
+
+   public ClusterManager getClusterManager()
+   {
+      return clusterManager;
+   }
+
+   public BackupManager getBackupManager()
+   {
+      return backupManager;
+   }
+
+   public ServerSession createSession(final String name,
+                                      final String username,
+                                      final String password,
+                                      final int minLargeMessageSize,
+                                      final RemotingConnection connection,
+                                      final boolean autoCommitSends,
+                                      final boolean autoCommitAcks,
+                                      final boolean preAcknowledge,
+                                      final boolean xa,
+                                      final String defaultAddress,
+                                      final SessionCallback callback,
+                                      final ServerSessionFactory sessionFactory) throws Exception
+   {
+
+      if (securityStore != null)
+      {
+         securityStore.authenticate(username, password);
+      }
+      final OperationContext context = storageManager.newContext(getExecutorFactory().getExecutor());
+      final ServerSessionImpl session = internalCreateSession(name, username, password, minLargeMessageSize, connection, autoCommitSends, autoCommitAcks, preAcknowledge, xa, defaultAddress, callback, context, sessionFactory);
+
+      sessions.put(name, session);
+
+      return session;
+   }
+
+   protected ServerSessionImpl internalCreateSession(String name, String username, String password, int minLargeMessageSize, RemotingConnection connection, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, boolean xa, String defaultAddress, SessionCallback callback, OperationContext context, ServerSessionFactory sessionFactory) throws Exception
+   {
+      if (sessionFactory == null)
+      {
+         return new ServerSessionImpl(name,
+                                   username,
+                                   password,
+                                   minLargeMessageSize,
+                                   autoCommitSends,
+                                   autoCommitAcks,
+                                   preAcknowledge,
+                                   configuration.isPersistDeliveryCountBeforeDelivery(),
+                                   xa,
+                                   connection,
+                                   storageManager,
+                                   postOffice,
+                                   resourceManager,
+                                   securityStore,
+                                   managementService,
+                                   this,
+                                   configuration.getManagementAddress(),
+                                   defaultAddress == null ? null
+                                      : new SimpleString(defaultAddress),
+                                   callback,
+                                   context);
+      }
+      else
+      {
+         return sessionFactory.createCoreSession(name,
+                                   username,
+                                   password,
+                                   minLargeMessageSize,
+                                   autoCommitSends,
+                                   autoCommitAcks,
+                                   preAcknowledge,
+                                   configuration.isPersistDeliveryCountBeforeDelivery(),
+                                   xa,
+                                   connection,
+                                   storageManager,
+                                   postOffice,
+                                   resourceManager,
+                                   securityStore,
+                                   managementService,
+                                   this,
+                                   configuration.getManagementAddress(),
+                                   defaultAddress == null ? null
+                                      : new SimpleString(defaultAddress),
+                                   callback,
+                                   context);
+      }
+   }
+
+   @Override
+   public SecurityStore getSecurityStore()
+   {
+      return securityStore;
+   }
+
+   public void removeSession(final String name) throws Exception
+   {
+      sessions.remove(name);
+   }
+
+   public ServerSession lookupSession(String key, String value)
+   {
+      // getSessions is called here in a try to minimize locking the Server while this check is being done
+      Set<ServerSession> allSessions = getSessions();
+
+      for (ServerSession session : allSessions)
+      {
+         String metaValue = session.getMetaData(key);
+         if (metaValue != null && metaValue.equals(value))
+         {
+            return session;
+         }
+      }
+
+      return null;
+   }
+
+   public synchronized List<ServerSession> getSessions(final String connectionID)
+   {
+      Set<Entry<String, ServerSession>> sessionEntries = sessions.entrySet();
+      List<ServerSession> matchingSessions = new ArrayList<ServerSession>();
+      for (Entry<String, ServerSession> sessionEntry : sessionEntries)
+      {
+         ServerSession serverSession = sessionEntry.getValue();
+         if (serverSession.getConnectionID().toString().equals(connectionID))
+         {
+            matchingSessions.add(serverSession);
+         }
+      }
+      return matchingSessions;
+   }
+
+   public synchronized Set<ServerSession> getSessions()
+   {
+      return new HashSet<ServerSession>(sessions.values());
+   }
+
+   @Override
+   public boolean isActive()
+   {
+      return activationLatch.getCount() < 1;
+   }
+
+   @Override
+   public boolean waitForActivation(long timeout, TimeUnit unit) throws InterruptedException
+   {
+      return activationLatch.await(timeout, unit);
+   }
+
+
+   public ActiveMQServerControlImpl getActiveMQServerControl()
+   {
+      return messagingServerControl;
+   }
+
+   public int getConnectionCount()
+   {
+      return remotingService.getConnections().size();
+   }
+
+   public PostOffice getPostOffice()
+   {
+      return postOffice;
+   }
+
+   public QueueFactory getQueueFactory()
+   {
+      return queueFactory;
+   }
+
+   public SimpleString getNodeID()
+   {
+      return nodeManager == null ? null : nodeManager.getNodeId();
+   }
+
+   public Queue createQueue(final SimpleString address,
+                            final SimpleString queueName,
+                            final SimpleString filterString,
+                            final boolean durable,
+                            final boolean temporary) throws Exception
+   {
+      return createQueue(address, queueName, filterString, durable, temporary, false, false);
+   }
+
+
+   /**
+    * Creates a transient queue. A queue that will exist as long as there are consumers.
+    * The queue will be deleted as soon as all the consumers are removed.
+    * <p/>
+    * Notice: the queue won't be deleted until the first consumer arrives.
+    *
+    * @param address
+    * @param name
+    * @param filterString
+    * @param durable
+    * @throws Exception
+    */
+   public void createSharedQueue(final SimpleString address,
+                                 final SimpleString name,
+                                 final SimpleString filterString,
+                                 boolean durable) throws Exception
+   {
+      Queue queue = createQueue(address, name, filterString, durable, !durable, true, !durable);
+
+      if (!queue.getAddress().equals(address))
+      {
+         throw ActiveMQMessageBundle.BUNDLE.queueSubscriptionBelongsToDifferentAddress(name);
+      }
+
+      if (filterString != null && (queue.getFilter() == null || !queue.getFilter().getFilterString().equals(filterString)) ||
+         filterString == null && queue.getFilter() != null)
+      {
+         throw ActiveMQMessageBundle.BUNDLE.queueSubscriptionBelongsToDifferentFilter(name);
+      }
+
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQServerLogger.LOGGER.debug("Transient Queue " + name + " created on address " + name +
+                                             " with filter=" + filterString);
+      }
+
+   }
+
+
+   public Queue locateQueue(SimpleString queueName) throws Exception
+   {
+      Binding binding = postOffice.getBinding(queueName);
+
+      if (binding == null)
+      {
+         return null;
+      }
+
+      Bindable queue = binding.getBindable();
+
+      if (!(queue instanceof Queue))
+      {
+         throw new IllegalStateException("locateQueue should only be used to locate queues");
+      }
+
+      return (Queue) binding.getBindable();
+   }
+
+   public Queue deployQueue(final SimpleString address,
+                            final SimpleString queueName,
+                            final SimpleString filterString,
+                            final boolean durable,
+                            final boolean temporary) throws Exception
+   {
+      ActiveMQServerLogger.LOGGER.deployQueue(queueName);
+
+      return createQueue(address, queueName, filterString, durable, temporary, true, false);
+   }
+
+   public void destroyQueue(final SimpleString queueName) throws Exception
+   {
+      // The session is passed as an argument to verify if the user has authorization to delete the queue
+      // in some cases (such as temporary queues) this should happen regardless of the authorization
+      // since that will only happen during a session close, which will be used to cleanup on temporary queues
+      destroyQueue(queueName, null, true);
+   }
+
+   public void destroyQueue(final SimpleString queueName, final ServerSession session) throws Exception
+   {
+      destroyQueue(queueName, session, true);
+   }
+
+   public void destroyQueue(final SimpleString queueName, final ServerSession session, final boolean checkConsumerCount) throws Exception
+   {
+      destroyQueue(queueName, session, checkConsumerCount, false);
+   }
+
+   public void destroyQueue(final SimpleString queueName, final ServerSession session, final boolean checkConsumerCount, final boolean removeConsumers) throws Exception
+   {
+      addressSettingsRepository.clearCache();
+
+      Binding binding = postOffice.getBinding(queueName);
+
+      if (binding == null)
+      {
+         throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(queueName);
+      }
+
+      Queue queue = (Queue) binding.getBindable();
+
+      // This check is only valid if checkConsumerCount == true
+      if (checkConsumerCount && queue.getConsumerCount() != 0)
+      {
+         throw ActiveMQMessageBundle.BUNDLE.cannotDeleteQueue(queue.getName(), queueName, binding.getClass().getName());
+      }
+
+      if (session != null)
+      {
+
+         if (queue.isDurable())
+         {
+            // make sure the user has privileges to delete this queue
+            securityStore.check(binding.getAddress(), CheckType.DELETE_DURABLE_QUEUE, session);
+         }
+         else
+         {
+            securityStore.check(binding.getAddress(), CheckType.DELETE_NON_DURABLE_QUEUE, session);
+         }
+      }
+
+      queue.deleteQueue(removeConsumers);
+   }
+
+
+   public void registerActivateCallback(final ActivateCallback callback)
+   {
+      activateCallbacks.add(callback);
+   }
+
+   public void unregisterActivateCallback(final ActivateCallback callback)
+   {
+      activateCallbacks.remove(callback);
+   }
+
+   public ExecutorFactory getExecutorFactory()
+   {
+      return executorFactory;
+   }
+
+   public void setGroupingHandler(final GroupingHandler groupingHandler)
+   {
+      if (this.groupingHandler != null && managementService != null)
+      {
+         // Removing old groupNotification
+         managementService.removeNotificationListener(this.groupingHandler);
+      }
+      this.groupingHandler = groupingHandler;
+      if (managementService != null)
+      {
+         managementService.addNotificationListener(this.groupingHandler);
+      }
+
+   }
+
+   public GroupingHandler getGroupingHandler()
+   {
+      return groupingHandler;
+   }
+
+   public ReplicationManager getReplicationManager()
+   {
+      return activation.getReplicationManager();
+   }
+
+   public ConnectorsService getConnectorsService()
+   {
+      return connectorsService;
+   }
+
+   public void deployDivert(DivertConfiguration config) throws Exception
+   {
+      if (config.getName() == null)
+      {
+         ActiveMQServerLogger.LOGGER.divertWithNoName();
+
+         return;
+      }
+
+      if (config.getAddress() == null)
+      {
+         ActiveMQServerLogger.LOGGER.divertWithNoAddress();
+
+         return;
+      }
+
+      if (config.getForwardingAddress() == null)
+      {
+         ActiveMQServerLogger.LOGGER.divertWithNoForwardingAddress();
+
+         return;
+      }
+
+      SimpleString sName = new SimpleString(config.getName());
+
+      if (postOffice.getBinding(sName) != null)
+      {
+         ActiveMQServerLogger.LOGGER.divertBindingNotExists(sName);
+
+         return;
+      }
+
+      SimpleString sAddress = new SimpleString(config.getAddress());
+
+      Transformer transformer = instantiateTransformer(config.getTransformerClassName());
+
+      Filter filter = FilterImpl.createFilter(config.getFilterString());
+
+      Divert divert = new DivertImpl(new SimpleString(config.getForwardingAddress()),
+                                     sName,
+                                     new SimpleString(config.getRoutingName()),
+                                     config.isExclusive(),
+                                     filter,
+                                     transformer,
+                                     postOffice,
+                                     storageManager);
+
+      Binding binding = new DivertBinding(storageManager.generateID(), sAddress, divert);
+
+      postOffice.addBinding(binding);
+
+      managementService.registerDivert(divert, config);
+   }
+
+   public void destroyDivert(SimpleString name) throws Exception
+   {
+      Binding binding = postOffice.getBinding(name);
+      if (binding == null)
+      {
+         throw ActiveMQMessageBundle.BUNDLE.noBindingForDivert(name);
+      }
+      if (!(binding instanceof DivertBinding))
+      {
+         throw ActiveMQMessageBundle.BUNDLE.bindingNotDivert(name);
+      }
+
+      postOffice.removeBinding(name, null);
+   }
+
+   public void deployBridge(BridgeConfiguration config) throws Exception
+   {
+      if (clusterManager != null)
+      {
+         clusterManager.deployBridge(config);
+      }
+   }
+
+   public void destroyBridge(String name) throws Exception
+   {
+      if (clusterManager != null)
+      {
+         clusterManager.destroyBridge(name);
+      }
+   }
+
+   public ServerSession getSessionByID(String sessionName)
+   {
+      return sessions.get(sessionName);
+   }
+
+   // PUBLIC -------
+
+   @Override
+   public String toString()
+   {
+      if (identity != null)
+      {
+         return "ActiveMQServerImpl::" + identity;
+      }
+      return "ActiveMQServerImpl::" + (nodeManager != null ? "serverUUID=" + nodeManager.getUUID() : "");
+   }
+
+   /**
+    * For tests only, don't use this method as it's not part of the API
+    *
+    * @param factory
+    */
+   public void replaceQueueFactory(QueueFactory factory)
+   {
+      this.queueFactory = factory;
+   }
+
+
+   private PagingManager createPagingManager()
+   {
+
+      return new PagingManagerImpl(new PagingStoreFactoryNIO(storageManager, configuration.getPagingDirectory(),
+                                                             configuration.getJournalBufferTimeout_NIO(),
+                                                             scheduledPool,
+                                                             executorFactory,
+                                                             configuration.isJournalSyncNonTransactional(),
+                                                             shutdownOnCriticalIO),
+                                   addressSettingsRepository);
+   }
+
+   /**
+    * This method is protected as it may be used as a hook for creating a custom storage manager (on tests for instance)
+    */
+   private StorageManager createStorageManager()
+   {
+      if (configuration.isPersistenceEnabled())
+      {
+         return new JournalStorageManager(configuration, executorFactory, shutdownOnCriticalIO);
+      }
+      return new NullStorageManager();
+   }
+
+   private void callActivateCallbacks()
+   {
+      for (ActivateCallback callback : activateCallbacks)
+      {
+         callback.activated();
+      }
+   }
+
+   private void callPreActiveCallbacks()
+   {
+      for (ActivateCallback callback : activateCallbacks)
+      {
+         callback.preActivate();
+      }
+   }
+
+   private void callDeActiveCallbacks()
+   {
+      for (ActivateCallback callback : activateCallbacks)
+      {
+         try
+         {
+            callback.deActivate();
+         }
+         catch (Throwable e)
+         {
+            // https://bugzilla.redhat.com/show_bug.cgi?id=1009530:
+            // we won't interrupt the shutdown sequence because of a failed callback here
+            ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
+         }
+      }
+   }
+
+   private void callActivationCompleteCallbacks()
+   {
+      for (ActivateCallback callback : activateCallbacks)
+      {
+         callback.activationComplete();
+      }
+   }
+
+   /**
+    * Sets up ActiveMQ Executor Services.
+    */
+   private void initializeExecutorServices()
+   {
+      /* We check to see if a Thread Pool is supplied in the InjectedObjectRegistry.  If so we created a new Ordered
+       * Executor based on the provided Thread pool.  Otherwise we create a new ThreadPool.
+       */
+      if (serviceRegistry.getExecutorService() == null)
+      {
+         ThreadFactory tFactory = new ActiveMQThreadFactory("ActiveMQ-server-" + this.toString(), false, getThisClassLoader());
+         if (configuration.getThreadPoolMaxSize() == -1)
+         {
+            threadPool = Executors.newCachedThreadPool(tFactory);
+         }
+         else
+         {
+            threadPool = Executors.newFixedThreadPool(configuration.getThreadPoolMaxSize(), tFactory);
+         }
+      }
+      else
+      {
+         threadPool = serviceRegistry.getExecutorService();
+         this.threadPoolSupplied = true;
+      }
+      this.executorFactory = new OrderedExecutorFactory(threadPool);
+
+       /* We check to see if a Scheduled Executor Service is provided in the InjectedObjectRegistry.  If so we use this
+       * Scheduled ExecutorService otherwise we create a new one.
+       */
+      if (serviceRegistry.getScheduledExecutorService() == null)
+      {
+         ThreadFactory tFactory = new ActiveMQThreadFactory("ActiveMQ-scheduled-threads", false, getThisClassLoader());
+         scheduledPool = new ScheduledThreadPoolExecutor(configuration.getScheduledThreadPoolMaxSize(), tFactory);
+      }
+      else
+      {
+         this.scheduledPoolSupplied = true;
+         this.scheduledPool = serviceRegistry.getScheduledExecutorService();
+      }
+   }
+
+   public ServiceRegistry getServiceRegistry()
+   {
+      return serviceRegistry;
+   }
+
+   /**
+    * Starts everything apart from RemotingService and loading the data.
+    * <p/>
+    * After optional intermediary steps, Part 1 is meant to be followed by part 2
+    * {@link #initialisePart2(boolean)}.
+    * @param scalingDown
+    */
+   synchronized boolean initialisePart1(boolean scalingDown) throws Exception
+   {
+      if (state == SERVER_STATE.STOPPED)
+         return false;
+
+      // Create the pools - we have two pools - one for non scheduled - and another for scheduled
+      initializeExecutorServices();
+
+      if (configuration.getJournalType() == JournalType.ASYNCIO && !AIOSequentialFileFactory.isSupported())
+      {
+         ActiveMQServerLogger.LOGGER.switchingNIO();
+         configuration.setJournalType(JournalType.NIO);
+      }
+
+      managementService = new ManagementServiceImpl(mbeanServer, configuration);
+
+      if (configuration.getMemoryMeasureInterval() != -1)
+      {
+         memoryManager = new MemoryManager(configuration.getMemoryWarningThreshold(),
+                                           configuration.getMemoryMeasureInterval());
+
+         memoryManager.start();
+      }
+
+      // Create the hard-wired components
+
+      if (configuration.isFileDeploymentEnabled())
+      {
+         deploymentManager = new FileDeploymentManager(configuration.getFileDeployerScanPeriod());
+      }
+
+      callPreActiveCallbacks();
+
+      // startReplication();
+
+      storageManager = createStorageManager();
+
+      if (ActiveMQDefaultConfiguration.getDefaultClusterUser().equals(configuration.getClusterUser()) && ActiveMQDefaultConfiguration.getDefaultClusterPassword().equals(configuration.getClusterPassword()))
+      {
+         ActiveMQServerLogger.LOGGER.clusterSecurityRisk();
+      }
+
+      securityStore = new SecurityStoreImpl(securityRepository,
+                                            securityManager,
+                                            configuration.getSecurityInvalidationInterval(),
+                                            configuration.isSecurityEnabled(),
+                                            configuration.getClusterUser(),
+                                            configuration.getClusterPassword(),
+                                            managementService);
+
+      queueFactory = new QueueFactoryImpl(executorFactory, scheduledPool, addressSettingsRepository, storageManager);
+
+      pagingManager = createPagingManager();
+
+      resourceManager = new ResourceManagerImpl((int) (configuration.getTransactionTimeout() / 1000),
+                                                configuration.getTransactionTimeoutScanPeriod(),
+                                                scheduledPool);
+      postOffice = new PostOfficeImpl(this,
+                                      storageManager,
+                                      pagingManager,
+                                      queueFactory,
+                                      managementService,
+                                      configuration.getMessageExpiryScanPeriod(),
+                                      configuration.getMessageExpiryThreadPriority(),
+                                      configuration.isWildcardRoutingEnabled(),
+                                      configuration.getIDCacheSize(),
+                                      configuration.isPersistIDCache(),
+                                      addressSettingsRepository);
+
+      // This can't be created until node id is set
+      clusterManager =
+         new ClusterManager(executorFactory, this, postOffice, scheduledPool, managementService, configuration,
+                            nodeManager, haPolicy.isBackup());
+
+      backupManager = new BackupManager(this, executorFactory, scheduledPool, nodeManager, configuration, clusterManager);
+
+      clusterManager.deploy();
+
+      remotingService = new RemotingServiceImpl(clusterManager,
+                                                configuration,
+                                                this,
+                                                managementService,
+                                                scheduledPool,
+                                                protocolManagerFactories,
+                                                executorFactory.getExecutor(),
+                                                serviceRegistry);
+
+      messagingServerControl = managementService.registerServer(postOffice,
+                                                                storageManager,
+                                                                configuration,
+                                                                addressSettingsRepository,
+                                                                securityRepository,
+                                                                resourceManager,
+                                                                remotingService,
+                                                                this,
+                                                                queueFactory,
+                                                                scheduledPool,
+                                                                pagingManager,
+                                                                haPolicy.isBackup());
+
+      // Address settings need to deployed initially, since they're require on paging manager.start()
+
+      if (!scalingDown)
+      {
+         if (configuration.isFileDeploymentEnabled())
+         {
+            addressSettingsDeployer = new AddressSettingsDeployer(deploymentManager, addressSettingsRepository);
+
+            addressSettingsDeployer.start();
+         }
+
+         deployAddressSettingsFromConfiguration();
+      }
+
+      storageManager.start();
+
+
+      if (securityManager != null)
+      {
+         securityManager.start();
+      }
+
+      postOffice.start();
+
+      pagingManager.start();
+
+      managementService.start();
+
+      resourceManager.start();
+
+      // Deploy all security related config
+      if (configuration.isFileDeploymentEnabled())
+      {
+         basicUserCredentialsDeployer = new BasicUserCredentialsDeployer(deploymentManager, securityManager);
+
+         basicUserCredentialsDeployer.start();
+
+         if (securityManager != null)
+         {
+            securityDeployer = new SecurityDeployer(deploymentManager, securityRepository);
+
+            securityDeployer.start();
+         }
+      }
+
+      deploySecurityFromConfiguration();
+
+      deployGroupingHandlerConfiguration(configuration.getGroupingHandlerConfiguration());
+
+      return true;
+   }
+
+   /*
+    * Load the data, and start remoting service so clients can connect
+    */
+   synchronized void initialisePart2(boolean scalingDown) throws Exception
+   {
+      // Load the journal and populate queues, transactions and caches in memory
+
+      if (state == SERVER_STATE.STOPPED || state == SERVER_STATE.STOPPING)
+      {
+         return;
+      }
+
+      pagingManager.reloadStores();
+
+      JournalLoadInformation[] journalInfo = loadJournals();
+
+
+      final ServerInfo dumper = new ServerInfo(this, pagingManager);
+
+      long dumpInfoInterval = configuration.getServerDumpInterval();
+
+      if (dumpInfoInterval > 0)
+      {
+         scheduledPool.scheduleWithFixedDelay(new Runnable()
+         {
+            public void run()
+            {
+               ActiveMQServerLogger.LOGGER.dumpServerInfo(dumper.dump());
+            }
+         }, 0, dumpInfoInterval, TimeUnit.MILLISECONDS);
+      }
+
+      // Deploy the rest of the stuff
+
+      // Deploy any predefined queues
+      if (configuration.isFileDeploymentEnabled())
+      {
+         queueDeployer = new QueueDeployer(deploymentManager, this);
+
+         queueDeployer.start();
+      }
+      else
+      {
+         deployQueuesFromConfiguration();
+      }
+
+
+      // We need to call this here, this gives any dependent server a chance to deploy its own addresses
+      // this needs to be done before clustering is fully activated
+      callActivateCallbacks();
+
+      if (!scalingDown)
+      {
+         // Deploy any pre-defined diverts
+         deployDiverts();
+
+         if (groupingHandler != null)
+         {
+            groupingHandler.start();
+         }
+
+      // We do this at the end - we don't want things like MDBs or other connections connecting to a backup server until
+      // it is activated
+
+         if (groupingHandler != null && groupingHandler instanceof LocalGroupingHandler)
+         {
+            clusterManager.start();
+
+            groupingHandler.awaitBindings();
+
+            remotingService.start();
+         }
+         else
+         {
+            remotingService.start();
+
+            clusterManager.start();
+         }
+
+         if (nodeManager.getNodeId() == null)
+         {
+            throw ActiveMQMessageBundle.BUNDLE.nodeIdNull();
+         }
+         activationLatch.countDown();
+
+         // We can only do this after everything is started otherwise we may get nasty races with expired messages
+         postOffice.startExpiryScanner();
+      }
+      else
+      {
+         activationLatch.countDown();
+      }
+
+      callActivationCompleteCallbacks();
+   }
+
+   private void deploySecurityFromConfiguration()
+   {
+      for (Map.Entry<String, Set<Role>> entry : configuration.getSecurityRoles().entrySet())
+      {
+         securityRepository.addMatch(entry.getKey(), entry.getValue(), true);
+      }
+   }
+
+   private void deployQueuesFromConfiguration() throws Exception
+   {
+      for (CoreQueueConfiguration config : configuration.getQueueConfigurations())
+      {
+         deployQueue(SimpleString.toSimpleString(config.getAddress()),
+                     SimpleString.toSimpleString(config.getName()),
+                     SimpleString.toSimpleString(config.getFilterString()),
+                     config.isDurable(),
+                     false);
+      }
+   }
+
+   private void deployAddressSettingsFromConfiguration()
+   {
+      for (Map.Entry<String, AddressSettings> entry : configuration.getAddressesSettings().entrySet())
+      {
+         addressSettingsRepository.addMatch(entry.getKey(), entry.getValue(), true);
+      }
+   }
+
+   private JournalLoadInformation[] loadJournals() throws Exception
+   {
+      JournalLoader journalLoader = activation.createJournalLoader(postOffice,
+            pagingManager,
+            storageManager,
+            queueFactory,
+            nodeManager,
+            managementService,
+            groupingHandler,
+            configuration,
+            parentServer);
+
+      JournalLoadInformation[] journalInfo = new JournalLoadInformation[2];
+
+      List<QueueBindingInfo> queueBindingInfos = new ArrayList();
+
+      List<GroupingInfo> groupingInfos = new ArrayList();
+
+      journalInfo[0] = storageManager.loadBindingJournal(queueBindingInfos, groupingInfos);
+
+      recoverStoredConfigs();
+
+      Map<Long, QueueBindingInfo> queueBindingInfosMap = new HashMap();
+
+
+      journalLoader.initQueues(queueBindingInfosMap, queueBindingInfos);
+
+      journalLoader.handleGroupingBindings(groupingInfos);
+
+      Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap = new HashMap<SimpleString, List<Pair<byte[], Long>>>();
+
+      HashSet<Pair<Long, Long>> pendingLargeMessages = new HashSet<Pair<Long, Long>>();
+
+      List<PageCountPending> pendingNonTXPageCounter = new LinkedList<PageCountPending>();
+
+      journalInfo[1] = storageManager.loadMessageJournal(postOffice,
+                                                         pagingManager,
+                                                         resourceManager,
+                                                         queueBindingInfosMap,
+                                                         duplicateIDMap,
+                                                         pendingLargeMessages,
+                                                         pendingNonTXPageCounter,
+                                                         journalLoader);
+
+      journalLoader.handleDuplicateIds(duplicateIDMap);
+
+      for (Pair<Long, Long> msgToDelete : pendingLargeMessages)
+      {
+         ActiveMQServerLogger.LOGGER.deletingPendingMessage(msgToDelete);
+         LargeServerMessage msg = storageManager.createLargeMessage();
+         msg.setMessageID(msgToDelete.getB());
+         msg.setPendingRecordID(msgToDelete.getA());
+         msg.setDurable(true);
+         msg.deleteFile();
+      }
+
+      if (pendingNonTXPageCounter.size() != 0)
+      {
+         try
+         {
+            journalLoader.recoverPendingPageCounters(pendingNonTXPageCounter);
+         }
+         catch (Throwable e)
+         {
+            ActiveMQServerLogger.LOGGER.errorRecoveringPageCounter(e);
+         }
+      }
+
+      journalLoader.cleanUp();
+
+      return journalInfo;
+   }
+
+
+   /**
+    * @throws Exception
+    */
+   private void recoverStoredConfigs() throws Exception
+   {
+      List<PersistedAddressSetting> adsettings = storageManager.recoverAddressSettings();
+      for (PersistedAddressSetting set : adsettings)
+      {
+         addressSettingsRepository.addMatch(set.getAddressMatch().toString(), set.getSetting());
+      }
+
+      List<PersistedRoles> roles = storageManager.recoverPersistedRoles();
+
+      for (PersistedRoles roleItem : roles)
+      {
+         Set<Role> setRoles = SecurityFormatter.createSecurity(roleItem.getSendRoles(),
+                                                               roleItem.getConsumeRoles(),
+                                                               roleItem.getCreateDurableQueueRoles(),
+                                                               roleItem.getDeleteDurableQueueRoles(),
+                                                               roleItem.getCreateNonDurableQueueRoles(),
+                                                               roleItem.getDeleteNonDurableQueueRoles(),
+                                                               roleItem.getManageRoles());
+
+         securityRepository.addMatch(roleItem.getAddressMatch().toString(), setRoles);
+      }
+   }
+
+   private Queue createQueue(final SimpleString address,
+                             final SimpleString queueName,
+                             final SimpleString filterString,
+                             final boolean durable,
+                             final boolean temporary,
+                             final boolean ignoreIfExists,
+                             final boolean transientQueue) throws Exception
+   {
+      QueueBinding binding = (QueueBinding) postOffice.getBinding(queueName);
+
+      if (binding != null)
+      {
+         if (ignoreIfExists)
+         {
+            return binding.getQueue();
+         }
+         else
+         {
+            throw ActiveMQMessageBundle.BUNDLE.queueAlreadyExists(queueName);
+         }
+      }
+
+      Filter filter = FilterImpl.createFilter(filterString);
+
+      long txID = storageManager.generateID();
+      long queueID = storageManager.generateID();
+
+      PageSubscription pageSubscription;
+
+      if (filterString != null && filterString.toString().equals(GENERIC_IGNORED_FILTER))
+      {
+         pageSubscription = null;
+      }
+      else
+      {
+         pageSubscription = pagingManager.getPageStore(address)
+            .getCursorProvider()
+            .createSubscription(queueID, filter, durable);
+      }
+
+      final Queue queue = queueFactory.createQueue(queueID,
+                                                   address,
+                                                   queueName,
+                                                   filter,
+                                                   pageSubscription,
+                                                   durable,
+                                                   temporary);
+
+      if (transientQueue)
+      {
+         queue.setConsumersRefCount(this);
+      }
+
+      binding = new LocalQueueBinding(address, queue, nodeManager.getNodeId());
+
+      if (durable)
+      {
+         storageManager.addQueueBinding(txID, binding);
+      }
+
+      try
+      {
+         postOffice.addBinding(binding);
+         if (durable)
+         {
+            storageManager.commitBindings(txID);
+         }
+      }
+      catch (Exception e)
+      {
+         try
+         {
+            if (durable)
+            {
+               storageManager.rollbackBindings(txID);
+            }
+            if (queue != null)
+            {
+               queue.close();
+            }
+            if (pageSubscription != null)
+            {
+               pageSubscription.destroy();
+            }
+         }
+         catch (Throwable ignored)
+         {
+            ActiveMQServerLogger.LOGGER.debug(ignored.getMessage(), ignored);
+         }
+         throw e;
+      }
+
+
+      managementService.registerAddress(address);
+      managementService.registerQueue(queue, address, storageManager);
+
+      return queue;
+   }
+
+   private void deployDiverts() throws Exception
+   {
+      for (DivertConfiguration config : configuration.getDivertConfigurations())
+      {
+         deployDivert(config);
+      }
+   }
+
+   private void deployGroupingHandlerConfiguration(final GroupingHandlerConfiguration config) throws Exception
+   {
+      if (config != null)
+      {
+         GroupingHandler groupingHandler1;
+         if (config.getType() == GroupingHandlerConfiguration.TYPE.LOCAL)
+         {
+            groupingHandler1 =
+               new LocalGroupingHandler(executorFactory,
+                                        scheduledPool,
+                                        managementService,
+                                        config.getName(),
+                                        config.getAddress(),
+                                        getStorageManager(),
+                                        config.getTimeout(),
+                                        config.getGroupTimeout(),
+                                        config.getReaperPeriod());
+         }
+         else
+         {
+            groupingHandler1 =
+                     new RemoteGroupingHandler(executorFactory, managementService,
+                        config.getName(),
+                        config.getAddress(),
+                        config.getTimeout(),
+                        config.getGroupTimeout());
+         }
+
+         this.groupingHandler = groupingHandler1;
+
+         managementService.addNotificationListener(groupingHandler1);
+      }
+   }
+
+   private Transformer instantiateTransformer(final String transformerClassName)
+   {
+      Transformer transformer = null;
+
+      if (transformerClassName != null)
+      {
+         transformer = (Transformer) instantiateInstance(transformerClassName);
+      }
+
+      return transformer;
+   }
+
+   private Object instantiateInstance(final String className)
+   {
+      return safeInitNewInstance(className);
+   }
+
+   private static ClassLoader getThisClassLoader()
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+      {
+         public ClassLoader run()
+         {
+            return ClientSessionFactoryImpl.class.getClassLoader();
+         }
+      });
+
+   }
+
+   /**
+    * Check if journal directory exists or create it (if configured to do so)
+    */
+   void checkJournalDirectory()
+   {
+      File journalDir = new File(configuration.getJournalDirectory());
+
+      if (!journalDir.exists())
+      {
+         if (configuration.isCreateJournalDir())
+         {
+            journalDir.mkdirs();
+         }
+         else
+         {
+            throw ActiveMQMessageBundle.BUNDLE.cannotCreateDir(journalDir.getAbsolutePath());
+         }
+      }
+   }
+
+
+   // Inner classes
+   // --------------------------------------------------------------------------------
+
+
+
+   public final class ShutdownOnCriticalErrorListener implements IOCriticalErrorListener
+   {
+      boolean failedAlready = false;
+
+      public synchronized void onIOException(Exception cause, String message, SequentialFile file)
+      {
+         if (!failedAlready)
+         {
+            failedAlready = true;
+
+            ActiveMQServerLogger.LOGGER.ioCriticalIOError(message, file.toString(), cause);
+
+            stopTheServer(true);
+         }
+      }
+   }
+
+
+   /**
+    * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+    * utility class, as it would be a door to load anything you like in a safe VM.
+    * For that reason any class trying to do a privileged block should do with the AccessController directly.
+    */
+   private static Object safeInitNewInstance(final String className)
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<Object>()
+      {
+         public Object run()
+         {
+            return ClassloadingUtil.newInstanceFromClassLoader(className);
+         }
+      });
+   }
+
+   public void addProtocolManagerFactory(ProtocolManagerFactory factory)
+   {
+      protocolManagerFactories.add(factory);
+   }
+
+   public void removeProtocolManagerFactory(ProtocolManagerFactory factory)
+   {
+      protocolManagerFactories.remove(factory);
+   }
+
+   @Override
+   public ActiveMQServer createBackupServer(Configuration configuration)
+   {
+      return new ActiveMQServerImpl(configuration, null, securityManager, this);
+   }
+
+   @Override
+   public void addScaledDownNode(SimpleString scaledDownNodeId)
+   {
+      synchronized (scaledDownNodeIDs)
+      {
+         scaledDownNodeIDs.add(scaledDownNodeId);
+         if (scaledDownNodeIDs.size() > 10)
+         {
+            scaledDownNodeIDs.remove(10);
+         }
+      }
+   }
+
+   @Override
+   public boolean hasScaledDown(SimpleString scaledDownNodeId)
+   {
+      return scaledDownNodeIDs.contains(scaledDownNodeId);
+   }
+
+
+   int countNumberOfCopiedJournals()
+   {
+      //will use the main journal to check for how many backups have been kept
+      File journalDir = new File(configuration.getJournalDirectory());
+      final String fileName = journalDir.getName();
+      int numberOfbackupsSaved = 0;
+      //fine if it doesn't exist, we aren't using file based persistence so it's no issue
+      if (journalDir.exists())
+      {
+         File parentFile = new File(journalDir.getParent());
+         String[] backupJournals = parentFile.list(new FilenameFilter()
+         {
+            @Override
+            public boolean accept(File dir, String name)
+            {
+               return name.startsWith(fileName) && !name.matches(fileName);
+            }
+         });
+         numberOfbackupsSaved = backupJournals != null ? backupJournals.length : 0;
+      }
+      return numberOfbackupsSaved;
+   }
+
+   /**
+    * Move data away before starting data synchronization for fail-back.
+    * <p/>
+    * Use case is a server, upon restarting, finding a former backup running in its place. It will
+    * move any older data away and log a warning about it.
+    */
+   void moveServerData()
+   {
+      String[] dataDirs =
+         new String[]{configuration.getBindingsDirectory(),
+            configuration.getJournalDirectory(),
+            configuration.getPagingDirectory(),
+            configuration.getLargeMessagesDirectory()};
+      boolean allEmpty = true;
+      int lowestSuffixForMovedData = 1;
+      boolean redo = true;
+
+      while (redo)
+      {
+         redo = false;
+         for (String dir : dataDirs)
+         {
+            File fDir = new File(dir);
+            if (fDir.exists())
+            {
+               if (!fDir.isDirectory())
+               {
+                  throw ActiveMQMessageBundle.BUNDLE.journalDirIsFile(fDir);
+               }
+
+               if (fDir.list().length > 0)
+                  allEmpty = false;
+            }
+
+            String sanitizedPath = fDir.getPath();
+            while (new File(sanitizedPath + lowestSuffixForMovedData).exists())
+            {
+               lowestSuffixForMovedData++;
+               redo = true;
+            }
+         }
+      }
+      if (allEmpty)
+         return;
+
+      for (String dir0 : dataDirs)
+      {
+         File dir = new File(dir0);
+         File newPath = new File(dir.getPath() + lowestSuffixForMovedData);
+         if (dir.exists())
+         {
+            if (!dir.renameTo(newPath))
+            {
+               throw ActiveMQMessageBundle.BUNDLE.couldNotMoveJournal(dir);
+            }
+
+            ActiveMQServerLogger.LOGGER.backupMovingDataAway(dir0, newPath.getPath());
+         }
+         /*
+         * sometimes OS's can hold on to file handles for a while so we need to check this actually qorks and then wait
+         * a while and try again if it doesn't
+         * */
+
+         File dirToRecreate = new File(dir0);
+         int count = 0;
+         while (!dirToRecreate.exists() && !dirToRecreate.mkdir())
+         {
+            try
+            {
+               Thread.sleep(1000);
+            }
+            catch (InterruptedException e)
+            {
+            }
+            count++;
+            if (count == 5)
+            {
+               throw ActiveMQMessageBundle.BUNDLE.cannotCreateDir(dir.getPath());
+            }
+         }
+      }
+   }
+}


[29/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSession.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSession.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSession.java
index 1eb47c9..6cb85b8 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSession.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSession.java
@@ -36,13 +36,13 @@ import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.postoffice.QueueBinding;
 import org.apache.activemq.core.protocol.openwire.AMQTransactionImpl;
 import org.apache.activemq.core.security.SecurityStore;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.ServerConsumer;
 import org.apache.activemq.core.server.ServerMessage;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.RefsOperation;
 import org.apache.activemq.core.server.impl.ServerConsumerImpl;
 import org.apache.activemq.core.server.impl.ServerSessionImpl;
@@ -66,7 +66,7 @@ public class AMQServerSession extends ServerSessionImpl
          RemotingConnection connection, StorageManager storageManager,
          PostOffice postOffice, ResourceManager resourceManager,
          SecurityStore securityStore, ManagementService managementService,
-         HornetQServerImpl hornetQServerImpl, SimpleString managementAddress,
+         ActiveMQServerImpl activeMQServerImpl, SimpleString managementAddress,
          SimpleString simpleString, SessionCallback callback,
          OperationContext context) throws Exception
    {
@@ -77,7 +77,7 @@ public class AMQServerSession extends ServerSessionImpl
          connection, storageManager,
          postOffice, resourceManager,
          securityStore, managementService,
-         hornetQServerImpl, managementAddress,
+         activeMQServerImpl, managementAddress,
          simpleString, callback,
          context, new AMQTransactionFactory());
    }
@@ -106,7 +106,7 @@ public class AMQServerSession extends ServerSessionImpl
 
       if (consumer == null)
       {
-         HornetQServerLogger.LOGGER.debug("There is no consumer with id " + consumerID);
+         ActiveMQServerLogger.LOGGER.debug("There is no consumer with id " + consumerID);
 
          return null;
       }
@@ -231,7 +231,7 @@ public class AMQServerSession extends ServerSessionImpl
       }
       else
       {
-         HornetQServerLogger.LOGGER.cannotFindConsumer(consumerID);
+         ActiveMQServerLogger.LOGGER.cannotFindConsumer(consumerID);
       }
    }
 
@@ -251,7 +251,7 @@ public class AMQServerSession extends ServerSessionImpl
 
          if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
          {
-            throw HornetQMessageBundle.BUNDLE.noSuchQueue(queueName);
+            throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(queueName);
          }
 
          Filter filter = FilterImpl.createFilter(filterString);
@@ -304,9 +304,9 @@ public class AMQServerSession extends ServerSessionImpl
             Notification notification = new Notification(null,
                   CoreNotificationType.CONSUMER_CREATED, props);
 
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug("Session with user=" + username
+               ActiveMQServerLogger.LOGGER.debug("Session with user=" + username
                      + ", connection=" + this.remotingConnection
                      + " created a consumer on queue " + queueName
                      + ", filter = " + filterString);
@@ -354,9 +354,9 @@ public class AMQServerSession extends ServerSessionImpl
          tempQueueCleannerUppers.put(name, cleaner);
       }
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Queue " + name + " created on address " + name +
+         ActiveMQServerLogger.LOGGER.debug("Queue " + name + " created on address " + name +
                                              " with filter=" + filterString + " temporary = " +
                                              temporary + " durable=" + durable + " on session user=" + this.username + ", connection=" + this.remotingConnection);
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSessionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSessionFactory.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSessionFactory.java
index bb3f4b8..61fac22 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSessionFactory.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerSessionFactory.java
@@ -18,7 +18,7 @@ import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.security.SecurityStore;
 import org.apache.activemq.core.server.ServerSessionFactory;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.ServerSessionImpl;
 import org.apache.activemq.core.server.management.ManagementService;
 import org.apache.activemq.core.transaction.ResourceManager;
@@ -36,14 +36,14 @@ public class AMQServerSessionFactory implements ServerSessionFactory
          RemotingConnection connection, StorageManager storageManager,
          PostOffice postOffice, ResourceManager resourceManager,
          SecurityStore securityStore, ManagementService managementService,
-         HornetQServerImpl hornetQServerImpl, SimpleString managementAddress,
+         ActiveMQServerImpl activeMQServerImpl, SimpleString managementAddress,
          SimpleString simpleString, SessionCallback callback,
          OperationContext context) throws Exception
    {
       return new AMQServerSession(name, username, password, minLargeMessageSize, autoCommitSends,
             autoCommitAcks, preAcknowledge, persistDeliveryCountBeforeDelivery, xa,
             connection, storageManager, postOffice, resourceManager, securityStore,
-            managementService, hornetQServerImpl, managementAddress, simpleString, callback,
+            managementService, activeMQServerImpl, managementAddress, simpleString, callback,
             context);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQSession.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQSession.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQSession.java
index d74e091..77b37e4 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQSession.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQSession.java
@@ -42,6 +42,7 @@ import org.apache.activemq.command.SessionInfo;
 import org.apache.activemq.command.TransactionId;
 import org.apache.activemq.command.TransactionInfo;
 import org.apache.activemq.command.XATransactionId;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.wireformat.WireFormat;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.paging.impl.PagingStoreImpl;
@@ -50,8 +51,7 @@ import org.apache.activemq.core.protocol.openwire.OpenWireMessageConverter;
 import org.apache.activemq.core.protocol.openwire.OpenWireProtocolManager;
 import org.apache.activemq.core.protocol.openwire.OpenWireUtil;
 import org.apache.activemq.core.protocol.openwire.SendingResult;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.ServerConsumer;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.impl.ServerMessageImpl;
@@ -64,7 +64,7 @@ public class AMQSession implements SessionCallback
    private AMQServerSession coreSession;
    private ConnectionInfo connInfo;
    private SessionInfo sessInfo;
-   private HornetQServer server;
+   private ActiveMQServer server;
    private OpenWireConnection connection;
    //native id -> consumer
    private Map<Long, AMQConsumer> consumers = new ConcurrentHashMap<Long, AMQConsumer>();
@@ -82,7 +82,7 @@ public class AMQSession implements SessionCallback
    private OpenWireProtocolManager manager;
 
    public AMQSession(ConnectionInfo connInfo, SessionInfo sessInfo,
-         HornetQServer server, OpenWireConnection connection, OpenWireProtocolManager manager)
+         ActiveMQServer server, OpenWireConnection connection, OpenWireProtocolManager manager)
    {
       this.connInfo = connInfo;
       this.sessInfo = sessInfo;
@@ -115,7 +115,7 @@ public class AMQSession implements SessionCallback
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.error("error init session", e);
+         ActiveMQServerLogger.LOGGER.error("error init session", e);
       }
 
    }
@@ -221,7 +221,7 @@ public class AMQSession implements SessionCallback
       return this.coreSession;
    }
 
-   public HornetQServer getCoreServer()
+   public ActiveMQServer getCoreServer()
    {
       return this.server;
    }
@@ -578,7 +578,7 @@ public class AMQSession implements SessionCallback
          long now = System.currentTimeMillis();
          if (now >= nextWarn)
          {
-            HornetQServerLogger.LOGGER.warn("Memory Limit reached. Producer (" + producerId + ") stopped to prevent flooding "
+            ActiveMQServerLogger.LOGGER.warn("Memory Limit reached. Producer (" + producerId + ") stopped to prevent flooding "
                                + result.getBlockingAddress()
                                + " See http://activemq.apache.org/producer-flow-control.html for more info"
                                + " (blocking for " + ((now - start) / 1000) + "s");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
new file mode 100644
index 0000000..82f81bf
--- /dev/null
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
@@ -0,0 +1 @@
+org.apache.activemq.core.protocol.openwire.OpenWireProtocolManagerFactory

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
deleted file mode 100644
index 82f81bf..0000000
--- a/activemq-protocols/activemq-openwire-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.activemq.core.protocol.openwire.OpenWireProtocolManagerFactory

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
index 5678a38..9b4e77e 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
@@ -13,7 +13,7 @@
 
 package org.proton.plug;
 
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * This is valid only on a client connection.
@@ -30,5 +30,5 @@ public interface AMQPClientConnectionContext extends AMQPConnectionContext
     */
    void clientOpen(ClientSASL sasl) throws Exception;
 
-   AMQPClientSessionContext createClientSession() throws HornetQAMQPException;
+   AMQPClientSessionContext createClientSession() throws ActiveMQAMQPException;
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
index 45cbaad..7f67970 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
@@ -13,7 +13,7 @@
 
 package org.proton.plug;
 
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author Clebert Suconic
@@ -21,7 +21,7 @@ import org.proton.plug.exceptions.HornetQAMQPException;
 
 public interface AMQPClientSessionContext extends AMQPSessionContext
 {
-   AMQPClientSenderContext createSender(String address, boolean preSettled) throws HornetQAMQPException;
+   AMQPClientSenderContext createSender(String address, boolean preSettled) throws ActiveMQAMQPException;
 
-   AMQPClientReceiverContext createReceiver(String address) throws HornetQAMQPException;
+   AMQPClientReceiverContext createReceiver(String address) throws ActiveMQAMQPException;
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPSessionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPSessionContext.java
index 2cc725d..52d906c 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPSessionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/AMQPSessionContext.java
@@ -15,7 +15,7 @@ package org.proton.plug;
 
 import org.apache.qpid.proton.engine.Receiver;
 import org.apache.qpid.proton.engine.Sender;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author Clebert Suconic
@@ -29,7 +29,7 @@ public interface AMQPSessionContext
 
    void close();
 
-   void removeSender(Sender sender) throws HornetQAMQPException;
+   void removeSender(Sender sender) throws ActiveMQAMQPException;
 
    void removeReceiver(Receiver receiver);
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
index 45a3ef0..86985eb 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractConnectionContext.java
@@ -25,7 +25,7 @@ import org.apache.qpid.proton.engine.Transport;
 import org.proton.plug.AMQPConnectionCallback;
 import org.proton.plug.AMQPConnectionContext;
 import org.proton.plug.SASLResult;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 import org.proton.plug.handler.ProtonHandler;
 import org.proton.plug.handler.impl.DefaultEventHandler;
 import org.proton.plug.util.ByteUtil;
@@ -111,7 +111,7 @@ public abstract class AbstractConnectionContext extends ProtonInitializable impl
       handler.close();
    }
 
-   protected AbstractProtonSessionContext getSessionExtension(Session realSession) throws HornetQAMQPException
+   protected AbstractProtonSessionContext getSessionExtension(Session realSession) throws ActiveMQAMQPException
    {
       AbstractProtonSessionContext sessionExtension = sessions.get(realSession);
       if (sessionExtension == null)
@@ -127,7 +127,7 @@ public abstract class AbstractConnectionContext extends ProtonInitializable impl
    protected abstract void remoteLinkOpened(Link link) throws Exception;
 
 
-   protected abstract AbstractProtonSessionContext newSessionExtension(Session realSession) throws HornetQAMQPException;
+   protected abstract AbstractProtonSessionContext newSessionExtension(Session realSession) throws ActiveMQAMQPException;
 
    @Override
    public boolean checkDataReceived()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonContextSender.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonContextSender.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonContextSender.java
index 45b5250..512bc07 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonContextSender.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonContextSender.java
@@ -20,12 +20,12 @@ import org.apache.qpid.proton.engine.Delivery;
 import org.apache.qpid.proton.engine.Sender;
 import org.apache.qpid.proton.message.ProtonJMessage;
 import org.proton.plug.AMQPSessionCallback;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 import org.proton.plug.util.CreditsSemaphore;
 import org.proton.plug.util.NettyWritable;
 
 /**
- * A this is a wrapper around a HornetQ ServerConsumer for handling outgoing messages and incoming acks via a Proton Sender
+ * A this is a wrapper around a ActiveMQ ServerConsumer for handling outgoing messages and incoming acks via a Proton Sender
  *
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  */
@@ -55,7 +55,7 @@ public abstract class AbstractProtonContextSender extends ProtonInitializable im
    /*
    * start the session
    * */
-   public void start() throws HornetQAMQPException
+   public void start() throws ActiveMQAMQPException
    {
       sessionSPI.start();
       // protonSession.getServerSession().start();
@@ -64,7 +64,7 @@ public abstract class AbstractProtonContextSender extends ProtonInitializable im
    /*
    * close the session
    * */
-   public void close() throws HornetQAMQPException
+   public void close() throws ActiveMQAMQPException
    {
       closed = true;
       protonSession.removeSender(sender);
@@ -78,9 +78,9 @@ public abstract class AbstractProtonContextSender extends ProtonInitializable im
 
    @Override
    /*
-   * handle an incoming Ack from Proton, basically pass to HornetQ to handle
+   * handle an incoming Ack from Proton, basically pass to ActiveMQ to handle
    * */
-   public abstract void onMessage(Delivery delivery) throws HornetQAMQPException;
+   public abstract void onMessage(Delivery delivery) throws ActiveMQAMQPException;
 
    /*
    * check the state of the consumer, i.e. are there any more messages. only really needed for browsers?

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonReceiverContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonReceiverContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonReceiverContext.java
index fb4bb07..3e3daeb 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonReceiverContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonReceiverContext.java
@@ -15,12 +15,12 @@ package org.proton.plug.context;
 
 import org.apache.qpid.proton.engine.Receiver;
 import org.proton.plug.AMQPSessionCallback;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  *         <p/>
- *         handles incoming messages via a Proton Receiver and forwards them to HornetQ
+ *         handles incoming messages via a Proton Receiver and forwards them to ActiveMQ
  */
 public abstract class AbstractProtonReceiverContext extends ProtonInitializable implements ProtonDeliveryHandler
 {
@@ -51,7 +51,7 @@ public abstract class AbstractProtonReceiverContext extends ProtonInitializable
    }
 
    @Override
-   public void close() throws HornetQAMQPException
+   public void close() throws ActiveMQAMQPException
    {
       protonSession.removeReceiver(receiver);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java
index 8f28039..d17e578 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/AbstractProtonSessionContext.java
@@ -24,8 +24,8 @@ import org.apache.qpid.proton.engine.Sender;
 import org.apache.qpid.proton.engine.Session;
 import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.AMQPSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
-import org.proton.plug.exceptions.HornetQAMQPInternalErrorException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPInternalErrorException;
 
 /**
  * ProtonSession is a direct representation of the session on the broker.
@@ -71,7 +71,7 @@ public abstract class AbstractProtonSessionContext extends ProtonInitializable i
             }
             catch (Exception e)
             {
-               throw new HornetQAMQPInternalErrorException(e.getMessage(), e);
+               throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
             }
          }
       }
@@ -93,7 +93,7 @@ public abstract class AbstractProtonSessionContext extends ProtonInitializable i
          {
             protonConsumer.close();
          }
-         catch (HornetQAMQPException e)
+         catch (ActiveMQAMQPException e)
          {
             protonConsumer.getSender().setTarget(null);
             protonConsumer.getSender().setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
@@ -176,7 +176,7 @@ public abstract class AbstractProtonSessionContext extends ProtonInitializable i
    }
 
    @Override
-   public void removeSender(Sender sender) throws HornetQAMQPException
+   public void removeSender(Sender sender) throws ActiveMQAMQPException
    {
       senders.remove(sender);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonDeliveryHandler.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonDeliveryHandler.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonDeliveryHandler.java
index 3436c5c..2411e87 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonDeliveryHandler.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonDeliveryHandler.java
@@ -14,7 +14,7 @@
 package org.proton.plug.context;
 
 import org.apache.qpid.proton.engine.Delivery;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
@@ -25,7 +25,7 @@ public interface ProtonDeliveryHandler
 {
    void onFlow(int currentCredits);
 
-   void onMessage(Delivery delivery) throws HornetQAMQPException;
+   void onMessage(Delivery delivery) throws ActiveMQAMQPException;
 
-   void close() throws HornetQAMQPException;
+   void close() throws ActiveMQAMQPException;
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonInitializable.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonInitializable.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonInitializable.java
index 0dad6d7..bf481a1 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonInitializable.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonInitializable.java
@@ -15,9 +15,9 @@ package org.proton.plug.context;
 
 import java.util.concurrent.TimeUnit;
 
-import org.proton.plug.exceptions.HornetQAMQPException;
-import org.proton.plug.exceptions.HornetQAMQPIllegalStateException;
-import org.proton.plug.exceptions.HornetQAMQPTimeoutException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPIllegalStateException;
+import org.proton.plug.exceptions.ActiveMQAMQPTimeoutException;
 import org.proton.plug.util.FutureRunnable;
 
 /**
@@ -63,20 +63,20 @@ public class ProtonInitializable
    }
 
 
-   public void waitWithTimeout(FutureRunnable latch) throws HornetQAMQPException
+   public void waitWithTimeout(FutureRunnable latch) throws ActiveMQAMQPException
    {
       try
       {
          // TODO Configure this
          if (!latch.await(30, TimeUnit.SECONDS))
          {
-            throw new HornetQAMQPTimeoutException("Timed out waiting for response");
+            throw new ActiveMQAMQPTimeoutException("Timed out waiting for response");
          }
       }
       catch (InterruptedException e)
       {
          Thread.currentThread().interrupt();
-         throw new HornetQAMQPIllegalStateException(e.getMessage());
+         throw new ActiveMQAMQPIllegalStateException(e.getMessage());
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonTransactionHandler.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonTransactionHandler.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonTransactionHandler.java
index 9f53085..e53e36a 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonTransactionHandler.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/ProtonTransactionHandler.java
@@ -26,8 +26,8 @@ import org.apache.qpid.proton.engine.Delivery;
 import org.apache.qpid.proton.engine.Receiver;
 import org.apache.qpid.proton.message.impl.MessageImpl;
 import org.proton.plug.AMQPSessionCallback;
-import org.proton.plug.exceptions.HornetQAMQPException;
-import org.proton.plug.logger.HornetQAMQPProtocolMessageBundle;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
+import org.proton.plug.logger.ActiveMQAMQPProtocolMessageBundle;
 
 import static org.proton.plug.util.DeliveryUtil.decodeMessageImpl;
 import static org.proton.plug.util.DeliveryUtil.readDelivery;
@@ -46,7 +46,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler
    }
 
    @Override
-   public void onMessage(Delivery delivery) throws HornetQAMQPException
+   public void onMessage(Delivery delivery) throws ActiveMQAMQPException
    {
       ByteBuf buffer = PooledByteBufAllocator.DEFAULT.heapBuffer(1024);
 
@@ -87,7 +87,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler
                }
                catch (Exception e)
                {
-                  throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorRollingbackCoordinator(e.getMessage());
+                  throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorRollingbackCoordinator(e.getMessage());
                }
             }
             else
@@ -98,7 +98,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler
                }
                catch (Exception e)
                {
-                  throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorCommittingCoordinator(e.getMessage());
+                  throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCommittingCoordinator(e.getMessage());
                }
             }
             delivery.settle();
@@ -127,7 +127,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler
    }
 
    @Override
-   public void close() throws HornetQAMQPException
+   public void close() throws ActiveMQAMQPException
    {
       //noop
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientConnectionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientConnectionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientConnectionContext.java
index 95a7f61..d58a4ef 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientConnectionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientConnectionContext.java
@@ -22,7 +22,7 @@ import org.proton.plug.AMQPConnectionCallback;
 import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 import org.proton.plug.context.ProtonInitializable;
 import org.proton.plug.util.FutureRunnable;
 
@@ -56,7 +56,7 @@ public class ProtonClientConnectionContext extends AbstractConnectionContext imp
       waitWithTimeout(future);
    }
 
-   public AMQPClientSessionContext createClientSession() throws HornetQAMQPException
+   public AMQPClientSessionContext createClientSession() throws ActiveMQAMQPException
    {
 
       FutureRunnable futureRunnable = new FutureRunnable(1);
@@ -76,7 +76,7 @@ public class ProtonClientConnectionContext extends AbstractConnectionContext imp
    }
 
    @Override
-   protected AbstractProtonSessionContext newSessionExtension(Session realSession) throws HornetQAMQPException
+   protected AbstractProtonSessionContext newSessionExtension(Session realSession) throws ActiveMQAMQPException
    {
       AMQPSessionCallback sessionSPI = connectionCallback.createSessionCallback(this);
       AbstractProtonSessionContext protonSession = new ProtonClientSessionContext(sessionSPI, this, realSession);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientContext.java
index f0dc46a..bfe5f24 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientContext.java
@@ -25,7 +25,7 @@ import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonContextSender;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 import org.proton.plug.util.FutureRunnable;
 
 /**
@@ -44,7 +44,7 @@ public class ProtonClientContext extends AbstractProtonContextSender implements
 
 
    @Override
-   public void onMessage(Delivery delivery) throws HornetQAMQPException
+   public void onMessage(Delivery delivery) throws ActiveMQAMQPException
    {
       if (delivery.getRemoteState() instanceof Accepted)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientReceiverContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientReceiverContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientReceiverContext.java
index ebf7f7d..f2fddf5 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientReceiverContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientReceiverContext.java
@@ -28,7 +28,7 @@ import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonReceiverContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 import static org.proton.plug.util.DeliveryUtil.readDelivery;
 import static org.proton.plug.util.DeliveryUtil.decodeMessageImpl;
@@ -55,7 +55,7 @@ public class ProtonClientReceiverContext extends AbstractProtonReceiverContext i
    * This may be called more than once per deliver so we have to cache the buffer until we have received it all.
    *
    * */
-   public void onMessage(Delivery delivery) throws HornetQAMQPException
+   public void onMessage(Delivery delivery) throws ActiveMQAMQPException
    {
       ByteBuf buffer = PooledByteBufAllocator.DEFAULT.heapBuffer(1024);
       try

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientSessionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientSessionContext.java
index e888ea9..4e4c080 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientSessionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/client/ProtonClientSessionContext.java
@@ -25,7 +25,7 @@ import org.proton.plug.AMQPClientSessionContext;
 import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 import org.proton.plug.util.FutureRunnable;
 
 /**
@@ -39,7 +39,7 @@ public class ProtonClientSessionContext extends AbstractProtonSessionContext imp
       super(sessionSPI, connection, session);
    }
 
-   public AMQPClientSenderContext createSender(String address, boolean preSettled) throws HornetQAMQPException
+   public AMQPClientSenderContext createSender(String address, boolean preSettled) throws ActiveMQAMQPException
    {
       FutureRunnable futureRunnable = new FutureRunnable(1);
 
@@ -63,7 +63,7 @@ public class ProtonClientSessionContext extends AbstractProtonSessionContext imp
       return amqpSender;
    }
 
-   public AMQPClientReceiverContext createReceiver(String address) throws HornetQAMQPException
+   public AMQPClientReceiverContext createReceiver(String address) throws ActiveMQAMQPException
    {
       FutureRunnable futureRunnable = new FutureRunnable(1);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerConnectionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerConnectionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerConnectionContext.java
index 1d83e54..b26a82e 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerConnectionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerConnectionContext.java
@@ -23,7 +23,7 @@ import org.proton.plug.AMQPServerConnectionContext;
 import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author Clebert Suconic
@@ -36,7 +36,7 @@ public class ProtonServerConnectionContext extends AbstractConnectionContext imp
       super(connectionSP);
    }
 
-   protected AbstractProtonSessionContext newSessionExtension(Session realSession) throws HornetQAMQPException
+   protected AbstractProtonSessionContext newSessionExtension(Session realSession) throws ActiveMQAMQPException
    {
       AMQPSessionCallback sessionSPI = connectionCallback.createSessionCallback(this);
       AbstractProtonSessionContext protonSession = new ProtonServerSessionContext(sessionSPI, this, realSession);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
index 21ca2bc..bef4299 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
@@ -25,9 +25,9 @@ import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonReceiverContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
-import org.proton.plug.exceptions.HornetQAMQPInternalErrorException;
-import org.proton.plug.logger.HornetQAMQPProtocolMessageBundle;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPInternalErrorException;
+import org.proton.plug.logger.ActiveMQAMQPProtocolMessageBundle;
 
 import static org.proton.plug.util.DeliveryUtil.readDelivery;
 
@@ -71,7 +71,7 @@ public class ProtonServerReceiverContext extends AbstractProtonReceiverContext
             }
             catch (Exception e)
             {
-               throw new HornetQAMQPInternalErrorException(e.getMessage(), e);
+               throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
             }
             target.setAddress(queue.toString());
          }
@@ -82,18 +82,18 @@ public class ProtonServerReceiverContext extends AbstractProtonReceiverContext
             String address = target.getAddress();
             if (address == null)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.targetAddressNotSet();
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.targetAddressNotSet();
             }
             try
             {
                if (!sessionSPI.queueQuery(address))
                {
-                  throw HornetQAMQPProtocolMessageBundle.BUNDLE.addressDoesntExist();
+                  throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.addressDoesntExist();
                }
             }
             catch (Exception e)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorFindingTemporaryQueue(e.getMessage());
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorFindingTemporaryQueue(e.getMessage());
             }
          }
       }
@@ -107,7 +107,7 @@ public class ProtonServerReceiverContext extends AbstractProtonReceiverContext
    * This may be called more than once per deliver so we have to cache the buffer until we have received it all.
    *
    * */
-   public void onMessage(Delivery delivery) throws HornetQAMQPException
+   public void onMessage(Delivery delivery) throws ActiveMQAMQPException
    {
       Receiver receiver;
       try

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSenderContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSenderContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSenderContext.java
index 9b66de0..380ea4f 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSenderContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSenderContext.java
@@ -30,9 +30,9 @@ import org.proton.plug.AMQPSessionCallback;
 import org.proton.plug.context.AbstractConnectionContext;
 import org.proton.plug.context.AbstractProtonContextSender;
 import org.proton.plug.context.AbstractProtonSessionContext;
-import org.proton.plug.exceptions.HornetQAMQPException;
-import org.proton.plug.exceptions.HornetQAMQPInternalErrorException;
-import org.proton.plug.logger.HornetQAMQPProtocolMessageBundle;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPInternalErrorException;
+import org.proton.plug.logger.ActiveMQAMQPProtocolMessageBundle;
 import org.proton.plug.context.ProtonPlugSender;
 import org.apache.qpid.proton.amqp.messaging.Source;
 
@@ -67,7 +67,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
    /*
 * start the session
 * */
-   public void start() throws HornetQAMQPException
+   public void start() throws ActiveMQAMQPException
    {
       super.start();
       // protonSession.getServerSession().start();
@@ -81,12 +81,12 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
       }
       catch (Exception e)
       {
-         throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorStartingConsumer(e.getMessage());
+         throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorStartingConsumer(e.getMessage());
       }
    }
 
    /**
-    * create the actual underlying HornetQ Server Consumer
+    * create the actual underlying ActiveMQ Server Consumer
     */
    @Override
    public void initialise() throws Exception
@@ -122,7 +122,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
             }
             catch (Exception e)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorCreatingTemporaryQueue(e.getMessage());
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCreatingTemporaryQueue(e.getMessage());
             }
             source.setAddress(queue);
          }
@@ -133,19 +133,19 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
             queue = source.getAddress();
             if (queue == null)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.sourceAddressNotSet();
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.sourceAddressNotSet();
             }
 
             try
             {
                if (!sessionSPI.queueQuery(queue))
                {
-                  throw HornetQAMQPProtocolMessageBundle.BUNDLE.sourceAddressDoesntExist();
+                  throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.sourceAddressDoesntExist();
                }
             }
             catch (Exception e)
             {
-               throw new HornetQAMQPInternalErrorException(e.getMessage(), e);
+               throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
             }
          }
 
@@ -156,7 +156,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
          }
          catch (Exception e)
          {
-            throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorCreatingHornetQConsumer(e.getMessage());
+            throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCreatingActiveMQConsumer(e.getMessage());
          }
       }
    }
@@ -164,7 +164,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
    /*
    * close the session
    * */
-   public void close() throws HornetQAMQPException
+   public void close() throws ActiveMQAMQPException
    {
       super.close();
       try
@@ -174,12 +174,12 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
       catch (Exception e)
       {
          e.printStackTrace();
-         throw new HornetQAMQPInternalErrorException(e.getMessage());
+         throw new ActiveMQAMQPInternalErrorException(e.getMessage());
       }
    }
 
 
-   public void onMessage(Delivery delivery) throws HornetQAMQPException
+   public void onMessage(Delivery delivery) throws ActiveMQAMQPException
    {
       Object message = delivery.getContext();
 
@@ -200,7 +200,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
             }
             catch (Exception e)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorAcknowledgingMessage(message.toString(), e.getMessage());
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorAcknowledgingMessage(message.toString(), e.getMessage());
             }
          }
          else if (remoteState instanceof Released)
@@ -211,7 +211,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
             }
             catch (Exception e)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorCancellingMessage(message.toString(), e.getMessage());
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCancellingMessage(message.toString(), e.getMessage());
             }
          }
          else if (remoteState instanceof Rejected || remoteState instanceof Modified)
@@ -222,7 +222,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
             }
             catch (Exception e)
             {
-               throw HornetQAMQPProtocolMessageBundle.BUNDLE.errorCancellingMessage(message.toString(), e.getMessage());
+               throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCancellingMessage(message.toString(), e.getMessage());
             }
          }
          //todo add tag caching
@@ -253,7 +253,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
 
 
    /**
-    * handle an out going message from HornetQ, send via the Proton Sender
+    * handle an out going message from ActiveMQ, send via the Proton Sender
     */
    public int deliverMessage(Object message, int deliveryCount) throws Exception
    {
@@ -273,7 +273,7 @@ public class ProtonServerSenderContext extends AbstractProtonContextSender imple
       catch (Throwable e)
       {
          e.printStackTrace();
-         throw new HornetQAMQPInternalErrorException(e.getMessage(), e);
+         throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
       }
 
       return performSend(serverMessage, message);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java
index 1860c90..8ce784f 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerSessionContext.java
@@ -27,7 +27,7 @@ import org.proton.plug.context.AbstractProtonContextSender;
 import org.proton.plug.context.AbstractProtonReceiverContext;
 import org.proton.plug.context.AbstractProtonSessionContext;
 import org.proton.plug.context.ProtonTransactionHandler;
-import org.proton.plug.exceptions.HornetQAMQPException;
+import org.proton.plug.exceptions.ActiveMQAMQPException;
 
 /**
  * @author Clebert Suconic
@@ -83,7 +83,7 @@ public class ProtonServerSessionContext extends AbstractProtonSessionContext
          sender.open();
          protonSender.start();
       }
-      catch (HornetQAMQPException e)
+      catch (ActiveMQAMQPException e)
       {
          senders.remove(sender);
          sender.setSource(null);
@@ -92,7 +92,7 @@ public class ProtonServerSessionContext extends AbstractProtonSessionContext
       }
    }
 
-   public void removeSender(Sender sender) throws HornetQAMQPException
+   public void removeSender(Sender sender) throws ActiveMQAMQPException
    {
       ProtonServerSenderContext senderRemoved = (ProtonServerSenderContext) senders.remove(sender);
       if (senderRemoved != null)
@@ -112,7 +112,7 @@ public class ProtonServerSessionContext extends AbstractProtonSessionContext
          receiver.setContext(protonReceiver);
          receiver.open();
       }
-      catch (HornetQAMQPException e)
+      catch (ActiveMQAMQPException e)
       {
          receivers.remove(receiver);
          receiver.setTarget(null);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPException.java
new file mode 100644
index 0000000..8effdd6
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPException.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.Symbol;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         6/6/13
+ */
+public class ActiveMQAMQPException extends Exception
+{
+
+   private static final String ERROR_PREFIX = "amqp:";
+
+   public Symbol getAmqpError()
+   {
+      return amqpError;
+   }
+
+   private final Symbol amqpError;
+
+   public ActiveMQAMQPException(Symbol amqpError, String message, Throwable e)
+   {
+      super(message, e);
+      this.amqpError = amqpError;
+   }
+
+   public ActiveMQAMQPException(Symbol amqpError, String message)
+   {
+      super(message);
+      this.amqpError = amqpError;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPIllegalStateException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPIllegalStateException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPIllegalStateException.java
new file mode 100644
index 0000000..d1cf795
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPIllegalStateException.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.transport.AmqpError;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         6/6/13
+ */
+public class ActiveMQAMQPIllegalStateException extends ActiveMQAMQPException
+{
+   public ActiveMQAMQPIllegalStateException(String message)
+   {
+      super(AmqpError.ILLEGAL_STATE, message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInternalErrorException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInternalErrorException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInternalErrorException.java
new file mode 100644
index 0000000..065a8c8
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInternalErrorException.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.transport.AmqpError;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         6/6/13
+ */
+public class ActiveMQAMQPInternalErrorException extends ActiveMQAMQPException
+{
+   public ActiveMQAMQPInternalErrorException(String message, Throwable e)
+   {
+      super(AmqpError.INTERNAL_ERROR, message, e);
+   }
+
+   public ActiveMQAMQPInternalErrorException(String message)
+   {
+      super(AmqpError.INTERNAL_ERROR, message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInvalidFieldException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInvalidFieldException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInvalidFieldException.java
new file mode 100644
index 0000000..781d2dd
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPInvalidFieldException.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.transport.AmqpError;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         6/6/13
+ */
+public class ActiveMQAMQPInvalidFieldException extends ActiveMQAMQPException
+{
+   public ActiveMQAMQPInvalidFieldException(String message)
+   {
+      super(AmqpError.INVALID_FIELD, message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPNotImplementedException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPNotImplementedException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPNotImplementedException.java
new file mode 100644
index 0000000..cc19b33
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPNotImplementedException.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.transport.AmqpError;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         6/19/13
+ */
+public class ActiveMQAMQPNotImplementedException extends ActiveMQAMQPException
+{
+   public ActiveMQAMQPNotImplementedException(String message)
+   {
+      super(AmqpError.NOT_IMPLEMENTED, message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPTimeoutException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPTimeoutException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPTimeoutException.java
new file mode 100644
index 0000000..11a595c
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/ActiveMQAMQPTimeoutException.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.proton.plug.exceptions;
+
+import org.apache.qpid.proton.amqp.transport.AmqpError;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQAMQPTimeoutException extends ActiveMQAMQPException
+{
+   public ActiveMQAMQPTimeoutException(String message)
+   {
+      super(AmqpError.ILLEGAL_STATE, message);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPException.java
deleted file mode 100644
index 0a3c68a..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.Symbol;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         6/6/13
- */
-public class HornetQAMQPException extends Exception
-{
-
-   private static final String ERROR_PREFIX = "amqp:";
-
-   public Symbol getAmqpError()
-   {
-      return amqpError;
-   }
-
-   private final Symbol amqpError;
-
-   public HornetQAMQPException(Symbol amqpError, String message, Throwable e)
-   {
-      super(message, e);
-      this.amqpError = amqpError;
-   }
-
-   public HornetQAMQPException(Symbol amqpError, String message)
-   {
-      super(message);
-      this.amqpError = amqpError;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPIllegalStateException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPIllegalStateException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPIllegalStateException.java
deleted file mode 100644
index f3e3b38..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPIllegalStateException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.transport.AmqpError;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         6/6/13
- */
-public class HornetQAMQPIllegalStateException extends HornetQAMQPException
-{
-   public HornetQAMQPIllegalStateException(String message)
-   {
-      super(AmqpError.ILLEGAL_STATE, message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInternalErrorException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInternalErrorException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInternalErrorException.java
deleted file mode 100644
index 7db34a7..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInternalErrorException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.transport.AmqpError;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         6/6/13
- */
-public class HornetQAMQPInternalErrorException extends HornetQAMQPException
-{
-   public HornetQAMQPInternalErrorException(String message, Throwable e)
-   {
-      super(AmqpError.INTERNAL_ERROR, message, e);
-   }
-
-   public HornetQAMQPInternalErrorException(String message)
-   {
-      super(AmqpError.INTERNAL_ERROR, message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInvalidFieldException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInvalidFieldException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInvalidFieldException.java
deleted file mode 100644
index 2f73de8..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPInvalidFieldException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.transport.AmqpError;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         6/6/13
- */
-public class HornetQAMQPInvalidFieldException extends HornetQAMQPException
-{
-   public HornetQAMQPInvalidFieldException(String message)
-   {
-      super(AmqpError.INVALID_FIELD, message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPNotImplementedException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPNotImplementedException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPNotImplementedException.java
deleted file mode 100644
index 35a2143..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPNotImplementedException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.transport.AmqpError;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         6/19/13
- */
-public class HornetQAMQPNotImplementedException extends HornetQAMQPException
-{
-   public HornetQAMQPNotImplementedException(String message)
-   {
-      super(AmqpError.NOT_IMPLEMENTED, message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPTimeoutException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPTimeoutException.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPTimeoutException.java
deleted file mode 100644
index 50d72d8..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/exceptions/HornetQAMQPTimeoutException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.proton.plug.exceptions;
-
-import org.apache.qpid.proton.amqp.transport.AmqpError;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQAMQPTimeoutException extends HornetQAMQPException
-{
-   public HornetQAMQPTimeoutException(String message)
-   {
-      super(AmqpError.ILLEGAL_STATE, message);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/ActiveMQAMQPProtocolMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/ActiveMQAMQPProtocolMessageBundle.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/ActiveMQAMQPProtocolMessageBundle.java
new file mode 100644
index 0000000..cf23596
--- /dev/null
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/ActiveMQAMQPProtocolMessageBundle.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.proton.plug.logger;
+
+import org.proton.plug.exceptions.ActiveMQAMQPIllegalStateException;
+import org.proton.plug.exceptions.ActiveMQAMQPInternalErrorException;
+import org.proton.plug.exceptions.ActiveMQAMQPInvalidFieldException;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * Logger Code 11
+ * <p/>
+ * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
+ * is from 219000 to 119999.
+ * <p/>
+ * Once released, methods should not be deleted as they may be referenced by knowledge base
+ * articles. Unused methods should be marked as deprecated.
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQAMQPProtocolMessageBundle
+{
+   ActiveMQAMQPProtocolMessageBundle BUNDLE = Messages.getBundle(ActiveMQAMQPProtocolMessageBundle.class);
+
+
+   @Message(id = 219000, value = "target address not set", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInvalidFieldException targetAddressNotSet();
+
+   @Message(id = 219001, value = "error creating temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInternalErrorException errorCreatingTemporaryQueue(String message);
+
+   @Message(id = 219002, value = "target address does not exist", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException addressDoesntExist();
+
+   @Message(id = 219003, value = "error finding temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInternalErrorException errorFindingTemporaryQueue(String message);
+
+   @Message(id = 219004, value = "error creating ActiveMQ Session, {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInternalErrorException errorCreatingActiveMQSession(String message);
+
+   @Message(id = 219005, value = "error creating ActiveMQ Consumer, {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInternalErrorException errorCreatingActiveMQConsumer(String message);
+
+   @Message(id = 219006, value = "error starting ActiveMQ Consumer, {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorStartingConsumer(String message);
+
+   @Message(id = 219007, value = "error acknowledging message {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorAcknowledgingMessage(String messageID, String message);
+
+   @Message(id = 219008, value = "error cancelling message {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorCancellingMessage(String messageID, String message);
+
+   @Message(id = 219009, value = "error closing consumer {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorClosingConsumer(long consumerID, String message);
+
+   @Message(id = 219010, value = "source address does not exist", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInvalidFieldException sourceAddressDoesntExist();
+
+   @Message(id = 219011, value = "source address not set", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPInvalidFieldException sourceAddressNotSet();
+
+   @Message(id = 219012, value = "error rolling back coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorRollingbackCoordinator(String message);
+
+   @Message(id = 219013, value = "error committing coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAMQPIllegalStateException errorCommittingCoordinator(String message);
+
+   @Message(id = 219015, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
+   String decodeError();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/HornetQAMQPProtocolMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/HornetQAMQPProtocolMessageBundle.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/HornetQAMQPProtocolMessageBundle.java
deleted file mode 100644
index c4c22c8..0000000
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/logger/HornetQAMQPProtocolMessageBundle.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.proton.plug.logger;
-
-import org.proton.plug.exceptions.HornetQAMQPIllegalStateException;
-import org.proton.plug.exceptions.HornetQAMQPInternalErrorException;
-import org.proton.plug.exceptions.HornetQAMQPInvalidFieldException;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * Logger Code 11
- * <p/>
- * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
- * is from 219000 to 119999.
- * <p/>
- * Once released, methods should not be deleted as they may be referenced by knowledge base
- * articles. Unused methods should be marked as deprecated.
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQAMQPProtocolMessageBundle
-{
-   HornetQAMQPProtocolMessageBundle BUNDLE = Messages.getBundle(HornetQAMQPProtocolMessageBundle.class);
-
-
-   @Message(id = 219000, value = "target address not set", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInvalidFieldException targetAddressNotSet();
-
-   @Message(id = 219001, value = "error creating temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInternalErrorException errorCreatingTemporaryQueue(String message);
-
-   @Message(id = 219002, value = "target address does not exist", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException addressDoesntExist();
-
-   @Message(id = 219003, value = "error finding temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInternalErrorException errorFindingTemporaryQueue(String message);
-
-   @Message(id = 219004, value = "error creating HornetQ Session, {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInternalErrorException errorCreatingHornetQSession(String message);
-
-   @Message(id = 219005, value = "error creating HornetQ Consumer, {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInternalErrorException errorCreatingHornetQConsumer(String message);
-
-   @Message(id = 219006, value = "error starting HornetQ Consumer, {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorStartingConsumer(String message);
-
-   @Message(id = 219007, value = "error acknowledging message {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorAcknowledgingMessage(String messageID, String message);
-
-   @Message(id = 219008, value = "error cancelling message {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorCancellingMessage(String messageID, String message);
-
-   @Message(id = 219009, value = "error closing consumer {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorClosingConsumer(long consumerID, String message);
-
-   @Message(id = 219010, value = "source address does not exist", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInvalidFieldException sourceAddressDoesntExist();
-
-   @Message(id = 219011, value = "source address not set", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPInvalidFieldException sourceAddressNotSet();
-
-   @Message(id = 219012, value = "error rolling back coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorRollingbackCoordinator(String message);
-
-   @Message(id = 219013, value = "error committing coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQAMQPIllegalStateException errorCommittingCoordinator(String message);
-
-   @Message(id = 219015, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
-   String decodeError();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/util/ReusableLatch.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/util/ReusableLatch.java b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/util/ReusableLatch.java
index 4f1f01e..80285a4 100644
--- a/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/util/ReusableLatch.java
+++ b/activemq-protocols/activemq-proton-plug/src/main/java/org/proton/plug/util/ReusableLatch.java
@@ -23,7 +23,7 @@ import java.util.concurrent.locks.AbstractQueuedSynchronizer;
  * <p/>
  * <p>It could be used for sync points when one process is feeding the latch while another will wait when everything is done. (e.g. waiting IO completions to finish)</p>
  * <p/>
- * <p>On HornetQ we have the requirement of increment and decrement a counter until the user fires a ready handler (commit). At that point we just act as a regular countDown.</p>
+ * <p>On ActiveMQ we have the requirement of increment and decrement a counter until the user fires a ready handler (commit). At that point we just act as a regular countDown.</p>
  * <p/>
  * <p>Note: This latch is reusable. Once it reaches zero, you can call up again, and reuse it on further waits.</p>
  * <p/>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/MinimalServer.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/MinimalServer.java b/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/MinimalServer.java
index 0c20c0f..d3c4022 100644
--- a/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/MinimalServer.java
+++ b/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/MinimalServer.java
@@ -114,9 +114,9 @@ public class MinimalServer
 //       childOption(ChannelOption.AUTO_READ, false).
          childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
 
-      channelGroup = new DefaultChannelGroup("hornetq-accepted-channels", GlobalEventExecutor.INSTANCE);
+      channelGroup = new DefaultChannelGroup("activemq-accepted-channels", GlobalEventExecutor.INSTANCE);
 
-      serverChannelGroup = new DefaultChannelGroup("hornetq-acceptor-channels", GlobalEventExecutor.INSTANCE);
+      serverChannelGroup = new DefaultChannelGroup("activemq-acceptor-channels", GlobalEventExecutor.INSTANCE);
 
 
       SocketAddress address;


[18/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASession.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASession.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASession.java
deleted file mode 100644
index b7a551b..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASession.java
+++ /dev/null
@@ -1,1903 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.jms.TransactionInProgressException;
-import javax.jms.XAQueueSession;
-import javax.jms.XATopicSession;
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionEvent;
-import javax.resource.spi.ManagedConnection;
-import javax.transaction.xa.XAResource;
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
-import org.apache.activemq.jms.client.HornetQSession;
-
-
-/**
- * A joint interface for JMS sessions
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- */
-public final class HornetQRASession implements QueueSession, TopicSession, XAQueueSession, XATopicSession
-{
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The managed connection
-    */
-   private HornetQRAManagedConnection mc;
-
-   /**
-    * The connection request info
-    */
-   private final HornetQRAConnectionRequestInfo cri;
-
-   /**
-    * The session factory
-    */
-   private HornetQRASessionFactory sf;
-
-   /**
-    * The message consumers
-    */
-   private final Set<MessageConsumer> consumers;
-
-   /**
-    * The message producers
-    */
-   private final Set<MessageProducer> producers;
-
-   /**
-    * Constructor
-    *
-    * @param mc  The managed connection
-    * @param cri The connection request info
-    */
-   public HornetQRASession(final HornetQRAManagedConnection mc, final HornetQRAConnectionRequestInfo cri)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mc + ", " + cri + ")");
-      }
-
-      this.mc = mc;
-      this.cri = cri;
-      sf = null;
-      consumers = new HashSet<MessageConsumer>();
-      producers = new HashSet<MessageProducer>();
-   }
-
-   /**
-    * Set the session factory
-    *
-    * @param sf The session factory
-    */
-   public void setHornetQSessionFactory(final HornetQRASessionFactory sf)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setHornetQSessionFactory(" + sf + ")");
-      }
-
-      this.sf = sf;
-   }
-
-   /**
-    * Lock
-    *
-    * @throws JMSException          Thrown if an error occurs
-    * @throws IllegalStateException The session is closed
-    */
-   protected void lock() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("lock()");
-      }
-
-      final HornetQRAManagedConnection mcLocal = this.mc;
-      if (mcLocal != null)
-      {
-         mcLocal.tryLock();
-      }
-      else
-      {
-         throw new IllegalStateException("Connection is not associated with a managed connection. " + this);
-      }
-   }
-
-   /**
-    * Unlock
-    */
-   protected void unlock()
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("unlock()");
-      }
-
-      final HornetQRAManagedConnection mcLocal = this.mc;
-      if (mcLocal != null)
-      {
-         mcLocal.unlock();
-      }
-
-      // We recreate the lock when returned to the pool
-      // so missing the unlock after disassociation is not important
-   }
-
-   /**
-    * Create a bytes message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public BytesMessage createBytesMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createBytesMessage" + session);
-      }
-
-      return session.createBytesMessage();
-   }
-
-   /**
-    * Create a map message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MapMessage createMapMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createMapMessage(), " + session);
-      }
-
-      return session.createMapMessage();
-   }
-
-   /**
-    * Create a message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Message createMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createMessage" + session);
-      }
-
-      return session.createMessage();
-   }
-
-   /**
-    * Create an object message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public ObjectMessage createObjectMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createObjectMessage" + session);
-      }
-
-      return session.createObjectMessage();
-   }
-
-   /**
-    * Create an object message
-    *
-    * @param object The object
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public ObjectMessage createObjectMessage(final Serializable object) throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createObjectMessage(" + object + ")" + session);
-      }
-
-      return session.createObjectMessage(object);
-   }
-
-   /**
-    * Create a stream message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public StreamMessage createStreamMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createStreamMessage" + session);
-      }
-
-      return session.createStreamMessage();
-   }
-
-   /**
-    * Create a text message
-    *
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TextMessage createTextMessage() throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTextMessage" + session);
-      }
-
-      return session.createTextMessage();
-   }
-
-   /**
-    * Create a text message
-    *
-    * @param string The text
-    * @return The message
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TextMessage createTextMessage(final String string) throws JMSException
-   {
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTextMessage(" + string + ")" + session);
-      }
-
-      return session.createTextMessage(string);
-   }
-
-   /**
-    * Get transacted
-    *
-    * @return True if transacted; otherwise false
-    * @throws JMSException Thrown if an error occurs
-    */
-   public boolean getTransacted() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTransacted()");
-      }
-
-      getSessionInternal();
-      return cri.isTransacted();
-   }
-
-   /**
-    * Get the message listener -- throws IllegalStateException
-    *
-    * @return The message listener
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MessageListener getMessageListener() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageListener()");
-      }
-
-      throw new IllegalStateException("Method not allowed");
-   }
-
-   /**
-    * Set the message listener -- Throws IllegalStateException
-    *
-    * @param listener The message listener
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setMessageListener(final MessageListener listener) throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setMessageListener(" + listener + ")");
-      }
-
-      throw new IllegalStateException("Method not allowed");
-   }
-
-   /**
-    * Always throws an Error.
-    *
-    * @throws Error Method not allowed.
-    */
-   public void run()
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("run()");
-      }
-
-      throw new Error("Method not allowed");
-   }
-
-   /**
-    * Closes the session. Sends a ConnectionEvent.CONNECTION_CLOSED to the
-    * managed connection.
-    *
-    * @throws JMSException Failed to close session.
-    */
-   public void close() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("close()");
-      }
-
-      sf.closeSession(this);
-      closeSession();
-   }
-
-   /**
-    * Commit
-    *
-    * @throws JMSException Failed to close session.
-    */
-   public void commit() throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.XA_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new TransactionInProgressException("XA connection");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (cri.isTransacted() == false)
-         {
-            throw new IllegalStateException("Session is not transacted");
-         }
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("Commit session " + this);
-         }
-
-         session.commit();
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Rollback
-    *
-    * @throws JMSException Failed to close session.
-    */
-   public void rollback() throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.XA_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new TransactionInProgressException("XA connection");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (cri.isTransacted() == false)
-         {
-            throw new IllegalStateException("Session is not transacted");
-         }
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("Rollback session " + this);
-         }
-
-         session.rollback();
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Recover
-    *
-    * @throws JMSException Failed to close session.
-    */
-   public void recover() throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (cri.isTransacted())
-         {
-            throw new IllegalStateException("Session is transacted");
-         }
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("Recover session " + this);
-         }
-
-         session.recover();
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a topic
-    *
-    * @param topicName The topic name
-    * @return The topic
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Topic createTopic(final String topicName) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create topic for javax.jms.QueueSession");
-      }
-
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTopic " + session + " topicName=" + topicName);
-      }
-
-      Topic result = session.createTopic(topicName);
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createdTopic " + session + " topic=" + result);
-      }
-
-      return result;
-   }
-
-   /**
-    * Create a topic subscriber
-    *
-    * @param topic The topic
-    * @return The subscriber
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
-   {
-      lock();
-      try
-      {
-         TopicSession session = getTopicSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSubscriber " + session + " topic=" + topic);
-         }
-
-         TopicSubscriber result = session.createSubscriber(topic);
-         result = new HornetQRATopicSubscriber(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdSubscriber " + session + " HornetQTopicSubscriber=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a topic subscriber
-    *
-    * @param topic           The topic
-    * @param messageSelector The message selector
-    * @param noLocal         If true inhibits the delivery of messages published by its own connection
-    * @return The subscriber
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSubscriber createSubscriber(final Topic topic, final String messageSelector, final boolean noLocal) throws JMSException
-   {
-      lock();
-      try
-      {
-         TopicSession session = getTopicSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSubscriber " + session +
-                                            " topic=" +
-                                            topic +
-                                            " selector=" +
-                                            messageSelector +
-                                            " noLocal=" +
-                                            noLocal);
-         }
-
-         TopicSubscriber result = session.createSubscriber(topic, messageSelector, noLocal);
-         result = new HornetQRATopicSubscriber(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdSubscriber " + session + " HornetQTopicSubscriber=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a durable topic subscriber
-    *
-    * @param topic The topic
-    * @param name  The name
-    * @return The subscriber
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create durable subscriber from javax.jms.QueueSession");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createDurableSubscriber " + session + " topic=" + topic + " name=" + name);
-         }
-
-         TopicSubscriber result = session.createDurableSubscriber(topic, name);
-         result = new HornetQRATopicSubscriber(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdDurableSubscriber " + session + " HornetQTopicSubscriber=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a topic subscriber
-    *
-    * @param topic           The topic
-    * @param name            The name
-    * @param messageSelector The message selector
-    * @param noLocal         If true inhibits the delivery of messages published by its own connection
-    * @return The subscriber
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSubscriber createDurableSubscriber(final Topic topic,
-                                                  final String name,
-                                                  final String messageSelector,
-                                                  final boolean noLocal) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createDurableSubscriber " + session +
-                                            " topic=" +
-                                            topic +
-                                            " name=" +
-                                            name +
-                                            " selector=" +
-                                            messageSelector +
-                                            " noLocal=" +
-                                            noLocal);
-         }
-
-         TopicSubscriber result = session.createDurableSubscriber(topic, name, messageSelector, noLocal);
-         result = new HornetQRATopicSubscriber(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdDurableSubscriber " + session + " HornetQTopicSubscriber=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a topic publisher
-    *
-    * @param topic The topic
-    * @return The publisher
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicPublisher createPublisher(final Topic topic) throws JMSException
-   {
-      lock();
-      try
-      {
-         TopicSession session = getTopicSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createPublisher " + session + " topic=" + topic);
-         }
-
-         TopicPublisher result = session.createPublisher(topic);
-         result = new HornetQRATopicPublisher(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdPublisher " + session + " publisher=" + result);
-         }
-
-         addProducer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a temporary topic
-    *
-    * @return The temporary topic
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TemporaryTopic createTemporaryTopic() throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create temporary topic for javax.jms.QueueSession");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createTemporaryTopic " + session);
-         }
-
-         TemporaryTopic temp = session.createTemporaryTopic();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdTemporaryTopic " + session + " temp=" + temp);
-         }
-
-         sf.addTemporaryTopic(temp);
-
-         return temp;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Unsubscribe
-    *
-    * @param name The name
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void unsubscribe(final String name) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot unsubscribe for javax.jms.QueueSession");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("unsubscribe " + session + " name=" + name);
-         }
-
-         session.unsubscribe(name);
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a browser
-    *
-    * @param queue The queue
-    * @return The browser
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueBrowser createBrowser(final Queue queue) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create browser for javax.jms.TopicSession");
-      }
-
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createBrowser " + session + " queue=" + queue);
-      }
-
-      QueueBrowser result = session.createBrowser(queue);
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createdBrowser " + session + " browser=" + result);
-      }
-
-      return result;
-   }
-
-   /**
-    * Create a browser
-    *
-    * @param queue           The queue
-    * @param messageSelector The message selector
-    * @return The browser
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueBrowser createBrowser(final Queue queue, final String messageSelector) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create browser for javax.jms.TopicSession");
-      }
-
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createBrowser " + session + " queue=" + queue + " selector=" + messageSelector);
-      }
-
-      QueueBrowser result = session.createBrowser(queue, messageSelector);
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createdBrowser " + session + " browser=" + result);
-      }
-
-      return result;
-   }
-
-   /**
-    * Create a queue
-    *
-    * @param queueName The queue name
-    * @return The queue
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Queue createQueue(final String queueName) throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create browser or javax.jms.TopicSession");
-      }
-
-      Session session = getSessionInternal();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createQueue " + session + " queueName=" + queueName);
-      }
-
-      Queue result = session.createQueue(queueName);
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createdQueue " + session + " queue=" + result);
-      }
-
-      return result;
-   }
-
-   /**
-    * Create a queue receiver
-    *
-    * @param queue The queue
-    * @return The queue receiver
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueReceiver createReceiver(final Queue queue) throws JMSException
-   {
-      lock();
-      try
-      {
-         QueueSession session = getQueueSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createReceiver " + session + " queue=" + queue);
-         }
-
-         QueueReceiver result = session.createReceiver(queue);
-         result = new HornetQRAQueueReceiver(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdReceiver " + session + " receiver=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a queue receiver
-    *
-    * @param queue           The queue
-    * @param messageSelector
-    * @return The queue receiver
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException
-   {
-      lock();
-      try
-      {
-         QueueSession session = getQueueSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createReceiver " + session + " queue=" + queue + " selector=" + messageSelector);
-         }
-
-         QueueReceiver result = session.createReceiver(queue, messageSelector);
-         result = new HornetQRAQueueReceiver(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdReceiver " + session + " receiver=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a queue sender
-    *
-    * @param queue The queue
-    * @return The queue sender
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueSender createSender(final Queue queue) throws JMSException
-   {
-      lock();
-      try
-      {
-         QueueSession session = getQueueSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSender " + session + " queue=" + queue);
-         }
-
-         QueueSender result = session.createSender(queue);
-         result = new HornetQRAQueueSender(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdSender " + session + " sender=" + result);
-         }
-
-         addProducer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a temporary queue
-    *
-    * @return The temporary queue
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TemporaryQueue createTemporaryQueue() throws JMSException
-   {
-      if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Cannot create temporary queue for javax.jms.TopicSession");
-      }
-
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createTemporaryQueue " + session);
-         }
-
-         TemporaryQueue temp = session.createTemporaryQueue();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdTemporaryQueue " + session + " temp=" + temp);
-         }
-
-         sf.addTemporaryQueue(temp);
-
-         return temp;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a message consumer
-    *
-    * @param destination The destination
-    * @return The message consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MessageConsumer createConsumer(final Destination destination) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createConsumer " + session + " dest=" + destination);
-         }
-
-         MessageConsumer result = session.createConsumer(destination);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a message consumer
-    *
-    * @param destination     The destination
-    * @param messageSelector The message selector
-    * @return The message consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MessageConsumer createConsumer(final Destination destination, final String messageSelector) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createConsumer " + session +
-                                            " dest=" +
-                                            destination +
-                                            " messageSelector=" +
-                                            messageSelector);
-         }
-
-         MessageConsumer result = session.createConsumer(destination, messageSelector);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a message consumer
-    *
-    * @param destination     The destination
-    * @param messageSelector The message selector
-    * @param noLocal         If true inhibits the delivery of messages published by its own connection
-    * @return The message consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MessageConsumer createConsumer(final Destination destination,
-                                         final String messageSelector,
-                                         final boolean noLocal) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createConsumer " + session +
-                                            " dest=" +
-                                            destination +
-                                            " messageSelector=" +
-                                            messageSelector +
-                                            " noLocal=" +
-                                            noLocal);
-         }
-
-         MessageConsumer result = session.createConsumer(destination, messageSelector, noLocal);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Create a message producer
-    *
-    * @param destination The destination
-    * @return The message producer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public MessageProducer createProducer(final Destination destination) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createProducer " + session + " dest=" + destination);
-         }
-
-         MessageProducer result = session.createProducer(destination);
-         result = new HornetQRAMessageProducer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdProducer " + session + " producer=" + result);
-         }
-
-         addProducer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Get the acknowledge mode
-    *
-    * @return The mode
-    * @throws JMSException Thrown if an error occurs
-    */
-   public int getAcknowledgeMode() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getAcknowledgeMode()");
-      }
-
-      getSessionInternal();
-      return cri.getAcknowledgeMode();
-   }
-
-   /**
-    * Get the XA resource
-    *
-    * @return The XA resource
-    * @throws IllegalStateException If non XA connection
-    */
-   public XAResource getXAResource()
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getXAResource()");
-      }
-
-      if (cri.getType() == HornetQRAConnectionFactory.CONNECTION || cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
-      {
-         return null;
-      }
-
-      try
-      {
-         lock();
-
-         return getXAResourceInternal();
-      }
-      catch (Throwable t)
-      {
-         return null;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Returns the ID of the Node that this session is associated with.
-    *
-    * @return Node ID
-    */
-   public String getNodeId() throws JMSException
-   {
-      HornetQSession session = (HornetQSession) getSessionInternal();
-      ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) session.getCoreSession().getSessionFactory();
-      return factory.getLiveNodeId();
-   }
-
-   /**
-    * Get the session
-    *
-    * @return The session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Session getSession() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getNonXAsession()");
-      }
-
-      if (cri.getType() == HornetQRAConnectionFactory.CONNECTION || cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Non XA connection");
-      }
-
-      lock();
-      try
-      {
-         return this;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Get the queue session
-    *
-    * @return The queue session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueSession getQueueSession() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getQueueSession()");
-      }
-
-      if (cri.getType() == HornetQRAConnectionFactory.CONNECTION || cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Non XA connection");
-      }
-
-      lock();
-      try
-      {
-         return this;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Get the topic session
-    *
-    * @return The topic session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSession getTopicSession() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTopicSession()");
-      }
-
-      if (cri.getType() == HornetQRAConnectionFactory.CONNECTION || cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION ||
-         cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Non XA connection");
-      }
-
-      lock();
-      try
-      {
-         return this;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createSharedConsumer(final Topic topic, final String sharedSubscriptionName) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic + ", sharedSubscriptionName=" + sharedSubscriptionName);
-         }
-
-         MessageConsumer result = session.createSharedConsumer(topic, sharedSubscriptionName);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createSharedConsumer(final Topic topic, final String sharedSubscriptionName,
-                                               final String messageSelector) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic +
-                                            ", sharedSubscriptionName=" + sharedSubscriptionName + ", messageSelector=" + messageSelector);
-         }
-
-         MessageConsumer result = session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createDurableConsumer(final Topic topic, final String name) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic + ", name=" + name);
-         }
-
-         MessageConsumer result = session.createDurableConsumer(topic, name);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createDurableConsumer " + session + " topic=" + topic + ", name=" + name +
-                                            ", messageSelector=" + messageSelector + ", noLocal=" + noLocal);
-         }
-
-         MessageConsumer result = session.createDurableConsumer(topic, name, messageSelector, noLocal);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSharedDurableConsumer " + session + " topic=" + topic + ", name=" +
-                                            name);
-         }
-
-         MessageConsumer result = session.createSharedDurableConsumer(topic, name);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   @Override
-   public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException
-   {
-      lock();
-      try
-      {
-         Session session = getSessionInternal();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createSharedDurableConsumer " + session + " topic=" + topic + ", name=" +
-                                            name + ", messageSelector=" + messageSelector);
-         }
-
-         MessageConsumer result = session.createSharedDurableConsumer(topic, name, messageSelector);
-         result = new HornetQRAMessageConsumer(result, this);
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
-         }
-
-         addConsumer(result);
-
-         return result;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * Set the managed connection
-    *
-    * @param managedConnection The managed connection
-    */
-   void setManagedConnection(final HornetQRAManagedConnection managedConnection)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setManagedConnection(" + managedConnection + ")");
-      }
-
-      if (mc != null)
-      {
-         mc.removeHandle(this);
-      }
-
-      mc = managedConnection;
-   }
-
-   /**
-    * for tests only
-    */
-   public ManagedConnection getManagedConnection()
-   {
-      return mc;
-   }
-
-   /**
-    * Destroy
-    */
-   void destroy()
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("destroy()");
-      }
-
-      mc = null;
-   }
-
-   /**
-    * Start
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   void start() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start()");
-      }
-
-      if (mc != null)
-      {
-         mc.start();
-      }
-   }
-
-   /**
-    * Stop
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   void stop() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("stop()");
-      }
-
-      if (mc != null)
-      {
-         mc.stop();
-      }
-   }
-
-   /**
-    * Check strict
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   void checkStrict() throws JMSException
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("checkStrict()");
-      }
-
-      if (mc != null)
-      {
-         throw new IllegalStateException(HornetQRASessionFactory.ISE);
-      }
-   }
-
-   /**
-    * Close session
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   void closeSession() throws JMSException
-   {
-      if (mc != null)
-      {
-         HornetQRALogger.LOGGER.trace("Closing session");
-
-         try
-         {
-            mc.stop();
-         }
-         catch (Throwable t)
-         {
-            HornetQRALogger.LOGGER.trace("Error stopping managed connection", t);
-         }
-
-         synchronized (consumers)
-         {
-            for (Iterator<MessageConsumer> i = consumers.iterator(); i.hasNext(); )
-            {
-               HornetQRAMessageConsumer consumer = (HornetQRAMessageConsumer) i.next();
-               try
-               {
-                  consumer.closeConsumer();
-               }
-               catch (Throwable t)
-               {
-                  HornetQRALogger.LOGGER.trace("Error closing consumer", t);
-               }
-               i.remove();
-            }
-         }
-
-         synchronized (producers)
-         {
-            for (Iterator<MessageProducer> i = producers.iterator(); i.hasNext(); )
-            {
-               HornetQRAMessageProducer producer = (HornetQRAMessageProducer) i.next();
-               try
-               {
-                  producer.closeProducer();
-               }
-               catch (Throwable t)
-               {
-                  HornetQRALogger.LOGGER.trace("Error closing producer", t);
-               }
-               i.remove();
-            }
-         }
-
-         mc.removeHandle(this);
-         ConnectionEvent ev = new ConnectionEvent(mc, ConnectionEvent.CONNECTION_CLOSED);
-         ev.setConnectionHandle(this);
-         mc.sendEvent(ev);
-         mc = null;
-      }
-   }
-
-   /**
-    * Add consumer
-    *
-    * @param consumer The consumer
-    */
-   void addConsumer(final MessageConsumer consumer)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("addConsumer(" + consumer + ")");
-      }
-
-      synchronized (consumers)
-      {
-         consumers.add(consumer);
-      }
-   }
-
-   /**
-    * Remove consumer
-    *
-    * @param consumer The consumer
-    */
-   void removeConsumer(final MessageConsumer consumer)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("removeConsumer(" + consumer + ")");
-      }
-
-      synchronized (consumers)
-      {
-         consumers.remove(consumer);
-      }
-   }
-
-   /**
-    * Add producer
-    *
-    * @param producer The producer
-    */
-   void addProducer(final MessageProducer producer)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("addProducer(" + producer + ")");
-      }
-
-      synchronized (producers)
-      {
-         producers.add(producer);
-      }
-   }
-
-   /**
-    * Remove producer
-    *
-    * @param producer The producer
-    */
-   void removeProducer(final MessageProducer producer)
-   {
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("removeProducer(" + producer + ")");
-      }
-
-      synchronized (producers)
-      {
-         producers.remove(producer);
-      }
-   }
-
-   /**
-    * Get the session and ensure that it is open
-    *
-    * @return The session
-    * @throws JMSException          Thrown if an error occurs
-    * @throws IllegalStateException The session is closed
-    */
-   Session getSessionInternal() throws JMSException
-   {
-      if (mc == null)
-      {
-         throw new IllegalStateException("The session is closed");
-      }
-
-      Session session = mc.getSession();
-
-      if (HornetQRASession.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSessionInternal " + session + " for " + this);
-      }
-
-      return session;
-   }
-
-   /**
-    * Get the XA resource and ensure that it is open
-    *
-    * @return The XA Resource
-    * @throws JMSException          Thrown if an error occurs
-    * @throws IllegalStateException The session is closed
-    */
-   XAResource getXAResourceInternal() throws JMSException
-   {
-      if (mc == null)
-      {
-         throw new IllegalStateException("The session is closed");
-      }
-
-      try
-      {
-         XAResource xares = mc.getXAResource();
-
-         if (HornetQRASession.trace)
-         {
-            HornetQRALogger.LOGGER.trace("getXAResourceInternal " + xares + " for " + this);
-         }
-
-         return xares;
-      }
-      catch (ResourceException e)
-      {
-         JMSException jmse = new JMSException("Unable to get XA Resource");
-         jmse.initCause(e);
-         throw jmse;
-      }
-   }
-
-   /**
-    * Get the queue session
-    *
-    * @return The queue session
-    * @throws JMSException          Thrown if an error occurs
-    * @throws IllegalStateException The session is closed
-    */
-   QueueSession getQueueSessionInternal() throws JMSException
-   {
-      Session s = getSessionInternal();
-      if (!(s instanceof QueueSession))
-      {
-         throw new InvalidDestinationException("Attempting to use QueueSession methods on: " + this);
-      }
-      return (QueueSession) s;
-   }
-
-   /**
-    * Get the topic session
-    *
-    * @return The topic session
-    * @throws JMSException          Thrown if an error occurs
-    * @throws IllegalStateException The session is closed
-    */
-   TopicSession getTopicSessionInternal() throws JMSException
-   {
-      Session s = getSessionInternal();
-      if (!(s instanceof TopicSession))
-      {
-         throw new InvalidDestinationException("Attempting to use TopicSession methods on: " + this);
-      }
-      return (TopicSession) s;
-   }
-
-   /**
-    * @throws SystemException
-    * @throws RollbackException
-    */
-   public void checkState() throws JMSException
-   {
-      if (mc != null)
-      {
-         mc.checkTransactionActive();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactory.java
deleted file mode 100644
index bcb631b..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.XAQueueConnection;
-import javax.jms.XATopicConnection;
-
-/**
- * A joint interface for all connection types
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @version $Revision: 71554 $
- */
-public interface HornetQRASessionFactory extends XATopicConnection, XAQueueConnection
-{
-   /** Error message for strict behaviour */
-   String ISE = "This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6";
-
-   /**
-    * Add a temporary queue
-    * @param temp The temporary queue
-    */
-   void addTemporaryQueue(TemporaryQueue temp);
-
-   /**
-    * Add a temporary topic
-    * @param temp The temporary topic
-    */
-   void addTemporaryTopic(TemporaryTopic temp);
-
-   /**
-    * Notification that a session is closed
-    * @param session The session
-    * @throws JMSException for any error
-    */
-   void closeSession(HornetQRASession session) throws JMSException;
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactoryImpl.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactoryImpl.java
deleted file mode 100644
index 37e0016..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRASessionFactoryImpl.java
+++ /dev/null
@@ -1,1046 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.ConnectionConsumer;
-import javax.jms.ConnectionMetaData;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSContext;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.QueueSession;
-import javax.jms.ServerSessionPool;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.Topic;
-import javax.jms.TopicSession;
-import javax.jms.XAJMSContext;
-import javax.jms.XAQueueSession;
-import javax.jms.XASession;
-import javax.jms.XATopicSession;
-import javax.naming.Reference;
-import javax.resource.Referenceable;
-import javax.resource.spi.ConnectionManager;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.activemq.api.jms.HornetQJMSConstants;
-import org.apache.activemq.jms.client.HornetQConnectionForContext;
-import org.apache.activemq.jms.client.HornetQConnectionForContextImpl;
-
-/**
- * Implements the JMS Connection API and produces {@link HornetQRASession} objects.
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public final class HornetQRASessionFactoryImpl extends HornetQConnectionForContextImpl implements
-   HornetQRASessionFactory, HornetQConnectionForContext, Referenceable
-{
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Are we closed?
-    */
-   private boolean closed = false;
-
-   /**
-    * The naming reference
-    */
-   private Reference reference;
-
-   /**
-    * The user name
-    */
-   private String userName;
-
-   /**
-    * The password
-    */
-   private String password;
-
-   /**
-    * The client ID
-    */
-   private String clientID;
-
-   /**
-    * The connection type
-    */
-   private final int type;
-
-   /**
-    * Whether we are started
-    */
-   private boolean started = false;
-
-   /**
-    * The managed connection factory
-    */
-   private final HornetQRAManagedConnectionFactory mcf;
-   private TransactionManager tm;
-
-   /**
-    * The connection manager
-    */
-   private ConnectionManager cm;
-
-   /**
-    * The sessions
-    */
-   private final Set<HornetQRASession> sessions = new HashSet<HornetQRASession>();
-
-   /**
-    * The temporary queues
-    */
-   private final Set<TemporaryQueue> tempQueues = new HashSet<TemporaryQueue>();
-
-   /**
-    * The temporary topics
-    */
-   private final Set<TemporaryTopic> tempTopics = new HashSet<TemporaryTopic>();
-
-   /**
-    * Constructor
-    *
-    * @param mcf  The managed connection factory
-    * @param cm   The connection manager
-    * @param type The connection type
-    */
-   public HornetQRASessionFactoryImpl(final HornetQRAManagedConnectionFactory mcf,
-                                      final ConnectionManager cm,
-                                      final TransactionManager tm,
-                                      final int type)
-   {
-      this.mcf = mcf;
-
-      this.tm = tm;
-
-      if (cm == null)
-      {
-         this.cm = new HornetQRAConnectionManager();
-      }
-      else
-      {
-         this.cm = cm;
-      }
-
-      this.type = type;
-
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cm + ", " + type);
-      }
-   }
-
-   public JMSContext createContext(int sessionMode)
-   {
-      boolean inJtaTx = inJtaTransaction();
-      int sessionModeToUse;
-      switch (sessionMode)
-      {
-         case Session.AUTO_ACKNOWLEDGE:
-         case Session.DUPS_OK_ACKNOWLEDGE:
-         case HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
-         case HornetQJMSConstants.PRE_ACKNOWLEDGE:
-            sessionModeToUse = sessionMode;
-            break;
-         //these are prohibited in JEE unless not in a JTA tx where they should be ignored and auto_ack used
-         case Session.CLIENT_ACKNOWLEDGE:
-            if (!inJtaTx)
-            {
-               throw HornetQRABundle.BUNDLE.invalidSessionTransactedModeRuntime();
-            }
-            sessionModeToUse = Session.AUTO_ACKNOWLEDGE;
-            break;
-         case Session.SESSION_TRANSACTED:
-            if (!inJtaTx)
-            {
-               throw HornetQRABundle.BUNDLE.invalidClientAcknowledgeModeRuntime();
-            }
-            sessionModeToUse = Session.AUTO_ACKNOWLEDGE;
-            break;
-         default:
-            throw HornetQRABundle.BUNDLE.invalidAcknowledgeMode(sessionMode);
-      }
-      incrementRefCounter();
-
-      return new HornetQRAJMSContext(this, sessionModeToUse, threadAwareContext);
-   }
-
-   public XAJMSContext createXAContext()
-   {
-      incrementRefCounter();
-
-      return new HornetQRAXAJMSContext(this, threadAwareContext);
-   }
-
-   /**
-    * Set the naming reference
-    *
-    * @param reference The reference
-    */
-   public void setReference(final Reference reference)
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setReference(" + reference + ")");
-      }
-
-      this.reference = reference;
-   }
-
-   /**
-    * Get the naming reference
-    *
-    * @return The reference
-    */
-   public Reference getReference()
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getReference()");
-      }
-
-      return reference;
-   }
-
-   /**
-    * Set the user name
-    *
-    * @param name The user name
-    */
-   public void setUserName(final String name)
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUserName(" + name + ")");
-      }
-
-      userName = name;
-   }
-
-   /**
-    * Set the password
-    *
-    * @param password The password
-    */
-   public void setPassword(final String password)
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      this.password = password;
-   }
-
-   /**
-    * Get the client ID
-    *
-    * @return The client ID
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public String getClientID() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getClientID()");
-      }
-
-      checkClosed();
-
-      if (clientID == null)
-      {
-         return ((HornetQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID();
-      }
-
-      return clientID;
-   }
-
-   /**
-    * Set the client ID -- throws IllegalStateException
-    *
-    * @param cID The client ID
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public void setClientID(final String cID) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setClientID(" + cID + ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a queue session
-    *
-    * @param transacted      Use transactions
-    * @param acknowledgeMode The acknowledge mode
-    * @return The queue session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createQueueSession(" + transacted + ", " + acknowledgeMode + ")");
-      }
-
-      checkClosed();
-
-      if (type == HornetQRAConnectionFactory.TOPIC_CONNECTION || type == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Can not get a queue session from a topic connection");
-      }
-
-      return allocateConnection(transacted, acknowledgeMode, type);
-   }
-
-   /**
-    * Create a XA queue session
-    *
-    * @return The XA queue session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public XAQueueSession createXAQueueSession() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXAQueueSession()");
-      }
-
-      checkClosed();
-
-      if (type == HornetQRAConnectionFactory.CONNECTION || type == HornetQRAConnectionFactory.TOPIC_CONNECTION ||
-         type == HornetQRAConnectionFactory.XA_TOPIC_CONNECTION)
-      {
-         throw new IllegalStateException("Can not get a topic session from a queue connection");
-      }
-
-      return allocateConnection(type);
-   }
-
-   /**
-    * Create a connection consumer -- throws IllegalStateException
-    *
-    * @param queue           The queue
-    * @param messageSelector The message selector
-    * @param sessionPool     The session pool
-    * @param maxMessages     The number of max messages
-    * @return The connection consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public ConnectionConsumer createConnectionConsumer(final Queue queue,
-                                                      final String messageSelector,
-                                                      final ServerSessionPool sessionPool,
-                                                      final int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionConsumer(" + queue +
-                                         ", " +
-                                         messageSelector +
-                                         ", " +
-                                         sessionPool +
-                                         ", " +
-                                         maxMessages +
-                                         ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a topic session
-    *
-    * @param transacted      Use transactions
-    * @param acknowledgeMode The acknowledge mode
-    * @return The topic session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTopicSession(" + transacted + ", " + acknowledgeMode + ")");
-      }
-
-      checkClosed();
-
-      if (type == HornetQRAConnectionFactory.QUEUE_CONNECTION || type == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Can not get a topic session from a queue connection");
-      }
-
-      return allocateConnection(transacted, acknowledgeMode, type);
-   }
-
-   /**
-    * Create a XA topic session
-    *
-    * @return The XA topic session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public XATopicSession createXATopicSession() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXATopicSession()");
-      }
-
-      checkClosed();
-
-      if (type == HornetQRAConnectionFactory.CONNECTION || type == HornetQRAConnectionFactory.QUEUE_CONNECTION ||
-         type == HornetQRAConnectionFactory.XA_QUEUE_CONNECTION)
-      {
-         throw new IllegalStateException("Can not get a topic session from a queue connection");
-      }
-
-      return allocateConnection(type);
-   }
-
-   /**
-    * Create a connection consumer -- throws IllegalStateException
-    *
-    * @param topic           The topic
-    * @param messageSelector The message selector
-    * @param sessionPool     The session pool
-    * @param maxMessages     The number of max messages
-    * @return The connection consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public ConnectionConsumer createConnectionConsumer(final Topic topic,
-                                                      final String messageSelector,
-                                                      final ServerSessionPool sessionPool,
-                                                      final int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionConsumer(" + topic +
-                                         ", " +
-                                         messageSelector +
-                                         ", " +
-                                         sessionPool +
-                                         ", " +
-                                         maxMessages +
-                                         ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a durable connection consumer -- throws IllegalStateException
-    *
-    * @param topic            The topic
-    * @param subscriptionName The subscription name
-    * @param messageSelector  The message selector
-    * @param sessionPool      The session pool
-    * @param maxMessages      The number of max messages
-    * @return The connection consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public ConnectionConsumer createDurableConnectionConsumer(final Topic topic,
-                                                             final String subscriptionName,
-                                                             final String messageSelector,
-                                                             final ServerSessionPool sessionPool,
-                                                             final int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionConsumer(" + topic +
-                                         ", " +
-                                         subscriptionName +
-                                         ", " +
-                                         messageSelector +
-                                         ", " +
-                                         sessionPool +
-                                         ", " +
-                                         maxMessages +
-                                         ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a connection consumer -- throws IllegalStateException
-    *
-    * @param destination The destination
-    * @param pool        The session pool
-    * @param maxMessages The number of max messages
-    * @return The connection consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   public ConnectionConsumer createConnectionConsumer(final Destination destination,
-                                                      final ServerSessionPool pool,
-                                                      final int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionConsumer(" + destination +
-                                         ", " +
-                                         pool +
-                                         ", " +
-                                         maxMessages +
-                                         ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a connection consumer -- throws IllegalStateException
-    *
-    * @param destination The destination
-    * @param name        The name
-    * @param pool        The session pool
-    * @param maxMessages The number of max messages
-    * @return The connection consumer
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public ConnectionConsumer createConnectionConsumer(final Destination destination,
-                                                      final String name,
-                                                      final ServerSessionPool pool,
-                                                      final int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionConsumer(" + destination +
-                                         ", " +
-                                         name +
-                                         ", " +
-                                         pool +
-                                         ", " +
-                                         maxMessages +
-                                         ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Create a session
-    *
-    * @param transacted      Use transactions
-    * @param acknowledgeMode The acknowledge mode
-    * @return The session
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createSession(" + transacted + ", " + acknowledgeMode + ")");
-      }
-
-      checkClosed();
-      return allocateConnection(transacted, acknowledgeMode, type);
-   }
-
-   /**
-    * Create a XA session
-    *
-    * @return The XA session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public XASession createXASession() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXASession()");
-      }
-
-      checkClosed();
-      return allocateConnection(type);
-   }
-
-   /**
-    * Get the connection metadata
-    *
-    * @return The connection metadata
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public ConnectionMetaData getMetaData() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMetaData()");
-      }
-
-      checkClosed();
-      return mcf.getMetaData();
-   }
-
-   /**
-    * Get the exception listener -- throws IllegalStateException
-    *
-    * @return The exception listener
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public ExceptionListener getExceptionListener() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getExceptionListener()");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Set the exception listener -- throws IllegalStateException
-    *
-    * @param listener The exception listener
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public void setExceptionListener(final ExceptionListener listener) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setExceptionListener(" + listener + ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Start
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public void start() throws JMSException
-   {
-      checkClosed();
-
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start() " + this);
-      }
-
-      synchronized (sessions)
-      {
-         if (started)
-         {
-            return;
-         }
-         started = true;
-         for (HornetQRASession session : sessions)
-         {
-            session.start();
-         }
-      }
-   }
-
-   /**
-    * Stop
-    *
-    * @throws IllegalStateException
-    * @throws JMSException          Thrown if an error occurs
-    */
-   @Override
-   public void stop() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("stop() " + this);
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Close
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   @Override
-   public void close() throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("close() " + this);
-      }
-
-      if (closed)
-      {
-         return;
-      }
-
-      closed = true;
-
-      synchronized (sessions)
-      {
-         for (Iterator<HornetQRASession> i = sessions.iterator(); i.hasNext(); )
-         {
-            HornetQRASession session = i.next();
-            try
-            {
-               session.closeSession();
-            }
-            catch (Throwable t)
-            {
-               HornetQRALogger.LOGGER.trace("Error closing session", t);
-            }
-            i.remove();
-         }
-      }
-
-      synchronized (tempQueues)
-      {
-         for (Iterator<TemporaryQueue> i = tempQueues.iterator(); i.hasNext(); )
-         {
-            TemporaryQueue temp = i.next();
-            try
-            {
-               if (HornetQRASessionFactoryImpl.trace)
-               {
-                  HornetQRALogger.LOGGER.trace("Closing temporary queue " + temp + " for " + this);
-               }
-               temp.delete();
-            }
-            catch (Throwable t)
-            {
-               HornetQRALogger.LOGGER.trace("Error deleting temporary queue", t);
-            }
-            i.remove();
-         }
-      }
-
-      synchronized (tempTopics)
-      {
-         for (Iterator<TemporaryTopic> i = tempTopics.iterator(); i.hasNext(); )
-         {
-            TemporaryTopic temp = i.next();
-            try
-            {
-               if (HornetQRASessionFactoryImpl.trace)
-               {
-                  HornetQRALogger.LOGGER.trace("Closing temporary topic " + temp + " for " + this);
-               }
-               temp.delete();
-            }
-            catch (Throwable t)
-            {
-               HornetQRALogger.LOGGER.trace("Error deleting temporary queue", t);
-            }
-            i.remove();
-         }
-      }
-   }
-
-   /**
-    * Close session
-    *
-    * @param session The session
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void closeSession(final HornetQRASession session) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("closeSession(" + session + ")");
-      }
-
-      synchronized (sessions)
-      {
-         sessions.remove(session);
-      }
-   }
-
-   /**
-    * Add temporary queue
-    *
-    * @param temp The temporary queue
-    */
-   public void addTemporaryQueue(final TemporaryQueue temp)
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("addTemporaryQueue(" + temp + ")");
-      }
-
-      synchronized (tempQueues)
-      {
-         tempQueues.add(temp);
-      }
-   }
-
-   /**
-    * Add temporary topic
-    *
-    * @param temp The temporary topic
-    */
-   public void addTemporaryTopic(final TemporaryTopic temp)
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("addTemporaryTopic(" + temp + ")");
-      }
-
-      synchronized (tempTopics)
-      {
-         tempTopics.add(temp);
-      }
-   }
-
-   @Override
-   public Session createSession(int sessionMode) throws JMSException
-   {
-      return createSession(sessionMode == Session.SESSION_TRANSACTED, sessionMode);
-   }
-
-   @Override
-   public Session createSession() throws JMSException
-   {
-      return createSession(Session.AUTO_ACKNOWLEDGE);
-   }
-
-   @Override
-   public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createSharedConnectionConsumer(" + topic + ", " + subscriptionName + ", " +
-                                         messageSelector + ", " + sessionPool + ", " + maxMessages + ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   @Override
-   public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createSharedDurableConnectionConsumer(" + topic + ", " + subscriptionName +
-                                         ", " + messageSelector + ", " + sessionPool + ", " + maxMessages + ")");
-      }
-
-      throw new IllegalStateException(HornetQRASessionFactory.ISE);
-   }
-
-   /**
-    * Allocation a connection
-    *
-    * @param sessionType The session type
-    * @return The session
-    * @throws JMSException Thrown if an error occurs
-    */
-   protected HornetQRASession allocateConnection(final int sessionType) throws JMSException
-   {
-      return allocateConnection(false, Session.AUTO_ACKNOWLEDGE, sessionType);
-   }
-
-   /**
-    * Allocate a connection
-    *
-    * @param transacted      Use transactions
-    * @param acknowledgeMode The acknowledge mode
-    * @param sessionType     The session type
-    * @return The session
-    * @throws JMSException Thrown if an error occurs
-    */
-   protected HornetQRASession allocateConnection(boolean transacted, int acknowledgeMode, final int sessionType) throws JMSException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("allocateConnection(" + transacted +
-                                         ", " +
-                                         acknowledgeMode +
-                                         ", " +
-                                         sessionType +
-                                         ")");
-      }
-
-      try
-      {
-         synchronized (sessions)
-         {
-            if (sessions.isEmpty() == false)
-            {
-               throw new IllegalStateException("Only allowed one session per connection. See the J2EE spec, e.g. J2EE1.4 Section 6.6");
-            }
-            //from createSession
-            // In a Java EE web or EJB container, when there is an active JTA transaction in progress:
-            //Both arguments {@code transacted} and {@code acknowledgeMode} are ignored.
-            if (inJtaTransaction())
-            {
-               transacted = true;
-               //from getAcknowledgeMode
-               // If the session is not transacted, returns the
-               // current acknowledgement mode for the session.
-               // If the session
-               // is transacted, returns SESSION_TRANSACTED.
-               acknowledgeMode = Session.SESSION_TRANSACTED;
-            }
-            //In the Java EE web or EJB container, when there is no active JTA transaction in progress
-            // The argument {@code transacted} is ignored.
-            else
-            {
-               //The session will always be non-transacted,
-               transacted = false;
-               switch (acknowledgeMode)
-               {
-                  //using one of the two acknowledgement modes AUTO_ACKNOWLEDGE and DUPS_OK_ACKNOWLEDGE.
-                  case Session.AUTO_ACKNOWLEDGE:
-                  case Session.DUPS_OK_ACKNOWLEDGE:
-                     //plus our own
-                  case HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
-                  case HornetQJMSConstants.PRE_ACKNOWLEDGE:
-                     break;
-                  //The value {@code Session.CLIENT_ACKNOWLEDGE} may not be used.
-                  case Session.CLIENT_ACKNOWLEDGE:
-                     throw HornetQRABundle.BUNDLE.invalidClientAcknowledgeModeRuntime();
-                     //same with this although the spec doesn't explicitly say
-                  case Session.SESSION_TRANSACTED:
-                     throw HornetQRABundle.BUNDLE.invalidSessionTransactedModeRuntime();
-                  default:
-                     throw HornetQRABundle.BUNDLE.invalidAcknowledgeMode(acknowledgeMode);
-               }
-            }
-
-            HornetQRAConnectionRequestInfo info = new HornetQRAConnectionRequestInfo(transacted,
-                                                                                     acknowledgeMode,
-                                                                                     sessionType);
-            info.setUserName(userName);
-            info.setPassword(password);
-            info.setClientID(clientID);
-            info.setDefaults(((HornetQResourceAdapter) mcf.getResourceAdapter()).getProperties());
-
-            if (HornetQRASessionFactoryImpl.trace)
-            {
-               HornetQRALogger.LOGGER.trace("Allocating session for " + this + " with request info=" + info);
-            }
-
-            HornetQRASession session = (HornetQRASession) cm.allocateConnection(mcf, info);
-
-            try
-            {
-               if (HornetQRASessionFactoryImpl.trace)
-               {
-                  HornetQRALogger.LOGGER.trace("Allocated  " + this + " session=" + session);
-               }
-
-               session.setHornetQSessionFactory(this);
-
-               if (started)
-               {
-                  session.start();
-               }
-
-               sessions.add(session);
-
-               return session;
-            }
-            catch (Throwable t)
-            {
-               try
-               {
-                  session.close();
-               }
-               catch (Throwable ignored)
-               {
-               }
-               if (t instanceof Exception)
-               {
-                  throw (Exception) t;
-               }
-               else
-               {
-                  throw new RuntimeException("Unexpected error: ", t);
-               }
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         Throwable current = e;
-         while (current != null && !(current instanceof JMSException))
-         {
-            current = current.getCause();
-         }
-
-         if (current != null && current instanceof JMSException)
-         {
-            throw (JMSException) current;
-         }
-         else
-         {
-            JMSException je = new JMSException("Could not create a session: " + e.getMessage());
-            je.setLinkedException(e);
-            je.initCause(e);
-            throw je;
-         }
-      }
-   }
-
-   /**
-    * Check if we are closed
-    *
-    * @throws IllegalStateException Thrown if closed
-    */
-   protected void checkClosed() throws IllegalStateException
-   {
-      if (HornetQRASessionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("checkClosed()" + this);
-      }
-
-      if (closed)
-      {
-         throw new IllegalStateException("The connection is closed");
-      }
-   }
-
-   private boolean inJtaTransaction()
-   {
-      boolean inJtaTx = false;
-      if (tm != null)
-      {
-         Transaction tx = null;
-         try
-         {
-            tx = tm.getTransaction();
-         }
-         catch (SystemException e)
-         {
-            //assume false
-         }
-         inJtaTx = tx != null;
-      }
-      return inJtaTx;
-   }
-}


[39/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQSession.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQSession.java
new file mode 100644
index 0000000..b106c61
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQSession.java
@@ -0,0 +1,1276 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.jms.BytesMessage;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.jms.TransactionInProgressException;
+import javax.transaction.xa.XAResource;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQQueueExistsException;
+import org.apache.activemq.selector.filter.FilterException;
+import org.apache.activemq.selector.SelectorParser;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientConsumer;
+import org.apache.activemq.api.core.client.ClientProducer;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.ClientSession.AddressQuery;
+import org.apache.activemq.api.core.client.ClientSession.QueueQuery;
+
+/**
+ * ActiveMQ implementation of a JMS Session.
+ * <br>
+ * Note that we *do not* support JMS ASF (Application Server Facilities) optional
+ * constructs such as ConnectionConsumer
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ *
+ *
+ */
+public class ActiveMQSession implements QueueSession, TopicSession
+{
+   public static final int TYPE_GENERIC_SESSION = 0;
+
+   public static final int TYPE_QUEUE_SESSION = 1;
+
+   public static final int TYPE_TOPIC_SESSION = 2;
+
+   private static SimpleString REJECTING_FILTER = new SimpleString("_HQX=-1");
+
+   private final ActiveMQConnection connection;
+
+   private final ClientSession session;
+
+   private final int sessionType;
+
+   private final int ackMode;
+
+   private final boolean transacted;
+
+   private final boolean xa;
+
+   private boolean recoverCalled;
+
+   private final Set<ActiveMQMessageConsumer> consumers = new HashSet<ActiveMQMessageConsumer>();
+
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQSession(final ActiveMQConnection connection,
+                             final boolean transacted,
+                             final boolean xa,
+                             final int ackMode,
+                             final ClientSession session,
+                             final int sessionType)
+   {
+      this.connection = connection;
+
+      this.ackMode = ackMode;
+
+      this.session = session;
+
+      this.sessionType = sessionType;
+
+      this.transacted = transacted;
+
+      this.xa = xa;
+   }
+
+   // Session implementation ----------------------------------------
+
+   public BytesMessage createBytesMessage() throws JMSException
+   {
+      checkClosed();
+
+      return new ActiveMQBytesMessage(session);
+   }
+
+   public MapMessage createMapMessage() throws JMSException
+   {
+      checkClosed();
+
+      return new ActiveMQMapMessage(session);
+   }
+
+   public Message createMessage() throws JMSException
+   {
+      checkClosed();
+
+      return new ActiveMQMessage(session);
+   }
+
+   public ObjectMessage createObjectMessage() throws JMSException
+   {
+      checkClosed();
+
+      return new ActiveMQObjectMessage(session);
+   }
+
+   public ObjectMessage createObjectMessage(final Serializable object) throws JMSException
+   {
+      checkClosed();
+
+      ActiveMQObjectMessage msg = new ActiveMQObjectMessage(session);
+
+      msg.setObject(object);
+
+      return msg;
+   }
+
+   public StreamMessage createStreamMessage() throws JMSException
+   {
+      checkClosed();
+
+      return new ActiveMQStreamMessage(session);
+   }
+
+   public TextMessage createTextMessage() throws JMSException
+   {
+      checkClosed();
+
+      ActiveMQTextMessage msg = new ActiveMQTextMessage(session);
+
+      msg.setText(null);
+
+      return msg;
+   }
+
+   public TextMessage createTextMessage(final String text) throws JMSException
+   {
+      checkClosed();
+
+      ActiveMQTextMessage msg = new ActiveMQTextMessage(session);
+
+      msg.setText(text);
+
+      return msg;
+   }
+
+   public boolean getTransacted() throws JMSException
+   {
+      checkClosed();
+
+      return transacted;
+   }
+
+   public int getAcknowledgeMode() throws JMSException
+   {
+      checkClosed();
+
+      return ackMode;
+   }
+
+   public boolean isXA()
+   {
+      return xa;
+   }
+
+   public void commit() throws JMSException
+   {
+      if (!transacted)
+      {
+         throw new IllegalStateException("Cannot commit a non-transacted session");
+      }
+      if (xa)
+      {
+         throw new TransactionInProgressException("Cannot call commit on an XA session");
+      }
+      try
+      {
+         session.commit();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void rollback() throws JMSException
+   {
+      if (!transacted)
+      {
+         throw new IllegalStateException("Cannot rollback a non-transacted session");
+      }
+      if (xa)
+      {
+         throw new TransactionInProgressException("Cannot call rollback on an XA session");
+      }
+
+      try
+      {
+         session.rollback();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void close() throws JMSException
+   {
+      connection.getThreadAwareContext().assertNotCompletionListenerThread();
+      connection.getThreadAwareContext().assertNotMessageListenerThread();
+      synchronized (connection)
+      {
+         try
+         {
+            for (ActiveMQMessageConsumer cons : new HashSet<ActiveMQMessageConsumer>(consumers))
+            {
+               cons.close();
+            }
+
+            session.close();
+
+            connection.removeSession(this);
+         }
+         catch (ActiveMQException e)
+         {
+            throw JMSExceptionHelper.convertFromActiveMQException(e);
+         }
+      }
+   }
+
+   public void recover() throws JMSException
+   {
+      if (transacted)
+      {
+         throw new IllegalStateException("Cannot recover a transacted session");
+      }
+
+      try
+      {
+         session.rollback(true);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+
+      recoverCalled = true;
+   }
+
+   public MessageListener getMessageListener() throws JMSException
+   {
+      checkClosed();
+
+      return null;
+   }
+
+   public void setMessageListener(final MessageListener listener) throws JMSException
+   {
+      checkClosed();
+   }
+
+   public void run()
+   {
+   }
+
+   public MessageProducer createProducer(final Destination destination) throws JMSException
+   {
+      if (destination != null && !(destination instanceof ActiveMQDestination))
+      {
+         throw new InvalidDestinationException("Not a ActiveMQ Destination:" + destination);
+      }
+
+      try
+      {
+         ActiveMQDestination jbd = (ActiveMQDestination)destination;
+
+         if (jbd != null)
+         {
+            ClientSession.AddressQuery response = session.addressQuery(jbd.getSimpleAddress());
+
+            if (!response.isExists())
+            {
+               throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
+            }
+
+            connection.addKnownDestination(jbd.getSimpleAddress());
+         }
+
+         ClientProducer producer = session.createProducer(jbd == null ? null : jbd.getSimpleAddress());
+
+         return new ActiveMQMessageProducer(connection, producer, jbd, session);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public MessageConsumer createConsumer(final Destination destination) throws JMSException
+   {
+      return createConsumer(destination, null, false);
+   }
+
+   public MessageConsumer createConsumer(final Destination destination, final String messageSelector) throws JMSException
+   {
+      return createConsumer(destination, messageSelector, false);
+   }
+
+   public MessageConsumer createConsumer(final Destination destination,
+                                         final String messageSelector,
+                                         final boolean noLocal) throws JMSException
+   {
+      if (destination == null)
+      {
+         throw new InvalidDestinationException("Cannot create a consumer with a null destination");
+      }
+
+      if (!(destination instanceof ActiveMQDestination))
+      {
+         throw new InvalidDestinationException("Not a ActiveMQDestination:" + destination);
+      }
+
+      ActiveMQDestination jbdest = (ActiveMQDestination)destination;
+
+      if (jbdest.isTemporary() && !connection.containsTemporaryQueue(jbdest.getSimpleAddress()))
+      {
+         throw new JMSException("Can not create consumer for temporary destination " + destination +
+                                " from another JMS connection");
+      }
+
+      return createConsumer(jbdest, null, messageSelector, noLocal, ConsumerDurability.NON_DURABLE);
+   }
+
+   public Queue createQueue(final String queueName) throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_TOPIC_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a queue using a TopicSession");
+      }
+
+      try
+      {
+         ActiveMQQueue queue = lookupQueue(queueName, false);
+
+         if (queue == null)
+         {
+            queue = lookupQueue(queueName, true);
+         }
+
+         if (queue == null)
+         {
+            throw new JMSException("There is no queue with name " + queueName);
+         }
+         else
+         {
+            return queue;
+         }
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public Topic createTopic(final String topicName) throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a topic on a QueueSession");
+      }
+
+      try
+      {
+         ActiveMQTopic topic = lookupTopic(topicName, false);
+
+         if (topic == null)
+         {
+            topic = lookupTopic(topicName, true);
+         }
+
+         if (topic == null)
+         {
+            throw new JMSException("There is no topic with name " + topicName);
+         }
+         else
+         {
+            return topic;
+         }
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException
+   {
+      return createDurableSubscriber(topic, name, null, false);
+   }
+
+   public TopicSubscriber createDurableSubscriber(final Topic topic,
+                                                  final String name,
+                                                  String messageSelector,
+                                                  final boolean noLocal) throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a durable subscriber on a QueueSession");
+      }
+      checkTopic(topic);
+      if (!(topic instanceof ActiveMQDestination))
+      {
+         throw new InvalidDestinationException("Not a ActiveMQTopic:" + topic);
+      }
+      if ("".equals(messageSelector))
+      {
+         messageSelector = null;
+      }
+
+      ActiveMQDestination jbdest = (ActiveMQDestination)topic;
+
+      if (jbdest.isQueue())
+      {
+         throw new InvalidDestinationException("Cannot create a subscriber on a queue");
+      }
+
+      return createConsumer(jbdest, name, messageSelector, noLocal, ConsumerDurability.DURABLE);
+   }
+
+   private void checkTopic(Topic topic) throws InvalidDestinationException
+   {
+      if (topic == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nullTopic();
+      }
+   }
+
+   @Override
+   public MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSException
+   {
+      return createSharedConsumer(topic, sharedSubscriptionName, null);
+   }
+
+   /**
+    * Note: Needs to throw an exception if a subscriptionName is already in use by another topic, or if the messageSelector is different
+    *
+    * validate multiple subscriptions on the same session.
+    * validate multiple subscriptions on different sessions
+    * validate failure in one connection while another connection stills fine.
+    * Validate different filters in different possible scenarios
+    *
+    * @param topic
+    * @param name
+    * @param messageSelector
+    * @return
+    * @throws JMSException
+    */
+   @Override
+   public MessageConsumer createSharedConsumer(Topic topic, String name, String messageSelector) throws JMSException
+   {
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a shared consumer on a QueueSession");
+      }
+      checkTopic(topic);
+      ActiveMQTopic localTopic;
+      if (topic instanceof ActiveMQTopic)
+      {
+         localTopic = (ActiveMQTopic)topic;
+      }
+      else
+      {
+         localTopic = new ActiveMQTopic(topic.getTopicName());
+      }
+      return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.NON_DURABLE, true);
+   }
+
+   @Override
+   public MessageConsumer createDurableConsumer(Topic topic, String name) throws JMSException
+   {
+      return createDurableConsumer(topic, name, null, false);
+   }
+
+   @Override
+   public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
+   {
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a durable consumer on a QueueSession");
+      }
+      checkTopic(topic);
+      ActiveMQTopic localTopic;
+      if (topic instanceof ActiveMQTopic)
+      {
+         localTopic = (ActiveMQTopic)topic;
+      }
+      else
+      {
+         localTopic = new ActiveMQTopic(topic.getTopicName());
+      }
+      return createConsumer(localTopic, name, messageSelector, noLocal, ConsumerDurability.DURABLE);
+   }
+
+   @Override
+   public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
+   {
+      return createSharedDurableConsumer(topic, name, null);
+   }
+
+   @Override
+   public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException
+   {
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a shared durable consumer on a QueueSession");
+      }
+
+      checkTopic(topic);
+
+      ActiveMQTopic localTopic;
+
+      if (topic instanceof ActiveMQTopic)
+      {
+         localTopic = (ActiveMQTopic)topic;
+      }
+      else
+      {
+         localTopic = new ActiveMQTopic(topic.getTopicName());
+      }
+      return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.DURABLE, true);
+   }
+
+   enum ConsumerDurability
+   {
+      DURABLE, NON_DURABLE;
+   }
+
+
+   /**
+    * This is an internal method for shared consumers
+    */
+   private ActiveMQMessageConsumer internalCreateSharedConsumer(final ActiveMQDestination dest,
+                                                               final String subscriptionName,
+                                                               String selectorString,
+                                                               ConsumerDurability durability,
+                                                               final boolean shared) throws JMSException
+   {
+      try
+      {
+
+         if (dest.isQueue())
+         {
+            // This is not really possible unless someone makes a mistake on code
+            // createSharedConsumer only accpets Topics by declaration
+            throw new RuntimeException("Internal error: createSharedConsumer is only meant for Topics");
+         }
+
+         if (subscriptionName == null)
+         {
+            throw ActiveMQJMSClientBundle.BUNDLE.invalidSubscriptionName();
+         }
+
+         selectorString = "".equals(selectorString) ? null : selectorString;
+
+         SimpleString coreFilterString = null;
+
+         if (selectorString != null)
+         {
+            coreFilterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(selectorString));
+         }
+
+         ClientConsumer consumer;
+
+         SimpleString autoDeleteQueueName = null;
+
+         AddressQuery response = session.addressQuery(dest.getSimpleAddress());
+
+         if (!response.isExists())
+         {
+            throw ActiveMQJMSClientBundle.BUNDLE.destinationDoesNotExist(dest.getSimpleAddress());
+         }
+
+         SimpleString queueName;
+
+         if (dest.isTemporary() && durability == ConsumerDurability.DURABLE)
+         {
+            throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
+         }
+
+         queueName = new SimpleString(ActiveMQDestination.createQueueNameForDurableSubscription(durability == ConsumerDurability.DURABLE, connection.getClientID(),
+                                                                                                subscriptionName));
+
+         if (durability == ConsumerDurability.DURABLE)
+         {
+            try
+            {
+               session.createSharedQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
+            }
+            catch (ActiveMQQueueExistsException ignored)
+            {
+               // We ignore this because querying and then creating the queue wouldn't be idempotent
+               // we could also add a parameter to ignore existence what would require a bigger work around to avoid
+               // compatibility.
+            }
+         }
+         else
+         {
+            session.createSharedQueue(dest.getSimpleAddress(), queueName, coreFilterString, false);
+         }
+
+         consumer = session.createConsumer(queueName, null, false);
+
+         ActiveMQMessageConsumer jbc = new ActiveMQMessageConsumer(connection, this,
+                                                                 consumer,
+                                                                 false,
+                                                                 dest,
+                                                                 selectorString,
+                                                                 autoDeleteQueueName);
+
+         consumers.add(jbc);
+
+         return jbc;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+
+
+   private ActiveMQMessageConsumer createConsumer(final ActiveMQDestination dest,
+                                                 final String subscriptionName,
+                                                 String selectorString, final boolean noLocal,
+                                                 ConsumerDurability durability) throws JMSException
+   {
+      try
+      {
+         selectorString = "".equals(selectorString) ? null : selectorString;
+
+         if (noLocal)
+         {
+            connection.setHasNoLocal();
+
+            String filter;
+            if (connection.getClientID() != null)
+            {
+               filter =
+                        ActiveMQConnection.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'" + connection.getClientID() +
+                                 "'";
+            }
+            else
+            {
+               filter = ActiveMQConnection.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'" + connection.getUID() + "'";
+            }
+
+            if (selectorString != null)
+            {
+               selectorString += " AND " + filter;
+            }
+            else
+            {
+               selectorString = filter;
+            }
+         }
+
+         SimpleString coreFilterString = null;
+
+         if (selectorString != null)
+         {
+            coreFilterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(selectorString));
+         }
+
+         ClientConsumer consumer;
+
+         SimpleString autoDeleteQueueName = null;
+
+         if (dest.isQueue())
+         {
+            AddressQuery response = session.addressQuery(dest.getSimpleAddress());
+
+            if (!response.isExists())
+            {
+               throw new InvalidDestinationException("Queue " + dest.getName() + " does not exist");
+            }
+
+            connection.addKnownDestination(dest.getSimpleAddress());
+
+            consumer = session.createConsumer(dest.getSimpleAddress(), coreFilterString, false);
+         }
+         else
+         {
+            AddressQuery response = session.addressQuery(dest.getSimpleAddress());
+
+            if (!response.isExists())
+            {
+               throw new InvalidDestinationException("Topic " + dest.getName() + " does not exist");
+            }
+
+            connection.addKnownDestination(dest.getSimpleAddress());
+
+            SimpleString queueName;
+
+            if (subscriptionName == null)
+            {
+               if (durability != ConsumerDurability.NON_DURABLE)
+                  throw new RuntimeException();
+               // Non durable sub
+
+               queueName = new SimpleString(UUID.randomUUID().toString());
+
+               session.createTemporaryQueue(dest.getSimpleAddress(), queueName, coreFilterString);
+
+               consumer = session.createConsumer(queueName, null, false);
+
+               autoDeleteQueueName = queueName;
+            }
+            else
+            {
+               // Durable sub
+               if (durability != ConsumerDurability.DURABLE)
+                  throw new RuntimeException();
+               if (connection.getClientID() == null)
+               {
+                  throw new IllegalStateException("Cannot create durable subscription - client ID has not been set");
+               }
+
+               if (dest.isTemporary())
+               {
+                  throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
+               }
+
+               queueName = new SimpleString(ActiveMQDestination.createQueueNameForDurableSubscription(true, connection.getClientID(),
+                                                                                                      subscriptionName));
+
+               QueueQuery subResponse = session.queueQuery(queueName);
+
+               if (!subResponse.isExists())
+               {
+                  session.createQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
+               }
+               else
+               {
+                  // Already exists
+                  if (subResponse.getConsumerCount() > 0)
+                  {
+                     throw new IllegalStateException("Cannot create a subscriber on the durable subscription since it already has subscriber(s)");
+                  }
+
+                  // From javax.jms.Session Javadoc (and also JMS 1.1 6.11.1):
+                  // A client can change an existing durable subscription by
+                  // creating a durable
+                  // TopicSubscriber with the same name and a new topic and/or
+                  // message selector.
+                  // Changing a durable subscriber is equivalent to
+                  // unsubscribing (deleting) the old
+                  // one and creating a new one.
+
+                  SimpleString oldFilterString = subResponse.getFilterString();
+
+                  boolean selectorChanged = coreFilterString == null && oldFilterString != null ||
+                                            oldFilterString == null &&
+                                            coreFilterString != null ||
+                                            oldFilterString != null &&
+                                            coreFilterString != null &&
+                                            !oldFilterString.equals(coreFilterString);
+
+                  SimpleString oldTopicName = subResponse.getAddress();
+
+                  boolean topicChanged = !oldTopicName.equals(dest.getSimpleAddress());
+
+                  if (selectorChanged || topicChanged)
+                  {
+                     // Delete the old durable sub
+                     session.deleteQueue(queueName);
+
+                     // Create the new one
+                     session.createQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
+                  }
+               }
+
+               consumer = session.createConsumer(queueName, null, false);
+            }
+         }
+
+         ActiveMQMessageConsumer jbc = new ActiveMQMessageConsumer(connection,
+                                                                 this,
+                                                                 consumer,
+                                                                 noLocal,
+                                                                 dest,
+                                                                 selectorString,
+                                                                 autoDeleteQueueName);
+
+         consumers.add(jbc);
+
+         return jbc;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void ackAllConsumers() throws JMSException
+   {
+      checkClosed();
+   }
+
+   public QueueBrowser createBrowser(final Queue queue) throws JMSException
+   {
+      return createBrowser(queue, null);
+   }
+
+   public QueueBrowser createBrowser(final Queue queue, String filterString) throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_TOPIC_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a browser on a TopicSession");
+      }
+      if (queue == null)
+      {
+         throw new InvalidDestinationException("Cannot create a browser with a null queue");
+      }
+      if (!(queue instanceof ActiveMQDestination))
+      {
+         throw new InvalidDestinationException("Not a ActiveMQQueue:" + queue);
+      }
+      if ("".equals(filterString))
+      {
+         filterString = null;
+      }
+
+      // eager test of the filter syntax as required by JMS spec
+      try
+      {
+         if (filterString != null)
+         {
+            SelectorParser.parse(filterString.trim());
+         }
+      }
+      catch (FilterException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(ActiveMQJMSClientBundle.BUNDLE.invalidFilter(e, new SimpleString(filterString)));
+      }
+
+      ActiveMQDestination jbq = (ActiveMQDestination)queue;
+
+      if (!jbq.isQueue())
+      {
+         throw new InvalidDestinationException("Cannot create a browser on a topic");
+      }
+
+      try
+      {
+         AddressQuery message = session.addressQuery(new SimpleString(jbq.getAddress()));
+         if (!message.isExists())
+         {
+            throw new InvalidDestinationException(jbq.getAddress() + " does not exist");
+         }
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+
+      return new ActiveMQQueueBrowser((ActiveMQQueue)jbq, filterString, session);
+
+   }
+
+   public TemporaryQueue createTemporaryQueue() throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_TOPIC_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a temporary queue using a TopicSession");
+      }
+
+      try
+      {
+         ActiveMQTemporaryQueue queue = ActiveMQDestination.createTemporaryQueue(this);
+
+         SimpleString simpleAddress = queue.getSimpleAddress();
+
+         session.createTemporaryQueue(simpleAddress, simpleAddress);
+
+         connection.addTemporaryQueue(simpleAddress);
+
+         return queue;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public TemporaryTopic createTemporaryTopic() throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot create a temporary topic on a QueueSession");
+      }
+
+      try
+      {
+         ActiveMQTemporaryTopic topic = ActiveMQDestination.createTemporaryTopic(this);
+
+         SimpleString simpleAddress = topic.getSimpleAddress();
+
+         // We create a dummy subscription on the topic, that never receives messages - this is so we can perform JMS
+         // checks when routing messages to a topic that
+         // does not exist - otherwise we would not be able to distinguish from a non existent topic and one with no
+         // subscriptions - core has no notion of a topic
+
+         session.createTemporaryQueue(simpleAddress, simpleAddress, ActiveMQSession.REJECTING_FILTER);
+
+         connection.addTemporaryQueue(simpleAddress);
+
+         return topic;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void unsubscribe(final String name) throws JMSException
+   {
+      // As per spec. section 4.11
+      if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION)
+      {
+         throw new IllegalStateException("Cannot unsubscribe using a QueueSession");
+      }
+
+      SimpleString queueName = new SimpleString(ActiveMQDestination.createQueueNameForDurableSubscription(true, connection.getClientID(),
+                                                                                                          name));
+
+      try
+      {
+         QueueQuery response = session.queueQuery(queueName);
+
+         if (!response.isExists())
+         {
+            throw new InvalidDestinationException("Cannot unsubscribe, subscription with name " + name +
+                                                  " does not exist");
+         }
+
+         if (response.getConsumerCount() != 0)
+         {
+            throw new IllegalStateException("Cannot unsubscribe durable subscription " + name +
+                                            " since it has active subscribers");
+         }
+
+         session.deleteQueue(queueName);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   // XASession implementation
+
+   public Session getSession() throws JMSException
+   {
+      if (!xa)
+      {
+         throw new IllegalStateException("Isn't an XASession");
+      }
+
+      return this;
+   }
+
+   public XAResource getXAResource()
+   {
+      return session.getXAResource();
+   }
+
+   // QueueSession implementation
+
+   public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException
+   {
+      return (QueueReceiver)createConsumer(queue, messageSelector);
+   }
+
+   public QueueReceiver createReceiver(final Queue queue) throws JMSException
+   {
+      return (QueueReceiver)createConsumer(queue);
+   }
+
+   public QueueSender createSender(final Queue queue) throws JMSException
+   {
+      return (QueueSender)createProducer(queue);
+   }
+
+   // XAQueueSession implementation
+
+   public QueueSession getQueueSession() throws JMSException
+   {
+      return (QueueSession)getSession();
+   }
+
+   // TopicSession implementation
+
+   public TopicPublisher createPublisher(final Topic topic) throws JMSException
+   {
+      return (TopicPublisher)createProducer(topic);
+   }
+
+   public TopicSubscriber createSubscriber(final Topic topic, final String messageSelector, final boolean noLocal) throws JMSException
+   {
+      return (TopicSubscriber)createConsumer(topic, messageSelector, noLocal);
+   }
+
+   public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
+   {
+      return (TopicSubscriber)createConsumer(topic);
+   }
+
+   // XATopicSession implementation
+
+   public TopicSession getTopicSession() throws JMSException
+   {
+      return (TopicSession)getSession();
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQSession->" + session;
+   }
+
+   public ClientSession getCoreSession()
+   {
+      return session;
+   }
+
+   public boolean isRecoverCalled()
+   {
+      return recoverCalled;
+   }
+
+   public void setRecoverCalled(final boolean recoverCalled)
+   {
+      this.recoverCalled = recoverCalled;
+   }
+
+   public void deleteTemporaryTopic(final ActiveMQDestination tempTopic) throws JMSException
+   {
+      if (!tempTopic.isTemporary())
+      {
+         throw new InvalidDestinationException("Not a temporary topic " + tempTopic);
+      }
+
+      try
+      {
+         AddressQuery response = session.addressQuery(tempTopic.getSimpleAddress());
+
+         if (!response.isExists())
+         {
+            throw new InvalidDestinationException("Cannot delete temporary topic " + tempTopic.getName() +
+                                                  " does not exist");
+         }
+
+         if (response.getQueueNames().size() > 1)
+         {
+            throw new IllegalStateException("Cannot delete temporary topic " + tempTopic.getName() +
+                                            " since it has subscribers");
+         }
+
+         SimpleString address = tempTopic.getSimpleAddress();
+
+         session.deleteQueue(address);
+
+         connection.removeTemporaryQueue(address);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void deleteTemporaryQueue(final ActiveMQDestination tempQueue) throws JMSException
+   {
+      if (!tempQueue.isTemporary())
+      {
+         throw new InvalidDestinationException("Not a temporary queue " + tempQueue);
+      }
+      try
+      {
+         QueueQuery response = session.queueQuery(tempQueue.getSimpleAddress());
+
+         if (!response.isExists())
+         {
+            throw new InvalidDestinationException("Cannot delete temporary queue " + tempQueue.getName() +
+                                                  " does not exist");
+         }
+
+         if (response.getConsumerCount() > 0)
+         {
+            throw new IllegalStateException("Cannot delete temporary queue " + tempQueue.getName() +
+                                            " since it has subscribers");
+         }
+
+         SimpleString address = tempQueue.getSimpleAddress();
+
+         session.deleteQueue(address);
+
+         connection.removeTemporaryQueue(address);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void start() throws JMSException
+   {
+      try
+      {
+         session.start();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void stop() throws JMSException
+   {
+      try
+      {
+         session.stop();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void removeConsumer(final ActiveMQMessageConsumer consumer)
+   {
+      consumers.remove(consumer);
+   }
+
+   // Package protected ---------------------------------------------
+
+   void deleteQueue(final SimpleString queueName) throws JMSException
+   {
+      if (!session.isClosed())
+      {
+         try
+         {
+            session.deleteQueue(queueName);
+         }
+         catch (ActiveMQException ignore)
+         {
+            // Exception on deleting queue shouldn't prevent close from completing
+         }
+      }
+   }
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   private void checkClosed() throws JMSException
+   {
+      if (session.isClosed())
+      {
+         throw new IllegalStateException("Session is closed");
+      }
+   }
+
+   private ActiveMQQueue lookupQueue(final String queueName, boolean isTemporary) throws ActiveMQException
+   {
+      ActiveMQQueue queue;
+
+      if (isTemporary)
+      {
+         queue = ActiveMQDestination.createTemporaryQueue(queueName);
+      }
+      else
+      {
+         queue = ActiveMQDestination.createQueue(queueName);
+      }
+
+      QueueQuery response = session.queueQuery(queue.getSimpleAddress());
+
+      if (response.isExists())
+      {
+         return queue;
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException
+   {
+
+      ActiveMQTopic topic;
+
+      if (isTemporary)
+      {
+         topic = ActiveMQDestination.createTemporaryTopic(topicName);
+      }
+      else
+      {
+         topic = ActiveMQDestination.createTopic(topicName);
+      }
+
+      AddressQuery query = session.addressQuery(topic.getSimpleAddress());
+
+      if (!query.isExists())
+      {
+         return null;
+      }
+      else
+      {
+         return topic;
+      }
+   }
+
+   // Inner classes -------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQStreamMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQStreamMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQStreamMessage.java
new file mode 100644
index 0000000..c59fbc3
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQStreamMessage.java
@@ -0,0 +1,466 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSException;
+import javax.jms.MessageEOFException;
+import javax.jms.MessageFormatException;
+import javax.jms.StreamMessage;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.core.client.impl.ClientMessageImpl;
+import org.apache.activemq.utils.DataConstants;
+
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadBoolean;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadByte;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadBytes;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadChar;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadDouble;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadFloat;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadInteger;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadLong;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadObject;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadShort;
+import static org.apache.activemq.reader.StreamMessageUtil.streamReadString;
+
+/**
+ * ActiveMQ implementation of a JMS StreamMessage.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * Some parts based on JBM 1.x class by:
+ *
+ * @author Norbert Lataille (Norbert.Lataille@m4x.org)
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ */
+public final class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMessage
+{
+   public static final byte TYPE = Message.STREAM_TYPE;
+
+   protected ActiveMQStreamMessage(final ClientSession session)
+   {
+      super(ActiveMQStreamMessage.TYPE, session);
+   }
+
+   protected ActiveMQStreamMessage(final ClientMessage message, final ClientSession session)
+   {
+      super(message, session);
+   }
+
+   public ActiveMQStreamMessage(final StreamMessage foreign, final ClientSession session) throws JMSException
+   {
+      super(foreign, ActiveMQStreamMessage.TYPE, session);
+
+      foreign.reset();
+
+      try
+      {
+         while (true)
+         {
+            Object obj = foreign.readObject();
+            writeObject(obj);
+         }
+      }
+      catch (MessageEOFException e)
+      {
+         // Ignore
+      }
+   }
+
+   // For testing only
+   public ActiveMQStreamMessage()
+   {
+      message = new ClientMessageImpl((byte)0, false, 0, 0, (byte)4, 1500);
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public byte getType()
+   {
+      return ActiveMQStreamMessage.TYPE;
+   }
+
+   // StreamMessage implementation ----------------------------------
+
+   public boolean readBoolean() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadBoolean(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public byte readByte() throws JMSException
+   {
+      checkRead();
+
+      try
+      {
+         return streamReadByte(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public short readShort() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadShort(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public char readChar() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadChar(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public int readInt() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadInteger(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public long readLong() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadLong(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public float readFloat() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadFloat(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public double readDouble() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadDouble(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public String readString() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadString(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   /**
+    * len here is used to control how many more bytes to read
+    */
+   private int len = 0;
+
+   public int readBytes(final byte[] value) throws JMSException
+   {
+      checkRead();
+      try
+      {
+         Pair<Integer, Integer> pairRead = streamReadBytes(message, len, value);
+
+         len = pairRead.getA();
+         return pairRead.getB();
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public Object readObject() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return streamReadObject(message);
+      }
+      catch (IllegalStateException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public void writeBoolean(final boolean value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.BOOLEAN);
+      getBuffer().writeBoolean(value);
+   }
+
+   public void writeByte(final byte value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.BYTE);
+      getBuffer().writeByte(value);
+   }
+
+   public void writeShort(final short value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.SHORT);
+      getBuffer().writeShort(value);
+   }
+
+   public void writeChar(final char value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.CHAR);
+      getBuffer().writeShort((short)value);
+   }
+
+   public void writeInt(final int value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.INT);
+      getBuffer().writeInt(value);
+   }
+
+   public void writeLong(final long value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.LONG);
+      getBuffer().writeLong(value);
+   }
+
+   public void writeFloat(final float value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.FLOAT);
+      getBuffer().writeInt(Float.floatToIntBits(value));
+   }
+
+   public void writeDouble(final double value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.DOUBLE);
+      getBuffer().writeLong(Double.doubleToLongBits(value));
+   }
+
+   public void writeString(final String value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.STRING);
+      getBuffer().writeNullableString(value);
+   }
+
+   public void writeBytes(final byte[] value) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.BYTES);
+      getBuffer().writeInt(value.length);
+      getBuffer().writeBytes(value);
+   }
+
+   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
+   {
+      checkWrite();
+      getBuffer().writeByte(DataConstants.BYTES);
+      getBuffer().writeInt(length);
+      getBuffer().writeBytes(value, offset, length);
+   }
+
+   public void writeObject(final Object value) throws JMSException
+   {
+      if (value instanceof String)
+      {
+         writeString((String)value);
+      }
+      else if (value instanceof Boolean)
+      {
+         writeBoolean((Boolean)value);
+      }
+      else if (value instanceof Byte)
+      {
+         writeByte((Byte)value);
+      }
+      else if (value instanceof Short)
+      {
+         writeShort((Short)value);
+      }
+      else if (value instanceof Integer)
+      {
+         writeInt((Integer)value);
+      }
+      else if (value instanceof Long)
+      {
+         writeLong((Long)value);
+      }
+      else if (value instanceof Float)
+      {
+         writeFloat((Float)value);
+      }
+      else if (value instanceof Double)
+      {
+         writeDouble((Double)value);
+      }
+      else if (value instanceof byte[])
+      {
+         writeBytes((byte[])value);
+      }
+      else if (value instanceof Character)
+      {
+         writeChar((Character)value);
+      }
+      else if (value == null)
+      {
+         writeString(null);
+      }
+      else
+      {
+         throw new MessageFormatException("Invalid object type: " + value.getClass());
+      }
+   }
+
+   public void reset() throws JMSException
+   {
+      if (!readOnly)
+      {
+         readOnly = true;
+      }
+      getBuffer().resetReaderIndex();
+   }
+
+   // ActiveMQRAMessage overrides ----------------------------------------
+
+   @Override
+   public void clearBody() throws JMSException
+   {
+      super.clearBody();
+
+      getBuffer().clear();
+   }
+
+   @Override
+   public void doBeforeSend() throws Exception
+   {
+      reset();
+   }
+
+   private ActiveMQBuffer getBuffer()
+   {
+      return message.getBodyBuffer();
+   }
+
+   @SuppressWarnings("rawtypes")
+   @Override
+   public boolean isBodyAssignableTo(Class c)
+   {
+      return false;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryQueue.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryQueue.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryQueue.java
new file mode 100644
index 0000000..97f7870
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryQueue.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.TemporaryQueue;
+
+
+/**
+ * ActiveMQ implementation of a JMS TemporaryQueue.
+ * <br>
+ * This class can be instantiated directly.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 3569 $</tt>
+ *
+ */
+public class ActiveMQTemporaryQueue extends ActiveMQQueue implements TemporaryQueue
+{
+   // Constants -----------------------------------------------------
+
+   private static final long serialVersionUID = -4624930377557954624L;
+
+   // Static --------------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+
+   // TemporaryQueue implementation ------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   /**
+    * @param address
+    * @param name
+    * @param session
+    */
+   public ActiveMQTemporaryQueue(String address, String name, ActiveMQSession session)
+   {
+      super(address, name, true, session);
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQTemporaryQueue[" + name + "]";
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryTopic.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryTopic.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryTopic.java
new file mode 100644
index 0000000..8a85376
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTemporaryTopic.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.TemporaryTopic;
+
+/**
+ * A ActiveMQTemporaryTopic
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ActiveMQTemporaryTopic extends ActiveMQTopic implements TemporaryTopic
+{
+
+   // Constants -----------------------------------------------------
+
+   private static final long serialVersionUID = 845450764835635266L;
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQTemporaryTopic(final String address, final String name,
+                                    final ActiveMQSession session)
+   {
+      super(address, name, true, session);
+   }
+
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTextMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTextMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTextMessage.java
new file mode 100644
index 0000000..75944b9
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTextMessage.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSException;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+
+import static org.apache.activemq.reader.TextMessageUtil.readBodyText;
+import static org.apache.activemq.reader.TextMessageUtil.writeBodyText;
+
+
+/**
+ * ActiveMQ implementation of a JMS TextMessage.
+ * <br>
+ * This class was ported from SpyTextMessage in JBossMQ.
+ *
+ * @author Norbert Lataille (Norbert.Lataille@m4x.org)
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ * @version $Revision: 3412 $
+ */
+public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
+{
+   // Constants -----------------------------------------------------
+
+   public static final byte TYPE = Message.TEXT_TYPE;
+
+   // Attributes ----------------------------------------------------
+
+   // We cache it locally - it's more performant to cache as a SimpleString, the AbstractChannelBuffer write
+   // methods are more efficient for a SimpleString
+   private SimpleString text;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQTextMessage(final ClientSession session)
+   {
+      super(ActiveMQTextMessage.TYPE, session);
+   }
+
+   public ActiveMQTextMessage(final ClientMessage message, final ClientSession session)
+   {
+      super(message, session);
+   }
+
+   /**
+    * A copy constructor for non-ActiveMQ JMS TextMessages.
+    */
+   public ActiveMQTextMessage(final TextMessage foreign, final ClientSession session) throws JMSException
+   {
+      super(foreign, ActiveMQTextMessage.TYPE, session);
+
+      setText(foreign.getText());
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public byte getType()
+   {
+      return ActiveMQTextMessage.TYPE;
+   }
+
+   // TextMessage implementation ------------------------------------
+
+   public void setText(final String text) throws JMSException
+   {
+      checkWrite();
+
+      if (text != null)
+      {
+         this.text = new SimpleString(text);
+      }
+      else
+      {
+         this.text = null;
+      }
+
+      writeBodyText(message, this.text);
+   }
+
+   public String getText()
+   {
+      if (text != null)
+      {
+         return text.toString();
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   @Override
+   public void clearBody() throws JMSException
+   {
+      super.clearBody();
+
+      text = null;
+   }
+
+   // ActiveMQRAMessage override -----------------------------------------
+
+   @Override
+   public void doBeforeReceive() throws ActiveMQException
+   {
+      super.doBeforeReceive();
+
+      text = readBodyText(message);
+   }
+
+   @Override
+   protected <T> T getBodyInternal(Class<T> c)
+   {
+      return (T) getText();
+   }
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class c)
+   {
+      if (text == null)
+         return true;
+      return c.isAssignableFrom(java.lang.String.class);
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopic.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopic.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopic.java
new file mode 100644
index 0000000..1c04629
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopic.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.Topic;
+
+import org.apache.activemq.api.core.SimpleString;
+
+/**
+ * ActiveMQ implementation of a JMS Topic.
+ * <br>
+ * This class can be instantiated directly.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 8737 $</tt>
+ *
+ */
+public class ActiveMQTopic extends ActiveMQDestination implements Topic
+{
+   // Constants -----------------------------------------------------
+
+   private static final long serialVersionUID = 7873614001276404156L;
+   // Static --------------------------------------------------------
+
+   public static SimpleString createAddressFromName(final String name)
+   {
+      return new SimpleString(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX + name);
+   }
+
+   // Attributes ----------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQTopic(final String name)
+   {
+      super(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX + name, name, false, false, null);
+   }
+
+
+   /**
+    * @param address
+    * @param name
+    * @param temporary
+    * @param session
+    */
+   protected ActiveMQTopic(String address, String name, boolean temporary, ActiveMQSession session)
+   {
+      super(address, name, temporary, false, session);
+   }
+
+
+   // Topic implementation ------------------------------------------
+
+   public String getTopicName()
+   {
+      return name;
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQTopic[" + name + "]";
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopicConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopicConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopicConnectionFactory.java
new file mode 100644
index 0000000..56d88d7
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQTopicConnectionFactory.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.TopicConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+
+/**
+ * A class that represents a TopicConnectionFactory.
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQTopicConnectionFactory extends ActiveMQConnectionFactory implements TopicConnectionFactory
+{
+   private static final long serialVersionUID = 7317051989866548455L;
+
+   /**
+    *
+    */
+   public ActiveMQTopicConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQTopicConnectionFactory(ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQTopicConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQTopicConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+   public int getFactoryType()
+   {
+      return JMSFactoryType.TOPIC_CF.intValue();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnection.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnection.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnection.java
new file mode 100644
index 0000000..9333f6d
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnection.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.jms.XAQueueConnection;
+import javax.jms.XAQueueSession;
+import javax.jms.XASession;
+import javax.jms.XATopicConnection;
+import javax.jms.XATopicSession;
+
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+
+/**
+ * ActiveMQ implementation of a JMS XAConnection.
+ * <p>
+ * The flat implementation of {@link XATopicConnection} and {@link XAQueueConnection} is per design,
+ * following common practices of JMS 1.1.
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public final class ActiveMQXAConnection extends ActiveMQConnection implements XATopicConnection, XAQueueConnection
+{
+
+   public ActiveMQXAConnection(final String username, final String password, final int connectionType,
+                               final String clientID, final int dupsOKBatchSize, final int transactionBatchSize,
+                               final ClientSessionFactory sessionFactory)
+   {
+      super(username, password, connectionType, clientID, dupsOKBatchSize, transactionBatchSize, sessionFactory);
+   }
+
+   @Override
+   public XASession createXASession() throws JMSException
+   {
+      checkClosed();
+      return (XASession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, ActiveMQSession.TYPE_GENERIC_SESSION);
+   }
+
+   @Override
+   public XAQueueSession createXAQueueSession() throws JMSException
+   {
+      checkClosed();
+      return (XAQueueSession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, ActiveMQSession.TYPE_QUEUE_SESSION);
+
+   }
+
+   @Override
+   public XATopicSession createXATopicSession() throws JMSException
+   {
+      checkClosed();
+      return (XATopicSession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, ActiveMQSession.TYPE_TOPIC_SESSION);
+   }
+
+   @Override
+   protected boolean isXA()
+   {
+      return true;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnectionFactory.java
new file mode 100644
index 0000000..61a131d
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAConnectionFactory.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.XAQueueConnectionFactory;
+import javax.jms.XATopicConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+
+/**
+ * A class that represents a XAConnectionFactory.
+ * <p>
+ * We consider the XAConnectionFactory to be the most complete possible option. It can be casted to any other connection factory since it is fully functional
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XATopicConnectionFactory,
+   XAQueueConnectionFactory
+{
+   private static final long serialVersionUID = 743611571839154115L;
+
+   /**
+    *
+    */
+   public ActiveMQXAConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQXAConnectionFactory(ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQXAConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQXAConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+   @Override
+   public int getFactoryType()
+   {
+      return JMSFactoryType.XA_CF.intValue();
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAJMSContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAJMSContext.java
new file mode 100644
index 0000000..7bc8421
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAJMSContext.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.XAJMSContext;
+
+public class ActiveMQXAJMSContext extends ActiveMQJMSContext implements XAJMSContext
+{
+   public ActiveMQXAJMSContext(ActiveMQConnectionForContext connection, ThreadAwareContext threadAwareContext)
+   {
+      super(connection, threadAwareContext);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAQueueConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAQueueConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAQueueConnectionFactory.java
new file mode 100644
index 0000000..a0d91a5
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXAQueueConnectionFactory.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.XAQueueConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+
+/**
+ * A class that represents a XAQueueConnectionFactory.
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ *
+ */
+public class ActiveMQXAQueueConnectionFactory extends ActiveMQConnectionFactory implements XAQueueConnectionFactory
+{
+   private static final long serialVersionUID = 8612457847251087454L;
+
+   /**
+    *
+    */
+   public ActiveMQXAQueueConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQXAQueueConnectionFactory(ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQXAQueueConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQXAQueueConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+   public int getFactoryType()
+   {
+      return JMSFactoryType.QUEUE_XA_CF.intValue();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXASession.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXASession.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXASession.java
new file mode 100644
index 0000000..6ce34b6
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXASession.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.XAQueueSession;
+import javax.jms.XATopicSession;
+
+import org.apache.activemq.api.core.client.ClientSession;
+
+/**
+ * A ActiveMQXASession
+ *
+ * @author clebertsuconic
+ *
+ *
+ */
+public class ActiveMQXASession extends ActiveMQSession implements XAQueueSession, XATopicSession
+{
+
+   /**
+    * @param connection
+    * @param transacted
+    * @param xa
+    * @param ackMode
+    * @param session
+    * @param sessionType
+    */
+   protected ActiveMQXASession(ActiveMQConnection connection,
+                               boolean transacted,
+                               boolean xa,
+                               int ackMode,
+                               ClientSession session,
+                               int sessionType)
+   {
+      super(connection, transacted, xa, ackMode, session, sessionType);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXATopicConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXATopicConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXATopicConnectionFactory.java
new file mode 100644
index 0000000..a9c327c
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQXATopicConnectionFactory.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.XATopicConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+
+/**
+ * A class that represents a XATopicConnectionFactory.
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQXATopicConnectionFactory extends ActiveMQConnectionFactory implements XATopicConnectionFactory
+{
+   private static final long serialVersionUID = -7018290426884419693L;
+
+   /**
+    *
+    */
+   public ActiveMQXATopicConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQXATopicConnectionFactory(final ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQXATopicConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQXATopicConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+   public int getFactoryType()
+   {
+      return JMSFactoryType.TOPIC_XA_CF.intValue();
+   }
+}


[21/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java
index f05809b..7139f85 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ConnectionFactoryProperties.java
@@ -24,7 +24,7 @@ public class ConnectionFactoryProperties
    /**
     * Trace enabled
     */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
 
    private boolean hasBeenUpdated = false;
 
@@ -180,7 +180,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getConnectionLoadBalancingPolicyClassName()");
+         ActiveMQRALogger.LOGGER.trace("getConnectionLoadBalancingPolicyClassName()");
       }
       return connectionLoadBalancingPolicyClassName;
    }
@@ -189,7 +189,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setSessionDefaultType(" + connectionLoadBalancingPolicyClassName + ")");
+         ActiveMQRALogger.LOGGER.trace("setSessionDefaultType(" + connectionLoadBalancingPolicyClassName + ")");
       }
       hasBeenUpdated = true;
       this.connectionLoadBalancingPolicyClassName = connectionLoadBalancingPolicyClassName;
@@ -199,7 +199,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDiscoveryAddress()");
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryAddress()");
       }
       return discoveryAddress;
    }
@@ -208,7 +208,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDiscoveryAddress(" + discoveryAddress + ")");
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryAddress(" + discoveryAddress + ")");
       }
       hasBeenUpdated = true;
       this.discoveryAddress = discoveryAddress;
@@ -218,7 +218,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDiscoveryPort()");
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryPort()");
       }
       return discoveryPort;
    }
@@ -227,7 +227,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
       }
       hasBeenUpdated = true;
       this.discoveryLocalBindAddress = discoveryLocalBindAddress;
@@ -237,7 +237,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDiscoveryLocalBindAddress()");
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryLocalBindAddress()");
       }
       return discoveryLocalBindAddress;
    }
@@ -246,7 +246,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDiscoveryPort(" + discoveryPort + ")");
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryPort(" + discoveryPort + ")");
       }
       hasBeenUpdated = true;
       this.discoveryPort = discoveryPort;
@@ -256,7 +256,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDiscoveryRefreshTimeout()");
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryRefreshTimeout()");
       }
       return discoveryRefreshTimeout;
    }
@@ -265,7 +265,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
       }
       hasBeenUpdated = true;
       this.discoveryRefreshTimeout = discoveryRefreshTimeout;
@@ -275,7 +275,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDiscoveryInitialWaitTimeout()");
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryInitialWaitTimeout()");
       }
       return discoveryInitialWaitTimeout;
    }
@@ -284,7 +284,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
       }
       hasBeenUpdated = true;
       this.discoveryInitialWaitTimeout = discoveryInitialWaitTimeout;
@@ -294,7 +294,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getClientID()");
+         ActiveMQRALogger.LOGGER.trace("getClientID()");
       }
       return clientID;
    }
@@ -303,7 +303,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
+         ActiveMQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
       }
       hasBeenUpdated = true;
       this.clientID = clientID;
@@ -324,7 +324,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getDupsOKBatchSize()");
+         ActiveMQRALogger.LOGGER.trace("getDupsOKBatchSize()");
       }
       return dupsOKBatchSize;
    }
@@ -333,7 +333,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
       }
       hasBeenUpdated = true;
       this.dupsOKBatchSize = dupsOKBatchSize;
@@ -343,7 +343,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getTransactionBatchSize()");
+         ActiveMQRALogger.LOGGER.trace("getTransactionBatchSize()");
       }
       return transactionBatchSize;
    }
@@ -352,7 +352,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
       }
       hasBeenUpdated = true;
       this.transactionBatchSize = transactionBatchSize;
@@ -362,7 +362,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getClientFailureCheckPeriod()");
+         ActiveMQRALogger.LOGGER.trace("getClientFailureCheckPeriod()");
       }
       return clientFailureCheckPeriod;
    }
@@ -371,7 +371,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
+         ActiveMQRALogger.LOGGER.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
       }
       hasBeenUpdated = true;
       this.clientFailureCheckPeriod = clientFailureCheckPeriod;
@@ -381,7 +381,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getConnectionTTL()");
+         ActiveMQRALogger.LOGGER.trace("getConnectionTTL()");
       }
       return connectionTTL;
    }
@@ -390,7 +390,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setConnectionTTL(" + connectionTTL + ")");
+         ActiveMQRALogger.LOGGER.trace("setConnectionTTL(" + connectionTTL + ")");
       }
       hasBeenUpdated = true;
       this.connectionTTL = connectionTTL;
@@ -400,7 +400,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getCallTimeout()");
+         ActiveMQRALogger.LOGGER.trace("getCallTimeout()");
       }
       return callTimeout;
    }
@@ -409,7 +409,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setCallTimeout(" + callTimeout + ")");
+         ActiveMQRALogger.LOGGER.trace("setCallTimeout(" + callTimeout + ")");
       }
       hasBeenUpdated = true;
       this.callTimeout = callTimeout;
@@ -419,7 +419,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getCallFailoverTimeout()");
+         ActiveMQRALogger.LOGGER.trace("getCallFailoverTimeout()");
       }
       return callFailoverTimeout;
    }
@@ -428,7 +428,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")");
+         ActiveMQRALogger.LOGGER.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")");
       }
       hasBeenUpdated = true;
       this.callFailoverTimeout = callFailoverTimeout;
@@ -438,7 +438,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getConsumerWindowSize()");
+         ActiveMQRALogger.LOGGER.trace("getConsumerWindowSize()");
       }
       return consumerWindowSize;
    }
@@ -447,7 +447,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
       }
       hasBeenUpdated = true;
       this.consumerWindowSize = consumerWindowSize;
@@ -457,7 +457,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getConsumerMaxRate()");
+         ActiveMQRALogger.LOGGER.trace("getConsumerMaxRate()");
       }
       return consumerMaxRate;
    }
@@ -466,7 +466,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
+         ActiveMQRALogger.LOGGER.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
       }
       hasBeenUpdated = true;
       this.consumerMaxRate = consumerMaxRate;
@@ -476,7 +476,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getConfirmationWindowSize()");
+         ActiveMQRALogger.LOGGER.trace("getConfirmationWindowSize()");
       }
       return confirmationWindowSize;
    }
@@ -485,7 +485,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")");
       }
       hasBeenUpdated = true;
       this.confirmationWindowSize = confirmationWindowSize;
@@ -506,7 +506,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getProducerMaxRate()");
+         ActiveMQRALogger.LOGGER.trace("getProducerMaxRate()");
       }
       return producerMaxRate;
    }
@@ -515,7 +515,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setProducerMaxRate(" + producerMaxRate + ")");
+         ActiveMQRALogger.LOGGER.trace("setProducerMaxRate(" + producerMaxRate + ")");
       }
       hasBeenUpdated = true;
       this.producerMaxRate = producerMaxRate;
@@ -525,7 +525,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getProducerWindowSize()");
+         ActiveMQRALogger.LOGGER.trace("getProducerWindowSize()");
       }
       return producerWindowSize;
    }
@@ -534,7 +534,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setProducerWindowSize(" + producerWindowSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setProducerWindowSize(" + producerWindowSize + ")");
       }
       hasBeenUpdated = true;
       this.producerWindowSize = producerWindowSize;
@@ -544,7 +544,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getMinLargeMessageSize()");
+         ActiveMQRALogger.LOGGER.trace("getMinLargeMessageSize()");
       }
       return minLargeMessageSize;
    }
@@ -553,7 +553,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
       }
       hasBeenUpdated = true;
       this.minLargeMessageSize = minLargeMessageSize;
@@ -563,7 +563,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isBlockOnAcknowledge()");
+         ActiveMQRALogger.LOGGER.trace("isBlockOnAcknowledge()");
       }
       return blockOnAcknowledge;
    }
@@ -572,7 +572,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
+         ActiveMQRALogger.LOGGER.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
       }
       hasBeenUpdated = true;
       this.blockOnAcknowledge = blockOnAcknowledge;
@@ -582,7 +582,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isBlockOnNonDurableSend()");
+         ActiveMQRALogger.LOGGER.trace("isBlockOnNonDurableSend()");
       }
       return blockOnNonDurableSend;
    }
@@ -591,7 +591,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")");
+         ActiveMQRALogger.LOGGER.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")");
       }
       hasBeenUpdated = true;
       this.blockOnNonDurableSend = blockOnNonDurableSend;
@@ -601,7 +601,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isBlockOnDurableSend()");
+         ActiveMQRALogger.LOGGER.trace("isBlockOnDurableSend()");
       }
       return blockOnDurableSend;
    }
@@ -610,7 +610,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")");
+         ActiveMQRALogger.LOGGER.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")");
       }
       hasBeenUpdated = true;
       this.blockOnDurableSend = blockOnDurableSend;
@@ -620,7 +620,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isAutoGroup()");
+         ActiveMQRALogger.LOGGER.trace("isAutoGroup()");
       }
       return autoGroup;
    }
@@ -629,7 +629,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setAutoGroup(" + autoGroup + ")");
+         ActiveMQRALogger.LOGGER.trace("setAutoGroup(" + autoGroup + ")");
       }
       hasBeenUpdated = true;
       this.autoGroup = autoGroup;
@@ -639,7 +639,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isPreAcknowledge()");
+         ActiveMQRALogger.LOGGER.trace("isPreAcknowledge()");
       }
       return preAcknowledge;
    }
@@ -648,7 +648,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setPreAcknowledge(" + preAcknowledge + ")");
+         ActiveMQRALogger.LOGGER.trace("setPreAcknowledge(" + preAcknowledge + ")");
       }
       hasBeenUpdated = true;
       this.preAcknowledge = preAcknowledge;
@@ -658,7 +658,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getRetryInterval()");
+         ActiveMQRALogger.LOGGER.trace("getRetryInterval()");
       }
       return retryInterval;
    }
@@ -667,7 +667,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setRetryInterval(" + retryInterval + ")");
+         ActiveMQRALogger.LOGGER.trace("setRetryInterval(" + retryInterval + ")");
       }
       hasBeenUpdated = true;
       this.retryInterval = retryInterval;
@@ -677,7 +677,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getRetryIntervalMultiplier()");
+         ActiveMQRALogger.LOGGER.trace("getRetryIntervalMultiplier()");
       }
       return retryIntervalMultiplier;
    }
@@ -686,7 +686,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
+         ActiveMQRALogger.LOGGER.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
       }
       hasBeenUpdated = true;
       this.retryIntervalMultiplier = retryIntervalMultiplier;
@@ -707,7 +707,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getReconnectAttempts()");
+         ActiveMQRALogger.LOGGER.trace("getReconnectAttempts()");
       }
       return reconnectAttempts;
    }
@@ -716,7 +716,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setReconnectAttempts(" + reconnectAttempts + ")");
+         ActiveMQRALogger.LOGGER.trace("setReconnectAttempts(" + reconnectAttempts + ")");
       }
       hasBeenUpdated = true;
       this.reconnectAttempts = reconnectAttempts;
@@ -726,7 +726,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("isUseGlobalPools()");
+         ActiveMQRALogger.LOGGER.trace("isUseGlobalPools()");
       }
       return useGlobalPools;
    }
@@ -735,7 +735,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setUseGlobalPools(" + useGlobalPools + ")");
+         ActiveMQRALogger.LOGGER.trace("setUseGlobalPools(" + useGlobalPools + ")");
       }
       hasBeenUpdated = true;
       this.useGlobalPools = useGlobalPools;
@@ -745,7 +745,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getScheduledThreadPoolMaxSize()");
+         ActiveMQRALogger.LOGGER.trace("getScheduledThreadPoolMaxSize()");
       }
       return scheduledThreadPoolMaxSize;
    }
@@ -754,7 +754,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setScheduledThreadPoolMaxSize(" + scheduledThreadPoolMaxSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setScheduledThreadPoolMaxSize(" + scheduledThreadPoolMaxSize + ")");
       }
       hasBeenUpdated = true;
       this.scheduledThreadPoolMaxSize = scheduledThreadPoolMaxSize;
@@ -764,7 +764,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("getThreadPoolMaxSize()");
+         ActiveMQRALogger.LOGGER.trace("getThreadPoolMaxSize()");
       }
       return threadPoolMaxSize;
    }
@@ -773,7 +773,7 @@ public class ConnectionFactoryProperties
    {
       if (ConnectionFactoryProperties.trace)
       {
-         HornetQRALogger.LOGGER.trace("setThreadPoolMaxSize(" + threadPoolMaxSize + ")");
+         ActiveMQRALogger.LOGGER.trace("setThreadPoolMaxSize(" + threadPoolMaxSize + ")");
       }
       hasBeenUpdated = true;
       this.threadPoolMaxSize = threadPoolMaxSize;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABundle.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABundle.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABundle.java
deleted file mode 100644
index 79979b7..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABundle.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.resource.NotSupportedException;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 15
- *
- * each message id must be 6 digits long starting with 15, the 3rd digit should be 9
- *
- * so 159000 to 159999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQRABundle
-{
-   /** Error message for strict behaviour */
-   String ISE = "This method is not applicable inside the application server. See the JEE spec, e.g. JEE 7 Section 6.7";
-
-   HornetQRABundle BUNDLE = Messages.getBundle(HornetQRABundle.class);
-
-   @Message(id = 159000, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
-
-   @Message(id = 159001, value = "MDB cannot be deployed as it has no Activation Spec. Please provide an Activation!", format = Message.Format.MESSAGE_FORMAT)
-   NotSupportedException noActivationSpec();
-
-   @Message(id = 159002, value = "Please provide a destination for the MDB", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noDestinationName();
-
-   @Message(id = 159003, value = ISE, format = Message.Format.MESSAGE_FORMAT)
-   JMSRuntimeException illegalJEEMethod();
-
-   @Message(id = 159004, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
-   JMSRuntimeException invalidSessionTransactedModeRuntime();
-
-   @Message(id = 159005, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
-   JMSRuntimeException invalidClientAcknowledgeModeRuntime();
-
-   @Message(id = 159006, value = "Invalid Session Mode {0}", format = Message.Format.MESSAGE_FORMAT)
-   JMSRuntimeException invalidAcknowledgeMode(int sessionMode);
-
-   @Message(id = 159007, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
-   JMSException invalidSessionTransactedMode();
-
-   @Message(id = 159008, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
-   JMSException invalidClientAcknowledgeMode();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABytesMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABytesMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABytesMessage.java
deleted file mode 100644
index a7de0d0..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRABytesMessage.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.util.Arrays;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRABytesMessage extends HornetQRAMessage implements BytesMessage
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRABytesMessage(final BytesMessage message, final HornetQRASession session)
-   {
-      super(message, session);
-
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get body length
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public long getBodyLength() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBodyLength()");
-      }
-
-      return ((BytesMessage)message).getBodyLength();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean readBoolean() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readBoolean()");
-      }
-
-      return ((BytesMessage)message).readBoolean();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public byte readByte() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readByte()");
-      }
-
-      return ((BytesMessage)message).readByte();
-   }
-
-   /**
-    * Read
-    * @param value The value
-    * @param length The length
-    * @return The result
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readBytes(final byte[] value, final int length) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ", " + length + ")");
-      }
-
-      return ((BytesMessage)message).readBytes(value, length);
-   }
-
-   /**
-    * Read
-    * @param value The value
-    * @return The result
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readBytes(final byte[] value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ")");
-      }
-
-      return ((BytesMessage)message).readBytes(value);
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public char readChar() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readChar()");
-      }
-
-      return ((BytesMessage)message).readChar();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public double readDouble() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readDouble()");
-      }
-
-      return ((BytesMessage)message).readDouble();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public float readFloat() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readFloat()");
-      }
-
-      return ((BytesMessage)message).readFloat();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readInt() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readInt()");
-      }
-
-      return ((BytesMessage)message).readInt();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public long readLong() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readLong()");
-      }
-
-      return ((BytesMessage)message).readLong();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public short readShort() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readShort()");
-      }
-
-      return ((BytesMessage)message).readShort();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readUnsignedByte() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readUnsignedByte()");
-      }
-
-      return ((BytesMessage)message).readUnsignedByte();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readUnsignedShort() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readUnsignedShort()");
-      }
-
-      return ((BytesMessage)message).readUnsignedShort();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public String readUTF() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readUTF()");
-      }
-
-      return ((BytesMessage)message).readUTF();
-   }
-
-   /**
-    * Reset
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void reset() throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("reset()");
-      }
-
-      ((BytesMessage)message).reset();
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBoolean(final boolean value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBoolean(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeBoolean(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeByte(final byte value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeByte(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeByte(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @param offset The offset
-    * @param length The length
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBytes(" + Arrays.toString(value) + ", " + offset + ", " + length + ")");
-      }
-
-      ((BytesMessage)message).writeBytes(value, offset, length);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBytes(final byte[] value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBytes(" + Arrays.toString(value) + ")");
-      }
-
-      ((BytesMessage)message).writeBytes(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeChar(final char value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeChar(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeChar(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeDouble(final double value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeDouble(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeDouble(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeFloat(final float value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeFloat(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeFloat(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeInt(final int value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeInt(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeInt(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeLong(final long value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeLong(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeLong(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeObject(final Object value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeObject(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeObject(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeShort(final short value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeShort(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeShort(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeUTF(final String value) throws JMSException
-   {
-      if (HornetQRABytesMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeUTF(" + value + ")");
-      }
-
-      ((BytesMessage)message).writeUTF(value);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactory.java
deleted file mode 100644
index 662506b..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.XAQueueConnectionFactory;
-import javax.jms.XATopicConnectionFactory;
-import javax.resource.Referenceable;
-import javax.resource.ResourceException;
-import java.io.Serializable;
-
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-
-/**
- * An aggregate interface for the JMS connection factories
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.com">Jesper Pedersen</a>
- */
-public interface HornetQRAConnectionFactory extends XAQueueConnectionFactory,
-   XATopicConnectionFactory, Serializable, Referenceable
-{
-   /**
-    * Connection factory capable of handling connections
-    */
-   int CONNECTION = 0;
-
-   /**
-    * Connection factory capable of handling queues
-    */
-   int QUEUE_CONNECTION = 1;
-
-   /**
-    * Connection factory capable of handling topics
-    */
-   int TOPIC_CONNECTION = 2;
-
-   /**
-    * Connection factory capable of handling XA connections
-    */
-   int XA_CONNECTION = 3;
-
-   /**
-    * Connection factory capable of handling XA queues
-    */
-   int XA_QUEUE_CONNECTION = 4;
-
-   /**
-    * Connection factory capable of handling XA topics
-    */
-   int XA_TOPIC_CONNECTION = 5;
-
-   HornetQConnectionFactory getDefaultFactory() throws ResourceException;
-
-   HornetQResourceAdapter getResourceAdapter();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactoryImpl.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactoryImpl.java
deleted file mode 100644
index f4d7327..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionFactoryImpl.java
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.Connection;
-import javax.jms.JMSContext;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.JMSSecurityException;
-import javax.jms.JMSSecurityRuntimeException;
-import javax.jms.QueueConnection;
-import javax.jms.Session;
-import javax.jms.TopicConnection;
-import javax.jms.XAConnection;
-import javax.jms.XAJMSContext;
-import javax.jms.XAQueueConnection;
-import javax.jms.XATopicConnection;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.referenceable.ConnectionFactoryObjectFactory;
-import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
-
-/**
- * The connection factory
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAConnectionFactoryImpl implements HornetQRAConnectionFactory
-{
-   /**
-    * Serial version UID
-    */
-   static final long serialVersionUID = 7981708919479859360L;
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The managed connection factory
-    */
-   private final HornetQRAManagedConnectionFactory mcf;
-
-   /**
-    * The connection manager
-    */
-   private ConnectionManager cm;
-
-   /**
-    * Naming reference
-    */
-   private Reference reference;
-
-   /**
-    * Constructor
-    *
-    * @param mcf The managed connection factory
-    * @param cm  The connection manager
-    */
-   public HornetQRAConnectionFactoryImpl(final HornetQRAManagedConnectionFactory mcf, final ConnectionManager cm)
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cm + ")");
-      }
-
-      this.mcf = mcf;
-
-      if (cm == null)
-      {
-         // This is standalone usage, no appserver
-         this.cm = new HornetQRAConnectionManager();
-         if (HornetQRAConnectionFactoryImpl.trace)
-         {
-            HornetQRALogger.LOGGER.trace("Created new ConnectionManager=" + this.cm);
-         }
-      }
-      else
-      {
-         this.cm = cm;
-      }
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Using ManagedConnectionFactory=" + mcf + ", ConnectionManager=" + cm);
-      }
-   }
-
-   /**
-    * Set the reference
-    *
-    * @param reference The reference
-    */
-   public void setReference(final Reference reference)
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setReference(" + reference + ")");
-      }
-
-      this.reference = reference;
-   }
-
-   /**
-    * Get the reference
-    *
-    * @return The reference
-    */
-   public Reference getReference()
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getReference()");
-      }
-      if (reference == null)
-      {
-         try
-         {
-            reference = new Reference(this.getClass().getCanonicalName(),
-                                      new SerializableObjectRefAddr("HornetQ-CF", this),
-                                      ConnectionFactoryObjectFactory.class.getCanonicalName(),
-                                      null);
-         }
-         catch (NamingException e)
-         {
-            HornetQRALogger.LOGGER.errorCreatingReference(e);
-         }
-      }
-
-      return reference;
-
-   }
-
-   /**
-    * Create a queue connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public QueueConnection createQueueConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createQueueConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.QUEUE_CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created queue connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a queue connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public QueueConnection createQueueConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createQueueConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.QUEUE_CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created queue connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a topic connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public TopicConnection createTopicConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTopicConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.TOPIC_CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created topic connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a topic connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public TopicConnection createTopicConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createTopicConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.TOPIC_CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created topic connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public Connection createConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public Connection createConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA queue connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XAQueueConnection createXAQueueConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXAQueueConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.XA_QUEUE_CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created queue connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA  queue connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XAQueueConnection createXAQueueConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXAQueueConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.XA_QUEUE_CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created queue connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA topic connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XATopicConnection createXATopicConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXATopicConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.XA_TOPIC_CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created topic connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA topic connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XATopicConnection createXATopicConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXATopicConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf,
-                                                                      cm,
-                                                                      getResourceAdapter().getTM(),
-                                                                      HornetQRAConnectionFactory.XA_TOPIC_CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created topic connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA connection
-    *
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XAConnection createXAConnection() throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXAConnection()");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.XA_CONNECTION);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created connection: " + s);
-      }
-
-      return s;
-   }
-
-   /**
-    * Create a XA connection
-    *
-    * @param userName The user name
-    * @param password The password
-    * @return The connection
-    * @throws JMSException Thrown if the operation fails
-    */
-   public XAConnection createXAConnection(final String userName, final String password) throws JMSException
-   {
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createXAConnection(" + userName + ", ****)");
-      }
-
-      HornetQRASessionFactoryImpl s = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.XA_CONNECTION);
-      s.setUserName(userName);
-      s.setPassword(password);
-      validateUser(s);
-
-      if (HornetQRAConnectionFactoryImpl.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created connection: " + s);
-      }
-
-      return s;
-   }
-
-   @Override
-   public JMSContext createContext()
-   {
-      return createContext(null, null);
-   }
-
-   @Override
-   public JMSContext createContext(String userName, String password)
-   {
-      return createContext(userName, password, Session.AUTO_ACKNOWLEDGE);
-   }
-
-   @Override
-   public JMSContext createContext(String userName, String password, int sessionMode)
-   {
-      @SuppressWarnings("resource")
-      HornetQRASessionFactoryImpl conn = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.CONNECTION);
-      conn.setUserName(userName);
-      conn.setPassword(password);
-      try
-      {
-         validateUser(conn);
-      }
-      catch (JMSSecurityException e)
-      {
-         JMSSecurityRuntimeException e2 = new JMSSecurityRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      return conn.createContext(sessionMode);
-   }
-
-   @Override
-   public JMSContext createContext(int sessionMode)
-   {
-      return createContext(null, null, sessionMode);
-   }
-
-   @Override
-   public XAJMSContext createXAContext()
-   {
-      return createXAContext(null, null);
-   }
-
-   @Override
-   public XAJMSContext createXAContext(String userName, String password)
-   {
-      HornetQRASessionFactoryImpl conn = new HornetQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), HornetQRAConnectionFactory.XA_CONNECTION);
-      conn.setUserName(userName);
-      conn.setPassword(password);
-      try
-      {
-         validateUser(conn);
-      }
-      catch (JMSSecurityException e)
-      {
-         JMSSecurityRuntimeException e2 = new JMSSecurityRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      return conn.createXAContext();
-   }
-
-   private void validateUser(HornetQRASessionFactoryImpl s) throws JMSException
-   {
-      Session session = s.createSession();
-      session.close();
-   }
-
-   @Override
-   public HornetQConnectionFactory getDefaultFactory() throws ResourceException
-   {
-      return ((HornetQResourceAdapter) mcf.getResourceAdapter()).getDefaultHornetQConnectionFactory();
-   }
-
-   @Override
-   public HornetQResourceAdapter getResourceAdapter()
-   {
-      return (HornetQResourceAdapter) mcf.getResourceAdapter();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionManager.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionManager.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionManager.java
deleted file mode 100644
index ee1defe..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionManager.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionFactory;
-
-import org.apache.activemq.utils.ConcurrentHashSet;
-
-
-/**
- * The connection manager used in non-managed environments.
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAConnectionManager implements ConnectionManager
-{
-   /** Serial version UID */
-   static final long serialVersionUID = 4409118162975011014L;
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Constructor
-    */
-   public HornetQRAConnectionManager()
-   {
-      if (HornetQRAConnectionManager.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-   }
-
-   ConcurrentHashSet<ManagedConnection> connections = new ConcurrentHashSet<>();
-
-   /**
-    * Allocates a connection
-    * @param mcf The managed connection factory
-    * @param cxRequestInfo The connection request information
-    * @return The connection
-    * @exception ResourceException Thrown if there is a problem obtaining the connection
-    */
-   public Object allocateConnection(final ManagedConnectionFactory mcf, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
-   {
-      if (HornetQRAConnectionManager.trace)
-      {
-         HornetQRALogger.LOGGER.trace("allocateConnection(" + mcf + ", " + cxRequestInfo + ")");
-      }
-
-      ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo);
-      Object c = mc.getConnection(null, cxRequestInfo);
-
-      if (HornetQRAConnectionManager.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Allocated connection: " + c + ", with managed connection: " + mc);
-      }
-
-      connections.add(mc);
-      return c;
-   }
-
-   public void stop()
-   {
-      for (ManagedConnection conn : connections)
-      {
-         try
-         {
-            conn.destroy();
-         }
-         catch (Throwable e)
-         {
-
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionMetaData.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionMetaData.java
deleted file mode 100644
index a34db36..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionMetaData.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.jms.ConnectionMetaData;
-
-
-/**
- * This class implements javax.jms.ConnectionMetaData
- *
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAConnectionMetaData implements ConnectionMetaData
-{
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Constructor
-    */
-   public HornetQRAConnectionMetaData()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-   }
-
-   /**
-    * Get the JMS version
-    * @return The version
-    */
-   public String getJMSVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSVersion()");
-      }
-
-      return "2.0";
-   }
-
-   /**
-    * Get the JMS major version
-    * @return The major version
-    */
-   public int getJMSMajorVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSMajorVersion()");
-      }
-
-      return 2;
-   }
-
-   /**
-    * Get the JMS minor version
-    * @return The minor version
-    */
-   public int getJMSMinorVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSMinorVersion()");
-      }
-
-      return 0;
-   }
-
-   /**
-    * Get the JMS provider name
-    * @return The name
-    */
-   public String getJMSProviderName()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSProviderName()");
-      }
-
-      return "HornetQ";
-   }
-
-   /**
-    * Get the provider version
-    * @return The version
-    */
-   public String getProviderVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSProviderName()");
-      }
-
-      return "2.4";
-   }
-
-   /**
-    * Get the provider major version
-    * @return The version
-    */
-   public int getProviderMajorVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProviderMajorVersion()");
-      }
-
-      return 2;
-   }
-
-   /**
-    * Get the provider minor version
-    * @return The version
-    */
-   public int getProviderMinorVersion()
-   {
-      if (HornetQRAConnectionMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProviderMinorVersion()");
-      }
-
-      return 4;
-   }
-
-   /**
-    * Get the JMS XPropertyNames
-    * @return The names
-    */
-   public Enumeration<Object> getJMSXPropertyNames()
-   {
-      Vector<Object> v = new Vector<Object>();
-      v.add("JMSXGroupID");
-      v.add("JMSXGroupSeq");
-      v.add("JMSXDeliveryCount");
-      return v.elements();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionRequestInfo.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionRequestInfo.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionRequestInfo.java
deleted file mode 100644
index 96eea48..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAConnectionRequestInfo.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.Session;
-import javax.resource.spi.ConnectionRequestInfo;
-
-
-/**
- * Connection request information
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQRAConnectionRequestInfo implements ConnectionRequestInfo
-{
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The user name */
-   private String userName;
-
-   /** The password */
-   private String password;
-
-   /** The client id */
-   private String clientID;
-
-   /** The type */
-   private final int type;
-
-   /** Use transactions */
-   private final boolean transacted;
-
-   /** The acknowledge mode */
-   private final int acknowledgeMode;
-
-   /**
-    * Constructor
-    * @param prop The resource adapter properties
-    * @param type The connection type
-    */
-   public HornetQRAConnectionRequestInfo(final HornetQRAProperties prop, final int type)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + prop + ")");
-      }
-
-      userName = prop.getUserName();
-      password = prop.getPassword();
-      clientID = prop.getClientID();
-      this.type = type;
-      transacted = true;
-      acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-   }
-
-   /**
-    * Constructor
-    * @param transacted Use transactions
-    * @param acknowledgeMode The acknowledge mode
-    * @param type The connection type
-    */
-   public HornetQRAConnectionRequestInfo(final boolean transacted, final int acknowledgeMode, final int type)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + transacted +
-                                                  ", " +
-                                                  acknowledgeMode +
-                                                  ", " +
-                                                  type +
-                                                  ")");
-      }
-
-      this.transacted = transacted;
-      this.acknowledgeMode = acknowledgeMode;
-      this.type = type;
-   }
-
-   /**
-    * Fill in default values if they are missing
-    * @param prop The resource adapter properties
-    */
-   public void setDefaults(final HornetQRAProperties prop)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDefaults(" + prop + ")");
-      }
-
-      if (userName == null)
-      {
-         userName = prop.getUserName();
-      }
-      if (password == null)
-      {
-         password = prop.getPassword();
-      }
-      if (clientID == null)
-      {
-         clientID = prop.getClientID();
-      }
-   }
-
-   /**
-    * Get the user name
-    * @return The value
-    */
-   public String getUserName()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return userName;
-   }
-
-   /**
-    * Set the user name
-    * @param userName The value
-    */
-   public void setUserName(final String userName)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUserName(" + userName + ")");
-      }
-
-      this.userName = userName;
-   }
-
-   /**
-    * Get the password
-    * @return The value
-    */
-   public String getPassword()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPassword()");
-      }
-
-      return password;
-   }
-
-   /**
-    * Set the password
-    * @param password The value
-    */
-   public void setPassword(final String password)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      this.password = password;
-   }
-
-   /**
-    * Get the client id
-    * @return The value
-    */
-   public String getClientID()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getClientID()");
-      }
-
-      return clientID;
-   }
-
-   /**
-    * Set the client id
-    * @param clientID The value
-    */
-   public void setClientID(final String clientID)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
-      }
-
-      this.clientID = clientID;
-   }
-
-   /**
-    * Get the connection type
-    * @return The type
-    */
-   public int getType()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getType()");
-      }
-
-      return type;
-   }
-
-   /**
-    * Use transactions
-    * @return True if transacted; otherwise false
-    */
-   public boolean isTransacted()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isTransacted() " + transacted);
-      }
-
-      return transacted;
-   }
-
-   /**
-    * Get the acknowledge mode
-    * @return The mode
-    */
-   public int getAcknowledgeMode()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getAcknowledgeMode()");
-      }
-
-      return acknowledgeMode;
-   }
-
-   /**
-    * Indicates whether some other object is "equal to" this one.
-    * @param obj Object with which to compare
-    * @return True if this object is the same as the obj argument; false otherwise.
-    */
-   @Override
-   public boolean equals(final Object obj)
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("equals(" + obj + ")");
-      }
-
-      if (obj == null)
-      {
-         return false;
-      }
-
-      if (obj instanceof HornetQRAConnectionRequestInfo)
-      {
-         HornetQRAConnectionRequestInfo you = (HornetQRAConnectionRequestInfo)obj;
-         return HornetQRaUtils.compare(userName, you.getUserName()) && HornetQRaUtils.compare(password, you.getPassword()) &&
-                HornetQRaUtils.compare(clientID, you.getClientID()) &&
-                type == you.getType() &&
-                transacted == you.isTransacted() &&
-                acknowledgeMode == you.getAcknowledgeMode();
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   /**
-    * Return the hash code for the object
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (HornetQRAConnectionRequestInfo.trace)
-      {
-         HornetQRALogger.LOGGER.trace("hashCode()");
-      }
-
-      int hash = 7;
-
-      hash += 31 * hash + (userName != null ? userName.hashCode() : 0);
-      hash += 31 * hash + (password != null ? password.hashCode() : 0);
-      hash += 31 * hash + Integer.valueOf(type).hashCode();
-      hash += 31 * hash + (transacted ? 1 : 0);
-      hash += 31 * hash + Integer.valueOf(acknowledgeMode).hashCode();
-
-      return hash;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "HornetQRAConnectionRequestInfo[type=" + type +
-         ", transacted=" + transacted + ", acknowledgeMode=" + acknowledgeMode +
-         ", clientID=" + clientID + ", userName=" + userName + ", password=****]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRACredential.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRACredential.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRACredential.java
deleted file mode 100644
index e67055c..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRACredential.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.io.Serializable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Set;
-
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnectionFactory;
-import javax.resource.spi.SecurityException;
-import javax.resource.spi.security.PasswordCredential;
-import javax.security.auth.Subject;
-
-
-/**
- * Credential information
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @version $Revision: 71554 $
- */
-public class HornetQRACredential implements Serializable
-{
-   /** Serial version UID */
-   static final long serialVersionUID = 210476602237497193L;
-
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The user name */
-   private String userName;
-
-   /** The password */
-   private String password;
-
-   /**
-    * Private constructor
-    */
-   private HornetQRACredential()
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-   }
-
-   /**
-    * Get the user name
-    * @return The value
-    */
-   public String getUserName()
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return userName;
-   }
-
-   /**
-    * Set the user name
-    * @param userName The value
-    */
-   private void setUserName(final String userName)
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUserName(" + userName + ")");
-      }
-
-      this.userName = userName;
-   }
-
-   /**
-    * Get the password
-    * @return The value
-    */
-   public String getPassword()
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPassword()");
-      }
-
-      return password;
-   }
-
-   /**
-    * Set the password
-    * @param password The value
-    */
-   private void setPassword(final String password)
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      this.password = password;
-   }
-
-   /**
-    * Get credentials
-    * @param mcf The managed connection factory
-    * @param subject The subject
-    * @param info The connection request info
-    * @return The credentials
-    * @exception SecurityException Thrown if the credentials can't be retrieved
-    */
-   public static HornetQRACredential getCredential(final ManagedConnectionFactory mcf,
-                                                   final Subject subject,
-                                                   final ConnectionRequestInfo info) throws SecurityException
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getCredential(" + mcf + ", " + subject + ", " + info + ")");
-      }
-
-      HornetQRACredential jc = new HornetQRACredential();
-      if (subject == null && info != null)
-      {
-         jc.setUserName(((HornetQRAConnectionRequestInfo)info).getUserName());
-         jc.setPassword(((HornetQRAConnectionRequestInfo)info).getPassword());
-      }
-      else if (subject != null)
-      {
-         PasswordCredential pwdc = GetCredentialAction.getCredential(subject, mcf);
-
-         if (pwdc == null)
-         {
-            throw new SecurityException("No password credentials found");
-         }
-
-         jc.setUserName(pwdc.getUserName());
-         jc.setPassword(new String(pwdc.getPassword()));
-      }
-      else
-      {
-         throw new SecurityException("No Subject or ConnectionRequestInfo set, could not get credentials");
-      }
-
-      return jc;
-   }
-
-   /**
-    * String representation
-    * @return The representation
-    */
-   @Override
-   public String toString()
-   {
-      if (HornetQRACredential.trace)
-      {
-         HornetQRALogger.LOGGER.trace("toString()");
-      }
-
-      return super.toString() + "{ username=" + userName + ", password=**** }";
-   }
-
-   /**
-    * Privileged class to get credentials
-    */
-   private static class GetCredentialAction implements PrivilegedAction<PasswordCredential>
-   {
-      /** The subject */
-      private final Subject subject;
-
-      /** The managed connection factory */
-      private final ManagedConnectionFactory mcf;
-
-      /**
-       * Constructor
-       * @param subject The subject
-       * @param mcf The managed connection factory
-       */
-      GetCredentialAction(final Subject subject, final ManagedConnectionFactory mcf)
-      {
-         if (HornetQRACredential.trace)
-         {
-            HornetQRALogger.LOGGER.trace("constructor(" + subject + ", " + mcf + ")");
-         }
-
-         this.subject = subject;
-         this.mcf = mcf;
-      }
-
-      /**
-       * Run
-       * @return The credential
-       */
-      public PasswordCredential run()
-      {
-         if (HornetQRACredential.trace)
-         {
-            HornetQRALogger.LOGGER.trace("run()");
-         }
-
-         Set<PasswordCredential> creds = subject.getPrivateCredentials(PasswordCredential.class);
-         PasswordCredential pwdc = null;
-
-         for (PasswordCredential curCred : creds)
-         {
-            if (curCred.getManagedConnectionFactory().equals(mcf))
-            {
-               pwdc = curCred;
-               break;
-            }
-         }
-         return pwdc;
-      }
-
-      /**
-       * Get credentials
-       * @param subject The subject
-       * @param mcf The managed connection factory
-       * @return The credential
-       */
-      static PasswordCredential getCredential(final Subject subject, final ManagedConnectionFactory mcf)
-      {
-         if (HornetQRACredential.trace)
-         {
-            HornetQRALogger.LOGGER.trace("getCredential(" + subject + ", " + mcf + ")");
-         }
-
-         GetCredentialAction action = new GetCredentialAction(subject, mcf);
-         return AccessController.doPrivileged(action);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAJMSContext.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAJMSContext.java
deleted file mode 100644
index 9185ac3..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAJMSContext.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import org.apache.activemq.jms.client.HornetQConnectionForContext;
-import org.apache.activemq.jms.client.HornetQJMSContext;
-import org.apache.activemq.jms.client.ThreadAwareContext;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSContext;
-
-public class HornetQRAJMSContext extends HornetQJMSContext
-{
-   public HornetQRAJMSContext(HornetQConnectionForContext connection, int ackMode, ThreadAwareContext threadAwareContext)
-   {
-      super(connection, ackMode, threadAwareContext);
-   }
-
-   public HornetQRAJMSContext(HornetQConnectionForContext connection, ThreadAwareContext threadAwareContext)
-   {
-      super(connection, threadAwareContext);
-   }
-
-   @Override
-   public JMSContext createContext(int sessionMode)
-   {
-      throw HornetQRABundle.BUNDLE.illegalJEEMethod();
-   }
-
-   @Override
-   public void stop()
-   {
-      throw HornetQRABundle.BUNDLE.illegalJEEMethod();
-   }
-
-   @Override
-   public void setClientID(String clientID)
-   {
-      throw HornetQRABundle.BUNDLE.illegalJEEMethod();
-   }
-
-   @Override
-   public void setExceptionListener(ExceptionListener listener)
-   {
-      throw HornetQRABundle.BUNDLE.illegalJEEMethod();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALocalTransaction.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALocalTransaction.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALocalTransaction.java
deleted file mode 100644
index bb67f34..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALocalTransaction.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.resource.ResourceException;
-import javax.resource.spi.LocalTransaction;
-
-
-/**
- * JMS Local transaction
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRALocalTransaction implements LocalTransaction
-{
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The managed connection */
-   private final HornetQRAManagedConnection mc;
-
-   /**
-    * Constructor
-    * @param mc The managed connection
-    */
-   public HornetQRALocalTransaction(final HornetQRAManagedConnection mc)
-   {
-      if (HornetQRALocalTransaction.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mc + ")");
-      }
-
-      this.mc = mc;
-   }
-
-   /**
-    * Begin
-    * @exception ResourceException Thrown if the operation fails
-    */
-   public void begin() throws ResourceException
-   {
-      if (HornetQRALocalTransaction.trace)
-      {
-         HornetQRALogger.LOGGER.trace("begin()");
-      }
-
-     // mc.setInManagedTx(true);
-   }
-
-   /**
-    * Commit
-    * @exception ResourceException Thrown if the operation fails
-    */
-   public void commit() throws ResourceException
-   {
-      if (HornetQRALocalTransaction.trace)
-      {
-         HornetQRALogger.LOGGER.trace("commit()");
-      }
-
-      mc.lock();
-      try
-      {
-         if (mc.getSession().getTransacted())
-         {
-            mc.getSession().commit();
-         }
-      }
-      catch (JMSException e)
-      {
-         throw new ResourceException("Could not commit LocalTransaction", e);
-      }
-      finally
-      {
-         //mc.setInManagedTx(false);
-         mc.unlock();
-      }
-   }
-
-   /**
-    * Rollback
-    * @exception ResourceException Thrown if the operation fails
-    */
-   public void rollback() throws ResourceException
-   {
-      if (HornetQRALocalTransaction.trace)
-      {
-         HornetQRALogger.LOGGER.trace("rollback()");
-      }
-
-      mc.lock();
-      try
-      {
-         if (mc.getSession().getTransacted())
-         {
-            mc.getSession().rollback();
-         }
-      }
-      catch (JMSException ex)
-      {
-         throw new ResourceException("Could not rollback LocalTransaction", ex);
-      }
-      finally
-      {
-         //mc.setInManagedTx(false);
-         mc.unlock();
-      }
-   }
-}


[15/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivation.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivation.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivation.java
new file mode 100644
index 0000000..d618e42
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivation.java
@@ -0,0 +1,831 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra.inflow;
+
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.xa.XAResource;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
+import org.apache.activemq.api.core.ActiveMQNotConnectedException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.core.client.impl.ClientSessionInternal;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
+import org.apache.activemq.ra.ActiveMQRABundle;
+import org.apache.activemq.ra.ActiveMQRAConnectionFactory;
+import org.apache.activemq.ra.ActiveMQRALogger;
+import org.apache.activemq.ra.ActiveMQRaUtils;
+import org.apache.activemq.ra.ActiveMQResourceAdapter;
+import org.apache.activemq.utils.FutureLatch;
+import org.apache.activemq.utils.SensitiveDataCodec;
+
+/**
+ * The activation.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ActiveMQActivation
+{
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The onMessage method
+    */
+   public static final Method ONMESSAGE;
+
+   /**
+    * The resource adapter
+    */
+   private final ActiveMQResourceAdapter ra;
+
+   /**
+    * The activation spec
+    */
+   private final ActiveMQActivationSpec spec;
+
+   /**
+    * The message endpoint factory
+    */
+   private final MessageEndpointFactory endpointFactory;
+
+   /**
+    * Whether delivery is active
+    */
+   private final AtomicBoolean deliveryActive = new AtomicBoolean(false);
+
+   /**
+    * The destination type
+    */
+   private boolean isTopic = false;
+
+   /**
+    * Is the delivery transacted
+    */
+   private boolean isDeliveryTransacted;
+
+   private ActiveMQDestination destination;
+
+   /**
+    * The name of the temporary subscription name that all the sessions will share
+    */
+   private SimpleString topicTemporaryQueue;
+
+   private final List<ActiveMQMessageHandler> handlers = new ArrayList<ActiveMQMessageHandler>();
+
+   private ActiveMQConnectionFactory factory;
+
+   // Whether we are in the failure recovery loop
+   private final AtomicBoolean inFailure = new AtomicBoolean(false);
+   private XARecoveryConfig resourceRecovery;
+
+   static
+   {
+      try
+      {
+         ONMESSAGE = MessageListener.class.getMethod("onMessage", new Class[]{Message.class});
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   /**
+    * Constructor
+    *
+    * @param ra              The resource adapter
+    * @param endpointFactory The endpoint factory
+    * @param spec            The activation spec
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public ActiveMQActivation(final ActiveMQResourceAdapter ra,
+                             final MessageEndpointFactory endpointFactory,
+                             final ActiveMQActivationSpec spec) throws ResourceException
+   {
+      spec.validate();
+
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + ra + ", " + endpointFactory + ", " + spec + ")");
+      }
+
+      if (ra.isUseMaskedPassword())
+      {
+         String pass = spec.getOwnPassword();
+         if (pass != null)
+         {
+            SensitiveDataCodec<String> codec = ra.getCodecInstance();
+
+            try
+            {
+               spec.setPassword(codec.decode(pass));
+            }
+            catch (Exception e)
+            {
+               throw new ResourceException(e);
+            }
+         }
+      }
+
+      this.ra = ra;
+      this.endpointFactory = endpointFactory;
+      this.spec = spec;
+      try
+      {
+         isDeliveryTransacted = endpointFactory.isDeliveryTransacted(ActiveMQActivation.ONMESSAGE);
+      }
+      catch (Exception e)
+      {
+         throw new ResourceException(e);
+      }
+   }
+
+   /**
+    * Get the activation spec
+    *
+    * @return The value
+    */
+   public ActiveMQActivationSpec getActivationSpec()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getActivationSpec()");
+      }
+
+      return spec;
+   }
+
+   /**
+    * Get the message endpoint factory
+    *
+    * @return The value
+    */
+   public MessageEndpointFactory getMessageEndpointFactory()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageEndpointFactory()");
+      }
+
+      return endpointFactory;
+   }
+
+   /**
+    * Get whether delivery is transacted
+    *
+    * @return The value
+    */
+   public boolean isDeliveryTransacted()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isDeliveryTransacted()");
+      }
+
+      return isDeliveryTransacted;
+   }
+
+   /**
+    * Get the work manager
+    *
+    * @return The value
+    */
+   public WorkManager getWorkManager()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getWorkManager()");
+      }
+
+      return ra.getWorkManager();
+   }
+
+   /**
+    * Is the destination a topic
+    *
+    * @return The value
+    */
+   public boolean isTopic()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isTopic()");
+      }
+
+      return isTopic;
+   }
+
+   /**
+    * Start the activation
+    *
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public void start() throws ResourceException
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start()");
+      }
+      deliveryActive.set(true);
+      ra.getWorkManager().scheduleWork(new SetupActivation());
+   }
+
+   /**
+    * @return the topicTemporaryQueue
+    */
+   public SimpleString getTopicTemporaryQueue()
+   {
+      return topicTemporaryQueue;
+   }
+
+   /**
+    * @param topicTemporaryQueue the topicTemporaryQueue to set
+    */
+   public void setTopicTemporaryQueue(SimpleString topicTemporaryQueue)
+   {
+      this.topicTemporaryQueue = topicTemporaryQueue;
+   }
+
+   /**
+    * @return the list of XAResources for this activation endpoint
+    */
+   public List<XAResource> getXAResources()
+   {
+      List<XAResource> xaresources = new ArrayList<XAResource>();
+      for (ActiveMQMessageHandler handler : handlers)
+      {
+         XAResource xares = handler.getXAResource();
+         if (xares != null)
+         {
+            xaresources.add(xares);
+         }
+      }
+      return xaresources;
+   }
+
+   /**
+    * Stop the activation
+    */
+   public void stop()
+   {
+      if (ActiveMQActivation.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("stop()");
+      }
+
+      deliveryActive.set(false);
+      teardown();
+   }
+
+   /**
+    * Setup the activation
+    *
+    * @throws Exception Thrown if an error occurs
+    */
+   protected synchronized void setup() throws Exception
+   {
+      ActiveMQRALogger.LOGGER.debug("Setting up " + spec);
+
+      setupCF();
+
+      setupDestination();
+
+      Exception firstException = null;
+
+      for (int i = 0; i < spec.getMaxSession(); i++)
+      {
+         ClientSessionFactory cf = null;
+         ClientSession session = null;
+
+         try
+         {
+            cf = factory.getServerLocator().createSessionFactory();
+            session = setupSession(cf);
+            ActiveMQMessageHandler handler = new ActiveMQMessageHandler(this, ra.getTM(), (ClientSessionInternal) session, cf, i);
+            handler.setup();
+            handlers.add(handler);
+         }
+         catch (Exception e)
+         {
+            if (cf != null)
+            {
+               cf.close();
+            }
+            if (session != null)
+            {
+               session.close();
+            }
+            if (firstException == null)
+            {
+               firstException = e;
+            }
+         }
+      }
+      //if we have any exceptions close all the handlers and throw the first exception.
+      //we don't want partially configured activations, i.e. only 8 out of 15 sessions started so best to stop and log the error.
+      if (firstException != null)
+      {
+         for (ActiveMQMessageHandler handler : handlers)
+         {
+            handler.teardown();
+         }
+         throw firstException;
+      }
+
+      //now start them all together.
+      for (ActiveMQMessageHandler handler : handlers)
+      {
+         handler.start();
+      }
+
+      resourceRecovery = ra.getRecoveryManager().register(factory, spec.getUser(), spec.getPassword());
+
+      ActiveMQRALogger.LOGGER.debug("Setup complete " + this);
+   }
+
+   /**
+    * Teardown the activation
+    */
+   protected synchronized void teardown()
+   {
+      ActiveMQRALogger.LOGGER.debug("Tearing down " + spec);
+
+      if (resourceRecovery != null)
+      {
+         ra.getRecoveryManager().unRegister(resourceRecovery);
+      }
+
+      final ActiveMQMessageHandler[] handlersCopy = new ActiveMQMessageHandler[handlers.size()];
+
+      // We need to do from last to first as any temporary queue will have been created on the first handler
+      // So we invert the handlers here
+      for (int i = 0; i < handlers.size(); i++)
+      {
+         // The index here is the complimentary so it's inverting the array
+         handlersCopy[i] = handlers.get(handlers.size() - i - 1);
+      }
+
+      handlers.clear();
+
+      FutureLatch future = new FutureLatch(handlersCopy.length);
+      List<Thread> interruptThreads = new ArrayList<>();
+      for (ActiveMQMessageHandler handler : handlersCopy)
+      {
+         Thread thread = handler.interruptConsumer(future);
+         if (thread != null)
+         {
+            interruptThreads.add(thread);
+         }
+      }
+
+      //wait for all the consumers to complete any onmessage calls
+      boolean stuckThreads = !future.await(factory.getCallTimeout());
+      //if any are stuck then we need to interrupt them
+      if (stuckThreads)
+      {
+         for (Thread interruptThread : interruptThreads)
+         {
+            try
+            {
+               interruptThread.interrupt();
+            }
+            catch (Exception e)
+            {
+               //ok
+            }
+         }
+      }
+
+      Thread threadTearDown = new Thread("TearDown/ActiveMQActivation")
+      {
+         public void run()
+         {
+            for (ActiveMQMessageHandler handler : handlersCopy)
+            {
+               handler.teardown();
+            }
+         }
+      };
+
+      // We will first start a new thread that will call tearDown on all the instances, trying to graciously shutdown everything.
+      // We will then use the call-timeout to determine a timeout.
+      // if that failed we will then close the connection factory, and interrupt the thread
+      threadTearDown.start();
+
+      try
+      {
+         threadTearDown.join(factory.getCallTimeout());
+      }
+      catch (InterruptedException e)
+      {
+         // nothing to be done on this context.. we will just keep going as we need to send an interrupt to threadTearDown and give up
+      }
+
+      if (threadTearDown.isAlive())
+      {
+         if (factory != null)
+         {
+            // This will interrupt any threads waiting on reconnect
+            factory.close();
+            factory = null;
+         }
+         threadTearDown.interrupt();
+
+         try
+         {
+            threadTearDown.join(5000);
+         }
+         catch (InterruptedException e)
+         {
+            // nothing to be done here.. we are going down anyways
+         }
+
+         if (threadTearDown.isAlive())
+         {
+            ActiveMQRALogger.LOGGER.warn("Thread " + threadTearDown + " couldn't be finished");
+         }
+      }
+
+      if (spec.isHasBeenUpdated() && factory != null)
+      {
+         factory.close();
+         factory = null;
+      }
+
+
+      ActiveMQRALogger.LOGGER.debug("Tearing down complete " + this);
+   }
+
+   protected void setupCF() throws Exception
+   {
+      if (spec.getConnectionFactoryLookup() != null)
+      {
+         Context ctx;
+         if (spec.getParsedJndiParams() == null)
+         {
+            ctx = new InitialContext();
+         }
+         else
+         {
+            ctx = new InitialContext(spec.getParsedJndiParams());
+         }
+         Object fac = ctx.lookup(spec.getConnectionFactoryLookup());
+         if (fac instanceof ActiveMQConnectionFactory)
+         {
+            factory = (ActiveMQConnectionFactory) fac;
+         }
+         else
+         {
+            ActiveMQRAConnectionFactory raFact = (ActiveMQRAConnectionFactory) fac;
+            if (spec.isHasBeenUpdated())
+            {
+               factory = raFact.getResourceAdapter().createActiveMQConnectionFactory(spec);
+            }
+            else
+            {
+               factory = raFact.getDefaultFactory();
+               if (factory != ra.getDefaultActiveMQConnectionFactory())
+               {
+                  ActiveMQRALogger.LOGGER.warnDifferentConnectionfactory();
+               }
+            }
+         }
+      }
+      else if (spec.isHasBeenUpdated())
+      {
+         factory = ra.createActiveMQConnectionFactory(spec);
+      }
+      else
+      {
+         factory = ra.getDefaultActiveMQConnectionFactory();
+      }
+   }
+
+   /**
+    * Setup a session
+    *
+    * @param cf
+    * @return The connection
+    * @throws Exception Thrown if an error occurs
+    */
+   protected ClientSession setupSession(ClientSessionFactory cf) throws Exception
+   {
+      ClientSession result = null;
+
+      try
+      {
+         result = ra.createSession(cf,
+                                   spec.getAcknowledgeModeInt(),
+                                   spec.getUser(),
+                                   spec.getPassword(),
+                                   ra.getPreAcknowledge(),
+                                   ra.getDupsOKBatchSize(),
+                                   ra.getTransactionBatchSize(),
+                                   isDeliveryTransacted,
+                                   spec.isUseLocalTx(),
+                                   spec.getTransactionTimeout());
+
+         result.addMetaData("resource-adapter", "inbound");
+         result.addMetaData("jms-session", "");
+         String clientID = ra.getClientID() == null ? spec.getClientID() : ra.getClientID();
+         if (clientID != null)
+         {
+            result.addMetaData("jms-client-id", clientID);
+         }
+
+         ActiveMQRALogger.LOGGER.debug("Using queue connection " + result);
+
+         return result;
+      }
+      catch (Throwable t)
+      {
+         try
+         {
+            if (result != null)
+            {
+               result.close();
+            }
+         }
+         catch (Exception e)
+         {
+            ActiveMQRALogger.LOGGER.trace("Ignored error closing connection", e);
+         }
+         if (t instanceof Exception)
+         {
+            throw (Exception) t;
+         }
+         throw new RuntimeException("Error configuring connection", t);
+      }
+   }
+
+   public SimpleString getAddress()
+   {
+      return destination.getSimpleAddress();
+   }
+
+   protected void setupDestination() throws Exception
+   {
+
+      String destinationName = spec.getDestination();
+
+      if (spec.isUseJNDI())
+      {
+         Context ctx;
+         if (spec.getParsedJndiParams() == null)
+         {
+            ctx = new InitialContext();
+         }
+         else
+         {
+            ctx = new InitialContext(spec.getParsedJndiParams());
+         }
+         ActiveMQRALogger.LOGGER.debug("Using context " + ctx.getEnvironment() + " for " + spec);
+         if (ActiveMQActivation.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("setupDestination(" + ctx + ")");
+         }
+
+         String destinationTypeString = spec.getDestinationType();
+         if (destinationTypeString != null && !destinationTypeString.trim().equals(""))
+         {
+            ActiveMQRALogger.LOGGER.debug("Destination type defined as " + destinationTypeString);
+
+            Class<?> destinationType;
+            if (Topic.class.getName().equals(destinationTypeString))
+            {
+               destinationType = Topic.class;
+               isTopic = true;
+            }
+            else
+            {
+               destinationType = Queue.class;
+            }
+
+            ActiveMQRALogger.LOGGER.debug("Retrieving " + destinationType.getName() + " \"" + destinationName + "\" from JNDI");
+
+            try
+            {
+               destination = (ActiveMQDestination) ActiveMQRaUtils.lookup(ctx, destinationName, destinationType);
+            }
+            catch (Exception e)
+            {
+               if (destinationName == null)
+               {
+                  throw ActiveMQRABundle.BUNDLE.noDestinationName();
+               }
+
+               String calculatedDestinationName = destinationName.substring(destinationName.lastIndexOf('/') + 1);
+
+               ActiveMQRALogger.LOGGER.debug("Unable to retrieve " + destinationName +
+                                               " from JNDI. Creating a new " + destinationType.getName() +
+                                               " named " + calculatedDestinationName + " to be used by the MDB.");
+
+               // If there is no binding on naming, we will just create a new instance
+               if (isTopic)
+               {
+                  destination = (ActiveMQDestination) ActiveMQJMSClient.createTopic(calculatedDestinationName);
+               }
+               else
+               {
+                  destination = (ActiveMQDestination) ActiveMQJMSClient.createQueue(calculatedDestinationName);
+               }
+            }
+         }
+         else
+         {
+            ActiveMQRALogger.LOGGER.debug("Destination type not defined in MDB activation configuration.");
+            ActiveMQRALogger.LOGGER.debug("Retrieving " + Destination.class.getName() + " \"" + destinationName + "\" from JNDI");
+
+            destination = (ActiveMQDestination) ActiveMQRaUtils.lookup(ctx, destinationName, Destination.class);
+            if (destination instanceof Topic)
+            {
+               isTopic = true;
+            }
+         }
+      }
+      else
+      {
+         ActiveMQRALogger.LOGGER.instantiatingDestination(spec.getDestinationType(), spec.getDestination());
+
+         if (Topic.class.getName().equals(spec.getDestinationType()))
+         {
+            destination = (ActiveMQDestination) ActiveMQJMSClient.createTopic(spec.getDestination());
+            isTopic = true;
+         }
+         else
+         {
+            destination = (ActiveMQDestination) ActiveMQJMSClient.createQueue(spec.getDestination());
+         }
+      }
+   }
+
+   /**
+    * Get a string representation
+    *
+    * @return The value
+    */
+   @Override
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer();
+      buffer.append(ActiveMQActivation.class.getName()).append('(');
+      buffer.append("spec=").append(spec.getClass().getName());
+      buffer.append(" mepf=").append(endpointFactory.getClass().getName());
+      buffer.append(" active=").append(deliveryActive.get());
+      if (spec.getDestination() != null)
+      {
+         buffer.append(" destination=").append(spec.getDestination());
+      }
+      buffer.append(" transacted=").append(isDeliveryTransacted);
+      buffer.append(')');
+      return buffer.toString();
+   }
+
+   /**
+    * Handles any failure by trying to reconnect
+    *
+    * @param failure the reason for the failure
+    */
+   public void handleFailure(Throwable failure)
+   {
+      if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST)
+      {
+         ActiveMQRALogger.LOGGER.awaitingTopicQueueCreation(getActivationSpec().getDestination());
+      }
+      else if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.NOT_CONNECTED)
+      {
+         ActiveMQRALogger.LOGGER.awaitingJMSServerCreation();
+      }
+      else
+      {
+         ActiveMQRALogger.LOGGER.failureInActivation(failure, spec);
+      }
+      int reconnectCount = 0;
+      int setupAttempts = spec.getSetupAttempts();
+      long setupInterval = spec.getSetupInterval();
+
+      // Only enter the failure loop once
+      if (inFailure.getAndSet(true))
+         return;
+      try
+      {
+         Throwable lastException = failure;
+         while (deliveryActive.get() && (setupAttempts == -1 || reconnectCount < setupAttempts))
+         {
+            teardown();
+
+            try
+            {
+               Thread.sleep(setupInterval);
+            }
+            catch (InterruptedException e)
+            {
+               ActiveMQRALogger.LOGGER.debug("Interrupted trying to reconnect " + spec, e);
+               break;
+            }
+
+            if (reconnectCount < 1)
+            {
+               ActiveMQRALogger.LOGGER.attemptingReconnect(spec);
+            }
+            try
+            {
+               setup();
+               ActiveMQRALogger.LOGGER.reconnected();
+               break;
+            }
+            catch (Throwable t)
+            {
+               if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST)
+               {
+                  if (lastException == null || !(t instanceof ActiveMQNonExistentQueueException))
+                  {
+                     lastException = t;
+                     ActiveMQRALogger.LOGGER.awaitingTopicQueueCreation(getActivationSpec().getDestination());
+                  }
+               }
+               else if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.NOT_CONNECTED)
+               {
+                  if (lastException == null || !(t instanceof ActiveMQNotConnectedException))
+                  {
+                     lastException = t;
+                     ActiveMQRALogger.LOGGER.awaitingJMSServerCreation();
+                  }
+               }
+               else
+               {
+                  ActiveMQRALogger.LOGGER.errorReconnecting(t, spec);
+               }
+            }
+            ++reconnectCount;
+         }
+      }
+      finally
+      {
+         // Leaving failure recovery loop
+         inFailure.set(false);
+      }
+   }
+
+   public ActiveMQConnectionFactory getConnectionFactory()
+   {
+      return this.factory;
+   }
+
+   /**
+    * Handles the setup
+    */
+   private class SetupActivation implements Work
+   {
+      public void run()
+      {
+         try
+         {
+            setup();
+         }
+         catch (Throwable t)
+         {
+            handleFailure(t);
+         }
+      }
+
+      public void release()
+      {
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivationSpec.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivationSpec.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivationSpec.java
new file mode 100644
index 0000000..06f9c7a
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQActivationSpec.java
@@ -0,0 +1,945 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra.inflow;
+
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.activemq.ra.ConnectionFactoryProperties;
+import org.apache.activemq.ra.ActiveMQRALogger;
+import org.apache.activemq.ra.ActiveMQRaUtils;
+import org.apache.activemq.ra.ActiveMQResourceAdapter;
+
+/**
+ * The activation spec
+ * These properties are set on the MDB ActivactionProperties
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ */
+public class ActiveMQActivationSpec extends ConnectionFactoryProperties implements ActivationSpec, Serializable
+{
+   private static final long serialVersionUID = -7997041053897964654L;
+
+   private static final int DEFAULT_MAX_SESSION = 15;
+
+   /**
+    * Whether trace is enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   public String strConnectorClassName;
+
+   public String strConnectionParameters;
+
+   /**
+    * The resource adapter
+    */
+   private ActiveMQResourceAdapter ra;
+
+   /**
+    * The connection factory lookup
+    */
+   private String connectionFactoryLookup;
+
+   /**
+    * The destination
+    */
+   private String destination;
+
+   /**
+    * The destination type
+    */
+   private String destinationType;
+
+   /**
+    * The message selector
+    */
+   private String messageSelector;
+
+   /**
+    * The acknowledgement mode
+    */
+   private int acknowledgeMode;
+
+   /**
+    * The subscription durability
+    */
+   private boolean subscriptionDurability;
+
+   /**
+    * The subscription name
+    */
+   private String subscriptionName;
+
+   /**
+    * If this is true, a durable subscription could be shared by multiple MDB instances
+    */
+   private boolean shareSubscriptions;
+
+   /**
+    * The user
+    */
+   private String user;
+
+   /**
+    * The password
+    */
+   private String password;
+
+   /**
+    * The maximum number of sessions
+    */
+   private Integer maxSession;
+
+   /**
+    * Transaction timeout
+    */
+   private Integer transactionTimeout;
+
+   private Boolean useJNDI = true;
+
+   private String jndiParams = null;
+
+   private Hashtable parsedJndiParams;
+
+   /* use local tx instead of XA*/
+   private Boolean localTx;
+
+   // undefined by default, default is specified at the RA level in ActiveMQRAProperties
+   private Integer setupAttempts;
+
+   // undefined by default, default is specified at the RA level in ActiveMQRAProperties
+   private Long setupInterval;
+
+   /**
+    * Constructor
+    */
+   public ActiveMQActivationSpec()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+
+      ra = null;
+      destination = null;
+      destinationType = null;
+      messageSelector = null;
+      acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
+      subscriptionDurability = false;
+      subscriptionName = null;
+      user = null;
+      password = null;
+      maxSession = DEFAULT_MAX_SESSION;
+      transactionTimeout = 0;
+   }
+
+   /**
+    * Get the resource adapter
+    *
+    * @return The resource adapter
+    */
+   public ResourceAdapter getResourceAdapter()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getResourceAdapter()");
+      }
+
+      return ra;
+   }
+
+   /**
+    * @return the useJNDI
+    */
+   public boolean isUseJNDI()
+   {
+      if (useJNDI == null)
+      {
+         return ra.isUseJNDI();
+      }
+      return useJNDI;
+   }
+
+   /**
+    * @param value the useJNDI to set
+    */
+   public void setUseJNDI(final boolean value)
+   {
+      useJNDI = value;
+   }
+
+   /**
+    * @return return the jndi params to use
+    */
+   public String getJndiParams()
+   {
+      if (jndiParams == null)
+      {
+         return ra.getJndiParams();
+      }
+      return jndiParams;
+   }
+
+   public void setJndiParams(String jndiParams)
+   {
+      this.jndiParams = jndiParams;
+      parsedJndiParams = ActiveMQRaUtils.parseHashtableConfig(jndiParams);
+   }
+
+   public Hashtable<?, ?> getParsedJndiParams()
+   {
+      if (parsedJndiParams == null)
+      {
+         return ra.getParsedJndiParams();
+      }
+      return parsedJndiParams;
+   }
+
+   /**
+    * Set the resource adapter
+    *
+    * @param ra The resource adapter
+    * @throws ResourceException Thrown if incorrect resource adapter
+    */
+   public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")");
+      }
+
+      if (ra == null || !(ra instanceof ActiveMQResourceAdapter))
+      {
+         throw new ResourceException("Resource adapter is " + ra);
+      }
+
+      this.ra = (ActiveMQResourceAdapter) ra;
+   }
+
+   /**
+    * Get the connection factory lookup
+    *
+    * @return The value
+    */
+   public String getConnectionFactoryLookup()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConnectionFactoryLookup() ->" + connectionFactoryLookup);
+      }
+
+      return connectionFactoryLookup;
+   }
+
+   /**
+    * Set the connection factory lookup
+    *
+    * @param value The value
+    */
+   public void setConnectionFactoryLookup(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConnectionFactoryLookup(" + value + ")");
+      }
+
+      connectionFactoryLookup = value;
+   }
+
+   /**
+    * Get the destination
+    *
+    * @return The value
+    */
+   public String getDestination()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDestination()");
+      }
+
+      return destination;
+   }
+
+   /**
+    * Set the destination
+    *
+    * @param value The value
+    */
+   public void setDestination(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDestination(" + value + ")");
+      }
+
+      destination = value;
+   }
+
+   /**
+    * Get the destination lookup
+    *
+    * @return The value
+    */
+   public String getDestinationLookup()
+   {
+      return getDestination();
+   }
+
+   /**
+    * Set the destination
+    *
+    * @param value The value
+    */
+   public void setDestinationLookup(final String value)
+   {
+      setDestination(value);
+      setUseJNDI(true);
+   }
+
+   /**
+    * Get the destination type
+    *
+    * @return The value
+    */
+   public String getDestinationType()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDestinationType()");
+      }
+
+      return destinationType;
+   }
+
+   /**
+    * Set the destination type
+    *
+    * @param value The value
+    */
+   public void setDestinationType(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDestinationType(" + value + ")");
+      }
+
+      destinationType = value;
+   }
+
+   /**
+    * Get the message selector
+    *
+    * @return The value
+    */
+   public String getMessageSelector()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageSelector()");
+      }
+
+      return messageSelector;
+   }
+
+   /**
+    * Set the message selector
+    *
+    * @param value The value
+    */
+   public void setMessageSelector(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setMessageSelector(" + value + ")");
+      }
+
+      messageSelector = value;
+   }
+
+   /**
+    * Get the acknowledge mode
+    *
+    * @return The value
+    */
+   public String getAcknowledgeMode()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()");
+      }
+
+      if (Session.DUPS_OK_ACKNOWLEDGE == acknowledgeMode)
+      {
+         return "Dups-ok-acknowledge";
+      }
+      else
+      {
+         return "Auto-acknowledge";
+      }
+   }
+
+   /**
+    * Set the acknowledge mode
+    *
+    * @param value The value
+    */
+   public void setAcknowledgeMode(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setAcknowledgeMode(" + value + ")");
+      }
+
+      if ("DUPS_OK_ACKNOWLEDGE".equalsIgnoreCase(value) || "Dups-ok-acknowledge".equalsIgnoreCase(value))
+      {
+         acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;
+      }
+      else if ("AUTO_ACKNOWLEDGE".equalsIgnoreCase(value) || "Auto-acknowledge".equalsIgnoreCase(value))
+      {
+         acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
+      }
+      else
+      {
+         throw new IllegalArgumentException("Unsupported acknowledgement mode " + value);
+      }
+   }
+
+   /**
+    * @return the acknowledgement mode
+    */
+   public int getAcknowledgeModeInt()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()");
+      }
+
+      return acknowledgeMode;
+   }
+
+   /**
+    * Get the subscription durability
+    *
+    * @return The value
+    */
+   public String getSubscriptionDurability()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSubscriptionDurability()");
+      }
+
+      if (subscriptionDurability)
+      {
+         return "Durable";
+      }
+      else
+      {
+         return "NonDurable";
+      }
+   }
+
+   /**
+    * Set the subscription durability
+    *
+    * @param value The value
+    */
+   public void setSubscriptionDurability(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSubscriptionDurability(" + value + ")");
+      }
+
+      subscriptionDurability = "Durable".equals(value);
+   }
+
+   /**
+    * Get the status of subscription durability
+    *
+    * @return The value
+    */
+   public boolean isSubscriptionDurable()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isSubscriptionDurable()");
+      }
+
+      return subscriptionDurability;
+   }
+
+   /**
+    * Get the subscription name
+    *
+    * @return The value
+    */
+   public String getSubscriptionName()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSubscriptionName()");
+      }
+
+      return subscriptionName;
+   }
+
+   /**
+    * Set the subscription name
+    *
+    * @param value The value
+    */
+   public void setSubscriptionName(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSubscriptionName(" + value + ")");
+      }
+
+      subscriptionName = value;
+   }
+
+
+   /**
+    * @return the shareDurableSubscriptions
+    */
+   public boolean isShareSubscriptions()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isShareSubscriptions() = " + shareSubscriptions);
+      }
+
+      return shareSubscriptions;
+   }
+
+   /**
+    * @param shareSubscriptions the shareDurableSubscriptions to set
+    */
+   public void setShareSubscriptions(boolean shareSubscriptions)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setShareSubscriptions(" + shareSubscriptions + ")");
+      }
+
+      this.shareSubscriptions = shareSubscriptions;
+   }
+
+   /**
+    * Get the user
+    *
+    * @return The value
+    */
+   public String getUser()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUser()");
+      }
+
+      if (user == null)
+      {
+         return ra.getUserName();
+      }
+      else
+      {
+         return user;
+      }
+   }
+
+   /**
+    * Set the user
+    *
+    * @param value The value
+    */
+   public void setUser(final String value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUser(" + value + ")");
+      }
+
+      user = value;
+   }
+
+   /**
+    * Get the password
+    *
+    * @return The value
+    */
+   public String getPassword()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPassword()");
+      }
+
+      if (password == null)
+      {
+         return ra.getPassword();
+      }
+      else
+      {
+         return password;
+      }
+   }
+
+   public String getOwnPassword()
+   {
+      return password;
+   }
+
+   /**
+    * Set the password
+    *
+    * @param value The value
+    */
+   public void setPassword(final String value) throws Exception
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      password = value;
+   }
+
+   /**
+    * Get the number of max session
+    *
+    * @return The value
+    */
+   public Integer getMaxSession()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMaxSession()");
+      }
+
+      if (maxSession == null)
+      {
+         return DEFAULT_MAX_SESSION;
+      }
+
+      return maxSession;
+   }
+
+   /**
+    * Set the number of max session
+    *
+    * @param value The value
+    */
+   public void setMaxSession(final Integer value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setMaxSession(" + value + ")");
+      }
+
+      maxSession = value;
+   }
+
+   /**
+    * Get the transaction timeout
+    *
+    * @return The value
+    */
+   public Integer getTransactionTimeout()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTransactionTimeout()");
+      }
+
+      return transactionTimeout;
+   }
+
+   /**
+    * Set the transaction timeout
+    *
+    * @param value The value
+    */
+   public void setTransactionTimeout(final Integer value)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setTransactionTimeout(" + value + ")");
+      }
+
+      transactionTimeout = value;
+   }
+
+   public Boolean isUseLocalTx()
+   {
+      if (localTx == null)
+      {
+         return ra.getUseLocalTx();
+      }
+      else
+      {
+         return localTx;
+      }
+   }
+
+   public void setUseLocalTx(final Boolean localTx)
+   {
+      this.localTx = localTx;
+   }
+
+   public int getSetupAttempts()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSetupAttempts()");
+      }
+
+      if (setupAttempts == null)
+      {
+         return ra.getSetupAttempts();
+      }
+      else
+      {
+         return setupAttempts;
+      }
+   }
+
+   public void setSetupAttempts(int setupAttempts)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")");
+      }
+
+      this.setupAttempts = setupAttempts;
+   }
+
+   public long getSetupInterval()
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSetupInterval()");
+      }
+
+      if (setupInterval == null)
+      {
+         return ra.getSetupInterval();
+      }
+      else
+      {
+         return setupInterval;
+      }
+   }
+
+   public void setSetupInterval(long setupInterval)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSetupInterval(" + setupInterval + ")");
+      }
+
+      this.setupInterval = setupInterval;
+   }
+
+   /**
+    * Validate
+    *
+    * @throws InvalidPropertyException Thrown if a validation exception occurs
+    */
+   public void validate() throws InvalidPropertyException
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("validate()");
+      }
+
+      List<String> errorMessages = new ArrayList<String>();
+      List<PropertyDescriptor> propsNotSet = new ArrayList<PropertyDescriptor>();
+
+      try
+      {
+         if (destination == null || destination.trim().equals(""))
+         {
+            propsNotSet.add(new PropertyDescriptor("destination", ActiveMQActivationSpec.class));
+            errorMessages.add("Destination is mandatory.");
+         }
+
+         if (destinationType != null && !Topic.class.getName().equals(destinationType) && !Queue.class.getName().equals(destinationType))
+         {
+            propsNotSet.add(new PropertyDescriptor("destinationType", ActiveMQActivationSpec.class));
+            errorMessages.add("If set, the destinationType must be either 'javax.jms.Topic' or 'javax.jms.Queue'.");
+         }
+
+         if ((destinationType == null || destinationType.length() == 0 || Topic.class.getName().equals(destinationType)) && isSubscriptionDurable() && (subscriptionName == null || subscriptionName.length() == 0))
+         {
+            propsNotSet.add(new PropertyDescriptor("subscriptionName", ActiveMQActivationSpec.class));
+            errorMessages.add("If subscription is durable then subscription name must be specified.");
+         }
+      }
+      catch (IntrospectionException e)
+      {
+         e.printStackTrace();
+      }
+
+      if (propsNotSet.size() > 0)
+      {
+         StringBuffer b = new StringBuffer();
+         b.append("Invalid settings:");
+         for (Iterator<String> iter = errorMessages.iterator(); iter.hasNext();)
+         {
+            b.append(" ");
+            b.append(iter.next());
+         }
+         InvalidPropertyException e = new InvalidPropertyException(b.toString());
+         final PropertyDescriptor[] descriptors = propsNotSet.toArray(new PropertyDescriptor[propsNotSet.size()]);
+         e.setInvalidPropertyDescriptors(descriptors);
+         throw e;
+      }
+   }
+
+   public String getConnectorClassName()
+   {
+      return strConnectorClassName;
+   }
+
+   public void setConnectorClassName(final String connectorClassName)
+   {
+      if (ActiveMQActivationSpec.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConnectorClassName(" + connectorClassName + ")");
+      }
+
+      strConnectorClassName = connectorClassName;
+
+      setParsedConnectorClassNames(ActiveMQRaUtils.parseConnectorConnectorConfig(connectorClassName));
+   }
+
+   /**
+    * @return the connectionParameters
+    */
+   public String getConnectionParameters()
+   {
+      return strConnectionParameters;
+   }
+
+   public void setConnectionParameters(final String configuration)
+   {
+      strConnectionParameters = configuration;
+      setParsedConnectionParameters(ActiveMQRaUtils.parseConfig(configuration));
+   }
+
+   /**
+    * Get a string representation
+    *
+    * @return The value
+    */
+   @Override
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer();
+      buffer.append(ActiveMQActivationSpec.class.getName()).append('(');
+      buffer.append("ra=").append(ra);
+      if (messageSelector != null)
+      {
+         buffer.append(" connectionFactoryLookup=").append(connectionFactoryLookup);
+      }
+      buffer.append(" destination=").append(destination);
+      buffer.append(" destinationType=").append(destinationType);
+      if (messageSelector != null)
+      {
+         buffer.append(" selector=").append(messageSelector);
+      }
+      buffer.append(" ack=").append(getAcknowledgeMode());
+      buffer.append(" durable=").append(subscriptionDurability);
+      buffer.append(" clientID=").append(getClientID());
+      if (subscriptionName != null)
+      {
+         buffer.append(" subscription=").append(subscriptionName);
+      }
+      buffer.append(" user=").append(user);
+      if (password != null)
+      {
+         buffer.append(" password=").append("****");
+      }
+      buffer.append(" maxSession=").append(maxSession);
+      buffer.append(')');
+      return buffer.toString();
+   }
+
+   // here for backwards compatibilty
+   public void setUseDLQ(final boolean b)
+   {
+   }
+
+   public void setDLQJNDIName(final String name)
+   {
+   }
+
+   public void setDLQHandler(final String handler)
+   {
+   }
+
+   public void setDLQMaxResent(final int maxResent)
+   {
+   }
+
+   public void setProviderAdapterJNDI(final String jndi)
+   {
+   }
+
+   /**
+    * @param keepAlive the keepAlive to set
+    */
+   public void setKeepAlive(boolean keepAlive)
+   {
+   }
+
+   /**
+    * @param keepAliveMillis the keepAliveMillis to set
+    */
+   public void setKeepAliveMillis(long keepAliveMillis)
+   {
+   }
+
+
+   public void setReconnectInterval(long interval)
+   {
+   }
+
+   public void setMinSession(final Integer value)
+   {
+   }
+
+   public void setMaxMessages(final Integer value)
+   {
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQMessageHandler.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQMessageHandler.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQMessageHandler.java
new file mode 100644
index 0000000..abd68d0
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/ActiveMQMessageHandler.java
@@ -0,0 +1,430 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra.inflow;
+
+import javax.jms.MessageListener;
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+import java.util.UUID;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession.QueueQuery;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.MessageHandler;
+import org.apache.activemq.core.client.impl.ClientConsumerInternal;
+import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
+import org.apache.activemq.core.client.impl.ClientSessionInternal;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQMessage;
+import org.apache.activemq.ra.ActiveMQRALogger;
+import org.apache.activemq.ra.ActiveMQResourceAdapter;
+import org.apache.activemq.ra.ActiveMQXAResourceWrapper;
+import org.apache.activemq.utils.FutureLatch;
+
+/**
+ * The message handler
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ */
+public class ActiveMQMessageHandler implements MessageHandler
+{
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+   /**
+    * The session
+    */
+   private final ClientSessionInternal session;
+
+   private ClientConsumerInternal consumer;
+
+   /**
+    * The endpoint
+    */
+   private MessageEndpoint endpoint;
+
+   private final ActiveMQActivation activation;
+
+   private boolean useLocalTx;
+
+   private boolean transacted;
+
+   private boolean useXA = false;
+
+   private final int sessionNr;
+
+   private final TransactionManager tm;
+
+   private ClientSessionFactory cf;
+
+   public ActiveMQMessageHandler(final ActiveMQActivation activation,
+                                 final TransactionManager tm,
+                                 final ClientSessionInternal session,
+                                 final ClientSessionFactory cf,
+                                 final int sessionNr)
+   {
+      this.activation = activation;
+      this.session = session;
+      this.cf = cf;
+      this.sessionNr = sessionNr;
+      this.tm = tm;
+   }
+
+   public void setup() throws Exception
+   {
+      if (ActiveMQMessageHandler.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setup()");
+      }
+
+      ActiveMQActivationSpec spec = activation.getActivationSpec();
+      String selector = spec.getMessageSelector();
+
+      // Create the message consumer
+      SimpleString selectorString = selector == null || selector.trim().equals("") ? null : new SimpleString(selector);
+      if (activation.isTopic() && spec.isSubscriptionDurable())
+      {
+         SimpleString queueName = new SimpleString(ActiveMQDestination.createQueueNameForDurableSubscription(true,
+                                                                                                             spec.getClientID(),
+                                                                                                             spec.getSubscriptionName()));
+
+         QueueQuery subResponse = session.queueQuery(queueName);
+
+         if (!subResponse.isExists())
+         {
+            session.createQueue(activation.getAddress(), queueName, selectorString, true);
+         }
+         else
+         {
+            // The check for already exists should be done only at the first session
+            // As a deployed MDB could set up multiple instances in order to process messages in parallel.
+            if (sessionNr == 0 && subResponse.getConsumerCount() > 0)
+            {
+               if (!spec.isShareSubscriptions())
+               {
+                  throw new javax.jms.IllegalStateException("Cannot create a subscriber on the durable subscription since it already has subscriber(s)");
+               }
+               else if (ActiveMQRALogger.LOGGER.isDebugEnabled())
+               {
+                  ActiveMQRALogger.LOGGER.debug("the mdb on destination " + queueName + " already had " +
+                                                  subResponse.getConsumerCount() +
+                                                  " consumers but the MDB is configured to share subscriptions, so no exceptions are thrown");
+               }
+            }
+
+            SimpleString oldFilterString = subResponse.getFilterString();
+
+            boolean selectorChanged = selector == null && oldFilterString != null ||
+               oldFilterString == null &&
+                  selector != null ||
+               (oldFilterString != null && selector != null && !oldFilterString.toString()
+                  .equals(selector));
+
+            SimpleString oldTopicName = subResponse.getAddress();
+
+            boolean topicChanged = !oldTopicName.equals(activation.getAddress());
+
+            if (selectorChanged || topicChanged)
+            {
+               // Delete the old durable sub
+               session.deleteQueue(queueName);
+
+               // Create the new one
+               session.createQueue(activation.getAddress(), queueName, selectorString, true);
+            }
+         }
+         consumer = (ClientConsumerInternal) session.createConsumer(queueName, null, false);
+      }
+      else
+      {
+         SimpleString tempQueueName;
+         if (activation.isTopic())
+         {
+            if (activation.getTopicTemporaryQueue() == null)
+            {
+               tempQueueName = new SimpleString(UUID.randomUUID().toString());
+               session.createTemporaryQueue(activation.getAddress(), tempQueueName, selectorString);
+               activation.setTopicTemporaryQueue(tempQueueName);
+            }
+            else
+            {
+               tempQueueName = activation.getTopicTemporaryQueue();
+               QueueQuery queueQuery = session.queueQuery(tempQueueName);
+               if (!queueQuery.isExists())
+               {
+                  // this is because we could be using remote servers (in cluster maybe)
+                  // and the queue wasn't created on that node yet.
+                  session.createTemporaryQueue(activation.getAddress(), tempQueueName, selectorString);
+               }
+            }
+         }
+         else
+         {
+            tempQueueName = activation.getAddress();
+         }
+         consumer = (ClientConsumerInternal) session.createConsumer(tempQueueName, selectorString);
+      }
+
+      // Create the endpoint, if we are transacted pass the session so it is enlisted, unless using Local TX
+      MessageEndpointFactory endpointFactory = activation.getMessageEndpointFactory();
+      useLocalTx = !activation.isDeliveryTransacted() && activation.getActivationSpec().isUseLocalTx();
+      transacted = activation.isDeliveryTransacted();
+      if (activation.isDeliveryTransacted() && !activation.getActivationSpec().isUseLocalTx())
+      {
+         XAResource xaResource = new ActiveMQXAResourceWrapper(session,
+                                                     ((ActiveMQResourceAdapter) spec.getResourceAdapter()).getJndiName(),
+                                                     ((ClientSessionFactoryInternal) cf).getLiveNodeId());
+         endpoint = endpointFactory.createEndpoint(xaResource);
+         useXA = true;
+      }
+      else
+      {
+         endpoint = endpointFactory.createEndpoint(null);
+         useXA = false;
+      }
+      consumer.setMessageHandler(this);
+   }
+
+   XAResource getXAResource()
+   {
+      return useXA ? session : null;
+   }
+
+   public Thread interruptConsumer(FutureLatch future)
+   {
+      try
+      {
+         if (consumer != null)
+         {
+            return consumer.prepareForClose(future);
+         }
+      }
+      catch (Throwable e)
+      {
+         ActiveMQRALogger.LOGGER.warn("Error interrupting handler on endpoint " + endpoint + " handler=" + consumer);
+      }
+      return null;
+   }
+
+   /**
+    * Stop the handler
+    */
+   public void teardown()
+   {
+      if (ActiveMQMessageHandler.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("teardown()");
+      }
+
+      try
+      {
+         if (endpoint != null)
+         {
+            endpoint.release();
+            endpoint = null;
+         }
+      }
+      catch (Throwable t)
+      {
+         ActiveMQRALogger.LOGGER.debug("Error releasing endpoint " + endpoint, t);
+      }
+
+      try
+      {
+         consumer.close();
+         if (activation.getTopicTemporaryQueue() != null)
+         {
+            // We need to delete temporary topics when the activation is stopped or messages will build up on the server
+            SimpleString tmpQueue = activation.getTopicTemporaryQueue();
+            QueueQuery subResponse = session.queueQuery(tmpQueue);
+            if (subResponse.getConsumerCount() == 0)
+            {
+               // This is optional really, since we now use temporaryQueues, we could simply ignore this
+               // and the server temporary queue would remove this as soon as the queue was removed
+               session.deleteQueue(tmpQueue);
+            }
+         }
+      }
+      catch (Throwable t)
+      {
+         ActiveMQRALogger.LOGGER.debug("Error closing core-queue consumer", t);
+      }
+
+      try
+      {
+         if (session != null)
+         {
+            session.close();
+         }
+      }
+      catch (Throwable t)
+      {
+         ActiveMQRALogger.LOGGER.debug("Error releasing session " + session, t);
+      }
+
+      try
+      {
+         if (cf != null)
+         {
+            cf.close();
+         }
+      }
+      catch (Throwable t)
+      {
+         ActiveMQRALogger.LOGGER.debug("Error releasing session factory " + session, t);
+      }
+   }
+
+   public void onMessage(final ClientMessage message)
+   {
+      if (ActiveMQMessageHandler.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("onMessage(" + message + ")");
+      }
+
+      ActiveMQMessage msg = ActiveMQMessage.createMessage(message, session);
+      boolean beforeDelivery = false;
+
+      try
+      {
+         if (activation.getActivationSpec().getTransactionTimeout() > 0 && tm != null)
+         {
+            tm.setTransactionTimeout(activation.getActivationSpec().getTransactionTimeout());
+         }
+         endpoint.beforeDelivery(ActiveMQActivation.ONMESSAGE);
+         beforeDelivery = true;
+         msg.doBeforeReceive();
+
+         //In the transacted case the message must be acked *before* onMessage is called
+
+         if (transacted)
+         {
+            message.acknowledge();
+         }
+
+         ((MessageListener) endpoint).onMessage(msg);
+
+         if (!transacted)
+         {
+            message.acknowledge();
+         }
+
+         try
+         {
+            endpoint.afterDelivery();
+         }
+         catch (ResourceException e)
+         {
+            ActiveMQRALogger.LOGGER.unableToCallAfterDelivery(e);
+            return;
+         }
+         if (useLocalTx)
+         {
+            session.commit();
+         }
+
+         if (trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("finished onMessage on " + message);
+         }
+      }
+      catch (Throwable e)
+      {
+         ActiveMQRALogger.LOGGER.errorDeliveringMessage(e);
+         // we need to call before/afterDelivery as a pair
+         if (beforeDelivery)
+         {
+            if (useXA && tm != null)
+            {
+               // This is the job for the container,
+               // however if the container throws an exception because of some other errors,
+               // there are situations where the container is not setting the rollback only
+               // this is to avoid a scenario where afterDelivery would kick in
+               try
+               {
+                  Transaction tx = tm.getTransaction();
+                  if (tx != null)
+                  {
+                     tx.setRollbackOnly();
+                  }
+               }
+               catch (Exception e1)
+               {
+                  ActiveMQRALogger.LOGGER.warn("unnable to clear the transaction", e1);
+                  try
+                  {
+                     session.rollback();
+                  }
+                  catch (ActiveMQException e2)
+                  {
+                     ActiveMQRALogger.LOGGER.warn("Unable to rollback", e2);
+                     return;
+                  }
+               }
+            }
+
+            MessageEndpoint endToUse = endpoint;
+            try
+            {
+               // to avoid a NPE that would happen while the RA is in tearDown
+               if (endToUse != null)
+               {
+                  endToUse.afterDelivery();
+               }
+            }
+            catch (ResourceException e1)
+            {
+               ActiveMQRALogger.LOGGER.unableToCallAfterDelivery(e1);
+            }
+         }
+         if (useLocalTx || !activation.isDeliveryTransacted())
+         {
+            try
+            {
+               session.rollback(true);
+            }
+            catch (ActiveMQException e1)
+            {
+               ActiveMQRALogger.LOGGER.unableToRollbackTX();
+            }
+         }
+      }
+      finally
+      {
+         try
+         {
+            session.resetIfNeeded();
+         }
+         catch (ActiveMQException e)
+         {
+            ActiveMQRALogger.LOGGER.unableToResetSession();
+         }
+      }
+
+   }
+
+   public void start() throws ActiveMQException
+   {
+      session.start();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivation.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivation.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivation.java
deleted file mode 100644
index 8bf12b6..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivation.java
+++ /dev/null
@@ -1,831 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra.inflow;
-
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.Topic;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.resource.ResourceException;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.xa.XAResource;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
-import org.apache.activemq.api.core.ActiveMQNotConnectedException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.jms.HornetQJMSClient;
-import org.apache.activemq.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
-import org.apache.activemq.ra.HornetQRABundle;
-import org.apache.activemq.ra.HornetQRAConnectionFactory;
-import org.apache.activemq.ra.HornetQRALogger;
-import org.apache.activemq.ra.HornetQRaUtils;
-import org.apache.activemq.ra.HornetQResourceAdapter;
-import org.apache.activemq.utils.FutureLatch;
-import org.apache.activemq.utils.SensitiveDataCodec;
-
-/**
- * The activation.
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQActivation
-{
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The onMessage method
-    */
-   public static final Method ONMESSAGE;
-
-   /**
-    * The resource adapter
-    */
-   private final HornetQResourceAdapter ra;
-
-   /**
-    * The activation spec
-    */
-   private final HornetQActivationSpec spec;
-
-   /**
-    * The message endpoint factory
-    */
-   private final MessageEndpointFactory endpointFactory;
-
-   /**
-    * Whether delivery is active
-    */
-   private final AtomicBoolean deliveryActive = new AtomicBoolean(false);
-
-   /**
-    * The destination type
-    */
-   private boolean isTopic = false;
-
-   /**
-    * Is the delivery transacted
-    */
-   private boolean isDeliveryTransacted;
-
-   private HornetQDestination destination;
-
-   /**
-    * The name of the temporary subscription name that all the sessions will share
-    */
-   private SimpleString topicTemporaryQueue;
-
-   private final List<HornetQMessageHandler> handlers = new ArrayList<HornetQMessageHandler>();
-
-   private HornetQConnectionFactory factory;
-
-   // Whether we are in the failure recovery loop
-   private final AtomicBoolean inFailure = new AtomicBoolean(false);
-   private XARecoveryConfig resourceRecovery;
-
-   static
-   {
-      try
-      {
-         ONMESSAGE = MessageListener.class.getMethod("onMessage", new Class[]{Message.class});
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   /**
-    * Constructor
-    *
-    * @param ra              The resource adapter
-    * @param endpointFactory The endpoint factory
-    * @param spec            The activation spec
-    * @throws ResourceException Thrown if an error occurs
-    */
-   public HornetQActivation(final HornetQResourceAdapter ra,
-                            final MessageEndpointFactory endpointFactory,
-                            final HornetQActivationSpec spec) throws ResourceException
-   {
-      spec.validate();
-
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + ra + ", " + endpointFactory + ", " + spec + ")");
-      }
-
-      if (ra.isUseMaskedPassword())
-      {
-         String pass = spec.getOwnPassword();
-         if (pass != null)
-         {
-            SensitiveDataCodec<String> codec = ra.getCodecInstance();
-
-            try
-            {
-               spec.setPassword(codec.decode(pass));
-            }
-            catch (Exception e)
-            {
-               throw new ResourceException(e);
-            }
-         }
-      }
-
-      this.ra = ra;
-      this.endpointFactory = endpointFactory;
-      this.spec = spec;
-      try
-      {
-         isDeliveryTransacted = endpointFactory.isDeliveryTransacted(HornetQActivation.ONMESSAGE);
-      }
-      catch (Exception e)
-      {
-         throw new ResourceException(e);
-      }
-   }
-
-   /**
-    * Get the activation spec
-    *
-    * @return The value
-    */
-   public HornetQActivationSpec getActivationSpec()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getActivationSpec()");
-      }
-
-      return spec;
-   }
-
-   /**
-    * Get the message endpoint factory
-    *
-    * @return The value
-    */
-   public MessageEndpointFactory getMessageEndpointFactory()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageEndpointFactory()");
-      }
-
-      return endpointFactory;
-   }
-
-   /**
-    * Get whether delivery is transacted
-    *
-    * @return The value
-    */
-   public boolean isDeliveryTransacted()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isDeliveryTransacted()");
-      }
-
-      return isDeliveryTransacted;
-   }
-
-   /**
-    * Get the work manager
-    *
-    * @return The value
-    */
-   public WorkManager getWorkManager()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getWorkManager()");
-      }
-
-      return ra.getWorkManager();
-   }
-
-   /**
-    * Is the destination a topic
-    *
-    * @return The value
-    */
-   public boolean isTopic()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isTopic()");
-      }
-
-      return isTopic;
-   }
-
-   /**
-    * Start the activation
-    *
-    * @throws ResourceException Thrown if an error occurs
-    */
-   public void start() throws ResourceException
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start()");
-      }
-      deliveryActive.set(true);
-      ra.getWorkManager().scheduleWork(new SetupActivation());
-   }
-
-   /**
-    * @return the topicTemporaryQueue
-    */
-   public SimpleString getTopicTemporaryQueue()
-   {
-      return topicTemporaryQueue;
-   }
-
-   /**
-    * @param topicTemporaryQueue the topicTemporaryQueue to set
-    */
-   public void setTopicTemporaryQueue(SimpleString topicTemporaryQueue)
-   {
-      this.topicTemporaryQueue = topicTemporaryQueue;
-   }
-
-   /**
-    * @return the list of XAResources for this activation endpoint
-    */
-   public List<XAResource> getXAResources()
-   {
-      List<XAResource> xaresources = new ArrayList<XAResource>();
-      for (HornetQMessageHandler handler : handlers)
-      {
-         XAResource xares = handler.getXAResource();
-         if (xares != null)
-         {
-            xaresources.add(xares);
-         }
-      }
-      return xaresources;
-   }
-
-   /**
-    * Stop the activation
-    */
-   public void stop()
-   {
-      if (HornetQActivation.trace)
-      {
-         HornetQRALogger.LOGGER.trace("stop()");
-      }
-
-      deliveryActive.set(false);
-      teardown();
-   }
-
-   /**
-    * Setup the activation
-    *
-    * @throws Exception Thrown if an error occurs
-    */
-   protected synchronized void setup() throws Exception
-   {
-      HornetQRALogger.LOGGER.debug("Setting up " + spec);
-
-      setupCF();
-
-      setupDestination();
-
-      Exception firstException = null;
-
-      for (int i = 0; i < spec.getMaxSession(); i++)
-      {
-         ClientSessionFactory cf = null;
-         ClientSession session = null;
-
-         try
-         {
-            cf = factory.getServerLocator().createSessionFactory();
-            session = setupSession(cf);
-            HornetQMessageHandler handler = new HornetQMessageHandler(this, ra.getTM(), (ClientSessionInternal) session, cf, i);
-            handler.setup();
-            handlers.add(handler);
-         }
-         catch (Exception e)
-         {
-            if (cf != null)
-            {
-               cf.close();
-            }
-            if (session != null)
-            {
-               session.close();
-            }
-            if (firstException == null)
-            {
-               firstException = e;
-            }
-         }
-      }
-      //if we have any exceptions close all the handlers and throw the first exception.
-      //we don't want partially configured activations, i.e. only 8 out of 15 sessions started so best to stop and log the error.
-      if (firstException != null)
-      {
-         for (HornetQMessageHandler handler : handlers)
-         {
-            handler.teardown();
-         }
-         throw firstException;
-      }
-
-      //now start them all together.
-      for (HornetQMessageHandler handler : handlers)
-      {
-         handler.start();
-      }
-
-      resourceRecovery = ra.getRecoveryManager().register(factory, spec.getUser(), spec.getPassword());
-
-      HornetQRALogger.LOGGER.debug("Setup complete " + this);
-   }
-
-   /**
-    * Teardown the activation
-    */
-   protected synchronized void teardown()
-   {
-      HornetQRALogger.LOGGER.debug("Tearing down " + spec);
-
-      if (resourceRecovery != null)
-      {
-         ra.getRecoveryManager().unRegister(resourceRecovery);
-      }
-
-      final HornetQMessageHandler[] handlersCopy = new HornetQMessageHandler[handlers.size()];
-
-      // We need to do from last to first as any temporary queue will have been created on the first handler
-      // So we invert the handlers here
-      for (int i = 0; i < handlers.size(); i++)
-      {
-         // The index here is the complimentary so it's inverting the array
-         handlersCopy[i] = handlers.get(handlers.size() - i - 1);
-      }
-
-      handlers.clear();
-
-      FutureLatch future = new FutureLatch(handlersCopy.length);
-      List<Thread> interruptThreads = new ArrayList<>();
-      for (HornetQMessageHandler handler : handlersCopy)
-      {
-         Thread thread = handler.interruptConsumer(future);
-         if (thread != null)
-         {
-            interruptThreads.add(thread);
-         }
-      }
-
-      //wait for all the consumers to complete any onmessage calls
-      boolean stuckThreads = !future.await(factory.getCallTimeout());
-      //if any are stuck then we need to interrupt them
-      if (stuckThreads)
-      {
-         for (Thread interruptThread : interruptThreads)
-         {
-            try
-            {
-               interruptThread.interrupt();
-            }
-            catch (Exception e)
-            {
-               //ok
-            }
-         }
-      }
-
-      Thread threadTearDown = new Thread("TearDown/HornetQActivation")
-      {
-         public void run()
-         {
-            for (HornetQMessageHandler handler : handlersCopy)
-            {
-               handler.teardown();
-            }
-         }
-      };
-
-      // We will first start a new thread that will call tearDown on all the instances, trying to graciously shutdown everything.
-      // We will then use the call-timeout to determine a timeout.
-      // if that failed we will then close the connection factory, and interrupt the thread
-      threadTearDown.start();
-
-      try
-      {
-         threadTearDown.join(factory.getCallTimeout());
-      }
-      catch (InterruptedException e)
-      {
-         // nothing to be done on this context.. we will just keep going as we need to send an interrupt to threadTearDown and give up
-      }
-
-      if (threadTearDown.isAlive())
-      {
-         if (factory != null)
-         {
-            // This will interrupt any threads waiting on reconnect
-            factory.close();
-            factory = null;
-         }
-         threadTearDown.interrupt();
-
-         try
-         {
-            threadTearDown.join(5000);
-         }
-         catch (InterruptedException e)
-         {
-            // nothing to be done here.. we are going down anyways
-         }
-
-         if (threadTearDown.isAlive())
-         {
-            HornetQRALogger.LOGGER.warn("Thread " + threadTearDown + " couldn't be finished");
-         }
-      }
-
-      if (spec.isHasBeenUpdated() && factory != null)
-      {
-         factory.close();
-         factory = null;
-      }
-
-
-      HornetQRALogger.LOGGER.debug("Tearing down complete " + this);
-   }
-
-   protected void setupCF() throws Exception
-   {
-      if (spec.getConnectionFactoryLookup() != null)
-      {
-         Context ctx;
-         if (spec.getParsedJndiParams() == null)
-         {
-            ctx = new InitialContext();
-         }
-         else
-         {
-            ctx = new InitialContext(spec.getParsedJndiParams());
-         }
-         Object fac = ctx.lookup(spec.getConnectionFactoryLookup());
-         if (fac instanceof HornetQConnectionFactory)
-         {
-            factory = (HornetQConnectionFactory) fac;
-         }
-         else
-         {
-            HornetQRAConnectionFactory raFact = (HornetQRAConnectionFactory) fac;
-            if (spec.isHasBeenUpdated())
-            {
-               factory = raFact.getResourceAdapter().createHornetQConnectionFactory(spec);
-            }
-            else
-            {
-               factory = raFact.getDefaultFactory();
-               if (factory != ra.getDefaultHornetQConnectionFactory())
-               {
-                  HornetQRALogger.LOGGER.warnDifferentConnectionfactory();
-               }
-            }
-         }
-      }
-      else if (spec.isHasBeenUpdated())
-      {
-         factory = ra.createHornetQConnectionFactory(spec);
-      }
-      else
-      {
-         factory = ra.getDefaultHornetQConnectionFactory();
-      }
-   }
-
-   /**
-    * Setup a session
-    *
-    * @param cf
-    * @return The connection
-    * @throws Exception Thrown if an error occurs
-    */
-   protected ClientSession setupSession(ClientSessionFactory cf) throws Exception
-   {
-      ClientSession result = null;
-
-      try
-      {
-         result = ra.createSession(cf,
-                                   spec.getAcknowledgeModeInt(),
-                                   spec.getUser(),
-                                   spec.getPassword(),
-                                   ra.getPreAcknowledge(),
-                                   ra.getDupsOKBatchSize(),
-                                   ra.getTransactionBatchSize(),
-                                   isDeliveryTransacted,
-                                   spec.isUseLocalTx(),
-                                   spec.getTransactionTimeout());
-
-         result.addMetaData("resource-adapter", "inbound");
-         result.addMetaData("jms-session", "");
-         String clientID = ra.getClientID() == null ? spec.getClientID() : ra.getClientID();
-         if (clientID != null)
-         {
-            result.addMetaData("jms-client-id", clientID);
-         }
-
-         HornetQRALogger.LOGGER.debug("Using queue connection " + result);
-
-         return result;
-      }
-      catch (Throwable t)
-      {
-         try
-         {
-            if (result != null)
-            {
-               result.close();
-            }
-         }
-         catch (Exception e)
-         {
-            HornetQRALogger.LOGGER.trace("Ignored error closing connection", e);
-         }
-         if (t instanceof Exception)
-         {
-            throw (Exception) t;
-         }
-         throw new RuntimeException("Error configuring connection", t);
-      }
-   }
-
-   public SimpleString getAddress()
-   {
-      return destination.getSimpleAddress();
-   }
-
-   protected void setupDestination() throws Exception
-   {
-
-      String destinationName = spec.getDestination();
-
-      if (spec.isUseJNDI())
-      {
-         Context ctx;
-         if (spec.getParsedJndiParams() == null)
-         {
-            ctx = new InitialContext();
-         }
-         else
-         {
-            ctx = new InitialContext(spec.getParsedJndiParams());
-         }
-         HornetQRALogger.LOGGER.debug("Using context " + ctx.getEnvironment() + " for " + spec);
-         if (HornetQActivation.trace)
-         {
-            HornetQRALogger.LOGGER.trace("setupDestination(" + ctx + ")");
-         }
-
-         String destinationTypeString = spec.getDestinationType();
-         if (destinationTypeString != null && !destinationTypeString.trim().equals(""))
-         {
-            HornetQRALogger.LOGGER.debug("Destination type defined as " + destinationTypeString);
-
-            Class<?> destinationType;
-            if (Topic.class.getName().equals(destinationTypeString))
-            {
-               destinationType = Topic.class;
-               isTopic = true;
-            }
-            else
-            {
-               destinationType = Queue.class;
-            }
-
-            HornetQRALogger.LOGGER.debug("Retrieving " + destinationType.getName() + " \"" + destinationName + "\" from JNDI");
-
-            try
-            {
-               destination = (HornetQDestination) HornetQRaUtils.lookup(ctx, destinationName, destinationType);
-            }
-            catch (Exception e)
-            {
-               if (destinationName == null)
-               {
-                  throw HornetQRABundle.BUNDLE.noDestinationName();
-               }
-
-               String calculatedDestinationName = destinationName.substring(destinationName.lastIndexOf('/') + 1);
-
-               HornetQRALogger.LOGGER.debug("Unable to retrieve " + destinationName +
-                                               " from JNDI. Creating a new " + destinationType.getName() +
-                                               " named " + calculatedDestinationName + " to be used by the MDB.");
-
-               // If there is no binding on naming, we will just create a new instance
-               if (isTopic)
-               {
-                  destination = (HornetQDestination) HornetQJMSClient.createTopic(calculatedDestinationName);
-               }
-               else
-               {
-                  destination = (HornetQDestination) HornetQJMSClient.createQueue(calculatedDestinationName);
-               }
-            }
-         }
-         else
-         {
-            HornetQRALogger.LOGGER.debug("Destination type not defined in MDB activation configuration.");
-            HornetQRALogger.LOGGER.debug("Retrieving " + Destination.class.getName() + " \"" + destinationName + "\" from JNDI");
-
-            destination = (HornetQDestination) HornetQRaUtils.lookup(ctx, destinationName, Destination.class);
-            if (destination instanceof Topic)
-            {
-               isTopic = true;
-            }
-         }
-      }
-      else
-      {
-         HornetQRALogger.LOGGER.instantiatingDestination(spec.getDestinationType(), spec.getDestination());
-
-         if (Topic.class.getName().equals(spec.getDestinationType()))
-         {
-            destination = (HornetQDestination) HornetQJMSClient.createTopic(spec.getDestination());
-            isTopic = true;
-         }
-         else
-         {
-            destination = (HornetQDestination) HornetQJMSClient.createQueue(spec.getDestination());
-         }
-      }
-   }
-
-   /**
-    * Get a string representation
-    *
-    * @return The value
-    */
-   @Override
-   public String toString()
-   {
-      StringBuffer buffer = new StringBuffer();
-      buffer.append(HornetQActivation.class.getName()).append('(');
-      buffer.append("spec=").append(spec.getClass().getName());
-      buffer.append(" mepf=").append(endpointFactory.getClass().getName());
-      buffer.append(" active=").append(deliveryActive.get());
-      if (spec.getDestination() != null)
-      {
-         buffer.append(" destination=").append(spec.getDestination());
-      }
-      buffer.append(" transacted=").append(isDeliveryTransacted);
-      buffer.append(')');
-      return buffer.toString();
-   }
-
-   /**
-    * Handles any failure by trying to reconnect
-    *
-    * @param failure the reason for the failure
-    */
-   public void handleFailure(Throwable failure)
-   {
-      if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST)
-      {
-         HornetQRALogger.LOGGER.awaitingTopicQueueCreation(getActivationSpec().getDestination());
-      }
-      else if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.NOT_CONNECTED)
-      {
-         HornetQRALogger.LOGGER.awaitingJMSServerCreation();
-      }
-      else
-      {
-         HornetQRALogger.LOGGER.failureInActivation(failure, spec);
-      }
-      int reconnectCount = 0;
-      int setupAttempts = spec.getSetupAttempts();
-      long setupInterval = spec.getSetupInterval();
-
-      // Only enter the failure loop once
-      if (inFailure.getAndSet(true))
-         return;
-      try
-      {
-         Throwable lastException = failure;
-         while (deliveryActive.get() && (setupAttempts == -1 || reconnectCount < setupAttempts))
-         {
-            teardown();
-
-            try
-            {
-               Thread.sleep(setupInterval);
-            }
-            catch (InterruptedException e)
-            {
-               HornetQRALogger.LOGGER.debug("Interrupted trying to reconnect " + spec, e);
-               break;
-            }
-
-            if (reconnectCount < 1)
-            {
-               HornetQRALogger.LOGGER.attemptingReconnect(spec);
-            }
-            try
-            {
-               setup();
-               HornetQRALogger.LOGGER.reconnected();
-               break;
-            }
-            catch (Throwable t)
-            {
-               if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST)
-               {
-                  if (lastException == null || !(t instanceof ActiveMQNonExistentQueueException))
-                  {
-                     lastException = t;
-                     HornetQRALogger.LOGGER.awaitingTopicQueueCreation(getActivationSpec().getDestination());
-                  }
-               }
-               else if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.NOT_CONNECTED)
-               {
-                  if (lastException == null || !(t instanceof ActiveMQNotConnectedException))
-                  {
-                     lastException = t;
-                     HornetQRALogger.LOGGER.awaitingJMSServerCreation();
-                  }
-               }
-               else
-               {
-                  HornetQRALogger.LOGGER.errorReconnecting(t, spec);
-               }
-            }
-            ++reconnectCount;
-         }
-      }
-      finally
-      {
-         // Leaving failure recovery loop
-         inFailure.set(false);
-      }
-   }
-
-   public HornetQConnectionFactory getConnectionFactory()
-   {
-      return this.factory;
-   }
-
-   /**
-    * Handles the setup
-    */
-   private class SetupActivation implements Work
-   {
-      public void run()
-      {
-         try
-         {
-            setup();
-         }
-         catch (Throwable t)
-         {
-            handleFailure(t);
-         }
-      }
-
-      public void release()
-      {
-      }
-   }
-}


[19/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessage.java
deleted file mode 100644
index 952588d..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessage.java
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import java.util.Arrays;
-import java.util.Enumeration;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAMessage implements Message
-{
-   /**
-    * Whether trace is enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The message
-    */
-   protected Message message;
-
-   /**
-    * The session
-    */
-   protected HornetQRASession session;
-
-   /**
-    * Create a new wrapper
-    *
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRAMessage(final Message message, final HornetQRASession session)
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-
-      this.message = message;
-      this.session = session;
-   }
-
-   /**
-    * Acknowledge
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void acknowledge() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("acknowledge()");
-      }
-
-      session.getSession(); // Check for closed
-      message.acknowledge();
-   }
-
-   /**
-    * Clear body
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void clearBody() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("clearBody()");
-      }
-
-      message.clearBody();
-   }
-
-   /**
-    * Clear properties
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void clearProperties() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("clearProperties()");
-      }
-
-      message.clearProperties();
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public boolean getBooleanProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBooleanProperty(" + name + ")");
-      }
-
-      return message.getBooleanProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public byte getByteProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getByteProperty(" + name + ")");
-      }
-
-      return message.getByteProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public double getDoubleProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDoubleProperty(" + name + ")");
-      }
-
-      return message.getDoubleProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public float getFloatProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getFloatProperty(" + name + ")");
-      }
-
-      return message.getFloatProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public int getIntProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getIntProperty(" + name + ")");
-      }
-
-      return message.getIntProperty(name);
-   }
-
-   /**
-    * Get correlation id
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public String getJMSCorrelationID() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSCorrelationID()");
-      }
-
-      return message.getJMSCorrelationID();
-   }
-
-   /**
-    * Get correlation id
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public byte[] getJMSCorrelationIDAsBytes() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSCorrelationIDAsBytes()");
-      }
-
-      return message.getJMSCorrelationIDAsBytes();
-   }
-
-   /**
-    * Get delivery mode
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public int getJMSDeliveryMode() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSDeliveryMode()");
-      }
-
-      return message.getJMSDeliveryMode();
-   }
-
-   /**
-    * Get destination
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Destination getJMSDestination() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSDestination()");
-      }
-
-      return message.getJMSDestination();
-   }
-
-   /**
-    * Get expiration
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public long getJMSExpiration() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSExpiration()");
-      }
-
-      return message.getJMSExpiration();
-   }
-
-   /**
-    * Get message id
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public String getJMSMessageID() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSMessageID()");
-      }
-
-      return message.getJMSMessageID();
-   }
-
-   /**
-    * Get priority
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public int getJMSPriority() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSPriority()");
-      }
-
-      return message.getJMSPriority();
-   }
-
-   /**
-    * Get redelivered status
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public boolean getJMSRedelivered() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSRedelivered()");
-      }
-
-      return message.getJMSRedelivered();
-   }
-
-   /**
-    * Get reply to destination
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Destination getJMSReplyTo() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSReplyTo()");
-      }
-
-      return message.getJMSReplyTo();
-   }
-
-   /**
-    * Get timestamp
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public long getJMSTimestamp() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSTimestamp()");
-      }
-
-      return message.getJMSTimestamp();
-   }
-
-   /**
-    * Get type
-    *
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public String getJMSType() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSType()");
-      }
-
-      return message.getJMSType();
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public long getLongProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getLongProperty(" + name + ")");
-      }
-
-      return message.getLongProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public Object getObjectProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getObjectProperty(" + name + ")");
-      }
-
-      return message.getObjectProperty(name);
-   }
-
-   /**
-    * Get property names
-    *
-    * @return The values
-    * @throws JMSException Thrown if an error occurs
-    */
-   @SuppressWarnings("rawtypes")
-   public Enumeration getPropertyNames() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPropertyNames()");
-      }
-
-      return message.getPropertyNames();
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public short getShortProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getShortProperty(" + name + ")");
-      }
-
-      return message.getShortProperty(name);
-   }
-
-   /**
-    * Get property
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public String getStringProperty(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getStringProperty(" + name + ")");
-      }
-
-      return message.getStringProperty(name);
-   }
-
-   /**
-    * Do property exist
-    *
-    * @param name The name
-    * @return The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public boolean propertyExists(final String name) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("propertyExists(" + name + ")");
-      }
-
-      return message.propertyExists(name);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setBooleanProperty(final String name, final boolean value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBooleanProperty(" + name + ", " + value + ")");
-      }
-
-      message.setBooleanProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setByteProperty(final String name, final byte value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setByteProperty(" + name + ", " + value + ")");
-      }
-
-      message.setByteProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setDoubleProperty(final String name, final double value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDoubleProperty(" + name + ", " + value + ")");
-      }
-
-      message.setDoubleProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setFloatProperty(final String name, final float value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFloatProperty(" + name + ", " + value + ")");
-      }
-
-      message.setFloatProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setIntProperty(final String name, final int value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setIntProperty(" + name + ", " + value + ")");
-      }
-
-      message.setIntProperty(name, value);
-   }
-
-   /**
-    * Set correlation id
-    *
-    * @param correlationID The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSCorrelationID(final String correlationID) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSCorrelationID(" + correlationID + ")");
-      }
-
-      message.setJMSCorrelationID(correlationID);
-   }
-
-   /**
-    * Set correlation id
-    *
-    * @param correlationID The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSCorrelationIDAsBytes(" + Arrays.toString(correlationID) + ")");
-      }
-
-      message.setJMSCorrelationIDAsBytes(correlationID);
-   }
-
-   /**
-    * Set delivery mode
-    *
-    * @param deliveryMode The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSDeliveryMode(final int deliveryMode) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSDeliveryMode(" + deliveryMode + ")");
-      }
-
-      message.setJMSDeliveryMode(deliveryMode);
-   }
-
-   /**
-    * Set destination
-    *
-    * @param destination The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSDestination(final Destination destination) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSDestination(" + destination + ")");
-      }
-
-      message.setJMSDestination(destination);
-   }
-
-   /**
-    * Set expiration
-    *
-    * @param expiration The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSExpiration(final long expiration) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSExpiration(" + expiration + ")");
-      }
-
-      message.setJMSExpiration(expiration);
-   }
-
-   /**
-    * Set message id
-    *
-    * @param id The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSMessageID(final String id) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSMessageID(" + id + ")");
-      }
-
-      message.setJMSMessageID(id);
-   }
-
-   /**
-    * Set priority
-    *
-    * @param priority The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSPriority(final int priority) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSPriority(" + priority + ")");
-      }
-
-      message.setJMSPriority(priority);
-   }
-
-   /**
-    * Set redelivered status
-    *
-    * @param redelivered The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSRedelivered(final boolean redelivered) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSRedelivered(" + redelivered + ")");
-      }
-
-      message.setJMSRedelivered(redelivered);
-   }
-
-   /**
-    * Set reply to
-    *
-    * @param replyTo The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSReplyTo(final Destination replyTo) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSReplyTo(" + replyTo + ")");
-      }
-
-      message.setJMSReplyTo(replyTo);
-   }
-
-   /**
-    * Set timestamp
-    *
-    * @param timestamp The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSTimestamp(final long timestamp) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSTimestamp(" + timestamp + ")");
-      }
-
-      message.setJMSTimestamp(timestamp);
-   }
-
-   /**
-    * Set type
-    *
-    * @param type The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setJMSType(final String type) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSType(" + type + ")");
-      }
-
-      message.setJMSType(type);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setLongProperty(final String name, final long value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setLongProperty(" + name + ", " + value + ")");
-      }
-
-      message.setLongProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setObjectProperty(final String name, final Object value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setObjectProperty(" + name + ", " + value + ")");
-      }
-
-      message.setObjectProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setShortProperty(final String name, final short value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setShortProperty(" + name + ", " + value + ")");
-      }
-
-      message.setShortProperty(name, value);
-   }
-
-   /**
-    * Set property
-    *
-    * @param name  The name
-    * @param value The value
-    * @throws JMSException Thrown if an error occurs
-    */
-   public void setStringProperty(final String name, final String value) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setStringProperty(" + name + ", " + value + ")");
-      }
-
-      message.setStringProperty(name, value);
-   }
-
-   @Override
-   public long getJMSDeliveryTime() throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getJMSDeliveryTime()");
-      }
-      return message.getJMSDeliveryTime();
-   }
-
-   @Override
-   public void setJMSDeliveryTime(long deliveryTime) throws JMSException
-   {
-
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setJMSDeliveryTime(" + deliveryTime + ")");
-      }
-      message.setJMSDeliveryTime(deliveryTime);
-   }
-
-   @Override
-   public <T> T getBody(Class<T> c) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBody(" + c + ")");
-      }
-      return message.getBody(c);
-   }
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
-                                     Class c) throws JMSException
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isBodyAssignableTo(" + c + ")");
-      }
-      return message.isBodyAssignableTo(c);
-   }
-
-   /**
-    * Return the hash code
-    *
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("hashCode()");
-      }
-
-      return message.hashCode();
-   }
-
-   /**
-    * Check for equality
-    *
-    * @param object The other object
-    * @return True / false
-    */
-   @Override
-   public boolean equals(final Object object)
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("equals(" + object + ")");
-      }
-
-      if (object != null && object instanceof HornetQRAMessage)
-      {
-         return message.equals(((HornetQRAMessage)object).message);
-      }
-      else
-      {
-         return message.equals(object);
-      }
-   }
-
-   /**
-    * Return string representation
-    *
-    * @return The string
-    */
-   @Override
-   public String toString()
-   {
-      if (HornetQRAMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("toString()");
-      }
-
-      return message.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageConsumer.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageConsumer.java
deleted file mode 100644
index 81e8ad6..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageConsumer.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-
-
-/**
- * A wrapper for a message consumer
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAMessageConsumer implements MessageConsumer
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The wrapped message consumer */
-   protected MessageConsumer consumer;
-
-   /** The session for this consumer */
-   protected HornetQRASession session;
-
-   /**
-    * Create a new wrapper
-    * @param consumer the consumer
-    * @param session the session
-    */
-   public HornetQRAMessageConsumer(final MessageConsumer consumer, final HornetQRASession session)
-   {
-      this.consumer = consumer;
-      this.session = session;
-
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("new HornetQMessageConsumer " + this +
-                                            " consumer=" +
-                                            consumer +
-                                            " session=" +
-                                            session);
-      }
-   }
-
-   /**
-    * Close
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void close() throws JMSException
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("close " + this);
-      }
-      try
-      {
-         closeConsumer();
-      }
-      finally
-      {
-         session.removeConsumer(this);
-      }
-   }
-
-   /**
-    * Check state
-    * @exception JMSException Thrown if an error occurs
-    */
-   void checkState() throws JMSException
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("checkState()");
-      }
-      session.checkState();
-   }
-
-   /**
-    * Get message listener
-    * @return The listener
-    * @exception JMSException Thrown if an error occurs
-    */
-   public MessageListener getMessageListener() throws JMSException
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageListener()");
-      }
-
-      checkState();
-      session.checkStrict();
-      return consumer.getMessageListener();
-   }
-
-   /**
-    * Set message listener
-    * @param listener The listener
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setMessageListener(final MessageListener listener) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         checkState();
-         session.checkStrict();
-         if (listener == null)
-         {
-            consumer.setMessageListener(null);
-         }
-         else
-         {
-            consumer.setMessageListener(wrapMessageListener(listener));
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Get message selector
-    * @return The selector
-    * @exception JMSException Thrown if an error occurs
-    */
-   public String getMessageSelector() throws JMSException
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageSelector()");
-      }
-
-      checkState();
-      return consumer.getMessageSelector();
-   }
-
-   /**
-    * Receive
-    * @return The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Message receive() throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("receive " + this);
-         }
-
-         checkState();
-         Message message = consumer.receive();
-
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("received " + this + " result=" + message);
-         }
-
-         if (message == null)
-         {
-            return null;
-         }
-         else
-         {
-            return wrapMessage(message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Receive
-    * @param timeout The timeout value
-    * @return The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Message receive(final long timeout) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("receive " + this + " timeout=" + timeout);
-         }
-
-         checkState();
-         Message message = consumer.receive(timeout);
-
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("received " + this + " result=" + message);
-         }
-
-         if (message == null)
-         {
-            return null;
-         }
-         else
-         {
-            return wrapMessage(message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Receive
-    * @return The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Message receiveNoWait() throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("receiveNoWait " + this);
-         }
-
-         checkState();
-         Message message = consumer.receiveNoWait();
-
-         if (HornetQRAMessageConsumer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("received " + this + " result=" + message);
-         }
-
-         if (message == null)
-         {
-            return null;
-         }
-         else
-         {
-            return wrapMessage(message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Close consumer
-    * @exception JMSException Thrown if an error occurs
-    */
-   void closeConsumer() throws JMSException
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("closeConsumer()");
-      }
-
-      consumer.close();
-   }
-
-   /**
-    * Wrap message
-    * @param message The message to be wrapped
-    * @return The wrapped message
-    */
-   Message wrapMessage(final Message message)
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("wrapMessage(" + message + ")");
-      }
-
-      if (message instanceof BytesMessage)
-      {
-         return new HornetQRABytesMessage((BytesMessage)message, session);
-      }
-      else if (message instanceof MapMessage)
-      {
-         return new HornetQRAMapMessage((MapMessage)message, session);
-      }
-      else if (message instanceof ObjectMessage)
-      {
-         return new HornetQRAObjectMessage((ObjectMessage)message, session);
-      }
-      else if (message instanceof StreamMessage)
-      {
-         return new HornetQRAStreamMessage((StreamMessage)message, session);
-      }
-      else if (message instanceof TextMessage)
-      {
-         return new HornetQRATextMessage((TextMessage)message, session);
-      }
-      return new HornetQRAMessage(message, session);
-   }
-
-   /**
-    * Wrap message listener
-    * @param listener The listener to be wrapped
-    * @return The wrapped listener
-    */
-   MessageListener wrapMessageListener(final MessageListener listener)
-   {
-      if (HornetQRAMessageConsumer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageSelector()");
-      }
-
-      return new HornetQRAMessageListener(listener, this);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageListener.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageListener.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageListener.java
deleted file mode 100644
index 79f4604..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-
-/**
- * A wrapper for a message listener
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAMessageListener implements MessageListener
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The message listener */
-   private final MessageListener listener;
-
-   /** The consumer */
-   private final HornetQRAMessageConsumer consumer;
-
-   /**
-    * Create a new wrapper
-    * @param listener the listener
-    * @param consumer the consumer
-    */
-   public HornetQRAMessageListener(final MessageListener listener, final HornetQRAMessageConsumer consumer)
-   {
-      if (HornetQRAMessageListener.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + listener + ", " + consumer + ")");
-      }
-
-      this.listener = listener;
-      this.consumer = consumer;
-   }
-
-   /**
-    * On message
-    * @param message The message
-    */
-   public void onMessage(Message message)
-   {
-      if (HornetQRAMessageListener.trace)
-      {
-         HornetQRALogger.LOGGER.trace("onMessage(" + message + ")");
-      }
-
-      message = consumer.wrapMessage(message);
-      listener.onMessage(message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageProducer.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageProducer.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageProducer.java
deleted file mode 100644
index a168c3e..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMessageProducer.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.CompletionListener;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-
-
-/**
- * HornetQMessageProducer.
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAMessageProducer implements MessageProducer
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The wrapped message producer */
-   protected MessageProducer producer;
-
-   /** The session for this consumer */
-   protected HornetQRASession session;
-
-   /**
-    * Create a new wrapper
-    * @param producer the producer
-    * @param session the session
-    */
-   public HornetQRAMessageProducer(final MessageProducer producer, final HornetQRASession session)
-   {
-      this.producer = producer;
-      this.session = session;
-
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("new HornetQMessageProducer " + this +
-                                            " producer=" +
-                                            producer +
-                                            " session=" +
-                                            session);
-      }
-   }
-
-   /**
-    * Close
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void close() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("close " + this);
-      }
-      try
-      {
-         closeProducer();
-      }
-      finally
-      {
-         session.removeProducer(this);
-      }
-   }
-
-   /**
-    * Send message
-    * @param destination The destination
-    * @param message The message
-    * @param deliveryMode The delivery mode
-    * @param priority The priority
-    * @param timeToLive The time to live
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Destination destination,
-                    final Message message,
-                    final int deliveryMode,
-                    final int priority,
-                    final long timeToLive) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this +
-                                               " destination=" +
-                                               destination +
-                                               " message=" +
-                                               message +
-                                               " deliveryMode=" +
-                                               deliveryMode +
-                                               " priority=" +
-                                               priority +
-                                               " ttl=" +
-                                               timeToLive);
-         }
-
-         checkState();
-
-         producer.send(destination, message, deliveryMode, priority, timeToLive);
-
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Send message
-    * @param destination The destination
-    * @param message The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Destination destination, final Message message) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
-         }
-
-         checkState();
-
-         producer.send(destination, message);
-
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Send message
-    * @param message The message
-    * @param deliveryMode The delivery mode
-    * @param priority The priority
-    * @param timeToLive The time to live
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this +
-                                               " message=" +
-                                               message +
-                                               " deliveryMode=" +
-                                               deliveryMode +
-                                               " priority=" +
-                                               priority +
-                                               " ttl=" +
-                                               timeToLive);
-         }
-
-         checkState();
-
-         producer.send(message, deliveryMode, priority, timeToLive);
-
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Send message
-    * @param message The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Message message) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this + " message=" + message);
-         }
-
-         checkState();
-
-         producer.send(message);
-
-         if (HornetQRAMessageProducer.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Get the delivery mode
-    * @return The mode
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int getDeliveryMode() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDeliveryMode()");
-      }
-
-      return producer.getDeliveryMode();
-   }
-
-   /**
-    * Get the destination
-    * @return The destination
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Destination getDestination() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDestination()");
-      }
-
-      return producer.getDestination();
-   }
-
-   /**
-    * Disable message id
-    * @return True if disable
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean getDisableMessageID() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDisableMessageID()");
-      }
-
-      return producer.getDisableMessageID();
-   }
-
-   /**
-    * Disable message timestamp
-    * @return True if disable
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean getDisableMessageTimestamp() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDisableMessageTimestamp()");
-      }
-
-      return producer.getDisableMessageTimestamp();
-   }
-
-   /**
-    * Get the priority
-    * @return The priority
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int getPriority() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPriority()");
-      }
-
-      return producer.getPriority();
-   }
-
-   /**
-    * Get the time to live
-    * @return The ttl
-    * @exception JMSException Thrown if an error occurs
-    */
-   public long getTimeToLive() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTimeToLive()");
-      }
-
-      return producer.getTimeToLive();
-   }
-
-   /**
-    * Set the delivery mode
-    * @param deliveryMode The mode
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setDeliveryMode(final int deliveryMode) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDeliveryMode(" + deliveryMode + ")");
-      }
-
-      producer.setDeliveryMode(deliveryMode);
-   }
-
-   /**
-    * Set disable message id
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setDisableMessageID(final boolean value) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDisableMessageID(" + value + ")");
-      }
-
-      producer.setDisableMessageID(value);
-   }
-
-   /**
-    * Set disable message timestamp
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setDisableMessageTimestamp(final boolean value) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDisableMessageTimestamp(" + value + ")");
-      }
-
-      producer.setDisableMessageTimestamp(value);
-   }
-
-   /**
-    * Set the priority
-    * @param defaultPriority The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setPriority(final int defaultPriority) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPriority(" + defaultPriority + ")");
-      }
-
-      producer.setPriority(defaultPriority);
-   }
-
-   /**
-    * Set the ttl
-    * @param timeToLive The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setTimeToLive(final long timeToLive) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setTimeToLive(" + timeToLive + ")");
-      }
-
-      producer.setTimeToLive(timeToLive);
-   }
-
-   @Override
-   public void setDeliveryDelay(long deliveryDelay) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDeliveryDelay(" + deliveryDelay + ")");
-      }
-      producer.setDeliveryDelay(deliveryDelay);
-   }
-
-   @Override
-   public long getDeliveryDelay() throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDeliveryDelay()");
-      }
-      return producer.getDeliveryDelay();
-   }
-
-   @Override
-   public void send(Message message, CompletionListener completionListener) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("send(" + message + ", " + completionListener + ")");
-      }
-      producer.send(message, completionListener);
-   }
-
-   @Override
-   public void send(Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("send(" + message + ", " + deliveryMode + ", " + priority + ", " + timeToLive +
-                  ", " + completionListener + ")");
-      }
-      producer.send(message, deliveryMode, priority, timeToLive, completionListener);
-   }
-
-   @Override
-   public void send(Destination destination, Message message, CompletionListener completionListener) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("send(" + destination + ", " + message + ", " + completionListener + ")");
-      }
-      producer.send(destination, message, completionListener);
-   }
-
-   @Override
-   public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener) throws JMSException
-   {
-      if (HornetQRAMessageProducer.trace)
-      {
-         HornetQRALogger.LOGGER.trace("send(" + destination + ", " + message + ", " + deliveryMode + ", " + priority +
-                  ", " + timeToLive + ", " + completionListener + ")");
-      }
-      producer.send(destination, message, deliveryMode, priority, timeToLive, completionListener);
-   }
-
-    /**
-    * Check state
-    * @exception JMSException Thrown if an error occurs
-    */
-   void checkState() throws JMSException
-   {
-      session.checkState();
-   }
-
-   /**
-    * Close producer
-    * @exception JMSException Thrown if an error occurs
-    */
-   void closeProducer() throws JMSException
-   {
-      producer.close();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMetaData.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMetaData.java
deleted file mode 100644
index 78d510a..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMetaData.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ManagedConnectionMetaData;
-
-
-/**
- * Managed connection meta data
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAMetaData implements ManagedConnectionMetaData
-{
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The managed connection */
-   private final HornetQRAManagedConnection mc;
-
-   /**
-    * Constructor
-    * @param mc The managed connection
-    */
-   public HornetQRAMetaData(final HornetQRAManagedConnection mc)
-   {
-      if (HornetQRAMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mc + ")");
-      }
-
-      this.mc = mc;
-   }
-
-   /**
-    * Get the EIS product name
-    * @return The name
-    * @exception ResourceException Thrown if operation fails
-    */
-   public String getEISProductName() throws ResourceException
-   {
-      if (HornetQRAMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getEISProductName()");
-      }
-
-      return "HornetQ";
-   }
-
-   /**
-    * Get the EIS product version
-    * @return The version
-    * @exception ResourceException Thrown if operation fails
-    */
-   public String getEISProductVersion() throws ResourceException
-   {
-      if (HornetQRAMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getEISProductVersion()");
-      }
-
-      return "2.0";
-   }
-
-   /**
-    * Get the user name
-    * @return The user name
-    * @exception ResourceException Thrown if operation fails
-    */
-   public String getUserName() throws ResourceException
-   {
-      if (HornetQRAMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return mc.getUserName();
-   }
-
-   /**
-     * Get the maximum number of connections -- RETURNS 0
-     * @return The number
-     * @exception ResourceException Thrown if operation fails
-     */
-   public int getMaxConnections() throws ResourceException
-   {
-      if (HornetQRAMetaData.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMaxConnections()");
-      }
-
-      return 0;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAObjectMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAObjectMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAObjectMessage.java
deleted file mode 100644
index d64eff8..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAObjectMessage.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.io.Serializable;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAObjectMessage extends HornetQRAMessage implements ObjectMessage
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRAObjectMessage(final ObjectMessage message, final HornetQRASession session)
-   {
-      super(message, session);
-
-      if (HornetQRAObjectMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get the object
-    * @return The object
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Serializable getObject() throws JMSException
-   {
-      if (HornetQRAObjectMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getObject()");
-      }
-
-      return ((ObjectMessage)message).getObject();
-   }
-
-   /**
-    * Set the object
-    * @param object The object
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setObject(final Serializable object) throws JMSException
-   {
-      if (HornetQRAObjectMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setObject(" + object + ")");
-      }
-
-      ((ObjectMessage)message).setObject(object);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAProperties.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAProperties.java
deleted file mode 100644
index c0f1d9b..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAProperties.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.io.Serializable;
-import java.util.Hashtable;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.utils.DefaultSensitiveStringCodec;
-import org.apache.activemq.utils.PasswordMaskingUtil;
-import org.apache.activemq.utils.SensitiveDataCodec;
-
-
-/**
- * The RA default properties - these are set in the ra.xml file
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQRAProperties extends ConnectionFactoryProperties implements Serializable
-{
-   /**
-    * Serial version UID
-    */
-   static final long serialVersionUID = -2772367477755473248L;
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The user name
-    */
-   private String userName;
-
-   /**
-    * The password
-    */
-   private String password = null;
-
-   /**
-    * Use Local TX instead of XA
-    */
-   private Boolean localTx = false;
-
-
-   /**
-    * Class used to locate the Transaction Manager.
-    * Using JBoss5 as the default locator
-    */
-   private String transactionManagerLocatorClass = "org.apache.activemq.integration.jboss.tm.JBoss5TransactionManagerLocator;org.apache.activemq.integration.jboss.tm.JBoss4TransactionManagerLocator";
-
-   /**
-    * Method used to locate the TM
-    */
-   private String transactionManagerLocatorMethod = "getTm;getTM";
-
-   private static final int DEFAULT_SETUP_ATTEMPTS = -1;
-
-   private static final long DEFAULT_SETUP_INTERVAL = 2 * 1000;
-
-   private int setupAttempts = DEFAULT_SETUP_ATTEMPTS;
-
-   private long setupInterval = DEFAULT_SETUP_INTERVAL;
-
-   private Hashtable<?, ?> jndiParams;
-
-   private boolean useJNDI;
-
-   private boolean useMaskedPassword = false;
-
-   private String passwordCodec;
-
-   private boolean initialized = false;
-
-   private transient SensitiveDataCodec<String> codecInstance;
-
-   /**
-    * Class used to get a JChannel
-    */
-   private String jgroupsChannelLocatorClass;
-
-   /**
-    * Name used to locate a JChannel
-    */
-   private String jgroupsChannelRefName;
-
-   /**
-    * Constructor
-    */
-   public HornetQRAProperties()
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-   }
-
-   /**
-    * Get the user name
-    *
-    * @return The value
-    */
-   public String getUserName()
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return userName;
-   }
-
-   /**
-    * Set the user name
-    *
-    * @param userName The value
-    */
-   public void setUserName(final String userName)
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUserName(" + userName + ")");
-      }
-
-      this.userName = userName;
-   }
-
-   /**
-    * Get the password
-    *
-    * @return The value
-    */
-   public String getPassword()
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPassword()");
-      }
-
-      return password;
-   }
-
-   /**
-    * Set the password
-    * Based on UseMaskedPassword property, the password can be
-    * plain text or encoded string. However we cannot decide
-    * which is the case at this moment, because we don't know
-    * when the UseMaskedPassword and PasswordCodec are loaded. So for the moment
-    * we just save the password.
-    *
-    * @param password The value
-    */
-   public void setPassword(final String password)
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      this.password = password;
-   }
-
-   /**
-    * @return the useJNDI
-    */
-   public boolean isUseJNDI()
-   {
-      return useJNDI;
-   }
-
-   /**
-    * @param value the useJNDI to set
-    */
-   public void setUseJNDI(final Boolean value)
-   {
-      useJNDI = value;
-   }
-
-   /**
-    * @return return the jndi params to use
-    */
-   public Hashtable<?, ?> getParsedJndiParams()
-   {
-      return jndiParams;
-   }
-
-
-   public void setParsedJndiParams(Hashtable<?, ?> params)
-   {
-      jndiParams = params;
-   }
-
-   /**
-    * Get the use XA flag
-    *
-    * @return The value
-    */
-   public Boolean getUseLocalTx()
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUseLocalTx()");
-      }
-
-      return localTx;
-   }
-
-   /**
-    * Set the use XA flag
-    *
-    * @param localTx The value
-    */
-   public void setUseLocalTx(final Boolean localTx)
-   {
-      if (HornetQRAProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUseLocalTx(" + localTx + ")");
-      }
-
-      this.localTx = localTx;
-   }
-
-
-   public void setTransactionManagerLocatorClass(final String transactionManagerLocatorClass)
-   {
-      this.transactionManagerLocatorClass = transactionManagerLocatorClass;
-   }
-
-   public String getTransactionManagerLocatorClass()
-   {
-      return transactionManagerLocatorClass;
-   }
-
-   public String getTransactionManagerLocatorMethod()
-   {
-      return transactionManagerLocatorMethod;
-   }
-
-   public void setTransactionManagerLocatorMethod(final String transactionManagerLocatorMethod)
-   {
-      this.transactionManagerLocatorMethod = transactionManagerLocatorMethod;
-   }
-
-   public int getSetupAttempts()
-   {
-      return setupAttempts;
-   }
-
-   public void setSetupAttempts(Integer setupAttempts)
-   {
-      this.setupAttempts = setupAttempts;
-   }
-
-   public long getSetupInterval()
-   {
-      return setupInterval;
-   }
-
-   public void setSetupInterval(Long setupInterval)
-   {
-      this.setupInterval = setupInterval;
-   }
-
-   public boolean isUseMaskedPassword()
-   {
-      return useMaskedPassword;
-   }
-
-   public void setUseMaskedPassword(boolean useMaskedPassword)
-   {
-      this.useMaskedPassword = useMaskedPassword;
-   }
-
-   public String getPasswordCodec()
-   {
-      return passwordCodec;
-   }
-
-   public void setPasswordCodec(String codecs)
-   {
-      passwordCodec = codecs;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "HornetQRAProperties[localTx=" + localTx +
-         ", userName=" + userName + ", password=****]";
-   }
-
-   public synchronized void init() throws ActiveMQException
-   {
-      if (initialized)
-         return;
-
-      if (useMaskedPassword)
-      {
-         codecInstance = new DefaultSensitiveStringCodec();
-
-         if (passwordCodec != null)
-         {
-            codecInstance = PasswordMaskingUtil.getCodec(passwordCodec);
-         }
-
-         try
-         {
-            if (password != null)
-            {
-               password = codecInstance.decode(password);
-            }
-         }
-         catch (Exception e)
-         {
-            throw HornetQRABundle.BUNDLE.errorDecodingPassword(e);
-         }
-
-      }
-      initialized = true;
-   }
-
-   public SensitiveDataCodec<String> getCodecInstance()
-   {
-      return codecInstance;
-   }
-
-   public String getJgroupsChannelLocatorClass()
-   {
-      return jgroupsChannelLocatorClass;
-   }
-
-   public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass)
-   {
-      this.jgroupsChannelLocatorClass = jgroupsChannelLocatorClass;
-   }
-
-   public String getJgroupsChannelRefName()
-   {
-      return jgroupsChannelRefName;
-   }
-
-   public void setJgroupsChannelRefName(String jgroupsChannelRefName)
-   {
-      this.jgroupsChannelRefName = jgroupsChannelRefName;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueReceiver.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueReceiver.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueReceiver.java
deleted file mode 100644
index de4a76d..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueReceiver.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.QueueReceiver;
-
-
-/**
- * A wrapper for a queue receiver
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAQueueReceiver extends HornetQRAMessageConsumer implements QueueReceiver
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param consumer the queue receiver
-    * @param session the session
-    */
-   public HornetQRAQueueReceiver(final QueueReceiver consumer, final HornetQRASession session)
-   {
-      super(consumer, session);
-
-      if (HornetQRAQueueReceiver.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + consumer + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get queue
-    * @return The queue
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Queue getQueue() throws JMSException
-   {
-      if (HornetQRAQueueReceiver.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getQueue()");
-      }
-
-      checkState();
-      return ((QueueReceiver)consumer).getQueue();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueSender.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueSender.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueSender.java
deleted file mode 100644
index e18cfcf..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAQueueSender.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-
-
-/**
- * HornetQQueueSender.
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAQueueSender extends HornetQRAMessageProducer implements QueueSender
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param producer the producer
-    * @param session the session
-    */
-   public HornetQRAQueueSender(final QueueSender producer, final HornetQRASession session)
-   {
-      super(producer, session);
-
-      if (HornetQRAQueueSender.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + producer + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get queue
-    * @return The queue
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Queue getQueue() throws JMSException
-   {
-      if (HornetQRAQueueSender.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getQueue()");
-      }
-
-      return ((QueueSender)producer).getQueue();
-   }
-
-   /**
-    * Send message
-    * @param destination The destination
-    * @param message The message
-    * @param deliveryMode The delivery mode
-    * @param priority The priority
-    * @param timeToLive The time to live
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Queue destination,
-                    final Message message,
-                    final int deliveryMode,
-                    final int priority,
-                    final long timeToLive) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAQueueSender.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this +
-                                           " destination=" +
-                                           destination +
-                                           " message=" +
-                                           message +
-                                           " deliveryMode=" +
-                                           deliveryMode +
-                                           " priority=" +
-                                           priority +
-                                           " ttl=" +
-                                           timeToLive);
-         }
-
-         checkState();
-         producer.send(destination, message, deliveryMode, priority, timeToLive);
-
-         if (HornetQRAQueueSender.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Send message
-    * @param destination The destination
-    * @param message The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void send(final Queue destination, final Message message) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRAQueueSender.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
-         }
-
-         checkState();
-         producer.send(destination, message);
-
-         if (HornetQRAQueueSender.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAService.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAService.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAService.java
deleted file mode 100644
index f82ada9..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAService.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.util.Set;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-
-
-/**
- * A HornetQRAService ensures that HornetQ Resource Adapter will be stopped *before* the HornetQ server.
- * https://jira.jboss.org/browse/HORNETQ-339
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- *
- */
-public class HornetQRAService
-{
-   // Constants -----------------------------------------------------
-   // Attributes ----------------------------------------------------
-
-   private final MBeanServer mBeanServer;
-
-   private final String resourceAdapterObjectName;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQRAService(final MBeanServer mBeanServer, final String resourceAdapterObjectName)
-   {
-      this.mBeanServer = mBeanServer;
-      this.resourceAdapterObjectName = resourceAdapterObjectName;
-   }
-
-   // Public --------------------------------------------------------
-
-   public void stop()
-   {
-      try
-      {
-         ObjectName objectName = new ObjectName(resourceAdapterObjectName);
-         Set<ObjectInstance> mbeanSet = mBeanServer.queryMBeans(objectName, null);
-
-         for (ObjectInstance mbean : mbeanSet)
-         {
-            String stateString = (String)mBeanServer.getAttribute(mbean.getObjectName(), "StateString");
-
-            if ("Started".equalsIgnoreCase(stateString) || "Starting".equalsIgnoreCase(stateString))
-            {
-               mBeanServer.invoke(mbean.getObjectName(), "stop", new Object[0], new String[0]);
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         HornetQRALogger.LOGGER.errorStoppingRA(e);
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}


[13/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/DestinationServiceManager.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/DestinationServiceManager.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/DestinationServiceManager.java
index da58b80..6f6b3fb 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/DestinationServiceManager.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/DestinationServiceManager.java
@@ -14,7 +14,7 @@ package org.apache.activemq.rest.queue;
 
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.ServerLocator;
 import org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.rest.util.LinkStrategy;
@@ -160,7 +160,7 @@ public abstract class DestinationServiceManager
    {
       if (locator == null)
       {
-         locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+         locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
       }
       if (sessionFactory == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessage.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessage.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessage.java
index 45e8eff..7894424 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessage.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessage.java
@@ -34,7 +34,7 @@ import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientProducer;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.util.HttpMessageHelper;
 import org.apache.activemq.utils.UUID;
 import org.apache.activemq.utils.UUIDGenerator;
@@ -82,10 +82,10 @@ public class PostMessage
       try
       {
          ClientProducer producer = pooled.producer;
-         ClientMessage message = createHornetQMessage(headers, body, durable, ttl, expiration, priority, pooled.session);
+         ClientMessage message = createActiveMQMessage(headers, body, durable, ttl, expiration, priority, pooled.session);
          message.putStringProperty(ClientMessage.HDR_DUPLICATE_DETECTION_ID.toString(), dup);
          producer.send(message);
-         HornetQRestLogger.LOGGER.debug("Sent message: " + message);
+         ActiveMQRestLogger.LOGGER.debug("Sent message: " + message);
          pool.add(pooled);
       }
       catch (Exception ex)
@@ -110,7 +110,7 @@ public class PostMessage
                              @QueryParam("priority") Integer priority,
                              @Context HttpHeaders headers, @Context UriInfo uriInfo, byte[] body)
    {
-      HornetQRestLogger.LOGGER.debug("Handling PUT request for \"" + uriInfo.getRequestUri() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling PUT request for \"" + uriInfo.getRequestUri() + "\"");
 
       return internalPostWithId(dupId, durable, ttl, expiration, priority, headers, uriInfo, body);
    }
@@ -123,7 +123,7 @@ public class PostMessage
                               @QueryParam("priority") Integer priority,
                               @Context HttpHeaders headers, @Context UriInfo uriInfo, byte[] body)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getRequestUri() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getRequestUri() + "\"");
 
       return internalPostWithId(dupId, durable, ttl, expiration, priority, headers, uriInfo, body);
    }
@@ -261,12 +261,12 @@ public class PostMessage
    }
 
 
-   protected ClientMessage createHornetQMessage(HttpHeaders headers, byte[] body,
-                                                boolean durable,
-                                                Long ttl,
-                                                Long expiration,
-                                                Integer priority,
-                                                ClientSession session) throws Exception
+   protected ClientMessage createActiveMQMessage(HttpHeaders headers, byte[] body,
+                                                 boolean durable,
+                                                 Long ttl,
+                                                 Long expiration,
+                                                 Integer priority,
+                                                 ClientSession session) throws Exception
    {
       ClientMessage message = session.createMessage(Message.BYTES_TYPE, durable);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageDupsOk.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageDupsOk.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageDupsOk.java
index 60fa2b7..b9b9d9a 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageDupsOk.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageDupsOk.java
@@ -15,7 +15,7 @@ package org.apache.activemq.rest.queue;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientProducer;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 
 import javax.ws.rs.POST;
 import javax.ws.rs.QueryParam;
@@ -45,9 +45,9 @@ public class PostMessageDupsOk extends PostMessage
       try
       {
          ClientProducer producer = pooled.producer;
-         ClientMessage message = createHornetQMessage(headers, body, durable, ttl, expiration, priority, pooled.session);
+         ClientMessage message = createActiveMQMessage(headers, body, durable, ttl, expiration, priority, pooled.session);
          producer.send(message);
-         HornetQRestLogger.LOGGER.debug("Sent message: " + message);
+         ActiveMQRestLogger.LOGGER.debug("Sent message: " + message);
          pool.add(pooled);
       }
       catch (Exception ex)
@@ -73,7 +73,7 @@ public class PostMessageDupsOk extends PostMessage
                           @Context UriInfo uriInfo,
                           byte[] body)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getRequestUri() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getRequestUri() + "\"");
 
       try
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageNoDups.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageNoDups.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageNoDups.java
index 609df82..6f5d17d 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageNoDups.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/PostMessageNoDups.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.rest.queue;
 
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 
 import javax.ws.rs.POST;
 import javax.ws.rs.core.Context;
@@ -31,7 +31,7 @@ public class PostMessageNoDups extends PostMessage
    @POST
    public Response redirectCreation(@Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       String id = generateDupId();
       Response.ResponseBuilder res = Response.status(Response.Status.TEMPORARY_REDIRECT.getStatusCode());

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueConsumer.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueConsumer.java
index 618c574..7669727 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueConsumer.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueConsumer.java
@@ -30,7 +30,7 @@ import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.jms.client.SelectorTranslator;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.util.Constants;
 import org.apache.activemq.rest.util.LinkStrategy;
 
@@ -114,7 +114,7 @@ public class QueueConsumer
       try
       {
          consumer.close();
-         HornetQRestLogger.LOGGER.debug("Closed consumer: " + consumer);
+         ActiveMQRestLogger.LOGGER.debug("Closed consumer: " + consumer);
       }
       catch (Exception e)
       {
@@ -123,7 +123,7 @@ public class QueueConsumer
       try
       {
          session.close();
-         HornetQRestLogger.LOGGER.debug("Closed session: " + session);
+         ActiveMQRestLogger.LOGGER.debug("Closed session: " + session);
       }
       catch (Exception e)
       {
@@ -139,7 +139,7 @@ public class QueueConsumer
                                      @PathParam("index") long index,
                                      @Context UriInfo info)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + info.getRequestUri() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + info.getRequestUri() + "\"");
 
       if (closed)
       {
@@ -213,16 +213,16 @@ public class QueueConsumer
    protected void createSession() throws ActiveMQException
    {
       session = factory.createSession(true, true, 0);
-      HornetQRestLogger.LOGGER.debug("Created session: " + session);
+      ActiveMQRestLogger.LOGGER.debug("Created session: " + session);
       if (selector == null)
       {
          consumer = session.createConsumer(destination);
       }
       else
       {
-         consumer = session.createConsumer(destination, SelectorTranslator.convertToHornetQFilterString(selector));
+         consumer = session.createConsumer(destination, SelectorTranslator.convertToActiveMQFilterString(selector));
       }
-      HornetQRestLogger.LOGGER.debug("Created consumer: " + consumer);
+      ActiveMQRestLogger.LOGGER.debug("Created consumer: " + consumer);
       session.start();
    }
 
@@ -238,7 +238,7 @@ public class QueueConsumer
          m = consumer.receive(timeoutSecs * 1000);
       }
 
-      HornetQRestLogger.LOGGER.debug("Returning message " + m + " from consumer: " + consumer);
+      ActiveMQRestLogger.LOGGER.debug("Returning message " + m + " from consumer: " + consumer);
 
       return m;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueDestinationsResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueDestinationsResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueDestinationsResource.java
index 7de0945..f47067e 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueDestinationsResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueDestinationsResource.java
@@ -28,11 +28,11 @@ import java.util.concurrent.ConcurrentHashMap;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQQueue;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQQueue;
 import org.apache.activemq.jms.server.config.JMSQueueConfiguration;
 import org.apache.activemq.jms.server.impl.JMSServerConfigParserImpl;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.PushConsumerResource;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 import org.apache.activemq.rest.util.Constants;
@@ -54,17 +54,17 @@ public class QueueDestinationsResource
    }
 
    @POST
-   @Consumes("application/hornetq.jms.queue+xml")
+   @Consumes("application/activemq.jms.queue+xml")
    public Response createJmsQueue(@Context UriInfo uriInfo, Document document)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       try
       {
          JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
          JMSQueueConfiguration queue = parser.parseQueueConfiguration(document.getDocumentElement());
-         HornetQQueue hqQueue = HornetQDestination.createQueue(queue.getName());
-         String queueName = hqQueue.getAddress();
+         ActiveMQQueue activeMQQueue = ActiveMQDestination.createQueue(queue.getName());
+         String queueName = activeMQQueue.getAddress();
          ClientSession session = manager.getSessionFactory().createSession(false, false, false);
          try
          {
@@ -101,7 +101,7 @@ public class QueueDestinationsResource
          {
             for (String binding : queue.getBindings())
             {
-               manager.getRegistry().bind(binding, hqQueue);
+               manager.getRegistry().bind(binding, activeMQQueue);
             }
          }
          URI uri = uriInfo.getRequestUriBuilder().path(queueName).build();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueResource.java
index c46ebaa..1ad264d 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/QueueResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.core.UriInfo;
 
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.PushConsumerResource;
 
 /**
@@ -53,7 +53,7 @@ public class QueueResource extends DestinationResource
    @Produces("application/xml")
    public Response get(@Context UriInfo uriInfo, @Context HttpServletRequest requestContext)
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + destination + "\" from " + requestContext.getRemoteAddr() + ":" + requestContext.getRemotePort());
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + destination + "\" from " + requestContext.getRemoteAddr() + ":" + requestContext.getRemotePort());
 
       StringBuilder msg = new StringBuilder();
       msg.append("<queue>")
@@ -77,7 +77,7 @@ public class QueueResource extends DestinationResource
    @Produces("application/xml")
    public Response head(@Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getRequestUri() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getRequestUri() + "\"");
 
       Response.ResponseBuilder builder = Response.ok();
       setSenderLink(builder, uriInfo);
@@ -183,7 +183,7 @@ public class QueueResource extends DestinationResource
    @DELETE
    public void deleteQueue(@Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       queueDestinationsResource.getQueues().remove(destination);
       stop();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/ActiveMQPushStrategy.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/ActiveMQPushStrategy.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/ActiveMQPushStrategy.java
new file mode 100644
index 0000000..adccf87
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/ActiveMQPushStrategy.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest.queue.push;
+
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.rest.queue.push.xml.XmlHttpHeader;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.specimpl.ResteasyUriBuilder;
+import org.jboss.resteasy.spi.Link;
+
+/**
+ * Forwarding to a ActiveMQ/REST-* endpoing
+ *
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class ActiveMQPushStrategy extends UriTemplateStrategy
+{
+   protected boolean initialized = false;
+
+   public void start() throws Exception
+   {
+      // initialize();
+   }
+
+   protected void initialize() throws Exception
+   {
+      super.start();
+      initialized = true;
+      initAuthentication();
+      ClientRequest request = executor.createRequest(registration.getTarget().getHref());
+      for (XmlHttpHeader header : registration.getHeaders())
+      {
+         request.header(header.getName(), header.getValue());
+      }
+      ClientResponse<?> res = request.head();
+      if (res.getStatus() != 200)
+      {
+         throw new RuntimeException("Failed to query ActiveMQ REST destination for init information.  Status: " + res.getStatus());
+      }
+      String url = (String)res.getHeaders().getFirst("msg-create-with-id");
+      if (url == null)
+      {
+         if (res.getLinkHeader() == null)
+         {
+            throw new RuntimeException("Could not find create-with-id URL");
+         }
+         Link link = res.getLinkHeader().getLinkByTitle("create-with-id");
+         if (link == null)
+         {
+            throw new RuntimeException("Could not find create-with-id URL");
+         }
+         url = link.getHref();
+      }
+      targetUri = ResteasyUriBuilder.fromTemplate(url);
+   }
+
+   @Override
+   public boolean push(ClientMessage message)
+   {
+      // we initialize lazily just in case target is in same VM
+      if (!initialized)
+      {
+         try
+         {
+            initialize();
+            initialized = true;
+         }
+         catch (Exception e)
+         {
+            throw new RuntimeException("Failed to initialize.", e);
+         }
+      }
+      return super.push(message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/FilePushStore.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/FilePushStore.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/FilePushStore.java
index 707ef19..d230e2b 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/FilePushStore.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/FilePushStore.java
@@ -21,7 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 import org.apache.activemq.rest.topic.PushTopicRegistration;
 
@@ -41,7 +41,7 @@ public class FilePushStore implements PushStore
       this.ctx = JAXBContext.newInstance(PushRegistration.class, PushTopicRegistration.class);
       if (this.dir.exists())
       {
-         HornetQRestLogger.LOGGER.loadingRestStore(dir.getAbsolutePath());
+         ActiveMQRestLogger.LOGGER.loadingRestStore(dir.getAbsolutePath());
          for (File file : this.dir.listFiles())
          {
             if (!file.isFile()) continue;
@@ -50,12 +50,12 @@ public class FilePushStore implements PushStore
             {
                reg = (PushRegistration)ctx.createUnmarshaller().unmarshal(file);
                reg.setLoadedFrom(file);
-               HornetQRestLogger.LOGGER.addingPushRegistration(reg.getId());
+               ActiveMQRestLogger.LOGGER.addingPushRegistration(reg.getId());
                map.put(reg.getId(), reg);
             }
             catch (Exception e)
             {
-               HornetQRestLogger.LOGGER.errorLoadingStore(e, file.getName());
+               ActiveMQRestLogger.LOGGER.errorLoadingStore(e, file.getName());
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/HornetQPushStrategy.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/HornetQPushStrategy.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/HornetQPushStrategy.java
deleted file mode 100644
index f93a499..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/HornetQPushStrategy.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest.queue.push;
-
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.rest.queue.push.xml.XmlHttpHeader;
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.specimpl.ResteasyUriBuilder;
-import org.jboss.resteasy.spi.Link;
-
-/**
- * Forwarding to a HornetQ/REST-* endpoing
- *
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class HornetQPushStrategy extends UriTemplateStrategy
-{
-   protected boolean initialized = false;
-
-   public void start() throws Exception
-   {
-      // initialize();
-   }
-
-   protected void initialize() throws Exception
-   {
-      super.start();
-      initialized = true;
-      initAuthentication();
-      ClientRequest request = executor.createRequest(registration.getTarget().getHref());
-      for (XmlHttpHeader header : registration.getHeaders())
-      {
-         request.header(header.getName(), header.getValue());
-      }
-      ClientResponse<?> res = request.head();
-      if (res.getStatus() != 200)
-      {
-         throw new RuntimeException("Failed to query HornetQ REST destination for init information.  Status: " + res.getStatus());
-      }
-      String url = (String)res.getHeaders().getFirst("msg-create-with-id");
-      if (url == null)
-      {
-         if (res.getLinkHeader() == null)
-         {
-            throw new RuntimeException("Could not find create-with-id URL");
-         }
-         Link link = res.getLinkHeader().getLinkByTitle("create-with-id");
-         if (link == null)
-         {
-            throw new RuntimeException("Could not find create-with-id URL");
-         }
-         url = link.getHref();
-      }
-      targetUri = ResteasyUriBuilder.fromTemplate(url);
-   }
-
-   @Override
-   public boolean push(ClientMessage message)
-   {
-      // we initialize lazily just in case target is in same VM
-      if (!initialized)
-      {
-         try
-         {
-            initialize();
-            initialized = true;
-         }
-         catch (Exception e)
-         {
-            throw new RuntimeException("Failed to initialize.", e);
-         }
-      }
-      return super.push(message);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumer.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumer.java
index b8671a4..432e737 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumer.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumer.java
@@ -17,7 +17,7 @@ import org.apache.activemq.api.core.client.ClientConsumer;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.jms.client.SelectorTranslator;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 
 import java.util.ArrayList;
@@ -73,7 +73,7 @@ public class PushConsumer
       {
          if (registration.getTarget().getRelationship().equals("destination"))
          {
-            strategy = new HornetQPushStrategy();
+            strategy = new ActiveMQPushStrategy();
          }
          else if (registration.getTarget().getRelationship().equals("template"))
          {
@@ -98,7 +98,7 @@ public class PushConsumer
 
          if (registration.getSelector() != null)
          {
-            consumer = session.createConsumer(destination, SelectorTranslator.convertToHornetQFilterString(registration.getSelector()));
+            consumer = session.createConsumer(destination, SelectorTranslator.convertToActiveMQFilterString(registration.getSelector()));
          }
          else
          {
@@ -106,7 +106,7 @@ public class PushConsumer
          }
          consumer.setMessageHandler(new PushConsumerMessageHandler(this, session));
          session.start();
-         HornetQRestLogger.LOGGER.startingPushConsumer(registration.getTarget());
+         ActiveMQRestLogger.LOGGER.startingPushConsumer(registration.getTarget());
 
          consumers.add(consumer);
          sessions.add(session);
@@ -154,7 +154,7 @@ public class PushConsumer
       }
       catch (Exception e)
       {
-         HornetQRestLogger.LOGGER.errorUpdatingStore(e);
+         ActiveMQRestLogger.LOGGER.errorUpdatingStore(e);
       }
       stop();
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerMessageHandler.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerMessageHandler.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerMessageHandler.java
index 04961ec..421e554 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerMessageHandler.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerMessageHandler.java
@@ -16,7 +16,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.MessageHandler;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 
 public class PushConsumerMessageHandler implements MessageHandler
 {
@@ -32,26 +32,26 @@ public class PushConsumerMessageHandler implements MessageHandler
    @Override
    public void onMessage(ClientMessage clientMessage)
    {
-      HornetQRestLogger.LOGGER.debug(this + ": receiving " + clientMessage);
+      ActiveMQRestLogger.LOGGER.debug(this + ": receiving " + clientMessage);
 
       try
       {
          clientMessage.acknowledge();
-         HornetQRestLogger.LOGGER.debug(this + ": acknowledged " + clientMessage);
+         ActiveMQRestLogger.LOGGER.debug(this + ": acknowledged " + clientMessage);
       }
       catch (ActiveMQException e)
       {
          throw new RuntimeException(e.getMessage(), e);
       }
 
-      HornetQRestLogger.LOGGER.debug(this + ": pushing " + clientMessage + " via " + pushConsumer.getStrategy());
+      ActiveMQRestLogger.LOGGER.debug(this + ": pushing " + clientMessage + " via " + pushConsumer.getStrategy());
       boolean acknowledge = pushConsumer.getStrategy().push(clientMessage);
 
       if (acknowledge)
       {
          try
          {
-            HornetQRestLogger.LOGGER.debug("Acknowledging: " + clientMessage.getMessageID());
+            ActiveMQRestLogger.LOGGER.debug("Acknowledging: " + clientMessage.getMessageID());
             session.commit();
             return;
          }
@@ -72,7 +72,7 @@ public class PushConsumerMessageHandler implements MessageHandler
          }
          if (pushConsumer.getRegistration().isDisableOnFailure())
          {
-            HornetQRestLogger.LOGGER.errorPushingMessage(pushConsumer.getRegistration().getTarget());
+            ActiveMQRestLogger.LOGGER.errorPushingMessage(pushConsumer.getRegistration().getTarget());
             pushConsumer.disableFromFailure();
             return;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerResource.java
index aa13dd1..6669a53 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushConsumerResource.java
@@ -29,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 
 /**
@@ -80,7 +80,7 @@ public class PushConsumerResource
    @Consumes("application/xml")
    public Response create(@Context UriInfo uriInfo, PushRegistration registration)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       // todo put some logic here to check for duplicates
       String genId = sessionCounter.getAndIncrement() + "-" + startup;
@@ -112,7 +112,7 @@ public class PushConsumerResource
    @Produces("application/xml")
    public PushRegistration getConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       PushConsumer consumer = consumers.get(consumerId);
       if (consumer == null)
@@ -126,7 +126,7 @@ public class PushConsumerResource
    @Path("{consumer-id}")
    public void deleteConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       PushConsumer consumer = consumers.remove(consumerId);
       if (consumer == null)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushStrategy.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushStrategy.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushStrategy.java
index 1437655..e58a4f6 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushStrategy.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/PushStrategy.java
@@ -24,7 +24,7 @@ public interface PushStrategy
    /**
     * Return false if unable to connect. Push consumer may be disabled if configured to do so when
     * unable to connect. Throw an exception if the message sent was unaccepted by the receiver.
-    * Hornetq's retry and dead letter logic will take over from there.
+    * ActiveMQ's retry and dead letter logic will take over from there.
     *
     * @param message
     * @return {@code false} if unable to connect

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/UriStrategy.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/UriStrategy.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/UriStrategy.java
index 3137c19..82fe8e1 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/UriStrategy.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/push/UriStrategy.java
@@ -34,7 +34,7 @@ import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.xml.BasicAuth;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 import org.apache.activemq.rest.queue.push.xml.XmlHttpHeader;
@@ -110,7 +110,7 @@ public class UriStrategy implements PushStrategy
 
    public boolean push(ClientMessage message)
    {
-      HornetQRestLogger.LOGGER.debug("Pushing " + message);
+      ActiveMQRestLogger.LOGGER.debug("Pushing " + message);
       String uri = createUri(message);
       for (int i = 0; i < registration.getMaxRetries(); i++)
       {
@@ -118,21 +118,21 @@ public class UriStrategy implements PushStrategy
          System.out.println("Creating request from " + uri);
          ClientRequest request = executor.createRequest(uri);
          request.followRedirects(false);
-         HornetQRestLogger.LOGGER.debug("Created request " + request);
+         ActiveMQRestLogger.LOGGER.debug("Created request " + request);
 
          for (XmlHttpHeader header : registration.getHeaders())
          {
-            HornetQRestLogger.LOGGER.debug("Setting XmlHttpHeader: " + header.getName() + "=" + header.getValue());
+            ActiveMQRestLogger.LOGGER.debug("Setting XmlHttpHeader: " + header.getName() + "=" + header.getValue());
             request.header(header.getName(), header.getValue());
          }
          HttpMessageHelper.buildMessage(message, request, contentType);
          ClientResponse<?> res = null;
          try
          {
-            HornetQRestLogger.LOGGER.debug(method + " " + uri);
+            ActiveMQRestLogger.LOGGER.debug(method + " " + uri);
             res = request.httpMethod(method);
             int status = res.getStatus();
-            HornetQRestLogger.LOGGER.debug("Status of push: " + status);
+            ActiveMQRestLogger.LOGGER.debug("Status of push: " + status);
             if (status == 503)
             {
                String retryAfter = res.getStringHeaders().getFirst("Retry-After");
@@ -148,7 +148,7 @@ public class UriStrategy implements PushStrategy
             }
             else if ((status >= 200 && status < 299) || status == 303 || status == 304)
             {
-               HornetQRestLogger.LOGGER.debug("Success");
+               ActiveMQRestLogger.LOGGER.debug("Success");
                return true;
             }
             else if (status >= 400)
@@ -184,7 +184,7 @@ public class UriStrategy implements PushStrategy
          }
          catch (Exception e)
          {
-            HornetQRestLogger.LOGGER.debug("failed to push message to " + uri, e);
+            ActiveMQRestLogger.LOGGER.debug("failed to push message to " + uri, e);
             e.printStackTrace();
             return false;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscription.java b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscription.java
index 82c17e2..cf4d672 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscription.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscription.java
@@ -15,7 +15,7 @@ package org.apache.activemq.rest.topic;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.PushConsumer;
 import org.apache.activemq.rest.queue.push.PushStore;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
@@ -50,7 +50,7 @@ public class PushSubscription extends PushConsumer
       }
       catch (ActiveMQException e)
       {
-         HornetQRestLogger.LOGGER.errorDeletingSubscriberQueue(e);
+         ActiveMQRestLogger.LOGGER.errorDeletingSubscriberQueue(e);
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscriptionsResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscriptionsResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscriptionsResource.java
index d97e010..a376100 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscriptionsResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/PushSubscriptionsResource.java
@@ -16,7 +16,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.push.PushConsumer;
 
 import javax.ws.rs.DELETE;
@@ -141,7 +141,7 @@ public class PushSubscriptionsResource
    @POST
    public Response create(@Context UriInfo uriInfo, PushTopicRegistration registration)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       //System.out.println("PushRegistration: " + registration);
       // todo put some logic here to check for duplicates
@@ -186,7 +186,7 @@ public class PushSubscriptionsResource
    @Produces("application/xml")
    public PushTopicRegistration getConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       PushConsumer consumer = consumers.get(consumerId);
       if (consumer == null)
@@ -200,7 +200,7 @@ public class PushSubscriptionsResource
    @Path("{consumer-id}")
    public void deleteConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       PushConsumer consumer = consumers.remove(consumerId);
       if (consumer == null)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/topic/SubscriptionsResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/SubscriptionsResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/SubscriptionsResource.java
index a501e29..53a2eee 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/SubscriptionsResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/SubscriptionsResource.java
@@ -32,7 +32,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.AcknowledgedQueueConsumer;
 import org.apache.activemq.rest.queue.Acknowledgement;
 import org.apache.activemq.rest.queue.DestinationServiceManager;
@@ -100,7 +100,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
       if (consumer == null) return false;
       if (System.currentTimeMillis() - consumer.getLastPingTime() > subscription.getTimeout())
       {
-         HornetQRestLogger.LOGGER.shutdownRestSubscription(consumer.getId());
+         ActiveMQRestLogger.LOGGER.shutdownRestSubscription(consumer.getId());
          if (autoShutdown)
          {
             shutdown(consumer);
@@ -160,7 +160,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
                                       @FormParam("idle-timeout") Long timeout,
                                       @Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       if (timeout == null)
          timeout = Long.valueOf(consumerTimeoutSeconds * 1000);
@@ -289,7 +289,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    public Response getAutoAckSubscription(@PathParam("consumer-id") String consumerId,
                                           @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       return internalHeadAutoAckSubscription(uriInfo, consumerId);
    }
@@ -299,7 +299,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    public Response headAutoAckSubscription(@PathParam("consumer-id") String consumerId,
                                            @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
 
       return internalHeadAutoAckSubscription(uriInfo, consumerId);
    }
@@ -340,7 +340,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    public Response getAcknowledgedConsumer(@PathParam("consumer-id") String consumerId,
                                            @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       return internalHeadAcknowledgedConsumer(uriInfo, consumerId);
    }
@@ -350,7 +350,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    public Response headAcknowledgedConsumer(@PathParam("consumer-id") String consumerId,
                                             @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
 
       return internalHeadAcknowledgedConsumer(uriInfo, consumerId);
    }
@@ -461,7 +461,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    @DELETE
    public void deleteAckSubscription(@Context UriInfo uriInfo, @PathParam("subscription-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       internalDeleteSubscription(consumerId);
    }
@@ -470,7 +470,7 @@ public class SubscriptionsResource implements TimeoutTask.Callback
    @DELETE
    public void deleteSubscription(@Context UriInfo uriInfo, @PathParam("subscription-id") String consumerId)
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       internalDeleteSubscription(consumerId);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicDestinationsResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicDestinationsResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicDestinationsResource.java
index 8a0168a..80499fd 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicDestinationsResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicDestinationsResource.java
@@ -28,11 +28,11 @@ import java.util.concurrent.ConcurrentHashMap;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQTopic;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQTopic;
 import org.apache.activemq.jms.server.config.TopicConfiguration;
 import org.apache.activemq.jms.server.impl.JMSServerConfigParserImpl;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.DestinationSettings;
 import org.apache.activemq.rest.queue.PostMessage;
 import org.apache.activemq.rest.queue.PostMessageDupsOk;
@@ -55,17 +55,17 @@ public class TopicDestinationsResource
    }
 
    @POST
-   @Consumes("application/hornetq.jms.topic+xml")
+   @Consumes("application/activemq.jms.topic+xml")
    public Response createJmsQueue(@Context UriInfo uriInfo, Document document)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       try
       {
          JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
          TopicConfiguration topic = parser.parseTopicConfiguration(document.getDocumentElement());
-         HornetQTopic hqTopic = HornetQDestination.createTopic(topic.getName());
-         String topicName = hqTopic.getAddress();
+         ActiveMQTopic activeMQTopic = ActiveMQDestination.createTopic(topic.getName());
+         String topicName = activeMQTopic.getAddress();
          ClientSession session = manager.getSessionFactory().createSession(false, false, false);
          try
          {
@@ -95,7 +95,7 @@ public class TopicDestinationsResource
          {
             for (String binding : topic.getBindings())
             {
-               manager.getRegistry().bind(binding, hqTopic);
+               manager.getRegistry().bind(binding, activeMQTopic);
             }
          }
          URI uri = uriInfo.getRequestUriBuilder().path(topicName).build();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicResource.java
index 61c2481..c5ef33f 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/topic/TopicResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.core.UriInfo;
 
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.queue.DestinationResource;
 import org.apache.activemq.rest.queue.PostMessage;
 
@@ -53,7 +53,7 @@ public class TopicResource extends DestinationResource
    @Produces("application/xml")
    public Response get(@Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       StringBuilder msg = new StringBuilder();
       msg.append("<topic>")
@@ -77,7 +77,7 @@ public class TopicResource extends DestinationResource
    @Produces("application/xml")
    public Response head(@Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
 
       Response.ResponseBuilder builder = Response.ok();
       setSenderLink(builder, uriInfo);
@@ -176,7 +176,7 @@ public class TopicResource extends DestinationResource
    @DELETE
    public void deleteTopic(@Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       topicDestinationsResource.getTopics().remove(destination);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/util/HttpMessageHelper.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/util/HttpMessageHelper.java b/activemq-rest/src/main/java/org/apache/activemq/rest/util/HttpMessageHelper.java
index 920df23..0d12f3c 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/util/HttpMessageHelper.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/util/HttpMessageHelper.java
@@ -14,7 +14,7 @@ package org.apache.activemq.rest.util;
 
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.HttpHeaderProperty;
 import org.jboss.resteasy.client.ClientRequest;
 
@@ -93,12 +93,12 @@ public class HttpMessageHelper
          String value = message.getStringProperty(k);
 
          request.header(headerName, value);
-         HornetQRestLogger.LOGGER.debug("Examining " + headerName + ": " + value);
+         ActiveMQRestLogger.LOGGER.debug("Examining " + headerName + ": " + value);
          // override default content type if it is set as a message property
          if (headerName.equalsIgnoreCase("content-type"))
          {
             contentType = value;
-            HornetQRestLogger.LOGGER.debug("Using contentType: " + contentType);
+            ActiveMQRestLogger.LOGGER.debug("Using contentType: " + contentType);
          }
       }
       int size = message.getBodySize();
@@ -109,12 +109,12 @@ public class HttpMessageHelper
          {
             byte[] body = new byte[size];
             message.getBodyBuffer().readBytes(body);
-            HornetQRestLogger.LOGGER.debug("Building Message from HTTP message");
+            ActiveMQRestLogger.LOGGER.debug("Building Message from HTTP message");
             request.body(contentType, body);
          }
          else
          {
-            // assume posted as a JMS or HornetQ object message
+            // assume posted as a JMS or ActiveMQ object message
             size = message.getBodyBuffer().readInt();
             byte[] body = new byte[size];
             message.getBodyBuffer().readBytes(body);
@@ -124,7 +124,7 @@ public class HttpMessageHelper
             {
                ObjectInputStream ois = new ObjectInputStream(bais);
                obj = ois.readObject();
-               HornetQRestLogger.LOGGER.debug("**** Building Message from object: " + obj.toString());
+               ActiveMQRestLogger.LOGGER.debug("**** Building Message from object: " + obj.toString());
                request.body(contentType, obj);
             }
             catch (Exception e)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/util/TimeoutTask.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/util/TimeoutTask.java b/activemq-rest/src/main/java/org/apache/activemq/rest/util/TimeoutTask.java
index d371aa2..363a9cf 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/util/TimeoutTask.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/util/TimeoutTask.java
@@ -19,7 +19,7 @@ import java.util.Map;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 
 /**
  * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -153,7 +153,7 @@ public class TimeoutTask implements Runnable
                   liveConsumers += 1;
                }
             }
-            HornetQRestLogger.LOGGER.debug("Finished testing callbacks for timeouts in " +
+            ActiveMQRestLogger.LOGGER.debug("Finished testing callbacks for timeouts in " +
                                               (System.currentTimeMillis() - startTime) + "ms. " +
                                               "(Live: " + liveConsumers + ", Expired: " + deadConsumers + ")");
 
@@ -163,7 +163,7 @@ public class TimeoutTask implements Runnable
             {
                if (pendingCallbacks.size() > 0)
                {
-                  HornetQRestLogger.LOGGER.debug("Found " + pendingCallbacks.size() + " callbacks to add.");
+                  ActiveMQRestLogger.LOGGER.debug("Found " + pendingCallbacks.size() + " callbacks to add.");
                   callbacks.putAll(pendingCallbacks);
                   pendingCallbacks.clear();
                }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/CreateDestinationTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/CreateDestinationTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/CreateDestinationTest.java
index d0d0e60..5692f9c 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/CreateDestinationTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/CreateDestinationTest.java
@@ -38,7 +38,7 @@ public class CreateDestinationTest extends MessageTestBase
    {
       String queueConfig = "<queue name=\"testQueue\"><durable>true</durable></queue>";
       ClientRequest create = new ClientRequest(TestPortProvider.generateURL("/queues"));
-      ClientResponse cRes = create.body("application/hornetq.jms.queue+xml", queueConfig).post();
+      ClientResponse cRes = create.body("application/activemq.jms.queue+xml", queueConfig).post();
       cRes.releaseConnection();
       Assert.assertEquals(201, cRes.getStatus());
       System.out.println("Location: " + cRes.getLocationLink());
@@ -93,7 +93,7 @@ public class CreateDestinationTest extends MessageTestBase
    {
       String queueConfig = "<topic name=\"testTopic\"></topic>";
       ClientRequest create = new ClientRequest(TestPortProvider.generateURL("/topics"));
-      ClientResponse cRes = create.body("application/hornetq.jms.topic+xml", queueConfig).post();
+      ClientResponse cRes = create.body("application/activemq.jms.topic+xml", queueConfig).post();
       cRes.releaseConnection();
       Assert.assertEquals(201, cRes.getStatus());
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/Embedded.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/Embedded.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/Embedded.java
index e31c090..f3fdcb4 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/Embedded.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/Embedded.java
@@ -16,8 +16,8 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServers;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServers;
 import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer;
 import org.apache.activemq.rest.MessageServiceConfiguration;
 import org.apache.activemq.rest.MessageServiceManager;
@@ -31,7 +31,7 @@ public class Embedded
 {
    protected MessageServiceManager manager = new MessageServiceManager();
    protected MessageServiceConfiguration config = new MessageServiceConfiguration();
-   protected HornetQServer hornetqServer;
+   protected ActiveMQServer activeMQServer;
    protected TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
 
    public Embedded()
@@ -53,14 +53,14 @@ public class Embedded
       this.config = config;
    }
 
-   public HornetQServer getHornetqServer()
+   public ActiveMQServer getActiveMQServer()
    {
-      return hornetqServer;
+      return activeMQServer;
    }
 
-   public void setHornetqServer(HornetQServer hornetqServer)
+   public void setActiveMQServer(ActiveMQServer activeMQServer)
    {
-      this.hornetqServer = hornetqServer;
+      this.activeMQServer = activeMQServer;
    }
 
    public TJWSEmbeddedJaxrsServer getJaxrsServer()
@@ -76,15 +76,15 @@ public class Embedded
    public void start() throws Exception
    {
       System.out.println("\nStarting Embedded");
-      if (hornetqServer == null)
+      if (activeMQServer == null)
       {
          Configuration configuration = new ConfigurationImpl()
             .setPersistenceEnabled(false)
             .setSecurityEnabled(false)
             .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-         hornetqServer = HornetQServers.newHornetQServer(configuration);
-         hornetqServer.start();
+         activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
+         activeMQServer.start();
       }
       tjws.start();
       manager.setConfiguration(config);
@@ -99,6 +99,6 @@ public class Embedded
       System.out.println("\nStopping Embedded");
       manager.stop();
       tjws.stop();
-      hornetqServer.stop();
+      activeMQServer.stop();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/EmbeddedTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/EmbeddedTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/EmbeddedTest.java
index b2421f7..5b210f3 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/EmbeddedTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/EmbeddedTest.java
@@ -21,7 +21,7 @@ import javax.jms.Session;
 import java.io.Serializable;
 
 import org.apache.activemq.rest.HttpHeaderProperty;
-import org.apache.activemq.rest.integration.EmbeddedRestHornetQJMS;
+import org.apache.activemq.rest.integration.EmbeddedRestActiveMQJMS;
 import org.apache.activemq.spi.core.naming.BindingRegistry;
 import org.jboss.resteasy.client.ClientRequest;
 import org.jboss.resteasy.client.ClientResponse;
@@ -37,13 +37,13 @@ import org.junit.Test;
  */
 public class EmbeddedTest
 {
-   public static EmbeddedRestHornetQJMS server;
+   public static EmbeddedRestActiveMQJMS server;
 
    @BeforeClass
    public static void startEmbedded() throws Exception
    {
-      server = new EmbeddedRestHornetQJMS();
-      server.getManager().setConfigResourcePath("hornetq-rest.xml");
+      server = new EmbeddedRestActiveMQJMS();
+      server.getManager().setConfigResourcePath("activemq-rest.xml");
       server.start();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/FindDestinationTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/FindDestinationTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/FindDestinationTest.java
index d4b300b..7582daf 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/FindDestinationTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/FindDestinationTest.java
@@ -29,7 +29,7 @@ public class FindDestinationTest extends MessageTestBase
    public void testFindQueue() throws Exception
    {
       String testName = "testFindQueue";
-      server.getHornetqServer().createQueue(new SimpleString(testName), new SimpleString(testName), null, false, false);
+      server.getActiveMQServer().createQueue(new SimpleString(testName), new SimpleString(testName), null, false, false);
 
       ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/queues/" + testName));
 
@@ -60,7 +60,7 @@ public class FindDestinationTest extends MessageTestBase
    @Test
    public void testFindTopic() throws Exception
    {
-      server.getHornetqServer().createQueue(new SimpleString("testTopic"), new SimpleString("testTopic"), null, false, false);
+      server.getActiveMQServer().createQueue(new SimpleString("testTopic"), new SimpleString("testTopic"), null, false, false);
       ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/topics/testTopic"));
 
       ClientResponse<?> response = request.head();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/JMSTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/JMSTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/JMSTest.java
index 972078d..635365b 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/JMSTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/JMSTest.java
@@ -26,8 +26,8 @@ import java.io.Serializable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQJMSConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQJMSConnectionFactory;
 import org.apache.activemq.rest.HttpHeaderProperty;
 import org.apache.activemq.rest.Jms;
 import org.apache.activemq.rest.queue.QueueDeployment;
@@ -51,7 +51,7 @@ public class JMSTest extends MessageTestBase
    @BeforeClass
    public static void setup() throws Exception
    {
-      connectionFactory = new HornetQJMSConnectionFactory(manager.getQueueManager().getServerLocator());
+      connectionFactory = new ActiveMQJMSConnectionFactory(manager.getQueueManager().getServerLocator());
    }
 
    @XmlRootElement
@@ -118,7 +118,7 @@ public class JMSTest extends MessageTestBase
 
    public static Destination createDestination(String dest)
    {
-      HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(dest);
+      ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress(dest);
       System.out.println("SimpleAddress: " + destination.getSimpleAddress());
       return destination;
    }
@@ -172,7 +172,7 @@ public class JMSTest extends MessageTestBase
    @Test
    public void testJmsConsumer() throws Exception
    {
-      String queueName = HornetQDestination.createQueueAddressFromName("testQueue2").toString();
+      String queueName = ActiveMQDestination.createQueueAddressFromName("testQueue2").toString();
       System.out.println("Queue name: " + queueName);
       QueueDeployment deployment = new QueueDeployment();
       deployment.setDuplicatesAllowed(true);
@@ -223,7 +223,7 @@ public class JMSTest extends MessageTestBase
    @Test
    public void testJmsProducer() throws Exception
    {
-      String queueName = HornetQDestination.createQueueAddressFromName("testQueue").toString();
+      String queueName = ActiveMQDestination.createQueueAddressFromName("testQueue").toString();
       System.out.println("Queue name: " + queueName);
       QueueDeployment deployment = new QueueDeployment();
       deployment.setDuplicatesAllowed(true);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/MessageTestBase.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/MessageTestBase.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/MessageTestBase.java
index 942fae7..74cb6a8 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/MessageTestBase.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/MessageTestBase.java
@@ -46,7 +46,7 @@ public class MessageTestBase
    }
 
    @BeforeClass
-   public static void setupHornetQServerAndManager() throws Exception
+   public static void setupActiveMQServerAndManager() throws Exception
    {
       server = new Embedded();
       server.start();
@@ -54,7 +54,7 @@ public class MessageTestBase
    }
 
    @AfterClass
-   public static void shutdownHornetqServerAndManager() throws Exception
+   public static void shutdownActiveMQServerAndManager() throws Exception
    {
       manager = null;
       server.stop();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushQueueConsumerTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushQueueConsumerTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushQueueConsumerTest.java
index 3ab1acc..ec47d3b 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushQueueConsumerTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushQueueConsumerTest.java
@@ -16,8 +16,8 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServers;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServers;
 import org.apache.activemq.rest.MessageServiceManager;
 import org.apache.activemq.rest.queue.QueueDeployment;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
@@ -42,7 +42,7 @@ public class PersistentPushQueueConsumerTest
 {
    public static MessageServiceManager manager;
    protected static ResteasyDeployment deployment;
-   public static HornetQServer hornetqServer;
+   public static ActiveMQServer activeMQServer;
 
    public static void startup() throws Exception
    {
@@ -51,8 +51,8 @@ public class PersistentPushQueueConsumerTest
          .setSecurityEnabled(false)
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-      hornetqServer = HornetQServers.newHornetQServer(configuration);
-      hornetqServer.start();
+      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
+      activeMQServer.start();
 
       deployment = EmbeddedContainer.start();
       manager = new MessageServiceManager();
@@ -67,8 +67,8 @@ public class PersistentPushQueueConsumerTest
       manager = null;
       EmbeddedContainer.stop();
       deployment = null;
-      hornetqServer.stop();
-      hornetqServer = null;
+      activeMQServer.stop();
+      activeMQServer = null;
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushTopicConsumerTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushTopicConsumerTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushTopicConsumerTest.java
index 091c0a3..cae94e6 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushTopicConsumerTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PersistentPushTopicConsumerTest.java
@@ -24,8 +24,8 @@ import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServers;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServers;
 import org.apache.activemq.rest.MessageServiceManager;
 import org.apache.activemq.rest.queue.push.xml.XmlLink;
 import org.apache.activemq.rest.topic.PushTopicRegistration;
@@ -50,7 +50,7 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL;
  */
 public class PersistentPushTopicConsumerTest
 {
-   public static HornetQServer server;
+   public static ActiveMQServer server;
    public static MessageServiceManager manager;
    protected static ResteasyDeployment deployment;
 
@@ -62,7 +62,7 @@ public class PersistentPushTopicConsumerTest
          .setSecurityEnabled(false)
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-      server = HornetQServers.newHornetQServer(configuration);
+      server = ActiveMQServers.newActiveMQServer(configuration);
       server.start();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushQueueConsumerTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushQueueConsumerTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushQueueConsumerTest.java
index 05ad32e..23d03ff 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushQueueConsumerTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushQueueConsumerTest.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.rest.test;
 
 import org.apache.activemq.rest.queue.QueueDeployment;
-import org.apache.activemq.rest.queue.push.HornetQPushStrategy;
+import org.apache.activemq.rest.queue.push.ActiveMQPushStrategy;
 import org.apache.activemq.rest.queue.push.xml.PushRegistration;
 import org.apache.activemq.rest.queue.push.xml.XmlLink;
 import org.apache.activemq.rest.util.Constants;
@@ -347,7 +347,7 @@ public class PushQueueConsumerTest extends MessageTestBase
       if (pushRegistrationType == PushRegistrationType.CLASS)
       {
          target.setHref(generateURL(Util.getUrlPath(queueToPushTo)));
-         target.setClassName(HornetQPushStrategy.class.getName());
+         target.setClassName(ActiveMQPushStrategy.class.getName());
       }
       else if (pushRegistrationType == PushRegistrationType.BRIDGE)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushTopicConsumerTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushTopicConsumerTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushTopicConsumerTest.java
index b8c483b..ff9251d 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushTopicConsumerTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/PushTopicConsumerTest.java
@@ -17,7 +17,7 @@ import javax.ws.rs.Path;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.rest.queue.QueueDeployment;
-import org.apache.activemq.rest.queue.push.HornetQPushStrategy;
+import org.apache.activemq.rest.queue.push.ActiveMQPushStrategy;
 import org.apache.activemq.rest.queue.push.xml.XmlLink;
 import org.apache.activemq.rest.topic.PushTopicRegistration;
 import org.apache.activemq.rest.topic.TopicDeployment;
@@ -146,7 +146,7 @@ public class PushTopicConsumerTest extends MessageTestBase
       reg.setDurable(false);
       XmlLink target = new XmlLink();
       target.setHref(generateURL("/queues/testClassForwardQueue"));
-      target.setClassName(HornetQPushStrategy.class.getName());
+      target.setClassName(ActiveMQPushStrategy.class.getName());
       reg.setTarget(target);
       response = pushSubscriptions.request().body("application/xml", reg).post();
       Assert.assertEquals(201, response.getStatus());

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/RawAckTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/RawAckTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/RawAckTest.java
index 901f1c6..9560f47 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/RawAckTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/RawAckTest.java
@@ -28,22 +28,22 @@ import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServers;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServers;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
- * Play with HornetQ
+ * Play with ActiveMQ
  *
  * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
  * @version $Revision: 1 $
  */
 public class RawAckTest
 {
-   protected static HornetQServer hornetqServer;
+   protected static ActiveMQServer activeMQServer;
    static ServerLocator serverLocator;
    static ClientSessionFactory sessionFactory;
    static ClientSessionFactory consumerSessionFactory;
@@ -58,8 +58,8 @@ public class RawAckTest
          .setSecurityEnabled(false)
          .addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
 
-      hornetqServer = HornetQServers.newHornetQServer(configuration);
-      hornetqServer.start();
+      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
+      activeMQServer.start();
 
       HashMap<String, Object> transportConfig = new HashMap<String, Object>();
 
@@ -67,7 +67,7 @@ public class RawAckTest
       sessionFactory = serverLocator.createSessionFactory();
       consumerSessionFactory = serverLocator.createSessionFactory();
 
-      hornetqServer.createQueue(new SimpleString("testQueue"), new SimpleString("testQueue"), null, false, false);
+      activeMQServer.createQueue(new SimpleString("testQueue"), new SimpleString("testQueue"), null, false, false);
       session = sessionFactory.createSession(true, true);
       producer = session.createProducer("testQueue");
       session.start();
@@ -77,7 +77,7 @@ public class RawAckTest
    public static void shutdown() throws Exception
    {
       serverLocator.close();
-      hornetqServer.stop();
+      activeMQServer.stop();
    }
 
    static boolean passed = false;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/SelectorTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/SelectorTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/SelectorTest.java
index 82dc664..ebe49dc 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/SelectorTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/SelectorTest.java
@@ -23,8 +23,8 @@ import javax.ws.rs.Path;
 import javax.xml.bind.annotation.XmlRootElement;
 import java.io.Serializable;
 
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQJMSConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQJMSConnectionFactory;
 import org.apache.activemq.rest.HttpHeaderProperty;
 import org.apache.activemq.rest.queue.push.xml.XmlLink;
 import org.apache.activemq.rest.topic.PushTopicRegistration;
@@ -45,12 +45,12 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL;
 public class SelectorTest extends MessageTestBase
 {
    public static ConnectionFactory connectionFactory;
-   public static String topicName = HornetQDestination.createQueueAddressFromName("testTopic").toString();
+   public static String topicName = ActiveMQDestination.createQueueAddressFromName("testTopic").toString();
 
    @BeforeClass
    public static void setup() throws Exception
    {
-      connectionFactory = new HornetQJMSConnectionFactory(manager.getQueueManager().getServerLocator());
+      connectionFactory = new ActiveMQJMSConnectionFactory(manager.getQueueManager().getServerLocator());
       System.out.println("Queue name: " + topicName);
       TopicDeployment deployment = new TopicDeployment();
       deployment.setDuplicatesAllowed(true);
@@ -131,7 +131,7 @@ public class SelectorTest extends MessageTestBase
 
    public static Destination createDestination(String dest)
    {
-      HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(dest);
+      ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress(dest);
       System.out.println("SimpleAddress: " + destination.getSimpleAddress());
       return destination;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/test/java/org/apache/activemq/rest/test/TransformTest.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/test/java/org/apache/activemq/rest/test/TransformTest.java b/activemq-rest/src/test/java/org/apache/activemq/rest/test/TransformTest.java
index 465ba30..737403e 100644
--- a/activemq-rest/src/test/java/org/apache/activemq/rest/test/TransformTest.java
+++ b/activemq-rest/src/test/java/org/apache/activemq/rest/test/TransformTest.java
@@ -22,7 +22,7 @@ import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientProducer;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.MessageHandler;
-import org.apache.activemq.rest.Hornetq;
+import org.apache.activemq.rest.ActiveMQ;
 import org.apache.activemq.rest.queue.QueueDeployment;
 import org.jboss.resteasy.client.ClientRequest;
 import org.jboss.resteasy.client.ClientResponse;
@@ -109,9 +109,9 @@ public class TransformTest extends MessageTestBase
          ClientMessage message = session.createMessage(Message.OBJECT_TYPE, false);
          if (contentType == null)
          {
-            Hornetq.setEntity(message, object);
+            ActiveMQ.setEntity(message, object);
          }
-         else Hornetq.setEntity(message, object, contentType);
+         else ActiveMQ.setEntity(message, object, contentType);
          producer.send(message);
          session.start();
       }
@@ -203,7 +203,7 @@ public class TransformTest extends MessageTestBase
          System.out.println("onMessage!");
          try
          {
-            order = Hornetq.getEntity(clientMessage, Order.class);
+            order = ActiveMQ.getEntity(clientMessage, Order.class);
          }
          catch (Exception e)
          {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/BridgeConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/BridgeConfiguration.java b/activemq-server/src/main/java/org/apache/activemq/core/config/BridgeConfiguration.java
index 6b60332..d3d7ca8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/BridgeConfiguration.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/BridgeConfiguration.java
@@ -16,7 +16,7 @@ import java.io.Serializable;
 import java.util.List;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 
 /**
  * A BridgeConfiguration
@@ -42,9 +42,9 @@ public final class BridgeConfiguration implements Serializable
 
    private String transformerClassName = null;
 
-   private long retryInterval = HornetQClient.DEFAULT_RETRY_INTERVAL;
+   private long retryInterval = ActiveMQClient.DEFAULT_RETRY_INTERVAL;
 
-   private double retryIntervalMultiplier = HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
+   private double retryIntervalMultiplier = ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
 
    private int initialConnectAttempts = ActiveMQDefaultConfiguration.getDefaultBridgeInitialConnectAttempts();
 
@@ -54,23 +54,23 @@ public final class BridgeConfiguration implements Serializable
 
    private boolean useDuplicateDetection = ActiveMQDefaultConfiguration.isDefaultBridgeDuplicateDetection();
 
-   private int confirmationWindowSize = HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
+   private int confirmationWindowSize = ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
 
-   private long clientFailureCheckPeriod = HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
+   private long clientFailureCheckPeriod = ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 
    private String user = ActiveMQDefaultConfiguration.getDefaultClusterUser();
 
    private String password = ActiveMQDefaultConfiguration.getDefaultClusterPassword();
 
-   private long connectionTTL = HornetQClient.DEFAULT_CONNECTION_TTL;
+   private long connectionTTL = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 
-   private long maxRetryInterval = HornetQClient.DEFAULT_MAX_RETRY_INTERVAL;
+   private long maxRetryInterval = ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL;
 
-   private int minLargeMessageSize = HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
+   private int minLargeMessageSize = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
 
    // At this point this is only changed on testcases
    // The bridge shouldn't be sending blocking anyways
-   private long callTimeout = HornetQClient.DEFAULT_CALL_TIMEOUT;
+   private long callTimeout = ActiveMQClient.DEFAULT_CALL_TIMEOUT;
 
 
    public BridgeConfiguration()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/ClusterConnectionConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/ClusterConnectionConfiguration.java b/activemq-server/src/main/java/org/apache/activemq/core/config/ClusterConnectionConfiguration.java
index 7cfd8a2..16a5e84 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/ClusterConnectionConfiguration.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/ClusterConnectionConfiguration.java
@@ -17,7 +17,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 
 /**
  * A ClusterConnectionConfiguration
@@ -66,7 +66,7 @@ public final class ClusterConnectionConfiguration implements Serializable
 
    private boolean allowDirectConnectionsOnly = false;
 
-   private int minLargeMessageSize = HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
+   private int minLargeMessageSize = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
 
    private long clusterNotificationInterval = ActiveMQDefaultConfiguration.getDefaultClusterNotificationInterval();
 


[16/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQResourceAdapter.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQResourceAdapter.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQResourceAdapter.java
deleted file mode 100644
index 508c533..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQResourceAdapter.java
+++ /dev/null
@@ -1,2411 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.Session;
-import javax.resource.ResourceException;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.BootstrapContext;
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterInternalException;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.BroadcastEndpointFactoryConfiguration;
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.JGroupsBroadcastGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.UDPBroadcastGroupConfiguration;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.HornetQClient;
-import org.apache.activemq.api.jms.HornetQJMSClient;
-import org.apache.activemq.api.jms.JMSFactoryType;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.ra.inflow.HornetQActivation;
-import org.apache.activemq.ra.inflow.HornetQActivationSpec;
-import org.apache.activemq.ra.recovery.RecoveryManager;
-import org.apache.activemq.utils.SensitiveDataCodec;
-import org.jgroups.JChannel;
-
-/**
- * The resource adapter for HornetQ
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- */
-public class HornetQResourceAdapter implements ResourceAdapter, Serializable
-{
-   private static final long serialVersionUID = 4756893709825838770L;
-
-   /**
-    * The Name of the product that this resource adapter represents.
-    */
-   public static final String PRODUCT_NAME = "HornetQ";
-
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The bootstrap context
-    */
-   private BootstrapContext ctx;
-
-   /**
-    * The resource adapter properties
-    */
-   private final HornetQRAProperties raProperties;
-
-   /**
-    * The resource adapter properties before parsing
-    */
-   private String unparsedProperties;
-
-
-   /**
-    * The resource adapter connector classnames before parsing
-    */
-   private String unparsedConnectors;
-
-   /**
-    * Have the factory been configured
-    */
-   private final AtomicBoolean configured;
-
-   /**
-    * The activations by activation spec
-    */
-   private final Map<ActivationSpec, HornetQActivation> activations;
-
-   private HornetQConnectionFactory defaultHornetQConnectionFactory;
-
-   private HornetQConnectionFactory recoveryHornetQConnectionFactory;
-
-   private TransactionManager tm;
-
-   private String unparsedJndiParams;
-
-   private final RecoveryManager recoveryManager;
-
-   private boolean useAutoRecovery = true;
-
-   private final List<HornetQRAManagedConnectionFactory> managedConnectionFactories = new ArrayList<HornetQRAManagedConnectionFactory>();
-
-   private String entries;
-
-   /**
-    * Constructor
-    */
-   public HornetQResourceAdapter()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-
-      raProperties = new HornetQRAProperties();
-      configured = new AtomicBoolean(false);
-      activations = new ConcurrentHashMap<ActivationSpec, HornetQActivation>();
-      recoveryManager = new RecoveryManager();
-   }
-
-   public TransactionManager getTM()
-   {
-      return tm;
-   }
-
-   /**
-    * Endpoint activation
-    *
-    * @param endpointFactory The endpoint factory
-    * @param spec            The activation spec
-    * @throws ResourceException Thrown if an error occurs
-    */
-   public void endpointActivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec) throws ResourceException
-   {
-      if (spec == null)
-      {
-         throw HornetQRABundle.BUNDLE.noActivationSpec();
-      }
-      if (!configured.getAndSet(true))
-      {
-         try
-         {
-            setup();
-         }
-         catch (ActiveMQException e)
-         {
-            throw new ResourceException("Unable to create activation", e);
-         }
-      }
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("endpointActivation(" + endpointFactory + ", " + spec + ")");
-      }
-
-      HornetQActivation activation = new HornetQActivation(this, endpointFactory, (HornetQActivationSpec) spec);
-      activations.put(spec, activation);
-      activation.start();
-   }
-
-   /**
-    * Endpoint deactivation
-    *
-    * @param endpointFactory The endpoint factory
-    * @param spec            The activation spec
-    */
-   public void endpointDeactivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("endpointDeactivation(" + endpointFactory + ", " + spec + ")");
-      }
-
-      HornetQActivation activation = activations.remove(spec);
-      if (activation != null)
-      {
-         activation.stop();
-      }
-   }
-
-   /**
-    * Get XA resources
-    *
-    * @param specs The activation specs
-    * @return The XA resources
-    * @throws ResourceException Thrown if an error occurs or unsupported
-    */
-   public XAResource[] getXAResources(final ActivationSpec[] specs) throws ResourceException
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getXAResources(" + Arrays.toString(specs) + ")");
-      }
-
-      if (useAutoRecovery)
-      {
-         // let the TM handle the recovery
-         return null;
-      }
-      else
-      {
-         List<XAResource> xaresources = new ArrayList<XAResource>();
-         for (ActivationSpec spec : specs)
-         {
-            HornetQActivation activation = activations.get(spec);
-            if (activation != null)
-            {
-               xaresources.addAll(activation.getXAResources());
-            }
-         }
-         return xaresources.toArray(new XAResource[xaresources.size()]);
-      }
-   }
-
-   /**
-    * Start
-    *
-    * @param ctx The bootstrap context
-    * @throws ResourceAdapterInternalException Thrown if an error occurs
-    */
-   public void start(final BootstrapContext ctx) throws ResourceAdapterInternalException
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start(" + ctx + ")");
-      }
-
-      locateTM();
-
-      recoveryManager.start(useAutoRecovery);
-
-      this.ctx = ctx;
-
-      if (!configured.getAndSet(true))
-      {
-         try
-         {
-            setup();
-         }
-         catch (ActiveMQException e)
-         {
-            throw new ResourceAdapterInternalException("Unable to create activation", e);
-         }
-      }
-
-      HornetQRALogger.LOGGER.info("HornetQ resource adaptor started");
-   }
-
-   /**
-    * Stop
-    */
-   public void stop()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("stop()");
-      }
-
-      for (Map.Entry<ActivationSpec, HornetQActivation> entry : activations.entrySet())
-      {
-         try
-         {
-            entry.getValue().stop();
-         }
-         catch (Exception ignored)
-         {
-            HornetQRALogger.LOGGER.debug("Ignored", ignored);
-         }
-      }
-
-      activations.clear();
-
-      for (HornetQRAManagedConnectionFactory managedConnectionFactory : managedConnectionFactories)
-      {
-         managedConnectionFactory.stop();
-      }
-
-      managedConnectionFactories.clear();
-
-      if (defaultHornetQConnectionFactory != null)
-      {
-         defaultHornetQConnectionFactory.close();
-      }
-
-      if (recoveryHornetQConnectionFactory != null)
-      {
-         recoveryHornetQConnectionFactory.close();
-      }
-
-      recoveryManager.stop();
-
-      HornetQRALogger.LOGGER.raStopped();
-   }
-
-   public void setUseAutoRecovery(Boolean useAutoRecovery)
-   {
-      this.useAutoRecovery = useAutoRecovery;
-   }
-
-   public Boolean isUseAutoRecovery()
-   {
-      return this.useAutoRecovery;
-   }
-
-   public Boolean isUseMaskedPassword()
-   {
-      return this.raProperties.isUseMaskedPassword();
-   }
-
-   public void setUseMaskedPassword(Boolean useMaskedPassword)
-   {
-      this.raProperties.setUseMaskedPassword(useMaskedPassword);
-   }
-
-   public void setPasswordCodec(String passwordCodec)
-   {
-      this.raProperties.setPasswordCodec(passwordCodec);
-   }
-
-   public String getPasswordCodec()
-   {
-      return this.raProperties.getPasswordCodec();
-   }
-
-   public void setConnectorClassName(final String connectorClassName)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setTransportType(" + connectorClassName + ")");
-      }
-      unparsedConnectors = connectorClassName;
-
-      raProperties.setParsedConnectorClassNames(HornetQRaUtils.parseConnectorConnectorConfig(connectorClassName));
-   }
-
-   public String getConnectorClassName()
-   {
-      return unparsedConnectors;
-   }
-
-   public String getConnectionParameters()
-   {
-      return unparsedProperties;
-   }
-
-   public void setConnectionParameters(final String config)
-   {
-      if (config != null)
-      {
-         this.unparsedProperties = config;
-         raProperties.setParsedConnectionParameters(HornetQRaUtils.parseConfig(config));
-      }
-   }
-
-
-   public Boolean getHA()
-   {
-      return raProperties.isHA();
-   }
-
-   public void setHA(final Boolean ha)
-   {
-      this.raProperties.setHA(ha);
-   }
-
-   public String getEntries()
-   {
-      return entries;
-   }
-
-   public String getJndiName()
-   {
-      if (!(entries == null || entries.isEmpty()))
-      {
-         Matcher m = Pattern.compile("\"(.*?)\"").matcher(entries);
-         if (m.find())
-         {
-            return m.group(1);
-         }
-      }
-      return null;
-   }
-
-   public void setEntries(String entries)
-   {
-      this.entries = entries;
-   }
-
-   /**
-    * Get the discovery group name
-    *
-    * @return The value
-    */
-   public String getDiscoveryAddress()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDiscoveryGroupAddress()");
-      }
-
-      return raProperties.getDiscoveryAddress();
-   }
-
-   public void setJgroupsFile(String jgroupsFile)
-   {
-      raProperties.setJgroupsFile(jgroupsFile);
-   }
-
-   public String getJgroupsFile()
-   {
-      return raProperties.getJgroupsFile();
-   }
-
-   public String getJgroupsChannelName()
-   {
-      return raProperties.getJgroupsChannelName();
-   }
-
-   public void setJgroupsChannelName(String jgroupsChannelName)
-   {
-      raProperties.setJgroupsChannelName(jgroupsChannelName);
-   }
-
-   /**
-    * Set the discovery group name
-    *
-    * @param dgn The value
-    */
-   public void setDiscoveryAddress(final String dgn)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDiscoveryGroupAddress(" + dgn + ")");
-      }
-
-      raProperties.setDiscoveryAddress(dgn);
-   }
-
-   /**
-    * Get the discovery group port
-    *
-    * @return The value
-    */
-   public Integer getDiscoveryPort()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDiscoveryGroupPort()");
-      }
-
-      return raProperties.getDiscoveryPort();
-   }
-
-   /**
-    * set the discovery local bind address
-    *
-    * @param discoveryLocalBindAddress the address value
-    */
-   public void setDiscoveryLocalBindAddress(final String discoveryLocalBindAddress)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
-      }
-
-      raProperties.setDiscoveryLocalBindAddress(discoveryLocalBindAddress);
-   }
-
-   /**
-    * get the discovery local bind address
-    *
-    * @return the address value
-    */
-   public String getDiscoveryLocalBindAddress()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDiscoveryLocalBindAddress()");
-      }
-
-      return raProperties.getDiscoveryLocalBindAddress();
-   }
-
-   /**
-    * Set the discovery group port
-    *
-    * @param dgp The value
-    */
-   public void setDiscoveryPort(final Integer dgp)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDiscoveryGroupPort(" + dgp + ")");
-      }
-
-      raProperties.setDiscoveryPort(dgp);
-   }
-
-   /**
-    * Get discovery refresh timeout
-    *
-    * @return The value
-    */
-   public Long getDiscoveryRefreshTimeout()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDiscoveryRefreshTimeout()");
-      }
-
-      return raProperties.getDiscoveryRefreshTimeout();
-   }
-
-   /**
-    * Set discovery refresh timeout
-    *
-    * @param discoveryRefreshTimeout The value
-    */
-   public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
-      }
-
-      raProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
-   }
-
-   /**
-    * Get discovery initial wait timeout
-    *
-    * @return The value
-    */
-   public Long getDiscoveryInitialWaitTimeout()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDiscoveryInitialWaitTimeout()");
-      }
-
-      return raProperties.getDiscoveryInitialWaitTimeout();
-   }
-
-   /**
-    * Set discovery initial wait timeout
-    *
-    * @param discoveryInitialWaitTimeout The value
-    */
-   public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
-      }
-
-      raProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
-   }
-
-   /**
-    * Get client failure check period
-    *
-    * @return The value
-    */
-   public Long getClientFailureCheckPeriod()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getClientFailureCheckPeriod()");
-      }
-
-      return raProperties.getClientFailureCheckPeriod();
-   }
-
-   /**
-    * Set client failure check period
-    *
-    * @param clientFailureCheckPeriod The value
-    */
-   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
-      }
-
-      raProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
-   }
-
-   /**
-    * Get connection TTL
-    *
-    * @return The value
-    */
-   public Long getConnectionTTL()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConnectionTTL()");
-      }
-
-      return raProperties.getConnectionTTL();
-   }
-
-   /**
-    * Set connection TTL
-    *
-    * @param connectionTTL The value
-    */
-   public void setConnectionTTL(final Long connectionTTL)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConnectionTTL(" + connectionTTL + ")");
-      }
-
-      raProperties.setConnectionTTL(connectionTTL);
-   }
-
-   /**
-    * Get cacheLargeMessagesClient
-    *
-    * @return The value
-    */
-   public Boolean isCacheLargeMessagesClient()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isCacheLargeMessagesClient()");
-      }
-
-      return raProperties.isCacheLargeMessagesClient();
-   }
-
-   /**
-    * Set cacheLargeMessagesClient
-    *
-    * @param cacheLargeMessagesClient The value
-    */
-   public void setCacheLargeMessagesClient(final Boolean cacheLargeMessagesClient)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setCacheLargeMessagesClient(" + cacheLargeMessagesClient + ")");
-      }
-
-      raProperties.setCacheLargeMessagesClient(cacheLargeMessagesClient);
-   }
-
-   /**
-    * Get compressLargeMessage
-    *
-    * @return The value
-    */
-   public Boolean isCompressLargeMessage()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isCompressLargeMessage()");
-      }
-
-      return raProperties.isCompressLargeMessage();
-   }
-
-   /**
-    * Set failoverOnInitialConnection
-    *
-    * @param failoverOnInitialConnection The value
-    */
-   public void setFailoverOnInitialConnection(final Boolean failoverOnInitialConnection)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFailoverOnInitialConnection(" + failoverOnInitialConnection + ")");
-      }
-
-      raProperties.setFailoverOnInitialConnection(failoverOnInitialConnection);
-   }
-
-   /**
-    * Get isFailoverOnInitialConnection
-    *
-    * @return The value
-    */
-   public Boolean isFailoverOnInitialConnection()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isFailoverOnInitialConnection()");
-      }
-
-      return raProperties.isFailoverOnInitialConnection();
-   }
-
-   /**
-    * Set compressLargeMessage
-    *
-    * @param compressLargeMessage The value
-    */
-   public void setCompressLargeMessage(final Boolean compressLargeMessage)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setCompressLargeMessage(" + compressLargeMessage + ")");
-      }
-
-      raProperties.setCompressLargeMessage(compressLargeMessage);
-   }
-
-   /**
-    * Get call timeout
-    *
-    * @return The value
-    */
-   public Long getCallTimeout()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getCallTimeout()");
-      }
-
-      return raProperties.getCallTimeout();
-   }
-
-   /**
-    * Set call timeout
-    *
-    * @param callTimeout The value
-    */
-   public void setCallTimeout(final Long callTimeout)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setCallTimeout(" + callTimeout + ")");
-      }
-
-      raProperties.setCallTimeout(callTimeout);
-   }
-
-   /**
-    * Get call failover timeout
-    *
-    * @return The value
-    */
-   public Long getCallFailoverTimeout()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getCallFailoverTimeout()");
-      }
-
-      return raProperties.getCallFailoverTimeout();
-   }
-
-   /**
-    * Set call failover timeout
-    *
-    * @param callFailoverTimeout The value
-    */
-   public void setCallFailoverTimeout(final Long callFailoverTimeout)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")");
-      }
-
-      raProperties.setCallFailoverTimeout(callFailoverTimeout);
-   }
-
-   /**
-    * Get dups ok batch size
-    *
-    * @return The value
-    */
-   public Integer getDupsOKBatchSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDupsOKBatchSize()");
-      }
-
-      return raProperties.getDupsOKBatchSize();
-   }
-
-   /**
-    * Set dups ok batch size
-    *
-    * @param dupsOKBatchSize The value
-    */
-   public void setDupsOKBatchSize(final Integer dupsOKBatchSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
-      }
-
-      raProperties.setDupsOKBatchSize(dupsOKBatchSize);
-   }
-
-   /**
-    * Get transaction batch size
-    *
-    * @return The value
-    */
-   public Integer getTransactionBatchSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTransactionBatchSize()");
-      }
-
-      return raProperties.getTransactionBatchSize();
-   }
-
-   /**
-    * Set transaction batch size
-    *
-    * @param transactionBatchSize The value
-    */
-   public void setTransactionBatchSize(final Integer transactionBatchSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
-      }
-
-      raProperties.setTransactionBatchSize(transactionBatchSize);
-   }
-
-   /**
-    * Get consumer window size
-    *
-    * @return The value
-    */
-   public Integer getConsumerWindowSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConsumerWindowSize()");
-      }
-
-      return raProperties.getConsumerWindowSize();
-   }
-
-   /**
-    * Set consumer window size
-    *
-    * @param consumerWindowSize The value
-    */
-   public void setConsumerWindowSize(final Integer consumerWindowSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
-      }
-
-      raProperties.setConsumerWindowSize(consumerWindowSize);
-   }
-
-   /**
-    * Get consumer max rate
-    *
-    * @return The value
-    */
-   public Integer getConsumerMaxRate()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConsumerMaxRate()");
-      }
-
-      return raProperties.getConsumerMaxRate();
-   }
-
-   /**
-    * Set consumer max rate
-    *
-    * @param consumerMaxRate The value
-    */
-   public void setConsumerMaxRate(final Integer consumerMaxRate)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
-      }
-
-      raProperties.setConsumerMaxRate(consumerMaxRate);
-   }
-
-   /**
-    * Get confirmation window size
-    *
-    * @return The value
-    */
-   public Integer getConfirmationWindowSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConfirmationWindowSize()");
-      }
-
-      return raProperties.getConfirmationWindowSize();
-   }
-
-   /**
-    * Set confirmation window size
-    *
-    * @param confirmationWindowSize The value
-    */
-   public void setConfirmationWindowSize(final Integer confirmationWindowSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")");
-      }
-
-      raProperties.setConfirmationWindowSize(confirmationWindowSize);
-   }
-
-   /**
-    * Get producer max rate
-    *
-    * @return The value
-    */
-   public Integer getProducerMaxRate()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProducerMaxRate()");
-      }
-
-      return raProperties.getProducerMaxRate();
-   }
-
-   /**
-    * Set producer max rate
-    *
-    * @param producerMaxRate The value
-    */
-   public void setProducerMaxRate(final Integer producerMaxRate)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setProducerMaxRate(" + producerMaxRate + ")");
-      }
-
-      raProperties.setProducerMaxRate(producerMaxRate);
-   }
-
-   /**
-    * Get producer window size
-    *
-    * @return The value
-    */
-   public Integer getProducerWindowSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProducerWindowSize()");
-      }
-
-      return raProperties.getProducerWindowSize();
-   }
-
-   /**
-    * Set producer window size
-    *
-    * @param producerWindowSize The value
-    */
-   public void setProducerWindowSize(final Integer producerWindowSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setProducerWindowSize(" + producerWindowSize + ")");
-      }
-
-      raProperties.setProducerWindowSize(producerWindowSize);
-   }
-
-   /**
-    * Get min large message size
-    *
-    * @return The value
-    */
-   public Integer getMinLargeMessageSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMinLargeMessageSize()");
-      }
-
-      return raProperties.getMinLargeMessageSize();
-   }
-
-   /**
-    * Set min large message size
-    *
-    * @param minLargeMessageSize The value
-    */
-   public void setMinLargeMessageSize(final Integer minLargeMessageSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
-      }
-
-      raProperties.setMinLargeMessageSize(minLargeMessageSize);
-   }
-
-   /**
-    * Get block on acknowledge
-    *
-    * @return The value
-    */
-   public Boolean getBlockOnAcknowledge()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBlockOnAcknowledge()");
-      }
-
-      return raProperties.isBlockOnAcknowledge();
-   }
-
-   /**
-    * Set block on acknowledge
-    *
-    * @param blockOnAcknowledge The value
-    */
-   public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
-      }
-
-      raProperties.setBlockOnAcknowledge(blockOnAcknowledge);
-   }
-
-   /**
-    * Get block on non durable send
-    *
-    * @return The value
-    */
-   public Boolean getBlockOnNonDurableSend()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBlockOnNonDurableSend()");
-      }
-
-      return raProperties.isBlockOnNonDurableSend();
-   }
-
-   /**
-    * Set block on non durable send
-    *
-    * @param blockOnNonDurableSend The value
-    */
-   public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")");
-      }
-
-      raProperties.setBlockOnNonDurableSend(blockOnNonDurableSend);
-   }
-
-   /**
-    * Get block on durable send
-    *
-    * @return The value
-    */
-   public Boolean getBlockOnDurableSend()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBlockOnDurableSend()");
-      }
-
-      return raProperties.isBlockOnDurableSend();
-   }
-
-   /**
-    * Set block on durable send
-    *
-    * @param blockOnDurableSend The value
-    */
-   public void setBlockOnDurableSend(final Boolean blockOnDurableSend)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")");
-      }
-
-      raProperties.setBlockOnDurableSend(blockOnDurableSend);
-   }
-
-   /**
-    * Get auto group
-    *
-    * @return The value
-    */
-   public Boolean getAutoGroup()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getAutoGroup()");
-      }
-
-      return raProperties.isAutoGroup();
-   }
-
-   /**
-    * Set auto group
-    *
-    * @param autoGroup The value
-    */
-   public void setAutoGroup(final Boolean autoGroup)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setAutoGroup(" + autoGroup + ")");
-      }
-
-      raProperties.setAutoGroup(autoGroup);
-   }
-
-   /**
-    * Get pre acknowledge
-    *
-    * @return The value
-    */
-   public Boolean getPreAcknowledge()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPreAcknowledge()");
-      }
-
-      return raProperties.isPreAcknowledge();
-   }
-
-   /**
-    * Set pre acknowledge
-    *
-    * @param preAcknowledge The value
-    */
-   public void setPreAcknowledge(final Boolean preAcknowledge)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPreAcknowledge(" + preAcknowledge + ")");
-      }
-
-      raProperties.setPreAcknowledge(preAcknowledge);
-   }
-
-   /**
-    * Get number of initial connect attempts
-    *
-    * @return The value
-    */
-   public Integer getInitialConnectAttempts()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getInitialConnectAttempts()");
-      }
-
-      return raProperties.getInitialConnectAttempts();
-   }
-
-   /**
-    * Set number of initial connect attempts
-    *
-    * @param initialConnectAttempts The value
-    */
-   public void setInitialConnectAttempts(final Integer initialConnectAttempts)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setInitialConnectionAttempts(" + initialConnectAttempts + ")");
-      }
-
-      raProperties.setInitialConnectAttempts(initialConnectAttempts);
-   }
-
-   /**
-    * Get initial message packet size
-    *
-    * @return The value
-    */
-   public Integer getInitialMessagePacketSize()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getInitialMessagePacketSize()");
-      }
-
-      return raProperties.getInitialMessagePacketSize();
-   }
-
-   /**
-    * Set initial message packet size
-    *
-    * @param initialMessagePacketSize The value
-    */
-   public void setInitialMessagePacketSize(final Integer initialMessagePacketSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setInitialMessagePacketSize(" + initialMessagePacketSize + ")");
-      }
-
-      raProperties.setInitialMessagePacketSize(initialMessagePacketSize);
-   }
-
-   /**
-    * Get retry interval
-    *
-    * @return The value
-    */
-   public Long getRetryInterval()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getRetryInterval()");
-      }
-
-      return raProperties.getRetryInterval();
-   }
-
-   /**
-    * Set retry interval
-    *
-    * @param retryInterval The value
-    */
-   public void setRetryInterval(final Long retryInterval)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setRetryInterval(" + retryInterval + ")");
-      }
-
-      raProperties.setRetryInterval(retryInterval);
-   }
-
-   /**
-    * Get retry interval multiplier
-    *
-    * @return The value
-    */
-   public Double getRetryIntervalMultiplier()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getRetryIntervalMultiplier()");
-      }
-
-      return raProperties.getRetryIntervalMultiplier();
-   }
-
-   /**
-    * Set retry interval multiplier
-    *
-    * @param retryIntervalMultiplier The value
-    */
-   public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
-      }
-
-      raProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
-   }
-
-   /**
-    * Get maximum time for retry interval
-    *
-    * @return The value
-    */
-   public Long getMaxRetryInterval()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMaxRetryInterval()");
-      }
-
-      return raProperties.getMaxRetryInterval();
-   }
-
-   /**
-    * Set maximum time for retry interval
-    *
-    * @param maxRetryInterval The value
-    */
-   public void setMaxRetryInterval(final Long maxRetryInterval)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setMaxRetryInterval(" + maxRetryInterval + ")");
-      }
-
-      raProperties.setMaxRetryInterval(maxRetryInterval);
-   }
-
-   /**
-    * Get number of reconnect attempts
-    *
-    * @return The value
-    */
-   public Integer getReconnectAttempts()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getReconnectAttempts()");
-      }
-
-      return raProperties.getReconnectAttempts();
-   }
-
-   /**
-    * Set number of reconnect attempts
-    *
-    * @param reconnectAttempts The value
-    */
-   public void setReconnectAttempts(final Integer reconnectAttempts)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setReconnectAttempts(" + reconnectAttempts + ")");
-      }
-
-      raProperties.setReconnectAttempts(reconnectAttempts);
-   }
-
-   public String getConnectionLoadBalancingPolicyClassName()
-   {
-      return raProperties.getConnectionLoadBalancingPolicyClassName();
-   }
-
-   public void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + connectionLoadBalancingPolicyClassName + ")");
-      }
-      raProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
-   }
-
-   public Integer getScheduledThreadPoolMaxSize()
-   {
-      return raProperties.getScheduledThreadPoolMaxSize();
-   }
-
-   public void setScheduledThreadPoolMaxSize(final Integer scheduledThreadPoolMaxSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + scheduledThreadPoolMaxSize + ")");
-      }
-      raProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
-   }
-
-   public Integer getThreadPoolMaxSize()
-   {
-      return raProperties.getThreadPoolMaxSize();
-   }
-
-   public void setThreadPoolMaxSize(final Integer threadPoolMaxSize)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + threadPoolMaxSize + ")");
-      }
-      raProperties.setThreadPoolMaxSize(threadPoolMaxSize);
-   }
-
-   public Boolean getUseGlobalPools()
-   {
-      return raProperties.isUseGlobalPools();
-   }
-
-   public void setUseGlobalPools(final Boolean useGlobalPools)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + useGlobalPools + ")");
-      }
-      raProperties.setUseGlobalPools(useGlobalPools);
-   }
-
-   /**
-    * Get the user name
-    *
-    * @return The value
-    */
-   public String getUserName()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return raProperties.getUserName();
-   }
-
-   /**
-    * Set the user name
-    *
-    * @param userName The value
-    */
-   public void setUserName(final String userName)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUserName(" + userName + ")");
-      }
-
-      raProperties.setUserName(userName);
-   }
-
-   /**
-    * Get the password
-    *
-    * @return The value
-    */
-   public String getPassword()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPassword()");
-      }
-
-      return raProperties.getPassword();
-   }
-
-   /**
-    * Set the password
-    *
-    * @param password The value
-    */
-   public void setPassword(final String password)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      raProperties.setPassword(password);
-   }
-
-   /**
-    * @return the useJNDI
-    */
-   public boolean isUseJNDI()
-   {
-      return raProperties.isUseJNDI();
-   }
-
-   /**
-    * @param value the useJNDI to set
-    */
-   public void setUseJNDI(final Boolean value)
-   {
-      raProperties.setUseJNDI(value);
-   }
-
-   /**
-    * @return return the jndi params to use
-    */
-   public String getJndiParams()
-   {
-      return unparsedJndiParams;
-   }
-
-   public void setJndiParams(String jndiParams)
-   {
-      unparsedJndiParams = jndiParams;
-      raProperties.setParsedJndiParams(HornetQRaUtils.parseHashtableConfig(jndiParams));
-   }
-
-   public Hashtable<?, ?> getParsedJndiParams()
-   {
-      return raProperties.getParsedJndiParams();
-   }
-
-   /**
-    * Get the client ID
-    *
-    * @return The value
-    */
-   public String getClientID()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getClientID()");
-      }
-
-      return raProperties.getClientID();
-   }
-
-   /**
-    * Set the client ID
-    *
-    * @param clientID The client id
-    */
-   public void setClientID(final String clientID)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
-      }
-
-      raProperties.setClientID(clientID);
-   }
-
-   /**
-    * Get the group ID
-    *
-    * @return The value
-    */
-   public String getGroupID()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getGroupID()");
-      }
-
-      return raProperties.getGroupID();
-   }
-
-   /**
-    * Set the group ID
-    *
-    * @param groupID The group id
-    */
-   public void setGroupID(final String groupID)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setGroupID(" + groupID + ")");
-      }
-
-      raProperties.setGroupID(groupID);
-   }
-
-   /**
-    * Get the use XA flag
-    *
-    * @return The value
-    */
-   public Boolean getUseLocalTx()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUseLocalTx()");
-      }
-
-      return raProperties.getUseLocalTx();
-   }
-
-   /**
-    * Set the use XA flag
-    *
-    * @param localTx The value
-    */
-   public void setUseLocalTx(final Boolean localTx)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUseXA(" + localTx + ")");
-      }
-
-      raProperties.setUseLocalTx(localTx);
-   }
-
-   public int getSetupAttempts()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSetupAttempts()");
-      }
-      return raProperties.getSetupAttempts();
-   }
-
-   public void setSetupAttempts(Integer setupAttempts)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")");
-      }
-      raProperties.setSetupAttempts(setupAttempts);
-   }
-
-   public long getSetupInterval()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSetupInterval()");
-      }
-      return raProperties.getSetupInterval();
-   }
-
-   public void setSetupInterval(Long interval)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSetupInterval(" + interval + ")");
-      }
-      raProperties.setSetupInterval(interval);
-   }
-
-   /**
-    * Indicates whether some other object is "equal to" this one.
-    *
-    * @param obj Object with which to compare
-    * @return True if this object is the same as the obj argument; false otherwise.
-    */
-   @Override
-   public boolean equals(final Object obj)
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("equals(" + obj + ")");
-      }
-
-      if (obj == null)
-      {
-         return false;
-      }
-
-      if (obj instanceof HornetQResourceAdapter)
-      {
-         return raProperties.equals(((HornetQResourceAdapter) obj).getProperties());
-      }
-      return false;
-   }
-
-   /**
-    * Return the hash code for the object
-    *
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("hashCode()");
-      }
-
-      return raProperties.hashCode();
-   }
-
-   /**
-    * Get the work manager
-    *
-    * @return The manager
-    */
-   public WorkManager getWorkManager()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getWorkManager()");
-      }
-
-      if (ctx == null)
-      {
-         return null;
-      }
-
-      return ctx.getWorkManager();
-   }
-
-   public ClientSession createSession(final ClientSessionFactory parameterFactory,
-                                      final int ackMode,
-                                      final String user,
-                                      final String pass,
-                                      final Boolean preAck,
-                                      final Integer dupsOkBatchSize,
-                                      final Integer transactionBatchSize,
-                                      final boolean deliveryTransacted,
-                                      final boolean useLocalTx,
-                                      final Integer txTimeout) throws Exception
-   {
-
-      ClientSession result;
-
-      // if we are CMP or BMP using local tx we ignore the ack mode as we are transactional
-      if (deliveryTransacted || useLocalTx)
-      {
-         // JBPAPP-8845
-         // If transacted we need to send the ack flush as soon as possible
-         // as if any transaction times out, we need the ack on the server already
-         if (useLocalTx)
-         {
-            result = parameterFactory.createSession(user, pass, false, false, false, false, 0);
-         }
-         else
-         {
-            result = parameterFactory.createSession(user, pass, true, false, false, false, 0);
-         }
-      }
-      else
-      {
-         if (preAck != null && preAck)
-         {
-            result = parameterFactory.createSession(user, pass, false, true, true, true, -1);
-         }
-         else
-         {
-            // only auto ack and dups ok are supported
-            switch (ackMode)
-            {
-               case Session.AUTO_ACKNOWLEDGE:
-                  result = parameterFactory.createSession(user, pass, false, true, true, false, 0);
-                  break;
-               case Session.DUPS_OK_ACKNOWLEDGE:
-                  int actDupsOkBatchSize = dupsOkBatchSize != null ? dupsOkBatchSize
-                     : HornetQClient.DEFAULT_ACK_BATCH_SIZE;
-                  result = parameterFactory.createSession(user, pass, false, true, true, false, actDupsOkBatchSize);
-                  break;
-               default:
-                  throw new IllegalArgumentException("Invalid ackmode: " + ackMode);
-            }
-         }
-      }
-
-      HornetQRALogger.LOGGER.debug("Using queue connection " + result);
-
-      return result;
-
-   }
-
-
-   public RecoveryManager getRecoveryManager()
-   {
-      return recoveryManager;
-   }
-
-   /**
-    * Get the resource adapter properties
-    *
-    * @return The properties
-    */
-   protected HornetQRAProperties getProperties()
-   {
-      if (HornetQResourceAdapter.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProperties()");
-      }
-
-      return raProperties;
-   }
-
-   /**
-    * Setup the factory
-    */
-   protected void setup() throws ActiveMQException
-   {
-      raProperties.init();
-      defaultHornetQConnectionFactory = createHornetQConnectionFactory(raProperties);
-      recoveryHornetQConnectionFactory = createRecoveryHornetQConnectionFactory(raProperties);
-      recoveryManager.register(recoveryHornetQConnectionFactory, raProperties.getUserName(), raProperties.getPassword());
-   }
-
-   public Map<ActivationSpec, HornetQActivation> getActivations()
-   {
-      return activations;
-   }
-
-   public HornetQConnectionFactory getDefaultHornetQConnectionFactory() throws ResourceException
-   {
-      if (!configured.getAndSet(true))
-      {
-         try
-         {
-            setup();
-         }
-         catch (ActiveMQException e)
-         {
-            throw new ResourceException("Unable to create activation", e);
-         }
-      }
-      return defaultHornetQConnectionFactory;
-   }
-
-   /**
-    * @param transactionManagerLocatorClass
-    * @see org.apache.activemq.ra.HornetQRAProperties#setTransactionManagerLocatorClass(java.lang.String)
-    */
-   public void setTransactionManagerLocatorClass(String transactionManagerLocatorClass)
-   {
-      raProperties.setTransactionManagerLocatorClass(transactionManagerLocatorClass);
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#getTransactionManagerLocatorClass()
-    */
-   public String getTransactionManagerLocatorClass()
-   {
-      return raProperties.getTransactionManagerLocatorClass();
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#getJgroupsChannelLocatorClass()
-    */
-   public String getJgroupsChannelLocatorClass()
-   {
-      return raProperties.getJgroupsChannelLocatorClass();
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#setJgroupsChannelLocatorClass()
-    */
-   public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass)
-   {
-      raProperties.setJgroupsChannelLocatorClass(jgroupsChannelLocatorClass);
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#getJgroupsChannelRefName()
-    */
-   public String getJgroupsChannelRefName()
-   {
-      return raProperties.getJgroupsChannelRefName();
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#setJgroupsChannelRefName()
-    */
-   public void setJgroupsChannelRefName(String jgroupsChannelRefName)
-   {
-      raProperties.setJgroupsChannelRefName(jgroupsChannelRefName);
-   }
-
-   /**
-    * @return
-    * @see org.apache.activemq.ra.HornetQRAProperties#getTransactionManagerLocatorMethod()
-    */
-   public String getTransactionManagerLocatorMethod()
-   {
-      return raProperties.getTransactionManagerLocatorMethod();
-   }
-
-   /**
-    * @param transactionManagerLocatorMethod
-    * @see org.apache.activemq.ra.HornetQRAProperties#setTransactionManagerLocatorMethod(java.lang.String)
-    */
-   public void setTransactionManagerLocatorMethod(String transactionManagerLocatorMethod)
-   {
-      raProperties.setTransactionManagerLocatorMethod(transactionManagerLocatorMethod);
-   }
-
-   public HornetQConnectionFactory createHornetQConnectionFactory(final ConnectionFactoryProperties overrideProperties)
-   {
-      HornetQConnectionFactory cf;
-      List<String> connectorClassName = overrideProperties.getParsedConnectorClassNames() != null ? overrideProperties.getParsedConnectorClassNames()
-         : raProperties.getParsedConnectorClassNames();
-
-      String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress()
-         : getDiscoveryAddress();
-
-      Boolean ha = overrideProperties.isHA() != null ? overrideProperties.isHA() : getHA();
-
-      String jgroupsFileName = overrideProperties.getJgroupsFile() != null ? overrideProperties.getJgroupsFile()
-         : getJgroupsFile();
-
-      String jgroupsChannel = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName()
-         : getJgroupsChannelName();
-
-      String jgroupsLocatorClassName = raProperties.getJgroupsChannelLocatorClass();
-
-      if (ha == null)
-      {
-         ha = HornetQClient.DEFAULT_IS_HA;
-      }
-
-      if (discoveryAddress != null || jgroupsFileName != null || jgroupsLocatorClassName != null)
-      {
-         BroadcastEndpointFactoryConfiguration endpointFactoryConfiguration = null;
-
-         if (jgroupsLocatorClassName != null)
-         {
-            String jchannelRefName = raProperties.getJgroupsChannelRefName();
-            JChannel jchannel = HornetQRaUtils.locateJGroupsChannel(jgroupsLocatorClassName, jchannelRefName);
-            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jchannel, jgroupsChannel);
-         }
-         else if (discoveryAddress != null)
-         {
-            Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
-               : getDiscoveryPort();
-            if (discoveryPort == null)
-            {
-               discoveryPort = HornetQClient.DEFAULT_DISCOVERY_PORT;
-            }
-
-            String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
-               : raProperties.getDiscoveryLocalBindAddress();
-            endpointFactoryConfiguration = new UDPBroadcastGroupConfiguration()
-               .setGroupAddress(discoveryAddress)
-               .setGroupPort(discoveryPort)
-               .setLocalBindAddress(localBindAddress)
-               .setLocalBindPort(-1);
-         }
-         else if (jgroupsFileName != null)
-         {
-            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jgroupsFileName, jgroupsChannel);
-         }
-         Long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
-            : raProperties.getDiscoveryRefreshTimeout();
-         if (refreshTimeout == null)
-         {
-            refreshTimeout = HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
-         }
-
-         Long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
-            : raProperties.getDiscoveryInitialWaitTimeout();
-
-         if (initialTimeout == null)
-         {
-            initialTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
-         }
-
-         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration()
-            .setRefreshTimeout(refreshTimeout)
-            .setDiscoveryInitialWaitTimeout(initialTimeout)
-            .setBroadcastEndpointFactoryConfiguration(endpointFactoryConfiguration);
-
-         if (HornetQRALogger.LOGGER.isDebugEnabled())
-         {
-            HornetQRALogger.LOGGER.debug("Creating Connection Factory on the resource adapter for discovery=" + groupConfiguration + " with ha=" + ha);
-         }
-
-         if (ha)
-         {
-            cf = HornetQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.XA_CF);
-         }
-         else
-         {
-            cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
-         }
-      }
-      else if (connectorClassName != null)
-      {
-         TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
-
-         List<Map<String, Object>> connectionParams;
-         if (overrideProperties.getParsedConnectorClassNames() != null)
-         {
-            connectionParams = overrideProperties.getParsedConnectionParameters();
-         }
-         else
-         {
-            connectionParams = raProperties.getParsedConnectionParameters();
-         }
-
-         for (int i = 0; i < connectorClassName.size(); i++)
-         {
-            TransportConfiguration tc;
-            if (connectionParams == null || i >= connectionParams.size())
-            {
-               tc = new TransportConfiguration(connectorClassName.get(i));
-               HornetQRALogger.LOGGER.debug("No connector params provided using default");
-            }
-            else
-            {
-               tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
-            }
-
-            transportConfigurations[i] = tc;
-         }
-
-
-         if (HornetQRALogger.LOGGER.isDebugEnabled())
-         {
-            HornetQRALogger.LOGGER.debug("Creating Connection Factory on the resource adapter for transport=" +
-                                            Arrays.toString(transportConfigurations) + " with ha=" + ha);
-         }
-
-         if (ha)
-         {
-            cf = HornetQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.XA_CF, transportConfigurations);
-         }
-         else
-         {
-            cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, transportConfigurations);
-         }
-      }
-      else
-      {
-         throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for HornetQ ResourceAdapter Connection Factory");
-      }
-
-      setParams(cf, overrideProperties);
-      return cf;
-   }
-
-   public HornetQConnectionFactory createRecoveryHornetQConnectionFactory(final ConnectionFactoryProperties overrideProperties)
-   {
-      HornetQConnectionFactory cf;
-      List<String> connectorClassName = overrideProperties.getParsedConnectorClassNames() != null ? overrideProperties.getParsedConnectorClassNames()
-         : raProperties.getParsedConnectorClassNames();
-
-      String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress()
-         : getDiscoveryAddress();
-
-      String jgroupsFileName = overrideProperties.getJgroupsFile() != null ? overrideProperties.getJgroupsFile()
-         : getJgroupsFile();
-
-      String jgroupsChannel = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName()
-         : getJgroupsChannelName();
-
-      if (connectorClassName == null)
-      {
-         BroadcastEndpointFactoryConfiguration endpointFactoryConfiguration = null;
-         if (discoveryAddress != null)
-         {
-            Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
-               : getDiscoveryPort();
-            if (discoveryPort == null)
-            {
-               discoveryPort = HornetQClient.DEFAULT_DISCOVERY_PORT;
-            }
-
-            String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
-               : raProperties.getDiscoveryLocalBindAddress();
-            endpointFactoryConfiguration = new UDPBroadcastGroupConfiguration()
-               .setGroupAddress(discoveryAddress)
-               .setGroupPort(discoveryPort)
-               .setLocalBindAddress(localBindAddress)
-               .setLocalBindPort(-1);
-         }
-         else if (jgroupsFileName != null)
-         {
-            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jgroupsFileName, jgroupsChannel);
-         }
-         else
-         {
-            String jgroupsLocatorClass = raProperties.getJgroupsChannelLocatorClass();
-            if (jgroupsLocatorClass != null)
-            {
-               String jgroupsChannelRefName = raProperties.getJgroupsChannelRefName();
-               JChannel jchannel = HornetQRaUtils.locateJGroupsChannel(jgroupsLocatorClass, jgroupsChannelRefName);
-               endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jchannel, jgroupsChannel);
-            }
-            if (endpointFactoryConfiguration == null)
-            {
-               throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for HornetQ ResourceAdapter Connection Factory");
-            }
-         }
-
-         Long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
-            : raProperties.getDiscoveryRefreshTimeout();
-         if (refreshTimeout == null)
-         {
-            refreshTimeout = HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
-         }
-
-         Long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
-            : raProperties.getDiscoveryInitialWaitTimeout();
-         if (initialTimeout == null)
-         {
-            initialTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
-         }
-         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration()
-            .setRefreshTimeout(refreshTimeout)
-            .setDiscoveryInitialWaitTimeout(initialTimeout)
-            .setBroadcastEndpointFactoryConfiguration(endpointFactoryConfiguration);
-
-         groupConfiguration.setRefreshTimeout(refreshTimeout);
-
-         if (HornetQRALogger.LOGGER.isDebugEnabled())
-         {
-            HornetQRALogger.LOGGER.debug("Creating Recovery Connection Factory on the resource adapter for discovery=" + groupConfiguration);
-         }
-
-         cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
-      }
-      else
-      {
-         TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
-
-         List<Map<String, Object>> connectionParams;
-         if (overrideProperties.getParsedConnectorClassNames() != null)
-         {
-            connectionParams = overrideProperties.getParsedConnectionParameters();
-         }
-         else
-         {
-            connectionParams = raProperties.getParsedConnectionParameters();
-         }
-
-         for (int i = 0; i < connectorClassName.size(); i++)
-         {
-            TransportConfiguration tc;
-            if (connectionParams == null || i >= connectionParams.size())
-            {
-               tc = new TransportConfiguration(connectorClassName.get(i));
-               HornetQRALogger.LOGGER.debug("No connector params provided using default");
-            }
-            else
-            {
-               tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
-            }
-
-            transportConfigurations[i] = tc;
-         }
-
-
-         if (HornetQRALogger.LOGGER.isDebugEnabled())
-         {
-            HornetQRALogger.LOGGER.debug("Creating Recovery Connection Factory on the resource adapter for transport=" +
-                                            Arrays.toString(transportConfigurations));
-         }
-
-         cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, transportConfigurations);
-      }
-      setParams(cf, overrideProperties);
-
-      //now make sure we are HA in any way
-
-      cf.setReconnectAttempts(0);
-      cf.setInitialConnectAttempts(0);
-      return cf;
-   }
-
-   public Map<String, Object> overrideConnectionParameters(final Map<String, Object> connectionParams,
-                                                           final Map<String, Object> overrideConnectionParams)
-   {
-      Map<String, Object> map = new HashMap<String, Object>();
-      if (connectionParams != null)
-      {
-         map.putAll(connectionParams);
-      }
-      if (overrideConnectionParams != null)
-      {
-         for (Map.Entry<String, Object> stringObjectEntry : overrideConnectionParams.entrySet())
-         {
-            map.put(stringObjectEntry.getKey(), stringObjectEntry.getValue());
-         }
-      }
-      return map;
-   }
-
-   private void locateTM()
-   {
-      String[] locatorClasses = raProperties.getTransactionManagerLocatorClass().split(";");
-      String[] locatorMethods = raProperties.getTransactionManagerLocatorMethod().split(";");
-
-      for (int i = 0; i < locatorClasses.length; i++)
-      {
-         tm = HornetQRaUtils.locateTM(locatorClasses[i], locatorMethods[i]);
-         if (tm != null)
-         {
-            break;
-         }
-      }
-
-      if (tm == null)
-      {
-         HornetQRALogger.LOGGER.noTXLocator();
-      }
-      else
-      {
-         HornetQRALogger.LOGGER.debug("TM located = " + tm);
-      }
-   }
-
-
-   private void setParams(final HornetQConnectionFactory cf,
-                          final ConnectionFactoryProperties overrideProperties)
-   {
-      Boolean val = overrideProperties.isAutoGroup() != null ? overrideProperties.isAutoGroup()
-         : raProperties.isAutoGroup();
-      if (val != null)
-      {
-         cf.setAutoGroup(val);
-      }
-      val = overrideProperties.isBlockOnAcknowledge() != null ? overrideProperties.isBlockOnAcknowledge()
-         : raProperties.isBlockOnAcknowledge();
-      if (val != null)
-      {
-         cf.setBlockOnAcknowledge(val);
-      }
-      val = overrideProperties.isBlockOnNonDurableSend() != null ? overrideProperties.isBlockOnNonDurableSend()
-         : raProperties.isBlockOnNonDurableSend();
-      if (val != null)
-      {
-         cf.setBlockOnNonDurableSend(val);
-      }
-      val = overrideProperties.isBlockOnDurableSend() != null ? overrideProperties.isBlockOnDurableSend()
-         : raProperties.isBlockOnDurableSend();
-      if (val != null)
-      {
-         cf.setBlockOnDurableSend(val);
-      }
-      val = overrideProperties.isPreAcknowledge() != null ? overrideProperties.isPreAcknowledge()
-         : raProperties.isPreAcknowledge();
-      if (val != null)
-      {
-         cf.setPreAcknowledge(val);
-      }
-      val = overrideProperties.isUseGlobalPools() != null ? overrideProperties.isUseGlobalPools()
-         : raProperties.isUseGlobalPools();
-      if (val != null)
-      {
-         cf.setUseGlobalPools(val);
-      }
-
-      val = overrideProperties.isCacheLargeMessagesClient() != null ? overrideProperties.isCacheLargeMessagesClient()
-         : raProperties.isCacheLargeMessagesClient();
-      if (val != null)
-      {
-         cf.setCacheLargeMessagesClient(val);
-      }
-
-      val = overrideProperties.isCompressLargeMessage() != null ? overrideProperties.isCompressLargeMessage()
-         : raProperties.isCompressLargeMessage();
-      if (val != null)
-      {
-         cf.setCompressLargeMessage(val);
-      }
-
-      val = overrideProperties.isFailoverOnInitialConnection() != null ? overrideProperties.isFailoverOnInitialConnection()
-         : raProperties.isFailoverOnInitialConnection();
-      if (val != null)
-      {
-         cf.setFailoverOnInitialConnection(val);
-      }
-
-      Integer val2 = overrideProperties.getConsumerMaxRate() != null ? overrideProperties.getConsumerMaxRate()
-         : raProperties.getConsumerMaxRate();
-      if (val2 != null)
-      {
-         cf.setConsumerMaxRate(val2);
-      }
-      val2 = overrideProperties.getConsumerWindowSize() != null ? overrideProperties.getConsumerWindowSize()
-         : raProperties.getConsumerWindowSize();
-      if (val2 != null)
-      {
-         cf.setConsumerWindowSize(val2);
-      }
-      val2 = overrideProperties.getDupsOKBatchSize() != null ? overrideProperties.getDupsOKBatchSize()
-         : raProperties.getDupsOKBatchSize();
-      if (val2 != null)
-      {
-         cf.setDupsOKBatchSize(val2);
-      }
-
-      val2 = overrideProperties.getMinLargeMessageSize() != null ? overrideProperties.getMinLargeMessageSize()
-         : raProperties.getMinLargeMessageSize();
-      if (val2 != null)
-      {
-         cf.setMinLargeMessageSize(val2);
-      }
-      val2 = overrideProperties.getProducerMaxRate() != null ? overrideProperties.getProducerMaxRate()
-         : raProperties.getProducerMaxRate();
-      if (val2 != null)
-      {
-         cf.setProducerMaxRate(val2);
-      }
-      val2 = overrideProperties.getProducerWindowSize() != null ? overrideProperties.getProducerWindowSize()
-         : raProperties.getProducerWindowSize();
-      if (val2 != null)
-      {
-         cf.setProducerWindowSize(val2);
-      }
-      val2 = overrideProperties.getConfirmationWindowSize() != null ? overrideProperties.getConfirmationWindowSize()
-         : raProperties.getConfirmationWindowSize();
-      if (val2 != null)
-      {
-         cf.setConfirmationWindowSize(val2);
-      }
-      val2 = overrideProperties.getReconnectAttempts() != null ? overrideProperties.getReconnectAttempts()
-         : raProperties.getReconnectAttempts();
-      if (val2 != null)
-      {
-         cf.setReconnectAttempts(val2);
-      }
-      else
-      {
-         //the global default is 0 but we should always try to reconnect JCA
-         cf.setReconnectAttempts(-1);
-      }
-      val2 = overrideProperties.getThreadPoolMaxSize() != null ? overrideProperties.getThreadPoolMaxSize()
-         : raProperties.getThreadPoolMaxSize();
-      if (val2 != null)
-      {
-         cf.setThreadPoolMaxSize(val2);
-      }
-      val2 = overrideProperties.getScheduledThreadPoolMaxSize() != null ? overrideProperties.getScheduledThreadPoolMaxSize()
-         : raProperties.getScheduledThreadPoolMaxSize();
-      if (val2 != null)
-      {
-         cf.setScheduledThreadPoolMaxSize(val2);
-      }
-      val2 = overrideProperties.getTransactionBatchSize() != null ? overrideProperties.getTransactionBatchSize()
-         : raProperties.getTransactionBatchSize();
-      if (val2 != null)
-      {
-         cf.setTransactionBatchSize(val2);
-      }
-      val2 = overrideProperties.getInitialConnectAttempts() != null ? overrideProperties.getInitialConnectAttempts()
-         : raProperties.getInitialConnectAttempts();
-      if (val2 != null)
-      {
-         cf.setInitialConnectAttempts(val2);
-      }
-      val2 = overrideProperties.getInitialMessagePacketSize() != null ? overrideProperties.getInitialMessagePacketSize()
-         : raProperties.getInitialMessagePacketSize();
-      if (val2 != null)
-      {
-         cf.setInitialMessagePacketSize(val2);
-      }
-
-      Long val3 = overrideProperties.getClientFailureCheckPeriod() != null ? overrideProperties.getClientFailureCheckPeriod()
-         : raProperties.getClientFailureCheckPeriod();
-      if (val3 != null)
-      {
-         cf.setClientFailureCheckPeriod(val3);
-      }
-      val3 = overrideProperties.getCallTimeout() != null ? overrideProperties.getCallTimeout()
-         : raProperties.getCallTimeout();
-      if (val3 != null)
-      {
-         cf.setCallTimeout(val3);
-      }
-      val3 = overrideProperties.getCallFailoverTimeout() != null ? overrideProperties.getCallFailoverTimeout()
-         : raProperties.getCallFailoverTimeout();
-      if (val3 != null)
-      {
-         cf.setCallFailoverTimeout(val3);
-      }
-      val3 = overrideProperties.getConnectionTTL() != null ? overrideProperties.getConnectionTTL()
-         : raProperties.getConnectionTTL();
-      if (val3 != null)
-      {
-         cf.setConnectionTTL(val3);
-      }
-
-      val3 = overrideProperties.getRetryInterval() != null ? overrideProperties.getRetryInterval()
-         : raProperties.getRetryInterval();
-      if (val3 != null)
-      {
-         cf.setRetryInterval(val3);
-      }
-
-      val3 = overrideProperties.getMaxRetryInterval() != null ? overrideProperties.getMaxRetryInterval()
-         : raProperties.getMaxRetryInterval();
-      if (val3 != null)
-      {
-         cf.setMaxRetryInterval(val3);
-      }
-
-      Double val4 = overrideProperties.getRetryIntervalMultiplier() != null ? overrideProperties.getRetryIntervalMultiplier()
-         : raProperties.getRetryIntervalMultiplier();
-      if (val4 != null)
-      {
-         cf.setRetryIntervalMultiplier(val4);
-      }
-      String val5 = overrideProperties.getClientID() != null ? overrideProperties.getClientID()
-         : raProperties.getClientID();
-      if (val5 != null)
-      {
-         cf.setClientID(val5);
-      }
-      val5 = overrideProperties.getConnectionLoadBalancingPolicyClassName() != null ? overrideProperties.getConnectionLoadBalancingPolicyClassName()
-         : raProperties.getConnectionLoadBalancingPolicyClassName();
-      if (val5 != null)
-      {
-         cf.setConnectionLoadBalancingPolicyClassName(val5);
-      }
-   }
-
-   public void setManagedConnectionFactory(HornetQRAManagedConnectionFactory hornetQRAManagedConnectionFactory)
-   {
-      managedConnectionFactories.add(hornetQRAManagedConnectionFactory);
-   }
-
-   public SensitiveDataCodec<String> getCodecInstance()
-   {
-      return raProperties.getCodecInstance();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQXAResourceWrapper.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQXAResourceWrapper.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQXAResourceWrapper.java
deleted file mode 100644
index 4861a94..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQXAResourceWrapper.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.ra;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.activemq.core.client.impl.HornetQXAResource;
-import org.apache.activemq.utils.VersionLoader;
-
-/**
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- *
- * Wraps XAResource with org.jboss.tm.XAResourceWrapper.  This adds extra meta-data to to the XAResource used by
- * Transaction Manager for recovery scenarios.
- */
-
-public class HornetQXAResourceWrapper implements org.jboss.tm.XAResourceWrapper, org.jboss.jca.core.spi.transaction.xa.XAResourceWrapper, HornetQXAResource
-{
-   private final XAResource xaResource;
-
-   // The EIS Name
-   private final String productName;
-
-   // The EIS Version
-   private final String productVersion;
-
-   // A composite of NodeID + JNDIName that allows adminstrator looking at an XAResource to determine it's origin.
-   private final String jndiNameNodeId;
-
-   /**
-    * Creates a new XAResourceWrapper.  PRODUCT_NAME, productVersion and jndiName are useful for log output in the
-    * Transaction Manager.  For HornetQ only the resourceManagerID is required to allow Transaction Manager to recover
-    * from relevant recovery scenarios.
-    *
-    * @param xaResource
-    * @param jndiName
-    */
-   public HornetQXAResourceWrapper(XAResource xaResource, String jndiName, String nodeId)
-   {
-      this.xaResource = xaResource;
-      this.productName = HornetQResourceAdapter.PRODUCT_NAME;
-      this.productVersion = VersionLoader.getVersion().getFullVersion();
-      this.jndiNameNodeId = jndiName + " NodeId:" + nodeId;
-   }
-
-   @Override
-   public XAResource getResource()
-   {
-      return xaResource;
-   }
-
-   @Override
-   public String getProductName()
-   {
-      return productName;
-   }
-
-   @Override
-   public String getProductVersion()
-   {
-      return productVersion;
-   }
-
-   @Override
-   public String getJndiName()
-   {
-      return jndiNameNodeId;
-   }
-
-   @Override
-   public void commit(Xid xid, boolean b) throws XAException
-   {
-      getResource().commit(xid, b);
-   }
-
-   @Override
-   public void end(Xid xid, int i) throws XAException
-   {
-      getResource().end(xid, i);
-   }
-
-   @Override
-   public void forget(Xid xid) throws XAException
-   {
-      getResource().forget(xid);
-   }
-
-   @Override
-   public int getTransactionTimeout() throws XAException
-   {
-      return getResource().getTransactionTimeout();
-   }
-
-   @Override
-   public boolean isSameRM(XAResource xaResource) throws XAException
-   {
-      return getResource().isSameRM(xaResource);
-   }
-
-   @Override
-   public int prepare(Xid xid) throws XAException
-   {
-      return getResource().prepare(xid);
-   }
-
-   @Override
-   public Xid[] recover(int i) throws XAException
-   {
-      return getResource().recover(i);
-   }
-
-   @Override
-   public void rollback(Xid xid) throws XAException
-   {
-      getResource().rollback(xid);
-   }
-
-   @Override
-   public boolean setTransactionTimeout(int i) throws XAException
-   {
-      return getResource().setTransactionTimeout(i);
-   }
-
-   @Override
-   public void start(Xid xid, int i) throws XAException
-   {
-      getResource().start(xid, i);
-   }
-
-}


[12/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java b/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java
index e0eb4e5..8efdb78 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/Configuration.java
@@ -27,7 +27,7 @@ import org.apache.activemq.core.server.group.impl.GroupingHandlerConfiguration;
 import org.apache.activemq.core.settings.impl.AddressSettings;
 
 /**
- * A Configuration is used to configure HornetQ servers.
+ * A Configuration is used to configure ActiveMQ servers.
  *
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */
@@ -225,7 +225,7 @@ public interface Configuration extends Serializable
    /**
     * Sets the domain used by JMX MBeans (provided JMX management is enabled).
     * <p/>
-    * Changing this JMX domain is required if multiple HornetQ servers are run inside
+    * Changing this JMX domain is required if multiple ActiveMQ servers are run inside
     * the same JVM and all servers are using the same MBeanServer.
     */
    Configuration setJMXDomain(String domain);
@@ -234,7 +234,7 @@ public interface Configuration extends Serializable
     * Returns the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to
     * the server from clients).  Invoking this method is the same as invoking <code>getIncomingInterceptorClassNames().</code>
     *
-    * @deprecated As of HornetQ 2.3.0.Final, replaced by
+    * @deprecated As of ActiveMQ 2.3.0.Final, replaced by
     * {@link #getIncomingInterceptorClassNames()} and
     * {@link #getOutgoingInterceptorClassNames()}
     */
@@ -261,7 +261,7 @@ public interface Configuration extends Serializable
     * <p/>
     * Deprecated but not immediately deleted, as embedded users may be using this file.
     *
-    * @deprecated As of HornetQ 2.3.0.Final, replaced by
+    * @deprecated As of ActiveMQ 2.3.0.Final, replaced by
     * {@link #setIncomingInterceptorClassNames(List)} and
     * {@link #setOutgoingInterceptorClassNames(List)}
     */
@@ -990,14 +990,14 @@ public interface Configuration extends Serializable
    String getReplicationClustername();
 
    /*
-   * Whether or not that HornetQ should use all protocols available on the classpath. If false only the core protocol will
-   * be set, any other protocols will need to be set directly on the HornetQServer
+   * Whether or not that ActiveMQ should use all protocols available on the classpath. If false only the core protocol will
+   * be set, any other protocols will need to be set directly on the ActiveMQServer
    * */
    Configuration setResolveProtocols(boolean resolveProtocols);
 
    /*
    * @see #setResolveProtocols()
-   * @return whether HornetQ should resolve and use any Protocols available on the classpath
+   * @return whether ActiveMQ should resolve and use any Protocols available on the classpath
    * Default value is {@value org.apache.activemq.api.config.ActiveMQDefaultConfiguration#DEFAULT_RESOLVE_PROTOCOLS}.
    * */
    boolean isResolveProtocols();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/ConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/ConfigurationUtils.java b/activemq-server/src/main/java/org/apache/activemq/core/config/ConfigurationUtils.java
index 056211d..ded1890 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/ConfigurationUtils.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/ConfigurationUtils.java
@@ -19,7 +19,7 @@ import org.apache.activemq.core.config.ha.ReplicaPolicyConfiguration;
 import org.apache.activemq.core.config.ha.ReplicatedPolicyConfiguration;
 import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration;
 import org.apache.activemq.core.config.ha.SharedStoreSlavePolicyConfiguration;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.cluster.ha.BackupPolicy;
 import org.apache.activemq.core.server.cluster.ha.ColocatedPolicy;
 import org.apache.activemq.core.server.cluster.ha.HAPolicy;
@@ -119,7 +119,7 @@ public final class ConfigurationUtils
          }
 
       }
-      throw HornetQMessageBundle.BUNDLE.unsupportedHAPolicyConfiguration(conf);
+      throw ActiveMQMessageBundle.BUNDLE.unsupportedHAPolicyConfiguration(conf);
    }
 
    public static ScaleDownPolicy getScaleDownPolicy(ScaleDownConfiguration scaleDownConfiguration)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java
index adb971f..bcab5ec 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/ConfigurationImpl.java
@@ -1069,7 +1069,7 @@ public class ConfigurationImpl implements Configuration
    @Override
    public String toString()
    {
-      StringBuilder sb = new StringBuilder("HornetQ Configuration (");
+      StringBuilder sb = new StringBuilder("ActiveMQ Configuration (");
       sb.append("clustered=").append(isClustered()).append(",");
       sb.append("journalDirectory=").append(journalDirectory).append(",");
       sb.append("bindingsDirectory=").append(bindingsDirectory).append(",");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/impl/FileConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/FileConfiguration.java b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/FileConfiguration.java
index 86ec8c8..92986dc 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/FileConfiguration.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/FileConfiguration.java
@@ -17,7 +17,7 @@ import java.io.Reader;
 import java.net.URL;
 
 import org.apache.activemq.core.deployers.impl.FileConfigurationParser;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.utils.XMLUtil;
 import org.w3c.dom.Element;
 
@@ -67,7 +67,7 @@ public final class FileConfiguration extends ConfigurationImpl
          url = new URL(configurationUrl);
       }
 
-      HornetQServerLogger.LOGGER.debug("Loading server configuration from " + url);
+      ActiveMQServerLogger.LOGGER.debug("Loading server configuration from " + url);
 
       Reader reader = new InputStreamReader(url.openStream());
       String xml = org.apache.activemq.utils.XMLUtil.readerToString(reader);
@@ -78,7 +78,7 @@ public final class FileConfiguration extends ConfigurationImpl
 
       // https://jira.jboss.org/browse/HORNETQ-478 - We only want to validate AIO when
       //     starting the server
-      //     and we don't want to do it when deploying hornetq-queues.xml which uses the same parser and XML format
+      //     and we don't want to do it when deploying activemq-queues.xml which uses the same parser and XML format
       parser.setValidateAIO(true);
 
       parser.parseMainConfig(e, this);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/config/impl/Validators.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/Validators.java b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/Validators.java
index 9a760b4..bf40f4e 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/config/impl/Validators.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/config/impl/Validators.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.core.config.impl;
 
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.JournalType;
 import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.core.settings.impl.SlowConsumerPolicy;
@@ -44,7 +44,7 @@ public final class Validators
          String str = (String) value;
          if (str == null || str.length() == 0)
          {
-            throw HornetQMessageBundle.BUNDLE.emptyOrNull(name);
+            throw ActiveMQMessageBundle.BUNDLE.emptyOrNull(name);
          }
       }
    };
@@ -60,7 +60,7 @@ public final class Validators
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.greaterThanZero(name, val);
+            throw ActiveMQMessageBundle.BUNDLE.greaterThanZero(name, val);
          }
       }
    };
@@ -72,7 +72,7 @@ public final class Validators
          Number val = (Number) value;
          if (val == null || (val.intValue() < 0 || val.intValue() > 100))
          {
-            throw HornetQMessageBundle.BUNDLE.notPercent(name, val);
+            throw ActiveMQMessageBundle.BUNDLE.notPercent(name, val);
          }
       }
    };
@@ -88,7 +88,7 @@ public final class Validators
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.greaterThanZero(name, val);
+            throw ActiveMQMessageBundle.BUNDLE.greaterThanZero(name, val);
          }
       }
    };
@@ -104,7 +104,7 @@ public final class Validators
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.greaterThanMinusOne(name, val);
+            throw ActiveMQMessageBundle.BUNDLE.greaterThanMinusOne(name, val);
          }
       }
    };
@@ -120,7 +120,7 @@ public final class Validators
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.greaterThanZeroOrMinusOne(name, val);
+            throw ActiveMQMessageBundle.BUNDLE.greaterThanZeroOrMinusOne(name, val);
          }
       }
    };
@@ -136,7 +136,7 @@ public final class Validators
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.mustbeBetween(name, Thread.MIN_PRIORITY, Thread.MAX_PRIORITY, value);
+            throw ActiveMQMessageBundle.BUNDLE.mustbeBetween(name, Thread.MIN_PRIORITY, Thread.MAX_PRIORITY, value);
          }
       }
    };
@@ -148,7 +148,7 @@ public final class Validators
          String val = (String) value;
          if (val == null || !val.equals(JournalType.NIO.toString()) && !val.equals(JournalType.ASYNCIO.toString()))
          {
-            throw HornetQMessageBundle.BUNDLE.invalidJournalType(val);
+            throw ActiveMQMessageBundle.BUNDLE.invalidJournalType(val);
          }
       }
    };
@@ -163,7 +163,7 @@ public final class Validators
                !val.equals(AddressFullMessagePolicy.BLOCK.toString()) &&
                !val.equals(AddressFullMessagePolicy.FAIL.toString()))
          {
-            throw HornetQMessageBundle.BUNDLE.invalidAddressFullPolicyType(val);
+            throw ActiveMQMessageBundle.BUNDLE.invalidAddressFullPolicyType(val);
          }
       }
    };
@@ -176,7 +176,7 @@ public final class Validators
          if (val == null || !val.equals(SlowConsumerPolicy.KILL.toString()) &&
             !val.equals(SlowConsumerPolicy.NOTIFY.toString()))
          {
-            throw HornetQMessageBundle.BUNDLE.invalidSlowConsumerPolicyType(val);
+            throw ActiveMQMessageBundle.BUNDLE.invalidSlowConsumerPolicyType(val);
          }
       }
    };

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/Deployer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/Deployer.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/Deployer.java
index 3b585af..1329486 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/Deployer.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/Deployer.java
@@ -14,14 +14,14 @@ package org.apache.activemq.core.deployers;
 
 import java.net.URI;
 
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 
 /**
  * abstract class that helps with deployment of messaging components.
  *
  * @author <a href="ataylor@redhat.com">Andy Taylor</a>
  */
-public interface Deployer extends HornetQComponent
+public interface Deployer extends ActiveMQComponent
 {
    /**
     * The name of the configuration files to look for for deployment

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/DeploymentManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/DeploymentManager.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/DeploymentManager.java
index d39d2e4..430122b 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/DeploymentManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/DeploymentManager.java
@@ -12,14 +12,14 @@
  */
 package org.apache.activemq.core.deployers;
 
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 
 /**
  * This class manages any configuration files available. It will notify any deployers registered with it on changes.
  *
  * @author <a href="ataylor@redhat.com">Andy Taylor</a>
  */
-public interface DeploymentManager extends HornetQComponent
+public interface DeploymentManager extends ActiveMQComponent
 {
    /**
     * registers a deployable object which will handle the deployment of URL's

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/BasicUserCredentialsDeployer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/BasicUserCredentialsDeployer.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/BasicUserCredentialsDeployer.java
index c72f90d..4bd0d12 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/BasicUserCredentialsDeployer.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/BasicUserCredentialsDeployer.java
@@ -13,20 +13,20 @@
 package org.apache.activemq.core.deployers.impl;
 
 import org.apache.activemq.core.deployers.DeploymentManager;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.utils.PasswordMaskingUtil;
 import org.apache.activemq.utils.SensitiveDataCodec;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 /**
- * deployer for adding security loaded from the file "hornetq-users.xml"
+ * deployer for adding security loaded from the file "activemq-users.xml"
  *
  * @author <a href="ataylor@redhat.com">Andy Taylor</a>
  */
 public class BasicUserCredentialsDeployer extends XmlDeployer
 {
-   private final HornetQSecurityManager hornetQSecurityManager;
+   private final ActiveMQSecurityManager activeMQSecurityManager;
 
    private static final String PASSWORD_ATTRIBUTE = "password";
 
@@ -47,11 +47,11 @@ public class BasicUserCredentialsDeployer extends XmlDeployer
    private SensitiveDataCodec<String> passwordCodec;
 
    public BasicUserCredentialsDeployer(final DeploymentManager deploymentManager,
-                                       final HornetQSecurityManager hornetQSecurityManager)
+                                       final ActiveMQSecurityManager activeMQSecurityManager)
    {
       super(deploymentManager);
 
-      this.hornetQSecurityManager = hornetQSecurityManager;
+      this.activeMQSecurityManager = activeMQSecurityManager;
    }
 
    @Override
@@ -109,11 +109,11 @@ public class BasicUserCredentialsDeployer extends XmlDeployer
       }
 
       // add the user
-      hornetQSecurityManager.addUser(username, password);
+      activeMQSecurityManager.addUser(username, password);
 
       if (BasicUserCredentialsDeployer.DEFAULT_USER.equalsIgnoreCase(nodeName))
       {
-         hornetQSecurityManager.setDefaultUser(username);
+         activeMQSecurityManager.setDefaultUser(username);
       }
       NodeList children = node.getChildNodes();
       for (int i = 0; i < children.getLength(); i++)
@@ -125,7 +125,7 @@ public class BasicUserCredentialsDeployer extends XmlDeployer
             String role = child.getAttributes()
                .getNamedItem(BasicUserCredentialsDeployer.ROLE_ATTR_NAME)
                .getNodeValue();
-            hornetQSecurityManager.addRole(username, role);
+            activeMQSecurityManager.addRole(username, role);
          }
       }
    }
@@ -134,7 +134,7 @@ public class BasicUserCredentialsDeployer extends XmlDeployer
    public void undeploy(final Node node) throws Exception
    {
       String username = node.getAttributes().getNamedItem("name").getNodeValue();
-      hornetQSecurityManager.removeUser(username);
+      activeMQSecurityManager.removeUser(username);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java
index 739bd4d..b78ce3e 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileConfigurationParser.java
@@ -31,7 +31,7 @@ import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.UDPBroadcastGroupConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.config.BridgeConfiguration;
 import org.apache.activemq.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.core.config.Configuration;
@@ -52,7 +52,7 @@ import org.apache.activemq.core.config.impl.Validators;
 import org.apache.activemq.core.journal.impl.AIOSequentialFileFactory;
 import org.apache.activemq.core.journal.impl.JournalConstants;
 import org.apache.activemq.core.security.Role;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.JournalType;
 import org.apache.activemq.core.server.group.impl.GroupingHandlerConfiguration;
 import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
@@ -204,7 +204,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       NodeList elems = e.getElementsByTagName("clustered");
       if (elems != null && elems.getLength() > 0)
       {
-         HornetQServerLogger.LOGGER.deprecatedConfigurationOption("clustered");
+         ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("clustered");
       }
 
       // these are combined because they are both required for setting the correct HAPolicyConfiguration
@@ -217,24 +217,24 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
          {
             if (parameterExists(e, "backup"))
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("backup");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("backup");
             }
 
             if (parameterExists(e, "shared-store"))
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("shared-store");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("shared-store");
             }
          }
          else
          {
             if (parameterExists(e, "backup"))
             {
-               HornetQServerLogger.LOGGER.deprecatedConfigurationOption("backup");
+               ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("backup");
             }
 
             if (parameterExists(e, "shared-store"))
             {
-               HornetQServerLogger.LOGGER.deprecatedConfigurationOption("shared-store");
+               ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("shared-store");
             }
 
             if (backup && sharedStore)
@@ -262,11 +262,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("check-for-live-server");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("check-for-live-server");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("check-for-live-server");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("check-for-live-server");
 
             if (haPolicyConfig instanceof ReplicatedPolicyConfiguration)
             {
@@ -280,11 +280,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("allow-failback");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("allow-failback");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("allow-failback");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("allow-failback");
 
             if (haPolicyConfig instanceof ReplicaPolicyConfiguration)
             {
@@ -298,7 +298,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("check-for-live-server");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("check-for-live-server");
             }
          }
       }
@@ -307,11 +307,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("backup-group-name");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("backup-group-name");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("backup-group-name");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("backup-group-name");
 
             if (haPolicyConfig instanceof ReplicaPolicyConfiguration)
             {
@@ -325,7 +325,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("backup-group-name");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("backup-group-name");
             }
          }
       }
@@ -334,11 +334,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("failback-delay");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("failback-delay");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("failback-delay");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("failback-delay");
 
             if (haPolicyConfig instanceof ReplicaPolicyConfiguration)
             {
@@ -357,7 +357,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failback-delay");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failback-delay");
             }
          }
       }
@@ -366,11 +366,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("failover-on-shutdown");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("failover-on-shutdown");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("failover-on-shutdown");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("failover-on-shutdown");
 
             if (haPolicyConfig instanceof SharedStoreMasterPolicyConfiguration)
             {
@@ -384,7 +384,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failover-on-shutdown");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("failover-on-shutdown");
             }
          }
       }
@@ -393,11 +393,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("replication-clustername");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("replication-clustername");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("replication-clustername");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("replication-clustername");
 
             if (haPolicyConfig instanceof ReplicaPolicyConfiguration)
             {
@@ -411,7 +411,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("replication-clustername");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("replication-clustername");
             }
          }
       }
@@ -420,11 +420,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       {
          if (containsHAPolicy)
          {
-            HornetQServerLogger.LOGGER.incompatibleWithHAPolicy("max-saved-replicated-journals-size");
+            ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicy("max-saved-replicated-journals-size");
          }
          else
          {
-            HornetQServerLogger.LOGGER.deprecatedConfigurationOption("max-saved-replicated-journals-size");
+            ActiveMQServerLogger.LOGGER.deprecatedConfigurationOption("max-saved-replicated-journals-size");
 
             if (haPolicyConfig instanceof ReplicaPolicyConfiguration)
             {
@@ -435,7 +435,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
             }
             else
             {
-               HornetQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("max-saved-replicated-journals-size");
+               ActiveMQServerLogger.LOGGER.incompatibleWithHAPolicyChosen("max-saved-replicated-journals-size");
             }
          }
       }
@@ -619,14 +619,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
 
          if (connectorConfig.getName() == null)
          {
-            HornetQServerLogger.LOGGER.connectorWithNoName();
+            ActiveMQServerLogger.LOGGER.connectorWithNoName();
 
             continue;
          }
 
          if (config.getConnectorConfigurations().containsKey(connectorConfig.getName()))
          {
-            HornetQServerLogger.LOGGER.connectorAlreadyDeployed(connectorConfig.getName());
+            ActiveMQServerLogger.LOGGER.connectorAlreadyDeployed(connectorConfig.getName());
 
             continue;
          }
@@ -756,7 +756,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
          {
             if (validateAIO)
             {
-               HornetQServerLogger.LOGGER.AIONotFound();
+               ActiveMQServerLogger.LOGGER.AIONotFound();
             }
 
             config.setJournalType(JournalType.NIO);
@@ -1003,7 +1003,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
                }
                else
                {
-                  HornetQServerLogger.LOGGER.rolePermissionConfigurationError(type);
+                  ActiveMQServerLogger.LOGGER.rolePermissionConfigurationError(type);
                }
                if (!allRoles.contains(role.trim()))
                {
@@ -1528,7 +1528,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
       String name = e.getAttribute("name");
 
       long discoveryInitialWaitTimeout =
-         getLong(e, "initial-wait-timeout", HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT,
+         getLong(e, "initial-wait-timeout", ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT,
                  Validators.GT_ZERO);
 
       long refreshTimeout =
@@ -1570,7 +1570,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
 
       if (mainConfig.getDiscoveryGroupConfigurations().containsKey(name))
       {
-         HornetQServerLogger.LOGGER.discoveryGroupAlreadyDeployed(name);
+         ActiveMQServerLogger.LOGGER.discoveryGroupAlreadyDeployed(name);
 
          return;
       }
@@ -1612,14 +1612,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
          getLong(e, "retry-interval", ActiveMQDefaultConfiguration.getDefaultClusterRetryInterval(),
                  Validators.GT_ZERO);
 
-      long callTimeout = getLong(e, "call-timeout", HornetQClient.DEFAULT_CALL_TIMEOUT, Validators.GT_ZERO);
+      long callTimeout = getLong(e, "call-timeout", ActiveMQClient.DEFAULT_CALL_TIMEOUT, Validators.GT_ZERO);
 
-      long callFailoverTimeout = getLong(e, "call-failover-timeout", HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT, Validators.MINUS_ONE_OR_GT_ZERO);
+      long callFailoverTimeout = getLong(e, "call-failover-timeout", ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT, Validators.MINUS_ONE_OR_GT_ZERO);
 
       double retryIntervalMultiplier = getDouble(e, "retry-interval-multiplier",
                                                  ActiveMQDefaultConfiguration.getDefaultClusterRetryIntervalMultiplier(), Validators.GT_ZERO);
 
-      int minLargeMessageSize = getInteger(e, "min-large-message-size", HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, Validators.GT_ZERO);
+      int minLargeMessageSize = getInteger(e, "min-large-message-size", ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, Validators.GT_ZERO);
 
       long maxRetryInterval = getLong(e, "max-retry-interval", ActiveMQDefaultConfiguration.getDefaultClusterMaxRetryInterval(), Validators.GT_ZERO);
 
@@ -1734,22 +1734,22 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
          getInteger(brNode, "confirmation-window-size", ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize(),
                     Validators.GT_ZERO);
 
-      long retryInterval = getLong(brNode, "retry-interval", HornetQClient.DEFAULT_RETRY_INTERVAL, Validators.GT_ZERO);
+      long retryInterval = getLong(brNode, "retry-interval", ActiveMQClient.DEFAULT_RETRY_INTERVAL, Validators.GT_ZERO);
 
       long clientFailureCheckPeriod =
-         getLong(brNode, "check-period", HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD, Validators.GT_ZERO);
+         getLong(brNode, "check-period", ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD, Validators.GT_ZERO);
 
-      long connectionTTL = getLong(brNode, "connection-ttl", HornetQClient.DEFAULT_CONNECTION_TTL, Validators.GT_ZERO);
+      long connectionTTL = getLong(brNode, "connection-ttl", ActiveMQClient.DEFAULT_CONNECTION_TTL, Validators.GT_ZERO);
 
       int minLargeMessageSize =
-         getInteger(brNode, "min-large-message-size", HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+         getInteger(brNode, "min-large-message-size", ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                     Validators.GT_ZERO);
 
-      long maxRetryInterval = getLong(brNode, "max-retry-interval", HornetQClient.DEFAULT_MAX_RETRY_INTERVAL, Validators.GT_ZERO);
+      long maxRetryInterval = getLong(brNode, "max-retry-interval", ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL, Validators.GT_ZERO);
 
 
       double retryIntervalMultiplier =
-         getDouble(brNode, "retry-interval-multiplier", HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
+         getDouble(brNode, "retry-interval-multiplier", ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
                    Validators.GT_ZERO);
 
       int initialConnectAttempts =

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileDeploymentManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileDeploymentManager.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileDeploymentManager.java
index 84121ae..238879b 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileDeploymentManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/FileDeploymentManager.java
@@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.core.deployers.Deployer;
 import org.apache.activemq.core.deployers.DeploymentManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 
 /**
  * @author <a href="ataylor@redhat.com">Andy Taylor</a>
@@ -114,7 +114,7 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
 
          for (String filename : filenames)
          {
-            HornetQServerLogger.LOGGER.debug("the filename is " + filename);
+            ActiveMQServerLogger.LOGGER.debug("the filename is " + filename);
 
             Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename);
 
@@ -122,16 +122,16 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
             {
                URI uri = urls.nextElement().toURI();
 
-               HornetQServerLogger.LOGGER.debug("Got URI " + uri);
+               ActiveMQServerLogger.LOGGER.debug("Got URI " + uri);
 
                try
                {
-                  HornetQServerLogger.LOGGER.debug("Deploying " + uri + " for " + deployer.getClass().getSimpleName());
+                  ActiveMQServerLogger.LOGGER.debug("Deploying " + uri + " for " + deployer.getClass().getSimpleName());
                   deployer.deploy(uri);
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.errorDeployingURI(e, uri);
+                  ActiveMQServerLogger.LOGGER.errorDeployingURI(e, uri);
                }
 
                Pair<URI, Deployer> pair = new Pair<URI, Deployer>(uri, deployer);
@@ -198,7 +198,7 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
                   }
                   catch (URISyntaxException e)
                   {
-                     HornetQServerLogger.LOGGER.errorDeployingURI(e);
+                     ActiveMQServerLogger.LOGGER.errorDeployingURI(e);
                      continue;
                   }
 
@@ -218,7 +218,7 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
                      }
                      catch (Exception e)
                      {
-                        HornetQServerLogger.LOGGER.errorDeployingURI(e, uri);
+                        ActiveMQServerLogger.LOGGER.errorDeployingURI(e, uri);
                      }
                   }
                   else if (newLastModified > info.lastModified)
@@ -231,7 +231,7 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
                      }
                      catch (Exception e)
                      {
-                        HornetQServerLogger.LOGGER.errorDeployingURI(e, uri);
+                        ActiveMQServerLogger.LOGGER.errorDeployingURI(e, uri);
                      }
                   }
                }
@@ -246,18 +246,18 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
                if (!fileExists(pair.getA()))
                {
                   Deployer deployer = entry.getValue().deployer;
-                  HornetQServerLogger.LOGGER.debug("Undeploying " + deployer + " with url " + pair.getA());
+                  ActiveMQServerLogger.LOGGER.debug("Undeploying " + deployer + " with url " + pair.getA());
                   deployer.undeploy(pair.getA());
                   toRemove.add(pair);
                }
             }
             catch (URISyntaxException e)
             {
-               HornetQServerLogger.LOGGER.errorUnDeployingURI(e, pair.getA());
+               ActiveMQServerLogger.LOGGER.errorUnDeployingURI(e, pair.getA());
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.errorUnDeployingURI(e, pair.getA());
+               ActiveMQServerLogger.LOGGER.errorUnDeployingURI(e, pair.getA());
             }
          }
          for (Pair<URI, Deployer> pair : toRemove)
@@ -267,7 +267,7 @@ public class FileDeploymentManager implements Runnable, DeploymentManager
       }
       catch (IOException e)
       {
-         HornetQServerLogger.LOGGER.errorScanningURLs(e);
+         ActiveMQServerLogger.LOGGER.errorScanningURLs(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/QueueDeployer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/QueueDeployer.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/QueueDeployer.java
index ece4fac..9df7961 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/QueueDeployer.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/QueueDeployer.java
@@ -15,7 +15,7 @@ package org.apache.activemq.core.deployers.impl;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.config.CoreQueueConfiguration;
 import org.apache.activemq.core.deployers.DeploymentManager;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.w3c.dom.Node;
 
 /**
@@ -27,11 +27,11 @@ import org.w3c.dom.Node;
  */
 public class QueueDeployer extends XmlDeployer
 {
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final FileConfigurationParser parser = new FileConfigurationParser();
 
-   public QueueDeployer(final DeploymentManager deploymentManager, final HornetQServer server)
+   public QueueDeployer(final DeploymentManager deploymentManager, final ActiveMQServer server)
    {
       super(deploymentManager);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/SecurityDeployer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/SecurityDeployer.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/SecurityDeployer.java
index dce1bda..55a8822 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/SecurityDeployer.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/SecurityDeployer.java
@@ -27,7 +27,7 @@ import org.w3c.dom.Node;
  */
 public class SecurityDeployer extends XmlDeployer
 {
-   private static final String QUEUES_XML = "hornetq-queues.xml";
+   private static final String QUEUES_XML = "activemq-queues.xml";
 
    private static final String MATCH = "match";
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/XmlDeployer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/XmlDeployer.java b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/XmlDeployer.java
index 87c4724..75dd47f 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/XmlDeployer.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/deployers/impl/XmlDeployer.java
@@ -25,7 +25,7 @@ import java.util.Set;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.core.deployers.Deployer;
 import org.apache.activemq.core.deployers.DeploymentManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.utils.XMLUtil;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -182,7 +182,7 @@ public abstract class XmlDeployer implements Deployer
             }
             catch (Exception e1)
             {
-               HornetQServerLogger.LOGGER.unableToDeployNode(e1, node);
+               ActiveMQServerLogger.LOGGER.unableToDeployNode(e1, node);
                continue;
             }
 
@@ -232,7 +232,7 @@ public abstract class XmlDeployer implements Deployer
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.problemUndeployingNode(e, node);
+               ActiveMQServerLogger.LOGGER.problemUndeployingNode(e, node);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/filter/impl/FilterImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/filter/impl/FilterImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/filter/impl/FilterImpl.java
index ac2df63..16fa5d9 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/filter/impl/FilterImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/filter/impl/FilterImpl.java
@@ -13,6 +13,7 @@
 package org.apache.activemq.core.filter.impl;
 
 import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.selector.filter.BooleanExpression;
 import org.apache.activemq.selector.filter.FilterException;
 import org.apache.activemq.selector.filter.Filterable;
@@ -20,17 +21,16 @@ import org.apache.activemq.selector.SelectorParser;
 import org.apache.activemq.api.core.FilterConstants;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.filter.Filter;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.ServerMessage;
 
 /**
-* This class implements a HornetQ filter
+* This class implements a ActiveMQ filter
 *
 * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
 * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
 *
-* HornetQ filters have the same syntax as JMS 1.1 selectors, but the identifiers are different.
+* ActiveMQ filters have the same syntax as JMS 1.1 selectors, but the identifiers are different.
 *
 * Valid identifiers that can be used are:
 *
@@ -93,8 +93,8 @@ public class FilterImpl implements Filter
       }
       catch (Throwable e)
       {
-         HornetQServerLogger.LOGGER.invalidFilter(e, filterStr);
-         throw HornetQMessageBundle.BUNDLE.invalidFilter(e, filterStr);
+         ActiveMQServerLogger.LOGGER.invalidFilter(e, filterStr);
+         throw ActiveMQMessageBundle.BUNDLE.invalidFilter(e, filterStr);
       }
       return new FilterImpl(filterStr, booleanExpression);
    }
@@ -123,7 +123,7 @@ public class FilterImpl implements Filter
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.invalidFilter(e, sfilterString);
+         ActiveMQServerLogger.LOGGER.invalidFilter(e, sfilterString);
          return false;
       }
    }
@@ -167,28 +167,28 @@ public class FilterImpl implements Filter
 
    private static Object getHeaderFieldValue(final ServerMessage msg, final SimpleString fieldName)
    {
-      if (FilterConstants.HORNETQ_USERID.equals(fieldName))
+      if (FilterConstants.ACTIVEMQ_USERID.equals(fieldName))
       {
          // It's the stringified (hex) representation of a user id that can be used in a selector expression
          return new SimpleString("ID:" + msg.getUserID());
       }
-      else if (FilterConstants.HORNETQ_PRIORITY.equals(fieldName))
+      else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName))
       {
          return Integer.valueOf(msg.getPriority());
       }
-      else if (FilterConstants.HORNETQ_TIMESTAMP.equals(fieldName))
+      else if (FilterConstants.ACTIVEMQ_TIMESTAMP.equals(fieldName))
       {
          return msg.getTimestamp();
       }
-      else if (FilterConstants.HORNETQ_DURABLE.equals(fieldName))
+      else if (FilterConstants.ACTIVEMQ_DURABLE.equals(fieldName))
       {
          return msg.isDurable() ? FilterConstants.DURABLE : FilterConstants.NON_DURABLE;
       }
-      else if (FilterConstants.HORNETQ_EXPIRATION.equals(fieldName))
+      else if (FilterConstants.ACTIVEMQ_EXPIRATION.equals(fieldName))
       {
          return msg.getExpiration();
       }
-      else if (FilterConstants.HORNETQ_SIZE.equals(fieldName))
+      else if (FilterConstants.ACTIVEMQ_SIZE.equals(fieldName))
       {
          return msg.getEncodeSize();
       }
@@ -211,7 +211,7 @@ public class FilterImpl implements Filter
       public Object getProperty(String id)
       {
          Object result = null;
-         if (id.startsWith(FilterConstants.HORNETQ_PREFIX.toString()))
+         if (id.startsWith(FilterConstants.ACTIVEMQ_PREFIX.toString()))
          {
             result = getHeaderFieldValue(message, new SimpleString(id));
          }


[45/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQSessionContext.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQSessionContext.java
new file mode 100644
index 0000000..4e3d34c
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQSessionContext.java
@@ -0,0 +1,940 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.core.impl;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientConsumer;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
+import org.apache.activemq.core.client.impl.AddressQueryImpl;
+import org.apache.activemq.core.client.impl.ClientConsumerImpl;
+import org.apache.activemq.core.client.impl.ClientConsumerInternal;
+import org.apache.activemq.core.client.impl.ClientLargeMessageInternal;
+import org.apache.activemq.core.client.impl.ClientMessageInternal;
+import org.apache.activemq.core.client.impl.ClientProducerCreditsImpl;
+import org.apache.activemq.core.client.impl.ClientSessionImpl;
+import org.apache.activemq.core.message.impl.MessageInternal;
+import org.apache.activemq.core.protocol.core.Channel;
+import org.apache.activemq.core.protocol.core.ChannelHandler;
+import org.apache.activemq.core.protocol.core.CommandConfirmationHandler;
+import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
+import org.apache.activemq.core.protocol.core.Packet;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectConsumerMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.RollbackMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionAddMetaDataMessageV2;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionCloseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionDeleteQueueMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionExpireMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionForceConsumerDelivery;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionIndividualAcknowledgeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionProducerCreditsFailMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionQueueQueryMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendLargeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionUniqueAddMetaDataMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAAfterFailedMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXACommitMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAEndMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAForgetMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAGetTimeoutResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAJoinMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAPrepareMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAResumeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXARollbackMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXASetTimeoutMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAStartMessage;
+import org.apache.activemq.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.spi.core.remoting.Connection;
+import org.apache.activemq.spi.core.remoting.SessionContext;
+import org.apache.activemq.utils.TokenBucketLimiterImpl;
+
+import static org.apache.activemq.core.protocol.core.impl.PacketImpl.DISCONNECT_CONSUMER;
+import static org.apache.activemq.core.protocol.core.impl.PacketImpl.EXCEPTION;
+import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_CONTINUATION;
+import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_LARGE_MSG;
+import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_MSG;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQSessionContext extends SessionContext
+{
+   private final Channel sessionChannel;
+   private final int serverVersion;
+   private int confirmationWindow;
+   private final String name;
+
+
+   public ActiveMQSessionContext(String name, RemotingConnection remotingConnection, Channel sessionChannel, int serverVersion, int confirmationWindow)
+   {
+      super(remotingConnection);
+
+      this.name = name;
+      this.sessionChannel = sessionChannel;
+      this.serverVersion = serverVersion;
+      this.confirmationWindow = confirmationWindow;
+
+      ChannelHandler handler = new ClientSessionPacketHandler();
+      sessionChannel.setHandler(handler);
+
+
+      if (confirmationWindow >= 0)
+      {
+         sessionChannel.setCommandConfirmationHandler(confirmationHandler);
+      }
+   }
+
+
+   private final CommandConfirmationHandler confirmationHandler = new CommandConfirmationHandler()
+   {
+      public void commandConfirmed(final Packet packet)
+      {
+         if (packet.getType() == PacketImpl.SESS_SEND)
+         {
+            SessionSendMessage ssm = (SessionSendMessage) packet;
+            callSendAck(ssm.getHandler(), ssm.getMessage());
+         }
+         else if (packet.getType() == PacketImpl.SESS_SEND_CONTINUATION)
+         {
+            SessionSendContinuationMessage scm = (SessionSendContinuationMessage) packet;
+            if (!scm.isContinues())
+            {
+               callSendAck(scm.getHandler(), scm.getMessage());
+            }
+         }
+      }
+
+      private void callSendAck(SendAcknowledgementHandler handler, final Message message)
+      {
+         if (handler != null)
+         {
+            handler.sendAcknowledged(message);
+         }
+         else if (sendAckHandler != null)
+         {
+            sendAckHandler.sendAcknowledged(message);
+         }
+      }
+
+   };
+
+
+   // Failover utility methods
+
+   @Override
+   public void returnBlocking(ActiveMQException cause)
+   {
+      sessionChannel.returnBlocking(cause);
+   }
+
+   @Override
+   public void lockCommunications()
+   {
+      sessionChannel.lock();
+   }
+
+   @Override
+   public void releaseCommunications()
+   {
+      sessionChannel.setTransferring(false);
+      sessionChannel.unlock();
+   }
+
+   public void cleanup()
+   {
+      sessionChannel.close();
+
+      // if the server is sending a disconnect
+      // any pending blocked operation could hang without this
+      sessionChannel.returnBlocking();
+   }
+
+   @Override
+   public void linkFlowControl(SimpleString address, ClientProducerCreditsImpl clientProducerCredits)
+   {
+      // nothing to be done here... Flow control here is done on the core side
+   }
+
+
+   public void setSendAcknowledgementHandler(final SendAcknowledgementHandler handler)
+   {
+      sessionChannel.setCommandConfirmationHandler(confirmationHandler);
+      this.sendAckHandler = handler;
+   }
+
+   public void createSharedQueue(SimpleString address,
+                                 SimpleString queueName,
+                                 SimpleString filterString,
+                                 boolean durable) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new CreateSharedQueueMessage(address, queueName, filterString, durable, true), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void deleteQueue(final SimpleString queueName) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new SessionDeleteQueueMessage(queueName), PacketImpl.NULL_RESPONSE);
+   }
+
+   public ClientSession.QueueQuery queueQuery(final SimpleString queueName) throws ActiveMQException
+   {
+      SessionQueueQueryMessage request = new SessionQueueQueryMessage(queueName);
+      SessionQueueQueryResponseMessage response = (SessionQueueQueryResponseMessage) sessionChannel.sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
+
+      return response.toQueueQuery();
+
+   }
+
+
+   public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString,
+                                                int windowSize, int maxRate, int ackBatchSize, boolean browseOnly,
+                                                Executor executor, Executor flowControlExecutor) throws ActiveMQException
+   {
+      long consumerID = idGenerator.generateID();
+
+      ActiveMQConsumerContext consumerContext = new ActiveMQConsumerContext(consumerID);
+
+      SessionCreateConsumerMessage request = new SessionCreateConsumerMessage(consumerID,
+                                                                              queueName,
+                                                                              filterString,
+                                                                              browseOnly,
+                                                                              true);
+
+      SessionQueueQueryResponseMessage queueInfo = (SessionQueueQueryResponseMessage) sessionChannel.sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
+
+      // The actual windows size that gets used is determined by the user since
+      // could be overridden on the queue settings
+      // The value we send is just a hint
+
+      return new ClientConsumerImpl(session,
+                                    consumerContext,
+                                    queueName,
+                                    filterString,
+                                    browseOnly,
+                                    calcWindowSize(windowSize),
+                                    ackBatchSize,
+                                    maxRate > 0 ? new TokenBucketLimiterImpl(maxRate,
+                                                                             false)
+                                       : null,
+                                    executor,
+                                    flowControlExecutor,
+                                    this,
+                                    queueInfo.toQueueQuery(),
+                                    lookupTCCL());
+   }
+
+
+   public int getServerVersion()
+   {
+      return serverVersion;
+   }
+
+   public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException
+   {
+      SessionBindingQueryResponseMessage response =
+         (SessionBindingQueryResponseMessage) sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
+
+      return new AddressQueryImpl(response.isExists(), response.getQueueNames());
+   }
+
+
+   @Override
+   public void closeConsumer(final ClientConsumer consumer) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new SessionConsumerCloseMessage(getConsumerID(consumer)), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void sendConsumerCredits(final ClientConsumer consumer, final int credits)
+   {
+      sessionChannel.send(new SessionConsumerFlowCreditMessage(getConsumerID(consumer), credits));
+   }
+
+   public void forceDelivery(final ClientConsumer consumer, final long sequence) throws ActiveMQException
+   {
+      SessionForceConsumerDelivery request = new SessionForceConsumerDelivery(getConsumerID(consumer), sequence);
+      sessionChannel.send(request);
+   }
+
+   public void simpleCommit() throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_COMMIT), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new RollbackMessage(lastMessageAsDelivered), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void sessionStart() throws ActiveMQException
+   {
+      sessionChannel.send(new PacketImpl(PacketImpl.SESS_START));
+   }
+
+   public void sessionStop() throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_STOP), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void addSessionMetadata(String key, String data) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new SessionAddMetaDataMessageV2(key, data), PacketImpl.NULL_RESPONSE);
+   }
+
+
+   public void addUniqueMetaData(String key, String data) throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new SessionUniqueAddMetaDataMessage(key, data), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
+   {
+      SessionXACommitMessage packet = new SessionXACommitMessage(xid, onePhase);
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         throw new XAException(response.getResponseCode());
+      }
+
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
+      {
+         ActiveMQClientLogger.LOGGER.trace("finished commit on " + ClientSessionImpl.convert(xid) + " with response = " + response);
+      }
+   }
+
+   public void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
+   {
+      Packet packet;
+      if (flags == XAResource.TMSUSPEND)
+      {
+         packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
+      }
+      else if (flags == XAResource.TMSUCCESS)
+      {
+         packet = new SessionXAEndMessage(xid, false);
+      }
+      else if (flags == XAResource.TMFAIL)
+      {
+         packet = new SessionXAEndMessage(xid, true);
+      }
+      else
+      {
+         throw new XAException(XAException.XAER_INVAL);
+      }
+
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         throw new XAException(response.getResponseCode());
+      }
+   }
+
+
+   public void sendProducerCreditsMessage(final int credits, final SimpleString address)
+   {
+      sessionChannel.send(new SessionRequestProducerCreditsMessage(credits, address));
+   }
+
+   /**
+    * ActiveMQ does support large messages
+    *
+    * @return
+    */
+   public boolean supportsLargeMessage()
+   {
+      return true;
+   }
+
+   @Override
+   public int getCreditsOnSendingFull(MessageInternal msgI)
+   {
+      return msgI.getEncodeSize();
+   }
+
+   public void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
+   {
+      SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking, handler);
+
+      if (sendBlocking)
+      {
+         sessionChannel.sendBlocking(packet, PacketImpl.NULL_RESPONSE);
+      }
+      else
+      {
+         sessionChannel.sendBatched(packet);
+      }
+   }
+
+   @Override
+   public int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws ActiveMQException
+   {
+      SessionSendLargeMessage initialChunk = new SessionSendLargeMessage(msgI);
+
+      sessionChannel.send(initialChunk);
+
+      return msgI.getHeadersAndPropertiesEncodeSize();
+   }
+
+   @Override
+   public int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
+   {
+      final boolean requiresResponse = lastChunk && sendBlocking;
+      final SessionSendContinuationMessage chunkPacket =
+         new SessionSendContinuationMessage(msgI, chunk, !lastChunk,
+                                            requiresResponse, messageBodySize, messageHandler);
+
+      if (requiresResponse)
+      {
+         // When sending it blocking, only the last chunk will be blocking.
+         sessionChannel.sendBlocking(chunkPacket, PacketImpl.NULL_RESPONSE);
+      }
+      else
+      {
+         sessionChannel.send(chunkPacket);
+      }
+
+      return chunkPacket.getPacketSize();
+   }
+
+   public void sendACK(boolean individual, boolean block, final ClientConsumer consumer, final Message message) throws ActiveMQException
+   {
+      PacketImpl messagePacket;
+      if (individual)
+      {
+         messagePacket = new SessionIndividualAcknowledgeMessage(getConsumerID(consumer), message.getMessageID(), block);
+      }
+      else
+      {
+         messagePacket = new SessionAcknowledgeMessage(getConsumerID(consumer), message.getMessageID(), block);
+      }
+
+      if (block)
+      {
+         sessionChannel.sendBlocking(messagePacket, PacketImpl.NULL_RESPONSE);
+      }
+      else
+      {
+         sessionChannel.sendBatched(messagePacket);
+      }
+   }
+
+   public void expireMessage(final ClientConsumer consumer, Message message) throws ActiveMQException
+   {
+      SessionExpireMessage messagePacket = new SessionExpireMessage(getConsumerID(consumer), message.getMessageID());
+
+      sessionChannel.send(messagePacket);
+   }
+
+
+   public void sessionClose() throws ActiveMQException
+   {
+      sessionChannel.sendBlocking(new SessionCloseMessage(), PacketImpl.NULL_RESPONSE);
+   }
+
+   public void xaForget(Xid xid) throws XAException, ActiveMQException
+   {
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(new SessionXAForgetMessage(xid), PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         throw new XAException(response.getResponseCode());
+      }
+   }
+
+   public int xaPrepare(Xid xid) throws XAException, ActiveMQException
+   {
+      SessionXAPrepareMessage packet = new SessionXAPrepareMessage(xid);
+
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         throw new XAException(response.getResponseCode());
+      }
+      else
+      {
+         return response.getResponseCode();
+      }
+   }
+
+   public Xid[] xaScan() throws ActiveMQException
+   {
+      SessionXAGetInDoubtXidsResponseMessage response = (SessionXAGetInDoubtXidsResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS), PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
+
+      List<Xid> xids = response.getXids();
+
+      Xid[] xidArray = xids.toArray(new Xid[xids.size()]);
+
+      return xidArray;
+   }
+
+   public void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
+   {
+      SessionXARollbackMessage packet = new SessionXARollbackMessage(xid);
+
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         throw new XAException(response.getResponseCode());
+      }
+   }
+
+   public void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
+   {
+      Packet packet;
+      if (flags == XAResource.TMJOIN)
+      {
+         packet = new SessionXAJoinMessage(xid);
+      }
+      else if (flags == XAResource.TMRESUME)
+      {
+         packet = new SessionXAResumeMessage(xid);
+      }
+      else if (flags == XAResource.TMNOFLAGS)
+      {
+         // Don't need to flush since the previous end will have done this
+         packet = new SessionXAStartMessage(xid);
+      }
+      else
+      {
+         throw new XAException(XAException.XAER_INVAL);
+      }
+
+      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
+
+      if (response.isError())
+      {
+         ActiveMQClientLogger.LOGGER.errorCallingStart(response.getMessage(), response.getResponseCode());
+         throw new XAException(response.getResponseCode());
+      }
+   }
+
+   public boolean configureTransactionTimeout(int seconds) throws ActiveMQException
+   {
+      SessionXASetTimeoutResponseMessage response = (SessionXASetTimeoutResponseMessage) sessionChannel.sendBlocking(new SessionXASetTimeoutMessage(seconds), PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
+
+      return response.isOK();
+   }
+
+   public int recoverSessionTimeout() throws ActiveMQException
+   {
+      SessionXAGetTimeoutResponseMessage response = (SessionXAGetTimeoutResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT), PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
+
+      return response.getTimeoutSeconds();
+   }
+
+   public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws ActiveMQException
+   {
+      CreateQueueMessage request = new CreateQueueMessage(address, queueName, filterString, durable, temp, true);
+      sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
+   }
+
+   @Override
+   public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
+   {
+
+      this.remotingConnection = newConnection;
+
+      sessionChannel.transferConnection((CoreRemotingConnection) newConnection);
+
+      Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID());
+
+      Channel channel1 = getCoreConnection().getChannel(1, -1);
+
+      ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP);
+
+      if (response.isReattached())
+      {
+         if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQClientLogger.LOGGER.debug("ClientSession reattached fine, replaying commands");
+         }
+         // The session was found on the server - we reattached transparently ok
+
+         sessionChannel.replayCommands(response.getLastConfirmedCommandID());
+
+         return true;
+      }
+      else
+      {
+
+         sessionChannel.clearCommands();
+
+         return false;
+      }
+
+   }
+
+   public void recreateSession(final String username,
+                               final String password,
+                               final int minLargeMessageSize,
+                               final boolean xa,
+                               final boolean autoCommitSends,
+                               final boolean autoCommitAcks,
+                               final boolean preAcknowledge,
+                               final SimpleString defaultAddress) throws ActiveMQException
+   {
+      Packet createRequest = new CreateSessionMessage(name,
+                                                      sessionChannel.getID(),
+                                                      getServerVersion(),
+                                                      username,
+                                                      password,
+                                                      minLargeMessageSize,
+                                                      xa,
+                                                      autoCommitSends,
+                                                      autoCommitAcks,
+                                                      preAcknowledge,
+                                                      confirmationWindow,
+                                                      defaultAddress == null ? null
+                                                         : defaultAddress.toString());
+      boolean retry;
+      do
+      {
+         try
+         {
+            getCreateChannel().sendBlocking(createRequest, PacketImpl.CREATESESSION_RESP);
+            retry = false;
+         }
+         catch (ActiveMQException e)
+         {
+            // the session was created while its server was starting, retry it:
+            if (e.getType() == ActiveMQExceptionType.SESSION_CREATION_REJECTED)
+            {
+               ActiveMQClientLogger.LOGGER.retryCreateSessionSeverStarting(name);
+               retry = true;
+               // sleep a little bit to avoid spinning too much
+               try
+               {
+                  Thread.sleep(10);
+               }
+               catch (InterruptedException ie)
+               {
+                  Thread.currentThread().interrupt();
+                  throw e;
+               }
+            }
+            else
+            {
+               throw e;
+            }
+         }
+      }
+      while (retry && !session.isClosing());
+   }
+
+   @Override
+   public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws ActiveMQException
+   {
+      ClientSession.QueueQuery queueInfo = consumerInternal.getQueueInfo();
+
+      // We try and recreate any non durable queues, since they probably won't be there unless
+      // they are defined in hornetq-configuration.xml
+      // This allows e.g. JMS non durable subs and temporary queues to continue to be used after failover
+      if (!queueInfo.isDurable())
+      {
+         CreateQueueMessage createQueueRequest = new CreateQueueMessage(queueInfo.getAddress(),
+                                                                        queueInfo.getName(),
+                                                                        queueInfo.getFilterString(),
+                                                                        false,
+                                                                        queueInfo.isTemporary(),
+                                                                        false);
+
+         sendPacketWithoutLock(sessionChannel, createQueueRequest);
+      }
+
+      SessionCreateConsumerMessage createConsumerRequest = new SessionCreateConsumerMessage(getConsumerID(consumerInternal),
+                                                                                            consumerInternal.getQueueName(),
+                                                                                            consumerInternal.getFilterString(),
+                                                                                            consumerInternal.isBrowseOnly(),
+                                                                                            false);
+
+      sendPacketWithoutLock(sessionChannel, createConsumerRequest);
+
+      int clientWindowSize = consumerInternal.getClientWindowSize();
+
+      if (clientWindowSize != 0)
+      {
+         SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal),
+                                                                                        clientWindowSize);
+
+         sendPacketWithoutLock(sessionChannel, packet);
+      }
+      else
+      {
+         // https://jira.jboss.org/browse/HORNETQ-522
+         SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal),
+                                                                                        1);
+         sendPacketWithoutLock(sessionChannel, packet);
+      }
+   }
+
+   public void xaFailed(Xid xid) throws ActiveMQException
+   {
+      sendPacketWithoutLock(sessionChannel, new SessionXAAfterFailedMessage(xid));
+   }
+
+   public void restartSession() throws ActiveMQException
+   {
+      sendPacketWithoutLock(sessionChannel, new PacketImpl(PacketImpl.SESS_START));
+   }
+
+   @Override
+   public void resetMetadata(HashMap<String, String> metaDataToSend)
+   {
+      // Resetting the metadata after failover
+      for (Map.Entry<String, String> entries : metaDataToSend.entrySet())
+      {
+         sendPacketWithoutLock(sessionChannel, new SessionAddMetaDataMessageV2(entries.getKey(), entries.getValue(), false));
+      }
+   }
+
+
+   private Channel getCreateChannel()
+   {
+      return getCoreConnection().getChannel(1, -1);
+   }
+
+   private CoreRemotingConnection getCoreConnection()
+   {
+      return (CoreRemotingConnection) remotingConnection;
+   }
+
+
+   /**
+    * This doesn't apply to other protocols probably, so it will be an ActiveMQ exclusive feature
+    *
+    * @throws org.apache.activemq.api.core.ActiveMQException
+    */
+   private void handleConsumerDisconnected(DisconnectConsumerMessage packet) throws ActiveMQException
+   {
+      DisconnectConsumerMessage message = packet;
+
+      session.handleConsumerDisconnect(new ActiveMQConsumerContext(message.getConsumerId()));
+   }
+
+   private void handleReceivedMessagePacket(SessionReceiveMessage messagePacket) throws Exception
+   {
+      ClientMessageInternal msgi = (ClientMessageInternal) messagePacket.getMessage();
+
+      msgi.setDeliveryCount(messagePacket.getDeliveryCount());
+
+      msgi.setFlowControlSize(messagePacket.getPacketSize());
+
+      handleReceiveMessage(new ActiveMQConsumerContext(messagePacket.getConsumerID()), msgi);
+   }
+
+   private void handleReceiveLargeMessage(SessionReceiveLargeMessage serverPacket) throws Exception
+   {
+      ClientLargeMessageInternal clientLargeMessage = (ClientLargeMessageInternal) serverPacket.getLargeMessage();
+
+      clientLargeMessage.setFlowControlSize(serverPacket.getPacketSize());
+
+      clientLargeMessage.setDeliveryCount(serverPacket.getDeliveryCount());
+
+      handleReceiveLargeMessage(new ActiveMQConsumerContext(serverPacket.getConsumerID()), clientLargeMessage, serverPacket.getLargeMessageSize());
+   }
+
+
+   private void handleReceiveContinuation(SessionReceiveContinuationMessage continuationPacket) throws Exception
+   {
+      handleReceiveContinuation(new ActiveMQConsumerContext(continuationPacket.getConsumerID()), continuationPacket.getBody(), continuationPacket.getPacketSize(),
+                                continuationPacket.isContinues());
+   }
+
+
+   protected void handleReceiveProducerCredits(SessionProducerCreditsMessage message)
+   {
+      handleReceiveProducerCredits(message.getAddress(), message.getCredits());
+   }
+
+
+   protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message)
+   {
+      handleReceiveProducerFailCredits(message.getAddress(), message.getCredits());
+   }
+
+   class ClientSessionPacketHandler implements ChannelHandler
+   {
+
+      public void handlePacket(final Packet packet)
+      {
+         byte type = packet.getType();
+
+         try
+         {
+            switch (type)
+            {
+               case DISCONNECT_CONSUMER:
+               {
+                  handleConsumerDisconnected((DisconnectConsumerMessage) packet);
+                  break;
+               }
+               case SESS_RECEIVE_CONTINUATION:
+               {
+                  handleReceiveContinuation((SessionReceiveContinuationMessage) packet);
+
+                  break;
+               }
+               case SESS_RECEIVE_MSG:
+               {
+                  handleReceivedMessagePacket((SessionReceiveMessage) packet);
+
+                  break;
+               }
+               case SESS_RECEIVE_LARGE_MSG:
+               {
+                  handleReceiveLargeMessage((SessionReceiveLargeMessage) packet);
+
+                  break;
+               }
+               case PacketImpl.SESS_PRODUCER_CREDITS:
+               {
+                  handleReceiveProducerCredits((SessionProducerCreditsMessage) packet);
+
+                  break;
+               }
+               case PacketImpl.SESS_PRODUCER_FAIL_CREDITS:
+               {
+                  handleReceiveProducerFailCredits((SessionProducerCreditsFailMessage) packet);
+
+                  break;
+               }
+               case EXCEPTION:
+               {
+                  // We can only log these exceptions
+                  // maybe we should cache it on SessionContext and throw an exception on any next calls
+                  ActiveMQExceptionMessage mem = (ActiveMQExceptionMessage) packet;
+
+                  ActiveMQClientLogger.LOGGER.receivedExceptionAsynchronously(mem.getException());
+
+                  break;
+               }
+               default:
+               {
+                  throw new IllegalStateException("Invalid packet: " + type);
+               }
+            }
+         }
+         catch (Exception e)
+         {
+            ActiveMQClientLogger.LOGGER.failedToHandlePacket(e);
+         }
+
+         sessionChannel.confirm(packet);
+      }
+   }
+
+   private long getConsumerID(ClientConsumer consumer)
+   {
+      return ((ActiveMQConsumerContext)consumer.getConsumerContext()).getId();
+   }
+
+   private ClassLoader lookupTCCL()
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+      {
+         public ClassLoader run()
+         {
+            return Thread.currentThread().getContextClassLoader();
+         }
+      });
+
+   }
+
+   private int calcWindowSize(final int windowSize)
+   {
+      int clientWindowSize;
+      if (windowSize == -1)
+      {
+         // No flow control - buffer can increase without bound! Only use with
+         // caution for very fast consumers
+         clientWindowSize = -1;
+      }
+      else if (windowSize == 0)
+      {
+         // Slow consumer - no buffering
+         clientWindowSize = 0;
+      }
+      else if (windowSize == 1)
+      {
+         // Slow consumer = buffer 1
+         clientWindowSize = 1;
+      }
+      else if (windowSize > 1)
+      {
+         // Client window size is half server window size
+         clientWindowSize = windowSize >> 1;
+      }
+      else
+      {
+         throw ActiveMQClientMessageBundle.BUNDLE.invalidWindowSize(windowSize);
+      }
+
+      return clientWindowSize;
+   }
+
+
+   private void sendPacketWithoutLock(final Channel parameterChannel, final Packet packet)
+   {
+      packet.setChannelID(parameterChannel.getID());
+
+      Connection conn = parameterChannel.getConnection().getTransportConnection();
+
+      ActiveMQBuffer buffer = packet.encode(this.getCoreConnection());
+
+      conn.write(buffer, false, false);
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ChannelImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ChannelImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ChannelImpl.java
index c5709b4..de7a3ef 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ChannelImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ChannelImpl.java
@@ -25,14 +25,14 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.protocol.core.Channel;
 import org.apache.activemq.core.protocol.core.ChannelHandler;
 import org.apache.activemq.core.protocol.core.CommandConfirmationHandler;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.core.protocol.core.Packet;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 
@@ -83,7 +83,7 @@ public final class ChannelImpl implements Channel
       }
    }
 
-   private static final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
    private volatile long id;
 
@@ -193,7 +193,7 @@ public final class ChannelImpl implements Channel
 
       try
       {
-         response = new HornetQExceptionMessage(HornetQClientMessageBundle.BUNDLE.unblockingACall(cause));
+         response = new ActiveMQExceptionMessage(ActiveMQClientMessageBundle.BUNDLE.unblockingACall(cause));
 
          sendCondition.signal();
       }
@@ -237,7 +237,7 @@ public final class ChannelImpl implements Channel
 
          if (isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Sending packet nonblocking " + packet + " on channeID=" + id);
+            ActiveMQClientLogger.LOGGER.trace("Sending packet nonblocking " + packet + " on channeID=" + id);
          }
 
          ActiveMQBuffer buffer = packet.encode(connection);
@@ -277,7 +277,7 @@ public final class ChannelImpl implements Channel
 
          if (isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Writing buffer for channelID=" + id);
+            ActiveMQClientLogger.LOGGER.trace("Writing buffer for channelID=" + id);
          }
 
 
@@ -301,12 +301,12 @@ public final class ChannelImpl implements Channel
       if (interceptionResult != null)
       {
          // if we don't throw an exception here the client might not unblock
-         throw HornetQClientMessageBundle.BUNDLE.interceptorRejectedPacket(interceptionResult);
+         throw ActiveMQClientMessageBundle.BUNDLE.interceptorRejectedPacket(interceptionResult);
       }
 
       if (closed)
       {
-         throw HornetQClientMessageBundle.BUNDLE.connectionDestroyed();
+         throw ActiveMQClientMessageBundle.BUNDLE.connectionDestroyed();
       }
 
       if (connection.getBlockingCallTimeout() == -1)
@@ -341,7 +341,7 @@ public final class ChannelImpl implements Channel
                   {
                      if (!failoverCondition.await(connection.getBlockingCallFailoverTimeout(), TimeUnit.MILLISECONDS))
                      {
-                        HornetQClientLogger.LOGGER.debug("timed-out waiting for failover condition");
+                        ActiveMQClientLogger.LOGGER.debug("timed-out waiting for failover condition");
                      }
                   }
                }
@@ -378,7 +378,7 @@ public final class ChannelImpl implements Channel
 
                if (response != null && response.getType() != PacketImpl.EXCEPTION && response.getType() != expectedPacket)
                {
-                  HornetQClientLogger.LOGGER.packetOutOfOrder(response, new Exception("trace"));
+                  ActiveMQClientLogger.LOGGER.packetOutOfOrder(response, new Exception("trace"));
                }
 
                if (closed)
@@ -395,12 +395,12 @@ public final class ChannelImpl implements Channel
 
             if (response == null)
             {
-               throw HornetQClientMessageBundle.BUNDLE.timedOutSendingPacket(packet.getType());
+               throw ActiveMQClientMessageBundle.BUNDLE.timedOutSendingPacket(packet.getType());
             }
 
             if (response.getType() == PacketImpl.EXCEPTION)
             {
-               final HornetQExceptionMessage mem = (HornetQExceptionMessage) response;
+               final ActiveMQExceptionMessage mem = (ActiveMQExceptionMessage) response;
 
                ActiveMQException e = mem.getException();
 
@@ -433,13 +433,13 @@ public final class ChannelImpl implements Channel
             {
                boolean callNext = interceptor.intercept(packet, connection);
 
-               if (HornetQClientLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                {
                   // use a StringBuilder for speed since this may be executed a lot
                   StringBuilder msg = new StringBuilder();
                   msg.append("Invocation of interceptor ").append(interceptor.getClass().getName()).append(" on ").
                      append(packet).append(" returned ").append(callNext);
-                  HornetQClientLogger.LOGGER.debug(msg.toString());
+                  ActiveMQClientLogger.LOGGER.debug(msg.toString());
                }
 
                if (!callNext)
@@ -449,7 +449,7 @@ public final class ChannelImpl implements Channel
             }
             catch (final Throwable e)
             {
-               HornetQClientLogger.LOGGER.errorCallingInterceptor(e, interceptor);
+               ActiveMQClientLogger.LOGGER.errorCallingInterceptor(e, interceptor);
             }
          }
       }
@@ -488,7 +488,7 @@ public final class ChannelImpl implements Channel
 
       if (!connection.isDestroyed() && !connection.removeChannel(id))
       {
-         throw HornetQClientMessageBundle.BUNDLE.noChannelToClose(id);
+         throw ActiveMQClientMessageBundle.BUNDLE.noChannelToClose(id);
       }
 
       if (failingOver)
@@ -524,7 +524,7 @@ public final class ChannelImpl implements Channel
       {
          if (isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Replaying commands on channelID=" + id);
+            ActiveMQClientLogger.LOGGER.trace("Replaying commands on channelID=" + id);
          }
          clearUpTo(otherLastConfirmedCommandID);
 
@@ -664,7 +664,7 @@ public final class ChannelImpl implements Channel
 
       if (numberToClear == -1)
       {
-         throw HornetQClientMessageBundle.BUNDLE.invalidCommandID(lastReceivedCommandID);
+         throw ActiveMQClientMessageBundle.BUNDLE.invalidCommandID(lastReceivedCommandID);
       }
 
       int sizeToFree = 0;
@@ -677,7 +677,7 @@ public final class ChannelImpl implements Channel
          {
             if (lastReceivedCommandID > 0)
             {
-               HornetQClientLogger.LOGGER.cannotFindPacketToClear(lastReceivedCommandID, firstStoredCommandID);
+               ActiveMQClientLogger.LOGGER.cannotFindPacketToClear(lastReceivedCommandID, firstStoredCommandID);
             }
             firstStoredCommandID = lastReceivedCommandID + 1;
             return;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManager.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManager.java
deleted file mode 100644
index c98db97..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManager.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.core.impl;
-
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
-
-import io.netty.channel.ChannelPipeline;
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.ActiveMQInterruptedException;
-import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.api.core.Pair;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.HornetQClient;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
-import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
-import org.apache.activemq.core.protocol.ClientPacketDecoder;
-import org.apache.activemq.core.protocol.core.Channel;
-import org.apache.activemq.core.protocol.core.ChannelHandler;
-import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
-import org.apache.activemq.core.protocol.core.Packet;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverReplyMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V2;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V3;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage_V2;
-import org.apache.activemq.core.protocol.core.impl.wireformat.Ping;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SubscribeClusterTopologyUpdatesMessageV2;
-import org.apache.activemq.core.remoting.impl.netty.HornetQFrameDecoder2;
-import org.apache.activemq.core.version.Version;
-import org.apache.activemq.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
-import org.apache.activemq.spi.core.remoting.Connection;
-import org.apache.activemq.spi.core.remoting.TopologyResponseHandler;
-import org.apache.activemq.spi.core.remoting.SessionContext;
-import org.apache.activemq.utils.VersionLoader;
-
-/**
- * This class will return specific packets for different types of actions happening on a messaging protocol.
- * <p/>
- * This is trying to unify the Core client into multiple protocols.
- * <p/>
- * Returning null in certain packets means no action is taken on this specific protocol.
- * <p/>
- * Semantic properties could also be added to this implementation.
- * <p/>
- * Implementations of this class need to be stateless.
- *
- * @author Clebert Suconic
- */
-
-public class HornetQClientProtocolManager implements ClientProtocolManager
-{
-   private final int versionID = VersionLoader.getVersion().getIncrementingVersion();
-
-   private ClientSessionFactoryInternal factoryInternal;
-
-   /**
-    * Guards assignments to {@link #inCreateSession} and {@link #inCreateSessionLatch}
-    */
-   private final Object inCreateSessionGuard = new Object();
-
-   /**
-    * Flag that tells whether we are trying to create a session.
-    */
-   private boolean inCreateSession;
-
-   /**
-    * Used to wait for the creation of a session.
-    */
-   private CountDownLatch inCreateSessionLatch;
-
-   protected volatile RemotingConnectionImpl connection;
-
-   protected TopologyResponseHandler topologyResponseHandler;
-
-   /**
-    * Flag that signals that the communication is closing. Causes many processes to exit.
-    */
-   private volatile boolean alive = true;
-
-   private final CountDownLatch waitLatch = new CountDownLatch(1);
-
-
-   public HornetQClientProtocolManager()
-   {
-   }
-
-   public String getName()
-   {
-      return HornetQClient.DEFAULT_CORE_PROTOCOL;
-   }
-
-   public void setSessionFactory(ClientSessionFactory factory)
-   {
-      this.factoryInternal = (ClientSessionFactoryInternal)factory;
-   }
-
-   public ClientSessionFactory getSessionFactory()
-   {
-      return this.factoryInternal;
-   }
-
-   @Override
-   public void addChannelHandlers(ChannelPipeline pipeline)
-   {
-      pipeline.addLast("hornetq-decoder", new HornetQFrameDecoder2());
-   }
-
-   public boolean waitOnLatch(long milliseconds) throws InterruptedException
-   {
-      return waitLatch.await(milliseconds, TimeUnit.MILLISECONDS);
-   }
-
-   public Channel getChannel0()
-   {
-      if (connection == null)
-      {
-         return null;
-      }
-      else
-      {
-         return connection.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
-      }
-   }
-
-   public RemotingConnection getCurrentConnection()
-   {
-      return connection;
-   }
-
-
-   public Channel getChannel1()
-   {
-      if (connection == null)
-      {
-         return null;
-      }
-      else
-      {
-         return connection.getChannel(1, -1);
-      }
-   }
-
-   public Lock lockSessionCreation()
-   {
-      try
-      {
-         Lock localFailoverLock = factoryInternal.lockFailover();
-         try
-         {
-            if (connection == null)
-            {
-               return null;
-            }
-
-            Lock lock = getChannel1().getLock();
-
-            // Lock it - this must be done while the failoverLock is held
-            while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS))
-            {
-            }
-
-            return lock;
-         }
-         finally
-         {
-            localFailoverLock.unlock();
-         }
-         // We can now release the failoverLock
-      }
-      catch (InterruptedException e)
-      {
-         Thread.currentThread().interrupt();
-         return null;
-      }
-   }
-
-
-   public void stop()
-   {
-      alive = false;
-
-
-      synchronized (inCreateSessionGuard)
-      {
-         if (inCreateSessionLatch != null)
-            inCreateSessionLatch.countDown();
-      }
-
-
-      Channel channel1 = getChannel1();
-      if (channel1 != null)
-      {
-         channel1.returnBlocking();
-      }
-
-      waitLatch.countDown();
-
-   }
-
-   public boolean isAlive()
-   {
-      return alive;
-   }
-
-
-   @Override
-   public void ping(long connectionTTL)
-   {
-      Channel channel = connection.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
-
-      Ping ping = new Ping(connectionTTL);
-
-      channel.send(ping);
-
-      connection.flush();
-   }
-
-   @Override
-   public void sendSubscribeTopology(final boolean isServer)
-   {
-      getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer,
-                                                                      VersionLoader.getVersion()
-                                                                         .getIncrementingVersion()));
-   }
-
-   @Override
-   public SessionContext createSessionContext(String name, String username, String password,
-                                              boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
-                                              boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
-   {
-      for (Version clientVersion : VersionLoader.getClientVersions())
-      {
-         try
-         {
-            return createSessionContext(clientVersion,
-                                        name,
-                                        username,
-                                        password,
-                                        xa,
-                                        autoCommitSends,
-                                        autoCommitAcks,
-                                        preAcknowledge,
-                                        minLargeMessageSize,
-                                        confirmationWindowSize);
-         }
-         catch (ActiveMQException e)
-         {
-            if (e.getType() != ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
-            {
-               throw e;
-            }
-         }
-      }
-      connection.destroy();
-      throw new ActiveMQException(ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
-   }
-
-   public SessionContext createSessionContext(Version clientVersion, String name, String username, String password,
-                                              boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
-                                              boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
-   {
-      if (!isAlive())
-         throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
-
-      Channel sessionChannel = null;
-      CreateSessionResponseMessage response = null;
-
-      boolean retry;
-      do
-      {
-         retry = false;
-
-         Lock lock = null;
-
-         try
-         {
-
-            lock = lockSessionCreation();
-
-            // We now set a flag saying createSession is executing
-            synchronized (inCreateSessionGuard)
-            {
-               if (!isAlive())
-                  throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
-               inCreateSession = true;
-               inCreateSessionLatch = new CountDownLatch(1);
-            }
-
-            long sessionChannelID = connection.generateChannelID();
-
-            Packet request = new CreateSessionMessage(name,
-                                                      sessionChannelID,
-                                                      clientVersion.getIncrementingVersion(),
-                                                      username,
-                                                      password,
-                                                      minLargeMessageSize,
-                                                      xa,
-                                                      autoCommitSends,
-                                                      autoCommitAcks,
-                                                      preAcknowledge,
-                                                      confirmationWindowSize,
-                                                      null);
-
-
-            try
-            {
-               // channel1 reference here has to go away
-               response = (CreateSessionResponseMessage) getChannel1().sendBlocking(request, PacketImpl.CREATESESSION_RESP);
-            }
-            catch (ActiveMQException cause)
-            {
-               if (!isAlive())
-                  throw cause;
-
-               if (cause.getType() == ActiveMQExceptionType.UNBLOCKED)
-               {
-                  // This means the thread was blocked on create session and failover unblocked it
-                  // so failover could occur
-
-                  retry = true;
-
-                  continue;
-               }
-               else
-               {
-                  throw cause;
-               }
-            }
-
-            sessionChannel = connection.getChannel(sessionChannelID, confirmationWindowSize);
-
-
-         }
-         catch (Throwable t)
-         {
-            if (lock != null)
-            {
-               lock.unlock();
-               lock = null;
-            }
-
-            if (t instanceof ActiveMQException)
-            {
-               throw (ActiveMQException) t;
-            }
-            else
-            {
-               throw HornetQClientMessageBundle.BUNDLE.failedToCreateSession(t);
-            }
-         }
-         finally
-         {
-            if (lock != null)
-            {
-               lock.unlock();
-            }
-
-            // Execution has finished so notify any failover thread that may be waiting for us to be done
-            inCreateSession = false;
-            inCreateSessionLatch.countDown();
-         }
-      }
-      while (retry);
-
-
-      // these objects won't be null, otherwise it would keep retrying on the previous loop
-      return new HornetQSessionContext(name, connection, sessionChannel, response.getServerVersion(), confirmationWindowSize);
-
-   }
-
-   public boolean cleanupBeforeFailover(ActiveMQException cause)
-   {
-
-      boolean needToInterrupt;
-
-      CountDownLatch exitLockLatch;
-      Lock lock = lockSessionCreation();
-
-      if (lock == null)
-      {
-         return false;
-      }
-
-      try
-      {
-         synchronized (inCreateSessionGuard)
-         {
-            needToInterrupt = inCreateSession;
-            exitLockLatch = inCreateSessionLatch;
-         }
-      }
-      finally
-      {
-         lock.unlock();
-      }
-
-      if (needToInterrupt)
-      {
-         forceReturnChannel1(cause);
-
-         // Now we need to make sure that the thread has actually exited and returned it's
-         // connections
-         // before failover occurs
-
-         while (inCreateSession && isAlive())
-         {
-            try
-            {
-               if (exitLockLatch != null)
-               {
-                  exitLockLatch.await(500, TimeUnit.MILLISECONDS);
-               }
-            }
-            catch (InterruptedException e1)
-            {
-               throw new ActiveMQInterruptedException(e1);
-            }
-         }
-      }
-
-      return true;
-   }
-
-   @Override
-   public boolean checkForFailover(String liveNodeID) throws ActiveMQException
-   {
-      CheckFailoverMessage packet = new CheckFailoverMessage(liveNodeID);
-      CheckFailoverReplyMessage message = (CheckFailoverReplyMessage) getChannel1().sendBlocking(packet,
-                                                                                                 PacketImpl.CHECK_FOR_FAILOVER_REPLY);
-      return message.isOkToFailover();
-   }
-
-
-   public RemotingConnection connect(Connection transportConnection, long callTimeout, long callFailoverTimeout,
-                                     List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors,
-                                     TopologyResponseHandler topologyResponseHandler)
-   {
-      this.connection = new RemotingConnectionImpl(getPacketDecoder(), transportConnection,
-                                                                             callTimeout, callFailoverTimeout,
-                                                                             incomingInterceptors, outgoingInterceptors);
-
-      this.topologyResponseHandler = topologyResponseHandler;
-
-      getChannel0().setHandler(new Channel0Handler(connection));
-
-
-      sendHandshake(transportConnection);
-
-      return connection;
-   }
-
-   private void sendHandshake(Connection transportConnection)
-   {
-      if (transportConnection.isUsingProtocolHandling())
-      {
-         // no need to send handshake on inVM as inVM is not using the NettyProtocolHandling
-         String handshake = "HORNETQ";
-         ActiveMQBuffer hqbuffer = connection.createBuffer(handshake.length());
-         hqbuffer.writeBytes(handshake.getBytes());
-         transportConnection.write(hqbuffer);
-      }
-   }
-
-
-   private class Channel0Handler implements ChannelHandler
-   {
-      private final CoreRemotingConnection conn;
-
-      private Channel0Handler(final CoreRemotingConnection conn)
-      {
-         this.conn = conn;
-      }
-
-      public void handlePacket(final Packet packet)
-      {
-         final byte type = packet.getType();
-
-         if (type == PacketImpl.DISCONNECT || type == PacketImpl.DISCONNECT_V2)
-         {
-            final DisconnectMessage msg = (DisconnectMessage) packet;
-            String scaleDownTargetNodeID = null;
-
-            SimpleString nodeID = msg.getNodeID();
-
-            if (packet instanceof DisconnectMessage_V2)
-            {
-               final DisconnectMessage_V2 msg_v2 = (DisconnectMessage_V2) packet;
-               scaleDownTargetNodeID = msg_v2.getScaleDownNodeID() == null ? null : msg_v2.getScaleDownNodeID().toString();
-            }
-
-            if (topologyResponseHandler != null)
-               topologyResponseHandler.nodeDisconnected(conn, nodeID == null ? null : nodeID.toString(), scaleDownTargetNodeID);
-         }
-         else if (type == PacketImpl.CLUSTER_TOPOLOGY)
-         {
-            ClusterTopologyChangeMessage topMessage = (ClusterTopologyChangeMessage) packet;
-            notifyTopologyChange(topMessage);
-         }
-         else if (type == PacketImpl.CLUSTER_TOPOLOGY_V2)
-         {
-            ClusterTopologyChangeMessage_V2 topMessage = (ClusterTopologyChangeMessage_V2) packet;
-            notifyTopologyChange(topMessage);
-         }
-         else if (type == PacketImpl.CLUSTER_TOPOLOGY || type == PacketImpl.CLUSTER_TOPOLOGY_V2 || type == PacketImpl.CLUSTER_TOPOLOGY_V3)
-         {
-            ClusterTopologyChangeMessage topMessage = (ClusterTopologyChangeMessage) packet;
-            notifyTopologyChange(topMessage);
-         }
-         else if (type == PacketImpl.CHECK_FOR_FAILOVER_REPLY)
-         {
-            System.out.println("Channel0Handler.handlePacket");
-         }
-      }
-
-      /**
-       * @param topMessage
-       */
-      private void notifyTopologyChange(final ClusterTopologyChangeMessage topMessage)
-      {
-         final long eventUID;
-         final String backupGroupName;
-         final String scaleDownGroupName;
-         if (topMessage instanceof ClusterTopologyChangeMessage_V3)
-         {
-            eventUID = ((ClusterTopologyChangeMessage_V3) topMessage).getUniqueEventID();
-            backupGroupName = ((ClusterTopologyChangeMessage_V3) topMessage).getBackupGroupName();
-            scaleDownGroupName = ((ClusterTopologyChangeMessage_V3) topMessage).getScaleDownGroupName();
-         }
-         else if (topMessage instanceof ClusterTopologyChangeMessage_V2)
-         {
-            eventUID = ((ClusterTopologyChangeMessage_V2) topMessage).getUniqueEventID();
-            backupGroupName = ((ClusterTopologyChangeMessage_V2) topMessage).getBackupGroupName();
-            scaleDownGroupName = null;
-         }
-         else
-         {
-            eventUID = System.currentTimeMillis();
-            backupGroupName = null;
-            scaleDownGroupName = null;
-         }
-
-         if (topMessage.isExit())
-         {
-            if (HornetQClientLogger.LOGGER.isDebugEnabled())
-            {
-               HornetQClientLogger.LOGGER.debug("Notifying " + topMessage.getNodeID() + " going down");
-            }
-
-            if (topologyResponseHandler != null)
-            {
-               topologyResponseHandler.notifyNodeDown(eventUID, topMessage.getNodeID());
-            }
-         }
-         else
-         {
-            Pair<TransportConfiguration, TransportConfiguration> transportConfig = topMessage.getPair();
-            if (transportConfig.getA() == null && transportConfig.getB() == null)
-            {
-               transportConfig = new Pair<>(conn.getTransportConnection()
-                                               .getConnectorConfig(),
-                                            null);
-            }
-
-            if (topologyResponseHandler != null)
-            {
-               topologyResponseHandler.notifyNodeUp(eventUID, topMessage.getNodeID(), backupGroupName, scaleDownGroupName, transportConfig, topMessage.isLast());
-            }
-         }
-      }
-   }
-
-   protected PacketDecoder getPacketDecoder()
-   {
-      return ClientPacketDecoder.INSTANCE;
-   }
-
-   private void forceReturnChannel1(ActiveMQException cause)
-   {
-      if (connection != null)
-      {
-         Channel channel1 = connection.getChannel(1, -1);
-
-         if (channel1 != null)
-         {
-            channel1.returnBlocking(cause);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManagerFactory.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManagerFactory.java
deleted file mode 100644
index 103e20d..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQClientProtocolManagerFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.core.impl;
-
-import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
-import org.apache.activemq.spi.core.remoting.ClientProtocolManagerFactory;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQClientProtocolManagerFactory implements ClientProtocolManagerFactory
-{
-   private static final long serialVersionUID = 1;
-
-   private static final HornetQClientProtocolManagerFactory INSTANCE = new HornetQClientProtocolManagerFactory();
-
-   private HornetQClientProtocolManagerFactory()
-   {
-   }
-
-   public static final HornetQClientProtocolManagerFactory getInstance()
-   {
-      return INSTANCE;
-   }
-
-   public ClientProtocolManager newProtocolManager()
-   {
-      return new HornetQClientProtocolManager();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQConsumerContext.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQConsumerContext.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQConsumerContext.java
deleted file mode 100644
index 27585e8..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQConsumerContext.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.core.impl;
-
-import org.apache.activemq.spi.core.remoting.ConsumerContext;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQConsumerContext extends ConsumerContext
-{
-   private long id;
-
-   public HornetQConsumerContext(long id)
-   {
-      this.id = id;
-   }
-
-   public long getId()
-   {
-      return id;
-   }
-
-   @Override
-   public boolean equals(Object o)
-   {
-      if (this == o) return true;
-      if (o == null || getClass() != o.getClass()) return false;
-
-      HornetQConsumerContext that = (HornetQConsumerContext) o;
-
-      if (id != that.id) return false;
-
-      return true;
-   }
-
-   @Override
-   public int hashCode()
-   {
-      return (int) (id ^ (id >>> 32));
-   }
-}


[10/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/management/impl/HornetQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/HornetQServerControlImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/HornetQServerControlImpl.java
deleted file mode 100644
index e5efd6b..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/HornetQServerControlImpl.java
+++ /dev/null
@@ -1,2187 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.management.impl;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.transaction.xa.Xid;
-
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.management.AddressControl;
-import org.apache.activemq.api.core.management.BridgeControl;
-import org.apache.activemq.api.core.management.CoreNotificationType;
-import org.apache.activemq.api.core.management.DivertControl;
-import org.apache.activemq.api.core.management.HornetQServerControl;
-import org.apache.activemq.api.core.management.QueueControl;
-import org.apache.activemq.core.config.BridgeConfiguration;
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.config.DivertConfiguration;
-import org.apache.activemq.core.messagecounter.MessageCounterManager;
-import org.apache.activemq.core.messagecounter.impl.MessageCounterManagerImpl;
-import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.persistence.config.PersistedAddressSetting;
-import org.apache.activemq.core.persistence.config.PersistedRoles;
-import org.apache.activemq.core.postoffice.Binding;
-import org.apache.activemq.core.postoffice.DuplicateIDCache;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.postoffice.impl.LocalQueueBinding;
-import org.apache.activemq.core.remoting.server.RemotingService;
-import org.apache.activemq.core.security.CheckType;
-import org.apache.activemq.core.security.Role;
-import org.apache.activemq.core.server.Consumer;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
-import org.apache.activemq.core.server.JournalType;
-import org.apache.activemq.core.server.Queue;
-import org.apache.activemq.core.server.ServerConsumer;
-import org.apache.activemq.core.server.ServerSession;
-import org.apache.activemq.core.server.cluster.ha.HAPolicy;
-import org.apache.activemq.core.server.cluster.ha.LiveOnlyPolicy;
-import org.apache.activemq.core.server.cluster.ha.ScaleDownPolicy;
-import org.apache.activemq.core.server.cluster.ha.SharedStoreSlavePolicy;
-import org.apache.activemq.core.server.group.GroupingHandler;
-import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
-import org.apache.activemq.core.settings.impl.AddressSettings;
-import org.apache.activemq.core.settings.impl.SlowConsumerPolicy;
-import org.apache.activemq.core.transaction.ResourceManager;
-import org.apache.activemq.core.transaction.Transaction;
-import org.apache.activemq.core.transaction.TransactionDetail;
-import org.apache.activemq.core.transaction.impl.CoreTransactionDetail;
-import org.apache.activemq.core.transaction.impl.XidImpl;
-import org.apache.activemq.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.utils.SecurityFormatter;
-import org.apache.activemq.utils.TypedProperties;
-import org.apache.activemq.utils.json.JSONArray;
-import org.apache.activemq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- *
- */
-public class HornetQServerControlImpl extends AbstractControl implements HornetQServerControl, NotificationEmitter,
-                                                                         org.apache.activemq.core.server.management.NotificationListener
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final PostOffice postOffice;
-
-   private final Configuration configuration;
-
-   private final ResourceManager resourceManager;
-
-   private final RemotingService remotingService;
-
-   private final HornetQServer server;
-
-   private final MessageCounterManager messageCounterManager;
-
-   private final NotificationBroadcasterSupport broadcaster;
-
-   private final AtomicLong notifSeq = new AtomicLong(0);
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQServerControlImpl(final PostOffice postOffice,
-                                   final Configuration configuration,
-                                   final ResourceManager resourceManager,
-                                   final RemotingService remotingService,
-                                   final HornetQServer messagingServer,
-                                   final MessageCounterManager messageCounterManager,
-                                   final StorageManager storageManager,
-                                   final NotificationBroadcasterSupport broadcaster) throws Exception
-   {
-      super(HornetQServerControl.class, storageManager);
-      this.postOffice = postOffice;
-      this.configuration = configuration;
-      this.resourceManager = resourceManager;
-      this.remotingService = remotingService;
-      server = messagingServer;
-      this.messageCounterManager = messageCounterManager;
-      this.broadcaster = broadcaster;
-      server.getManagementService().addNotificationListener(this);
-   }
-
-   // HornetQServerControlMBean implementation --------------------
-
-   public boolean isStarted()
-   {
-      clearIO();
-      try
-      {
-         return server.isStarted();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getVersion()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return server.getVersion().getFullVersion();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isBackup()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return server.getHAPolicy().isBackup();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isSharedStore()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return server.getHAPolicy().isSharedStore();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getBindingsDirectory()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getBindingsDirectory();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getInterceptorClassNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getIncomingInterceptorClassNames().toArray(new String[configuration.getIncomingInterceptorClassNames()
-               .size()]);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getIncomingInterceptorClassNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getIncomingInterceptorClassNames().toArray(new String[configuration.getIncomingInterceptorClassNames()
-               .size()]);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getOutgoingInterceptorClassNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getOutgoingInterceptorClassNames().toArray(new String[configuration.getOutgoingInterceptorClassNames()
-               .size()]);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalBufferSize()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalBufferSize_AIO()
-               : configuration.getJournalBufferSize_NIO();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalBufferTimeout()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalBufferTimeout_AIO()
-               : configuration.getJournalBufferTimeout_NIO();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         HAPolicy haPolicy = server.getHAPolicy();
-         if (haPolicy instanceof SharedStoreSlavePolicy)
-         {
-            ((SharedStoreSlavePolicy) haPolicy).setFailoverOnServerShutdown(failoverOnServerShutdown);
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-
-   public boolean isFailoverOnServerShutdown()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         HAPolicy haPolicy = server.getHAPolicy();
-         if (haPolicy instanceof SharedStoreSlavePolicy)
-         {
-            return ((SharedStoreSlavePolicy) haPolicy).isFailoverOnServerShutdown();
-         }
-         else
-         {
-            return false;
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalMaxIO()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalMaxIO_AIO()
-               : configuration.getJournalMaxIO_NIO();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getJournalDirectory()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalDirectory();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalFileSize()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalFileSize();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalMinFiles()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalMinFiles();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalCompactMinFiles()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalCompactMinFiles();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getJournalCompactPercentage()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalCompactPercentage();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isPersistenceEnabled()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isPersistenceEnabled();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getJournalType()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getJournalType().toString();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getPagingDirectory()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getPagingDirectory();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getScheduledThreadPoolMaxSize()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getScheduledThreadPoolMaxSize();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getThreadPoolMaxSize()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getThreadPoolMaxSize();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public long getSecurityInvalidationInterval()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.getSecurityInvalidationInterval();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isClustered()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isClustered();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isCreateBindingsDir()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isCreateBindingsDir();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isCreateJournalDir()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isCreateJournalDir();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isJournalSyncNonTransactional()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isJournalSyncNonTransactional();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isJournalSyncTransactional()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isJournalSyncTransactional();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isSecurityEnabled()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isSecurityEnabled();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isAsyncConnectionExecutionEnabled()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isAsyncConnectionExecutionEnabled();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void deployQueue(final String address, final String name, final String filterString) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.deployQueue(new SimpleString(address),
-               new SimpleString(name),
-               new SimpleString(filterString),
-               true,
-               false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void deployQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
-   {
-      checkStarted();
-
-      SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
-      clearIO();
-      try
-      {
-
-         server.deployQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void createQueue(final String address, final String name) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.createQueue(new SimpleString(address), new SimpleString(name), null, true, false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void createQueue(final String address, final String name, final boolean durable) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.createQueue(new SimpleString(address), new SimpleString(name), null, durable, false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void createQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         SimpleString filter = null;
-         if (filterStr != null && !filterStr.trim().equals(""))
-         {
-            filter = new SimpleString(filterStr);
-         }
-
-         server.createQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getQueueNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Object[] queues = server.getManagementService().getResources(QueueControl.class);
-         String[] names = new String[queues.length];
-         for (int i = 0; i < queues.length; i++)
-         {
-            QueueControl queue = (QueueControl) queues[i];
-            names[i] = queue.getName();
-         }
-
-         return names;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getAddressNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Object[] addresses = server.getManagementService().getResources(AddressControl.class);
-         String[] names = new String[addresses.length];
-         for (int i = 0; i < addresses.length; i++)
-         {
-            AddressControl address = (AddressControl) addresses[i];
-            names[i] = address.getAddress();
-         }
-
-         return names;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void destroyQueue(final String name) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         SimpleString queueName = new SimpleString(name);
-
-         server.destroyQueue(queueName, null, true);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getConnectionCount()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return server.getConnectionCount();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void enableMessageCounters()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         setMessageCounterEnabled(true);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void disableMessageCounters()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         setMessageCounterEnabled(false);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void resetAllMessageCounters()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         messageCounterManager.resetAllCounters();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void resetAllMessageCounterHistories()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         messageCounterManager.resetAllCounterHistories();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public boolean isMessageCounterEnabled()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return configuration.isMessageCounterEnabled();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public synchronized long getMessageCounterSamplePeriod()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return messageCounterManager.getSamplePeriod();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public synchronized void setMessageCounterSamplePeriod(final long newPeriod)
-   {
-      checkStarted();
-
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         if (newPeriod < MessageCounterManagerImpl.MIN_SAMPLE_PERIOD)
-         {
-            throw HornetQMessageBundle.BUNDLE.invalidMessageCounterPeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
-         }
-
-         if (messageCounterManager != null && newPeriod != messageCounterManager.getSamplePeriod())
-         {
-            messageCounterManager.reschedule(newPeriod);
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public int getMessageCounterMaxDayCount()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         return messageCounterManager.getMaxDayCount();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void setMessageCounterMaxDayCount(final int count)
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         if (count <= 0)
-         {
-            throw HornetQMessageBundle.BUNDLE.greaterThanZero(count);
-         }
-         messageCounterManager.setMaxDayCount(count);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] listPreparedTransactions()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
-
-         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
-         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
-         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
-         {
-            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
-            {
-               // sort by creation time, oldest first
-               return (int) (entry1.getValue() - entry2.getValue());
-            }
-         });
-         String[] s = new String[xidsSortedByCreationTime.size()];
-         int i = 0;
-         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
-         {
-            Date creation = new Date(entry.getValue());
-            Xid xid = entry.getKey();
-            s[i++] = dateFormat.format(creation) + " base64: " + XidImpl.toBase64String(xid) + " " + xid.toString();
-         }
-         return s;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String listPreparedTransactionDetailsAsJSON() throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
-         if (xids == null || xids.size() == 0)
-         {
-            return "";
-         }
-
-         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
-         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
-         {
-            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
-            {
-               // sort by creation time, oldest first
-               return (int) (entry1.getValue() - entry2.getValue());
-            }
-         });
-
-         JSONArray txDetailListJson = new JSONArray();
-         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
-         {
-            Xid xid = entry.getKey();
-            TransactionDetail detail = new CoreTransactionDetail(xid,
-                  resourceManager.getTransaction(xid),
-                  entry.getValue());
-
-            txDetailListJson.put(detail.toJSON());
-         }
-         return txDetailListJson.toString();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String listPreparedTransactionDetailsAsHTML() throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
-         if (xids == null || xids.size() == 0)
-         {
-            return "<h3>*** Prepared Transaction Details ***</h3><p>No entry.</p>";
-         }
-
-         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
-         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
-         {
-            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
-            {
-               // sort by creation time, oldest first
-               return (int) (entry1.getValue() - entry2.getValue());
-            }
-         });
-
-         StringBuilder html = new StringBuilder();
-         html.append("<h3>*** Prepared Transaction Details ***</h3>");
-
-         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
-         {
-            Xid xid = entry.getKey();
-            TransactionDetail detail = new CoreTransactionDetail(xid,
-                  resourceManager.getTransaction(xid),
-                  entry.getValue());
-
-            JSONObject txJson = detail.toJSON();
-
-            html.append("<table border=\"1\">");
-            html.append("<tr><th>creation_time</th>");
-            html.append("<td>" + txJson.get(TransactionDetail.KEY_CREATION_TIME) + "</td>");
-            html.append("<th>xid_as_base_64</th>");
-            html.append("<td colspan=\"3\">" + txJson.get(TransactionDetail.KEY_XID_AS_BASE64) + "</td></tr>");
-            html.append("<tr><th>xid_format_id</th>");
-            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_FORMAT_ID) + "</td>");
-            html.append("<th>xid_global_txid</th>");
-            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_GLOBAL_TXID) + "</td>");
-            html.append("<th>xid_branch_qual</th>");
-            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_BRANCH_QUAL) + "</td></tr>");
-
-            html.append("<tr><th colspan=\"6\">Message List</th></tr>");
-            html.append("<tr><td colspan=\"6\">");
-            html.append("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">");
-
-            JSONArray msgs = txJson.getJSONArray(TransactionDetail.KEY_TX_RELATED_MESSAGES);
-            for (int i = 0; i < msgs.length(); i++)
-            {
-               JSONObject msgJson = msgs.getJSONObject(i);
-               JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES);
-               StringBuilder propstr = new StringBuilder();
-               @SuppressWarnings("unchecked")
-               Iterator<String> propkeys = props.keys();
-               while (propkeys.hasNext())
-               {
-                  String key = propkeys.next();
-                  propstr.append(key);
-                  propstr.append("=");
-                  propstr.append(props.get(key));
-                  propstr.append(", ");
-               }
-
-               html.append("<th>operation_type</th>");
-               html.append("<td>" + msgJson.get(TransactionDetail.KEY_MSG_OP_TYPE) + "</th>");
-               html.append("<th>message_type</th>");
-               html.append("<td>" + msgJson.get(TransactionDetail.KEY_MSG_TYPE) + "</td></tr>");
-               html.append("<tr><th>properties</th>");
-               html.append("<td colspan=\"3\">" + propstr.toString() + "</td></tr>");
-            }
-            html.append("</table></td></tr>");
-            html.append("</table><br/>");
-         }
-
-         return html.toString();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] listHeuristicCommittedTransactions()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         List<Xid> xids = resourceManager.getHeuristicCommittedTransactions();
-         String[] s = new String[xids.size()];
-         int i = 0;
-         for (Xid xid : xids)
-         {
-            s[i++] = XidImpl.toBase64String(xid);
-         }
-         return s;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] listHeuristicRolledBackTransactions()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         List<Xid> xids = resourceManager.getHeuristicRolledbackTransactions();
-         String[] s = new String[xids.size()];
-         int i = 0;
-         for (Xid xid : xids)
-         {
-            s[i++] = XidImpl.toBase64String(xid);
-         }
-         return s;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public synchronized boolean commitPreparedTransaction(final String transactionAsBase64) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         List<Xid> xids = resourceManager.getPreparedTransactions();
-
-         for (Xid xid : xids)
-         {
-            if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
-            {
-               Transaction transaction = resourceManager.removeTransaction(xid);
-               transaction.commit(false);
-               long recordID = server.getStorageManager().storeHeuristicCompletion(xid, true);
-               storageManager.waitOnOperations();
-               resourceManager.putHeuristicCompletion(recordID, xid, true);
-               return true;
-            }
-         }
-         return false;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public synchronized boolean rollbackPreparedTransaction(final String transactionAsBase64) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-
-         List<Xid> xids = resourceManager.getPreparedTransactions();
-
-         for (Xid xid : xids)
-         {
-            if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
-            {
-               Transaction transaction = resourceManager.removeTransaction(xid);
-               transaction.rollback();
-               long recordID = server.getStorageManager().storeHeuristicCompletion(xid, false);
-               server.getStorageManager().waitOnOperations();
-               resourceManager.putHeuristicCompletion(recordID, xid, false);
-               return true;
-            }
-         }
-         return false;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] listRemoteAddresses()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Set<RemotingConnection> connections = remotingService.getConnections();
-
-         String[] remoteAddresses = new String[connections.size()];
-         int i = 0;
-         for (RemotingConnection connection : connections)
-         {
-            remoteAddresses[i++] = connection.getRemoteAddress();
-         }
-         return remoteAddresses;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-
-   }
-
-   public String[] listRemoteAddresses(final String ipAddress)
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Set<RemotingConnection> connections = remotingService.getConnections();
-         List<String> remoteConnections = new ArrayList<String>();
-         for (RemotingConnection connection : connections)
-         {
-            String remoteAddress = connection.getRemoteAddress();
-            if (remoteAddress.contains(ipAddress))
-            {
-               remoteConnections.add(connection.getRemoteAddress());
-            }
-         }
-         return remoteConnections.toArray(new String[remoteConnections.size()]);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-
-   }
-
-   public synchronized boolean closeConnectionsForAddress(final String ipAddress)
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         boolean closed = false;
-         Set<RemotingConnection> connections = remotingService.getConnections();
-         for (RemotingConnection connection : connections)
-         {
-            String remoteAddress = connection.getRemoteAddress();
-            if (remoteAddress.contains(ipAddress))
-            {
-               connection.fail(HornetQMessageBundle.BUNDLE.connectionsClosedByManagement(ipAddress));
-               remotingService.removeConnection(connection.getID());
-               closed = true;
-            }
-         }
-
-         return closed;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-
-   }
-
-   public synchronized boolean closeConsumerConnectionsForAddress(final String address)
-   {
-      boolean closed = false;
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         for (Binding binding : postOffice.getMatchingBindings(SimpleString.toSimpleString(address)).getBindings())
-         {
-            if (binding instanceof LocalQueueBinding)
-            {
-               Queue queue = ((LocalQueueBinding) binding).getQueue();
-               for (Consumer consumer : queue.getConsumers())
-               {
-                  if (consumer instanceof ServerConsumer)
-                  {
-                     ServerConsumer serverConsumer = (ServerConsumer) consumer;
-                     RemotingConnection connection = null;
-
-                     for (RemotingConnection potentialConnection : remotingService.getConnections())
-                     {
-                        if (potentialConnection.getID().toString().equals(serverConsumer.getConnectionID()))
-                        {
-                           connection = potentialConnection;
-                        }
-                     }
-
-                     if (connection != null)
-                     {
-                        remotingService.removeConnection(connection.getID());
-                        connection.fail(HornetQMessageBundle.BUNDLE.consumerConnectionsClosedByManagement(address));
-                        closed = true;
-                     }
-                  }
-               }
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         HornetQServerLogger.LOGGER.failedToCloseConsumerConnectionsForAddress(address, e);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-      return closed;
-   }
-
-   public synchronized boolean closeConnectionsForUser(final String userName)
-   {
-      boolean closed = false;
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         for (ServerSession serverSession : server.getSessions())
-         {
-            if (serverSession.getUsername() != null && serverSession.getUsername().equals(userName))
-            {
-               RemotingConnection connection = null;
-
-               for (RemotingConnection potentialConnection : remotingService.getConnections())
-               {
-                  if (potentialConnection.getID().toString().equals(serverSession.getConnectionID().toString()))
-                  {
-                     connection = potentialConnection;
-                  }
-               }
-
-               if (connection != null)
-               {
-                  remotingService.removeConnection(connection.getID());
-                  connection.fail(HornetQMessageBundle.BUNDLE.connectionsForUserClosedByManagement(userName));
-                  closed = true;
-               }
-            }
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-      return closed;
-   }
-
-   public String[] listConnectionIDs()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Set<RemotingConnection> connections = remotingService.getConnections();
-         String[] connectionIDs = new String[connections.size()];
-         int i = 0;
-         for (RemotingConnection connection : connections)
-         {
-            connectionIDs[i++] = connection.getID().toString();
-         }
-         return connectionIDs;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] listSessions(final String connectionID)
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         List<ServerSession> sessions = server.getSessions(connectionID);
-         String[] sessionIDs = new String[sessions.size()];
-         int i = 0;
-         for (ServerSession serverSession : sessions)
-         {
-            sessionIDs[i++] = serverSession.getName();
-         }
-         return sessionIDs;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-
-   /* (non-Javadoc)
-   * @see org.apache.activemq.api.core.management.HornetQServerControl#listProducersInfoAsJSON()
-   */
-   public String listProducersInfoAsJSON() throws Exception
-   {
-      JSONArray producers = new JSONArray();
-
-
-      for (ServerSession session : server.getSessions())
-      {
-         session.describeProducersInfo(producers);
-      }
-
-      return producers.toString();
-   }
-
-
-   public Object[] getConnectors() throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations()
-               .values();
-
-         Object[] ret = new Object[connectorConfigurations.size()];
-
-         int i = 0;
-         for (TransportConfiguration config : connectorConfigurations)
-         {
-            Object[] tc = new Object[3];
-
-            tc[0] = config.getName();
-            tc[1] = config.getFactoryClassName();
-            tc[2] = config.getParams();
-
-            ret[i++] = tc;
-         }
-
-         return ret;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getConnectorsAsJSON() throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         JSONArray array = new JSONArray();
-
-         for (TransportConfiguration config : configuration.getConnectorConfigurations().values())
-         {
-            array.put(new JSONObject(config));
-         }
-
-         return array.toString();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void addSecuritySettings(final String addressMatch,
-                                   final String sendRoles,
-                                   final String consumeRoles,
-                                   final String createDurableQueueRoles,
-                                   final String deleteDurableQueueRoles,
-                                   final String createNonDurableQueueRoles,
-                                   final String deleteNonDurableQueueRoles,
-                                   final String manageRoles) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Set<Role> roles = SecurityFormatter.createSecurity(sendRoles,
-               consumeRoles,
-               createDurableQueueRoles,
-               deleteDurableQueueRoles,
-               createNonDurableQueueRoles,
-               deleteNonDurableQueueRoles,
-               manageRoles);
-
-         server.getSecurityRepository().addMatch(addressMatch, roles);
-
-         PersistedRoles persistedRoles = new PersistedRoles(addressMatch,
-               sendRoles,
-               consumeRoles,
-               createDurableQueueRoles,
-               deleteDurableQueueRoles,
-               createNonDurableQueueRoles,
-               deleteNonDurableQueueRoles,
-               manageRoles);
-
-         storageManager.storeSecurityRoles(persistedRoles);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void removeSecuritySettings(final String addressMatch) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.getSecurityRepository().removeMatch(addressMatch);
-         storageManager.deleteSecurityRoles(new SimpleString(addressMatch));
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public Object[] getRoles(final String addressMatch) throws Exception
-   {
-      checkStarted();
-
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Set<Role> roles = server.getSecurityRepository().getMatch(addressMatch);
-
-         Object[] objRoles = new Object[roles.size()];
-
-         int i = 0;
-         for (Role role : roles)
-         {
-            objRoles[i++] = new Object[]{role.getName(),
-                  CheckType.SEND.hasRole(role),
-                  CheckType.CONSUME.hasRole(role),
-                  CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
-                  CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
-                  CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
-                  CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
-                  CheckType.MANAGE.hasRole(role)};
-         }
-         return objRoles;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getRolesAsJSON(final String addressMatch) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         JSONArray json = new JSONArray();
-         Set<Role> roles = server.getSecurityRepository().getMatch(addressMatch);
-
-         for (Role role : roles)
-         {
-            json.put(new JSONObject(role));
-         }
-         return json.toString();
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String getAddressSettingsAsJSON(final String address) throws Exception
-   {
-      checkStarted();
-
-      AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address);
-      Map<String, Object> settings = new HashMap<String, Object>();
-      if (addressSettings.getDeadLetterAddress() != null)
-      {
-         settings.put("DLA", addressSettings.getDeadLetterAddress());
-      }
-      if (addressSettings.getExpiryAddress() != null)
-      {
-         settings.put("expiryAddress", addressSettings.getExpiryAddress());
-      }
-      settings.put("expiryDelay", addressSettings.getExpiryDelay());
-      settings.put("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts());
-      settings.put("pageCacheMaxSize", addressSettings.getPageCacheMaxSize());
-      settings.put("maxSizeBytes", addressSettings.getMaxSizeBytes());
-      settings.put("pageSizeBytes", addressSettings.getPageSizeBytes());
-      settings.put("redeliveryDelay", addressSettings.getRedeliveryDelay());
-      settings.put("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier());
-      settings.put("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay());
-      settings.put("redistributionDelay", addressSettings.getRedistributionDelay());
-      settings.put("lastValueQueue", addressSettings.isLastValueQueue());
-      settings.put("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute());
-      String policy = addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.PAGE ? "PAGE"
-            : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.BLOCK ? "BLOCK"
-            : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.DROP ? "DROP"
-            : "FAIL";
-      settings.put("addressFullMessagePolicy", policy);
-      settings.put("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold());
-      settings.put("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod());
-      policy = addressSettings.getSlowConsumerPolicy() == SlowConsumerPolicy.NOTIFY ? "NOTIFY"
-         : "KILL";
-      settings.put("slowConsumerPolicy", policy);
-
-      JSONObject jsonObject = new JSONObject(settings);
-      return jsonObject.toString();
-   }
-
-
-   public void addAddressSettings(final String address,
-                                  final String DLA,
-                                  final String expiryAddress,
-                                  final long expiryDelay,
-                                  final boolean lastValueQueue,
-                                  final int deliveryAttempts,
-                                  final long maxSizeBytes,
-                                  final int pageSizeBytes,
-                                  final int pageMaxCacheSize,
-                                  final long redeliveryDelay,
-                                  final double redeliveryMultiplier,
-                                  final long maxRedeliveryDelay,
-                                  final long redistributionDelay,
-                                  final boolean sendToDLAOnNoRoute,
-                                  final String addressFullMessagePolicy,
-                                  final long slowConsumerThreshold,
-                                  final long slowConsumerCheckPeriod,
-                                  final String slowConsumerPolicy) throws Exception
-   {
-      checkStarted();
-
-      // JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes
-      if (pageSizeBytes > maxSizeBytes && maxSizeBytes > 0)
-      {
-         throw new IllegalStateException("pageSize has to be lower than maxSizeBytes. Invalid argument (" + pageSizeBytes + " < " + maxSizeBytes + ")");
-      }
-
-      if (maxSizeBytes < -1)
-      {
-         throw new IllegalStateException("Invalid argument on maxSizeBytes");
-      }
-
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setDeadLetterAddress(DLA == null ? null : new SimpleString(DLA));
-      addressSettings.setExpiryAddress(expiryAddress == null ? null : new SimpleString(expiryAddress));
-      addressSettings.setExpiryDelay(expiryDelay);
-      addressSettings.setLastValueQueue(lastValueQueue);
-      addressSettings.setMaxDeliveryAttempts(deliveryAttempts);
-      addressSettings.setPageCacheMaxSize(pageMaxCacheSize);
-      addressSettings.setMaxSizeBytes(maxSizeBytes);
-      addressSettings.setPageSizeBytes(pageSizeBytes);
-      addressSettings.setRedeliveryDelay(redeliveryDelay);
-      addressSettings.setRedeliveryMultiplier(redeliveryMultiplier);
-      addressSettings.setMaxRedeliveryDelay(maxRedeliveryDelay);
-      addressSettings.setRedistributionDelay(redistributionDelay);
-      addressSettings.setSendToDLAOnNoRoute(sendToDLAOnNoRoute);
-      if (addressFullMessagePolicy == null)
-      {
-         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      }
-      else if (addressFullMessagePolicy.equalsIgnoreCase("PAGE"))
-      {
-         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      }
-      else if (addressFullMessagePolicy.equalsIgnoreCase("DROP"))
-      {
-         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.DROP);
-      }
-      else if (addressFullMessagePolicy.equalsIgnoreCase("BLOCK"))
-      {
-         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
-      }
-      else if (addressFullMessagePolicy.equalsIgnoreCase("FAIL"))
-      {
-         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.FAIL);
-      }
-      addressSettings.setSlowConsumerThreshold(slowConsumerThreshold);
-      addressSettings.setSlowConsumerCheckPeriod(slowConsumerCheckPeriod);
-      if (slowConsumerPolicy == null)
-      {
-         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
-      }
-      else if (slowConsumerPolicy.equalsIgnoreCase("NOTIFY"))
-      {
-         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
-      }
-      else if (slowConsumerPolicy.equalsIgnoreCase("KILL"))
-      {
-         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
-      }
-      server.getAddressSettingsRepository().addMatch(address, addressSettings);
-
-      storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));
-   }
-
-   public void removeAddressSettings(final String addressMatch) throws Exception
-   {
-      checkStarted();
-
-      server.getAddressSettingsRepository().removeMatch(addressMatch);
-      storageManager.deleteAddressSetting(new SimpleString(addressMatch));
-   }
-
-   public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address));
-
-         GroupingHandler handler = server.getGroupingHandler();
-         if (handler != null)
-         {
-            // the group handler would miss responses if the group was requested before the reset was done
-            // on that case we ask the groupinghandler to replay its send in case it's waiting for the information
-            handler.resendPending();
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getDivertNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Object[] diverts = server.getManagementService().getResources(DivertControl.class);
-         String[] names = new String[diverts.length];
-         for (int i = 0; i < diverts.length; i++)
-         {
-            DivertControl divert = (DivertControl) diverts[i];
-            names[i] = divert.getUniqueName();
-         }
-
-         return names;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void createDivert(final String name,
-                            final String routingName,
-                            final String address,
-                            final String forwardingAddress,
-                            final boolean exclusive,
-                            final String filterString,
-                            final String transformerClassName) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         DivertConfiguration config = new DivertConfiguration()
-            .setName(name)
-            .setRoutingName(routingName)
-            .setAddress(address)
-            .setForwardingAddress(forwardingAddress)
-            .setExclusive(exclusive)
-            .setFilterString(filterString)
-            .setTransformerClassName(transformerClassName);
-         server.deployDivert(config);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void destroyDivert(final String name) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.destroyDivert(SimpleString.toSimpleString(name));
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public String[] getBridgeNames()
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         Object[] bridges = server.getManagementService().getResources(BridgeControl.class);
-         String[] names = new String[bridges.length];
-         for (int i = 0; i < bridges.length; i++)
-         {
-            BridgeControl bridge = (BridgeControl) bridges[i];
-            names[i] = bridge.getName();
-         }
-
-         return names;
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void createBridge(final String name,
-                            final String queueName,
-                            final String forwardingAddress,
-                            final String filterString,
-                            final String transformerClassName,
-                            final long retryInterval,
-                            final double retryIntervalMultiplier,
-                            final int initialConnectAttempts,
-                            final int reconnectAttempts,
-                            final boolean useDuplicateDetection,
-                            final int confirmationWindowSize,
-                            final long clientFailureCheckPeriod,
-                            final String staticConnectorsOrDiscoveryGroup,
-                            boolean useDiscoveryGroup,
-                            final boolean ha,
-                            final String user,
-                            final String password) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-
-      try
-      {
-         BridgeConfiguration config = new BridgeConfiguration()
-               .setName(name)
-               .setQueueName(queueName)
-               .setForwardingAddress(forwardingAddress)
-               .setFilterString(filterString)
-               .setTransformerClassName(transformerClassName)
-               .setClientFailureCheckPeriod(clientFailureCheckPeriod)
-               .setRetryInterval(retryInterval)
-               .setRetryIntervalMultiplier(retryIntervalMultiplier)
-               .setInitialConnectAttempts(initialConnectAttempts)
-               .setReconnectAttempts(reconnectAttempts)
-               .setUseDuplicateDetection(useDuplicateDetection)
-               .setConfirmationWindowSize(confirmationWindowSize)
-               .setHA(ha)
-               .setUser(user)
-               .setPassword(password);
-
-         if (useDiscoveryGroup)
-         {
-            config.setDiscoveryGroupName(staticConnectorsOrDiscoveryGroup);
-         }
-         else
-         {
-            config.setStaticConnectors(toList(staticConnectorsOrDiscoveryGroup));
-         }
-
-         server.deployBridge(config);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-
-   public void destroyBridge(final String name) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      try
-      {
-         server.destroyBridge(name);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void forceFailover() throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-
-      try
-      {
-         server.stop(true);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   @Override
-   public void updateDuplicateIdCache(String address, Object[] ids) throws Exception
-   {
-      clearIO();
-      try
-      {
-         DuplicateIDCache duplicateIDCache = server.getPostOffice().getDuplicateIDCache(new SimpleString(address));
-         for (Object id : ids)
-         {
-            duplicateIDCache.addToCache(((String)id).getBytes(), null);
-         }
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   @Override
-   public void scaleDown(String connector) throws Exception
-   {
-      checkStarted();
-
-      clearIO();
-      HAPolicy haPolicy = server.getHAPolicy();
-      if (haPolicy instanceof LiveOnlyPolicy)
-      {
-         LiveOnlyPolicy liveOnlyPolicy = (LiveOnlyPolicy) haPolicy;
-
-         if (liveOnlyPolicy.getScaleDownPolicy() == null)
-         {
-            liveOnlyPolicy.setScaleDownPolicy(new ScaleDownPolicy());
-         }
-
-         liveOnlyPolicy.getScaleDownPolicy().setEnabled(true);
-
-         if (connector != null)
-         {
-            liveOnlyPolicy.getScaleDownPolicy().getConnectors().add(0, connector);
-         }
-
-         server.stop(true);
-      }
-
-   }
-
-   // NotificationEmitter implementation ----------------------------
-
-   public void removeNotificationListener(final NotificationListener listener,
-                                          final NotificationFilter filter,
-                                          final Object handback) throws ListenerNotFoundException
-   {
-      clearIO();
-      try
-      {
-         broadcaster.removeNotificationListener(listener, filter, handback);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
-   {
-      clearIO();
-      try
-      {
-         broadcaster.removeNotificationListener(listener);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public void addNotificationListener(final NotificationListener listener,
-                                       final NotificationFilter filter,
-                                       final Object handback) throws IllegalArgumentException
-   {
-      clearIO();
-      try
-      {
-         broadcaster.addNotificationListener(listener, filter, handback);
-      }
-      finally
-      {
-         blockOnIO();
-      }
-   }
-
-   public MBeanNotificationInfo[] getNotificationInfo()
-   {
-      CoreNotificationType[] values = CoreNotificationType.values();
-      String[] names = new String[values.length];
-      for (int i = 0; i < values.length; i++)
-      {
-         names[i] = values[i].toString();
-      }
-      return new MBeanNotificationInfo[]{new MBeanNotificationInfo(names,
-            this.getClass().getName(),
-            "Notifications emitted by a Core Server")};
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   private synchronized void setMessageCounterEnabled(final boolean enable)
-   {
-      if (isStarted())
-      {
-         if (configuration.isMessageCounterEnabled() && !enable)
-         {
-            stopMessageCounters();
-         }
-         else if (!configuration.isMessageCounterEnabled() && enable)
-         {
-            startMessageCounters();
-         }
-      }
-      configuration.setMessageCounterEnabled(enable);
-   }
-
-   private void startMessageCounters()
-   {
-      messageCounterManager.start();
-   }
-
-   private void stopMessageCounters()
-   {
-      messageCounterManager.stop();
-
-      messageCounterManager.resetAllCounters();
-
-      messageCounterManager.resetAllCounterHistories();
-   }
-
-   public long getConnectionTTLOverride()
-   {
-      return configuration.getConnectionTTLOverride();
-   }
-
-   public int getIDCacheSize()
-   {
-      return configuration.getIDCacheSize();
-   }
-
-   public String getLargeMessagesDirectory()
-   {
-      return configuration.getLargeMessagesDirectory();
-   }
-
-   public String getManagementAddress()
-   {
-      return configuration.getManagementAddress().toString();
-   }
-
-   public String getManagementNotificationAddress()
-   {
-      return configuration.getManagementNotificationAddress().toString();
-   }
-
-   public long getMessageExpiryScanPeriod()
-   {
-      return configuration.getMessageExpiryScanPeriod();
-   }
-
-   public long getMessageExpiryThreadPriority()
-   {
-      return configuration.getMessageExpiryThreadPriority();
-   }
-
-   public long getTransactionTimeout()
-   {
-      return configuration.getTransactionTimeout();
-   }
-
-   public long getTransactionTimeoutScanPeriod()
-   {
-      return configuration.getTransactionTimeoutScanPeriod();
-   }
-
-   public boolean isPersistDeliveryCountBeforeDelivery()
-   {
-      return configuration.isPersistDeliveryCountBeforeDelivery();
-   }
-
-   public boolean isPersistIDCache()
-   {
-      return configuration.isPersistIDCache();
-   }
-
-   public boolean isWildcardRoutingEnabled()
-   {
-      return configuration.isWildcardRoutingEnabled();
-   }
-
-   @Override
-   protected MBeanOperationInfo[] fillMBeanOperationInfo()
-   {
-      return MBeanInfoHelper.getMBeanOperationsInfo(HornetQServerControl.class);
-   }
-
-   private void checkStarted()
-   {
-      if (!server.isStarted())
-      {
-         throw new IllegalStateException("HornetQ Server is not started. It can not be managed yet");
-      }
-   }
-
-   public String[] listTargetAddresses(final String sessionID)
-   {
-      ServerSession session = server.getSessionByID(sessionID);
-      if (session != null)
-      {
-         return session.getTargetAddresses();
-      }
-      return new String[0];
-   }
-
-   private static List<String> toList(final String commaSeparatedString)
-   {
-      List<String> list = new ArrayList<String>();
-      if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
-      {
-         return list;
-      }
-      String[] values = commaSeparatedString.split(",");
-      for (String value : values)
-      {
-         list.add(value.trim());
-      }
-      return list;
-   }
-
-   @Override
-   public void onNotification(org.apache.activemq.core.server.management.Notification notification)
-   {
-      if (!(notification.getType() instanceof CoreNotificationType)) return;
-      CoreNotificationType type = (CoreNotificationType) notification.getType();
-      TypedProperties prop = notification.getProperties();
-
-      this.broadcaster.sendNotification(new Notification(type.toString(), this,
-            notifSeq.incrementAndGet(), notification.toString()));
-   }
-
-}
-

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java
index d021712..34174d9 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/QueueControlImpl.java
@@ -32,7 +32,7 @@ import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.server.Consumer;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.ServerConsumer;
@@ -696,7 +696,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
 
          if (binding == null)
          {
-            throw HornetQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
+            throw ActiveMQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
          }
 
          return queue.moveReference(messageID, binding.getAddress(), rejectDuplicates);
@@ -726,7 +726,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
 
          if (binding == null)
          {
-            throw HornetQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
+            throw ActiveMQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
          }
 
          int retValue = queue.moveReferences(flushLimit, filter, binding.getAddress(), rejectDuplicates);
@@ -786,7 +786,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
       {
          if (newPriority < 0 || newPriority > 9)
          {
-            throw HornetQMessageBundle.BUNDLE.invalidNewPriority(newPriority);
+            throw ActiveMQMessageBundle.BUNDLE.invalidNewPriority(newPriority);
          }
          Filter filter = FilterImpl.createFilter(filterStr);
 
@@ -807,7 +807,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
       {
          if (newPriority < 0 || newPriority > 9)
          {
-            throw HornetQMessageBundle.BUNDLE.invalidNewPriority(newPriority);
+            throw ActiveMQMessageBundle.BUNDLE.invalidNewPriority(newPriority);
          }
          return queue.changeReferencePriority(messageID, (byte) newPriority);
       }
@@ -1044,7 +1044,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
    {
       if (!postOffice.isStarted())
       {
-         throw new IllegalStateException("HornetQ Server is not started. Queue can not be managed yet");
+         throw new IllegalStateException("ActiveMQ Server is not started. Queue can not be managed yet");
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/messagecounter/impl/MessageCounterHelper.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/messagecounter/impl/MessageCounterHelper.java b/activemq-server/src/main/java/org/apache/activemq/core/messagecounter/impl/MessageCounterHelper.java
index becf971..94a14f1 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/messagecounter/impl/MessageCounterHelper.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/messagecounter/impl/MessageCounterHelper.java
@@ -60,7 +60,7 @@ public class MessageCounterHelper
       }
 
       String ret0 =
-               "<table class=\"hornetq-message-counter\">\n" + "<tr>"
+               "<table class=\"activemq-message-counter\">\n" + "<tr>"
                    + "<th>Type</th>"
                    + "<th>Name</th>"
                    + "<th>Subscription</th>"
@@ -136,7 +136,7 @@ public class MessageCounterHelper
 
          ret.append("    <li>");
          // table header
-         ret.append("<table class=\"hornetq-message-counter-history\">\n");
+         ret.append("<table class=\"activemq-message-counter-history\">\n");
          ret.append("<tr><th>Date</th>");
 
          for (int j = 0; j < 24; j++)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingManager.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingManager.java
index f42f161..2bffb46 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingManager.java
@@ -15,7 +15,7 @@ package org.apache.activemq.core.paging;
 import java.util.Map;
 
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.settings.HierarchicalRepositoryChangeListener;
 
 /**
@@ -36,7 +36,7 @@ import org.apache.activemq.core.settings.HierarchicalRepositoryChangeListener;
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author <a href="mailto:andy.taylor@jboss.org>Andy Taylor</a>
  */
-public interface PagingManager extends HornetQComponent, HierarchicalRepositoryChangeListener
+public interface PagingManager extends ActiveMQComponent, HierarchicalRepositoryChangeListener
 {
    /** Returns the PageStore associated with the address. A new page store is created if necessary. */
    PagingStore getPageStore(SimpleString address) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingStore.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingStore.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingStore.java
index 517693f..8dae219 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingStore.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/PagingStore.java
@@ -19,7 +19,7 @@ import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.paging.cursor.PageCursorProvider;
 import org.apache.activemq.core.paging.impl.Page;
 import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.RouteContextList;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
@@ -37,7 +37,7 @@ import org.apache.activemq.core.transaction.Transaction;
  * @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
  * @see PagingManager
  */
-public interface PagingStore extends HornetQComponent
+public interface PagingStore extends ActiveMQComponent
 {
    SimpleString getAddress();
 
@@ -103,7 +103,7 @@ public interface PagingStore extends HornetQComponent
     * The file will still exist until Page.delete is called,
     * So, case the system is reloaded the same Page will be loaded back if delete is not called.
     *
-    * @throws Exception Note: This should still be part of the interface, even though HornetQ only uses through the
+    * @throws Exception Note: This should still be part of the interface, even though ActiveMQ only uses through the
     */
    Page depage() throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/PagedReferenceImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/PagedReferenceImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/PagedReferenceImpl.java
index fd9257e..35ab54b 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/PagedReferenceImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/PagedReferenceImpl.java
@@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.core.paging.PagedMessage;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.ServerMessage;
@@ -29,7 +29,7 @@ import org.apache.activemq.core.server.ServerMessage;
  */
 public class PagedReferenceImpl implements PagedReference
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final PagePosition position;
 
@@ -169,7 +169,7 @@ public class PagedReferenceImpl implements PagedReference
       deliveryCount.incrementAndGet();
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("++deliveryCount = " + deliveryCount + " for " + this, new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace("++deliveryCount = " + deliveryCount + " for " + this, new Exception("trace"));
       }
 
    }
@@ -180,7 +180,7 @@ public class PagedReferenceImpl implements PagedReference
       deliveryCount.decrementAndGet();
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("--deliveryCount = " + deliveryCount + " for " + this, new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace("--deliveryCount = " + deliveryCount + " for " + this, new Exception("trace"));
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageCursorProviderImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageCursorProviderImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageCursorProviderImpl.java
index 842c220..e5eec98 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageCursorProviderImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageCursorProviderImpl.java
@@ -31,7 +31,7 @@ import org.apache.activemq.core.paging.cursor.PagedReference;
 import org.apache.activemq.core.paging.cursor.PagedReferenceImpl;
 import org.apache.activemq.core.paging.impl.Page;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.impl.TransactionImpl;
 import org.apache.activemq.utils.FutureLatch;
@@ -50,7 +50,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
 {
    // Constants -----------------------------------------------------
 
-   boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    // Attributes ----------------------------------------------------
 
@@ -91,9 +91,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
 
    public synchronized PageSubscription createSubscription(long cursorID, Filter filter, boolean persistent)
    {
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace(this.pagingStore.getAddress() + " creating subscription " + cursorID + " with filter " + filter, new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace(this.pagingStore.getAddress() + " creating subscription " + cursorID + " with filter " + filter, new Exception("trace"));
       }
 
       if (activeCursors.containsKey(cursorID))
@@ -160,7 +160,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
                cache.lock();
                if (isTrace)
                {
-                  HornetQServerLogger.LOGGER.trace("adding " + pageId +  " into cursor = " + this.pagingStore.getAddress());
+                  ActiveMQServerLogger.LOGGER.trace("adding " + pageId +  " into cursor = " + this.pagingStore.getAddress());
                }
                softCache.put(pageId, cache);
             }
@@ -285,7 +285,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
 
       while (!future.await(10000))
       {
-         HornetQServerLogger.LOGGER.timedOutStoppingPagingCursor(future, executor);
+         ActiveMQServerLogger.LOGGER.timedOutStoppingPagingCursor(future, executor);
       }
    }
 
@@ -355,7 +355,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.warn("Error while cleaning paging on queue " + sub.getQueue().getName(), e);
+            ActiveMQServerLogger.LOGGER.warn("Error while cleaning paging on queue " + sub.getQueue().getName(), e);
          }
       }
 
@@ -365,7 +365,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.warn("Error while cleaning page, during the commit", e);
+         ActiveMQServerLogger.LOGGER.warn("Error while cleaning page, during the commit", e);
       }
    }
 
@@ -408,9 +408,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
                return;
             }
 
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug("Asserting cleanup for address " + this.pagingStore.getAddress());
+               ActiveMQServerLogger.LOGGER.debug("Asserting cleanup for address " + this.pagingStore.getAddress());
             }
 
             ArrayList<PageSubscription> cursorList = cloneSubscriptions();
@@ -427,9 +427,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
                {
                   if (!cursor.isComplete(minPage))
                   {
-                     if (HornetQServerLogger.LOGGER.isDebugEnabled())
+                     if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                      {
-                        HornetQServerLogger.LOGGER.debug("Cursor " + cursor + " was considered incomplete at page " + minPage);
+                        ActiveMQServerLogger.LOGGER.debug("Cursor " + cursor + " was considered incomplete at page " + minPage);
                      }
 
                      complete = false;
@@ -437,9 +437,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
                   }
                   else
                   {
-                     if (HornetQServerLogger.LOGGER.isDebugEnabled())
+                     if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                      {
-                        HornetQServerLogger.LOGGER.debug("Cursor " + cursor + "was considered **complete** at page " + minPage);
+                        ActiveMQServerLogger.LOGGER.debug("Cursor " + cursor + "was considered **complete** at page " + minPage);
                      }
                   }
                }
@@ -453,9 +453,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
                if (complete)
                {
 
-                  if (HornetQServerLogger.LOGGER.isDebugEnabled())
+                  if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                   {
-                     HornetQServerLogger.LOGGER.debug("Address " + pagingStore.getAddress() +
+                     ActiveMQServerLogger.LOGGER.debug("Address " + pagingStore.getAddress() +
                         " is leaving page mode as all messages are consumed and acknowledged from the page store");
                   }
 
@@ -486,9 +486,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
             }
             else
             {
-               if (HornetQServerLogger.LOGGER.isTraceEnabled())
+               if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
                {
-                  HornetQServerLogger.LOGGER.trace("Couldn't cleanup page on address " + this.pagingStore.getAddress() +
+                  ActiveMQServerLogger.LOGGER.trace("Couldn't cleanup page on address " + this.pagingStore.getAddress() +
                      " as numberOfPages == " +
                      pagingStore.getNumberOfPages() +
                      " and currentPage.numberOfMessages = " +
@@ -498,7 +498,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
          }
          catch (Exception ex)
          {
-            HornetQServerLogger.LOGGER.problemCleaningPageAddress(ex, pagingStore.getAddress());
+            ActiveMQServerLogger.LOGGER.problemCleaningPageAddress(ex, pagingStore.getAddress());
             return;
          }
          finally
@@ -520,7 +520,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
 
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Removing page " + depagedPage.getPageId() + " from page-cache");
+               ActiveMQServerLogger.LOGGER.trace("Removing page " + depagedPage.getPageId() + " from page-cache");
             }
 
             if (cache == null)
@@ -567,7 +567,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
       }
       catch (Exception ex)
       {
-         HornetQServerLogger.LOGGER.problemCleaningPageAddress(ex, pagingStore.getAddress());
+         ActiveMQServerLogger.LOGGER.problemCleaningPageAddress(ex, pagingStore.getAddress());
          return;
       }
 
@@ -608,7 +608,7 @@ public class PageCursorProviderImpl implements PageCursorProvider
 
          while (!storageManager.waitOnOperations(5000))
          {
-            HornetQServerLogger.LOGGER.problemCompletingOperations(storageManager.getContext());
+            ActiveMQServerLogger.LOGGER.problemCompletingOperations(storageManager.getContext());
          }
       }
       finally
@@ -651,9 +651,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
       for (PageSubscription cursor : cursorList)
       {
          long firstPage = cursor.getFirstPage();
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug(this.pagingStore.getAddress() + " has a cursor " + cursor + " with first page=" + firstPage);
+            ActiveMQServerLogger.LOGGER.debug(this.pagingStore.getAddress() + " has a cursor " + cursor + " with first page=" + firstPage);
          }
 
          // the cursor will return -1 if the cursor is empty
@@ -663,9 +663,9 @@ public class PageCursorProviderImpl implements PageCursorProvider
          }
       }
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug(this.pagingStore.getAddress() + " has minPage=" + minPage);
+         ActiveMQServerLogger.LOGGER.debug(this.pagingStore.getAddress() + " has minPage=" + minPage);
       }
 
       return minPage;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
index 57f43ea..1beb556 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
@@ -25,7 +25,7 @@ import org.apache.activemq.core.paging.cursor.PageSubscription;
 import org.apache.activemq.core.paging.cursor.PageSubscriptionCounter;
 import org.apache.activemq.core.paging.impl.Page;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionOperation;
 import org.apache.activemq.core.transaction.TransactionOperationAbstract;
@@ -39,7 +39,7 @@ import org.apache.activemq.core.transaction.impl.TransactionImpl;
  */
 public class PageSubscriptionCounterImpl implements PageSubscriptionCounter
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private static final int FLUSH_COUNTER = 1000;
 
@@ -364,7 +364,7 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter
 
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Replacing page-counter record = "  + recordID + " by record = " + newRecordID + " on subscriptionID = " + this.subscriptionID + " for queue = " + this.subscription.getQueue().getName());
+            ActiveMQServerLogger.LOGGER.trace("Replacing page-counter record = "  + recordID + " by record = " + newRecordID + " on subscriptionID = " + this.subscriptionID + " for queue = " + this.subscription.getQueue().getName());
          }
 
          storage.commit(txCleanup);
@@ -373,7 +373,7 @@ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter
       {
          newRecordID = recordID;
 
-         HornetQServerLogger.LOGGER.problemCleaningPagesubscriptionCounter(e);
+         ActiveMQServerLogger.LOGGER.problemCleaningPagesubscriptionCounter(e);
          try
          {
             storage.rollback(txCleanup);


[47/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientMessageBundle.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientMessageBundle.java
deleted file mode 100644
index 9dbb233..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientMessageBundle.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.client;
-
-
-import org.apache.activemq.api.core.ActiveMQAddressFullException;
-import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
-import org.apache.activemq.api.core.ActiveMQDisconnectedException;
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.apache.activemq.api.core.ActiveMQInterceptorRejectedPacketException;
-import org.apache.activemq.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.api.core.ActiveMQLargeMessageException;
-import org.apache.activemq.api.core.ActiveMQLargeMessageInterruptedException;
-import org.apache.activemq.api.core.ActiveMQNotConnectedException;
-import org.apache.activemq.api.core.ActiveMQObjectClosedException;
-import org.apache.activemq.api.core.ActiveMQTransactionOutcomeUnknownException;
-import org.apache.activemq.api.core.ActiveMQTransactionRolledBackException;
-import org.apache.activemq.api.core.ActiveMQUnBlockedException;
-import org.apache.activemq.core.cluster.DiscoveryGroup;
-import org.apache.activemq.spi.core.remoting.Connection;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-import org.w3c.dom.Node;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 11
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
- *
- * so 119000 to 119999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQClientMessageBundle
-{
-   HornetQClientMessageBundle BUNDLE = Messages.getBundle(HornetQClientMessageBundle.class);
-
-   @Message(id = 119000, value = "ClientSession closed while creating session", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException clientSessionClosed();
-
-   @Message(id = 119001, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
-
-   @Message(id = 119002, value = "Internal Error! ClientSessionFactoryImpl::createSessionInternal "
-                                          + "just reached a condition that was not supposed to happen. "
-                                      + "Please inform this condition to the HornetQ team", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException clietSessionInternal();
-
-   @Message(id = 119003, value = "Queue can not be both durable and temporary", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException queueMisConfigured();
-
-   @Message(id = 119004, value = "Failed to initialise session factory", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
-
-   @Message(id = 119005, value = "Exception in Netty transport", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException nettyError();
-
-   @Message(id = 119006, value =  "Channel disconnected", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNotConnectedException channelDisconnected();
-
-   @Message(id = 119007, value =  "Cannot connect to server(s). Tried with all available servers.", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNotConnectedException cannotConnectToServers();
-
-   @Message(id = 119008, value =  "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
-
-   @Message(id = 119009, value =  "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
-
-   @Message(id = 119010, value =  "Connection is destroyed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNotConnectedException connectionDestroyed();
-
-   @Message(id = 119011, value =  "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
-
-   @Message(id = 119012, value =  "Timed out waiting to receive initial broadcast from cluster", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
-
-   @Message(id = 119013, value =  "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
-
-   @Message(id = 119014, value =  "Timed out waiting for response when sending packet {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQConnectionTimedOutException timedOutSendingPacket(Byte type);
-
-   @Message(id = 119015, value =  "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQDisconnectedException disconnected();
-
-   @Message(id = 119016, value =  "Connection failure detected. Unblocking a blocking call that will never get a resp" +
-         "onse", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
-
-   @Message(id = 119017, value =  "Consumer is closed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQObjectClosedException consumerClosed();
-
-   @Message(id = 119018, value =  "Producer is closed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQObjectClosedException producerClosed();
-
-   @Message(id = 119019, value =  "Session is closed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQObjectClosedException sessionClosed();
-
-   @Message(id = 119020, value =  "Cannot call receive(...) - a MessageHandler is set", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException messageHandlerSet();
-
-   @Message(id = 119021, value =  "Cannot set MessageHandler - consumer is in receive(...)", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException inReceive();
-
-   @Message(id = 119022, value =  "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize",
-         format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize);
-
-   @Message(id = 119023, value =  "The large message lost connection with its session, either because of a rollback or a closed session", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException largeMessageLostSession();
-
-   @Message(id = 119024, value =  "Could not select a TransportConfiguration to create SessionFactory", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException noTCForSessionFactory();
-
-   @Message(id = 119025, value = "Error saving the message body", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
-
-   @Message(id = 119026, value =  "Error reading the LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
-
-   @Message(id = 119027, value =  "Error closing stream from LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
-
-   @Message(id = 119028, value =  "Timeout waiting for LargeMessage Body", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageException timeoutOnLargeMessage();
-
-   @Message(id = 119029, value =  "Error writing body of message", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
-
-   @Message(id = 119030, value =  "The transaction was rolled back on failover to a backup server", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQTransactionRolledBackException txRolledBack();
-
-   @Message(id = 119031, value =  "The transaction was rolled back on failover however commit may have been successful" +
-         "", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown();
-
-   @Message(id = 119032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidType(Object type);
-
-   @Message(id = 119033, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidEncodeType(Object type);
-
-   @Message(id = 119034, value = "Params for management operations must be of the following type: int long double String boolean Map or array thereof but found {0}",
-         format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidManagementParam(Object type);
-
-   @Message(id = 119035, value = "Invalid window size {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidWindowSize(Integer size);
-
-   @Message(id = 119036, value = "No operation mapped to int {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noOperationMapped(Integer operation);
-
-   @Message(id = 119037, value = "Invalid last Received Command ID: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidCommandID(Integer lastReceivedCommandID);
-
-   @Message(id = 119038, value = "Cannot find channel with id {0} to close", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noChannelToClose(Long id);
-
-   @Message(id = 119039, value = "Close Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException closeListenerCannotBeNull();
-
-   @Message(id = 119040, value = "Fail Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException failListenerCannotBeNull();
-
-   @Message(id = 119041, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException connectionExists(Object id);
-
-   @Message(id = 119042, value = "Invalid argument null listener", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullListener();
-
-   @Message(id = 119043, value = "Invalid argument null handler", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullHandler();
-
-   @Message(id = 119044, value = "No available codec to decode password!", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noCodec();
-
-   @Message(id = 119045, value = "the first node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException firstNodeNull();
-
-   @Message(id = 119046, value = "the second node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException secondNodeNull();
-
-   @Message(id = 119047, value = "nodes have different node names", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nodeHaveDifferentNames();
-
-   @Message(id = 119048, value = "nodes hava a different number of attributes", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nodeHaveDifferentAttNumber();
-
-   @Message(id = 119049, value = "attribute {0}={1} does not match", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException attsDontMatch(String name, String value);
-
-   @Message(id = 119050, value = "one node has children and the other does not" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException oneNodeHasChildren();
-
-   @Message(id = 119051, value = "nodes hava a different number of children" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nodeHasDifferentChildNumber();
-
-   @Message(id = 119052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException mustBeBoolean(Node elem, String value);
-
-   @Message(id = 119053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException mustBeDouble(Node elem, String value);
-
-   @Message(id = 119054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as a Integer" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException mustBeInteger(Node elem, String value);
-
-   @Message(id = 119055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException mustBeLong(Node elem, String value);
-
-   @Message(id = 119056, value = "Failed to get decoder" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException failedToGetDecoder(@Cause Exception e);
-
-   @Message(id = 119057, value = "Error decoding password" , format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException errordecodingPassword(@Cause Exception e);
-
-   @Message(id = 119058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQAddressFullException addressIsFull(String addressName, int size);
-
-   @Message(id = 119059, value = "Interceptor {0} rejected packet in a blocking call. This call will never complete."
-         , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
-
-   @Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown."
-         , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQLargeMessageInterruptedException largeMessageInterrupted();
-
-   @Message(id = 119061, value =  "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
-   String decodeError();
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ActiveMQXAResource.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ActiveMQXAResource.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ActiveMQXAResource.java
new file mode 100644
index 0000000..ceff93a
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ActiveMQXAResource.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.client.impl;
+
+import javax.transaction.xa.XAResource;
+
+public interface ActiveMQXAResource extends XAResource
+{
+   XAResource getResource();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientConsumerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientConsumerImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientConsumerImpl.java
index c145186..6295a74 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientConsumerImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientConsumerImpl.java
@@ -30,8 +30,8 @@ import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.api.core.client.MessageHandler;
 import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.spi.core.remoting.ConsumerContext;
 import org.apache.activemq.spi.core.remoting.SessionContext;
 import org.apache.activemq.utils.FutureLatch;
@@ -53,7 +53,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
    // Constants
    // ------------------------------------------------------------------------------------
 
-   private static final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
    private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
 
@@ -204,7 +204,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
       if (handler != null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.messageHandlerSet();
+         throw ActiveMQClientMessageBundle.BUNDLE.messageHandlerSet();
       }
 
       if (clientWindowSize == 0)
@@ -295,7 +295,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             {
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Forcing delivery");
+                  ActiveMQClientLogger.LOGGER.trace("Forcing delivery");
                }
                // JBPAPP-6030 - Calling forceDelivery outside of the lock to avoid distributed dead locks
                sessionContext.forceDelivery(this, forceDeliveryCount++);
@@ -321,7 +321,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
                      if (isTrace)
                      {
-                        HornetQClientLogger.LOGGER.trace("There was nothing on the queue, leaving it now:: returning null");
+                        ActiveMQClientLogger.LOGGER.trace("There was nothing on the queue, leaving it now:: returning null");
                      }
 
                      return null;
@@ -330,7 +330,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
                   {
                      if (isTrace)
                      {
-                        HornetQClientLogger.LOGGER.trace("Ignored force delivery answer as it belonged to another call");
+                        ActiveMQClientLogger.LOGGER.trace("Ignored force delivery answer as it belonged to another call");
                      }
                      // Ignore the message
                      continue;
@@ -369,7 +369,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Returning " + m);
+                  ActiveMQClientLogger.LOGGER.trace("Returning " + m);
                }
 
                return m;
@@ -378,7 +378,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             {
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Returning null");
+                  ActiveMQClientLogger.LOGGER.trace("Returning null");
                }
                resetIfSlowConsumer();
                return null;
@@ -428,7 +428,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
       if (receiverThread != null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.inReceive();
+         throw ActiveMQClientMessageBundle.BUNDLE.inReceive();
       }
 
       boolean noPreviousHandler = handler == null;
@@ -492,7 +492,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
       }
       catch (ActiveMQException e)
       {
-         HornetQClientLogger.LOGGER.warn("problem cleaning up: " + this);
+         ActiveMQClientLogger.LOGGER.warn("problem cleaning up: " + this);
       }
    }
 
@@ -717,7 +717,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
       {
          if (isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Sending back credits for largeController = null " + flowControlSize);
+            ActiveMQClientLogger.LOGGER.trace("Sending back credits for largeController = null " + flowControlSize);
          }
          flowControl(flowControlSize, false);
       }
@@ -751,7 +751,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorClearingMessages(e);
+               ActiveMQClientLogger.LOGGER.errorClearingMessages(e);
             }
          }
 
@@ -764,7 +764,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
          catch (Throwable e)
          {
             // nothing that could be done here
-            HornetQClientLogger.LOGGER.errorClearingMessages(e);
+            ActiveMQClientLogger.LOGGER.errorClearingMessages(e);
          }
       }
 
@@ -853,7 +853,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             {
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("FlowControl::Sending " + creditsToSend + " -1, for slow consumer");
+                  ActiveMQClientLogger.LOGGER.trace("FlowControl::Sending " + creditsToSend + " -1, for slow consumer");
                }
 
                // sending the credits - 1 initially send to fire the slow consumer, or the slow consumer would be
@@ -869,9 +869,9 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             }
             else
             {
-               if (HornetQClientLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                {
-                  HornetQClientLogger.LOGGER.debug("Sending " + messageBytes + " from flow-control");
+                  ActiveMQClientLogger.LOGGER.debug("Sending " + messageBytes + " from flow-control");
                }
 
                final int credits = creditsToSend;
@@ -906,7 +906,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
    {
       if (isTrace)
       {
-         HornetQClientLogger.LOGGER.trace("Sending 1 credit to start delivering of one message to slow consumer");
+         ActiveMQClientLogger.LOGGER.trace("Sending 1 credit to start delivering of one message to slow consumer");
       }
       sendCredits(1);
       try
@@ -962,7 +962,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
    {
       if (isTrace)
       {
-         HornetQClientLogger.LOGGER.trace("Adding Runner on Executor for delivery");
+         ActiveMQClientLogger.LOGGER.trace("Adding Runner on Executor for delivery");
       }
 
       sessionExecutor.execute(runner);
@@ -1011,7 +1011,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
       if (!ok)
       {
-         HornetQClientLogger.LOGGER.timeOutWaitingForProcessing();
+         ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing();
       }
    }
 
@@ -1019,7 +1019,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
    {
       if (closed)
       {
-         throw HornetQClientMessageBundle.BUNDLE.consumerClosed();
+         throw ActiveMQClientMessageBundle.BUNDLE.consumerClosed();
       }
    }
 
@@ -1073,7 +1073,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
             {
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Calling handler.onMessage");
+                  ActiveMQClientLogger.LOGGER.trace("Calling handler.onMessage");
                }
                final ClassLoader originalLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
                {
@@ -1107,7 +1107,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
                   }
                   catch (Exception e)
                   {
-                     HornetQClientLogger.LOGGER.warn(e.getMessage(), e);
+                     ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
                   }
 
                   onMessageThread = null;
@@ -1115,7 +1115,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
 
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Handler.onMessage done");
+                  ActiveMQClientLogger.LOGGER.trace("Handler.onMessage done");
                }
 
                if (message.isLargeMessage())
@@ -1229,7 +1229,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
          }
          catch (Exception e)
          {
-            HornetQClientLogger.LOGGER.onMessageError(e);
+            ActiveMQClientLogger.LOGGER.onMessageError(e);
 
             lastException = e;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientLargeMessageImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientLargeMessageImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientLargeMessageImpl.java
index b6fa16b..5a795fe 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientLargeMessageImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientLargeMessageImpl.java
@@ -18,7 +18,7 @@ import java.io.OutputStream;
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.Message;
-import org.apache.activemq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
+import org.apache.activemq.core.buffers.impl.ResetLimitWrappedActiveMQBuffer;
 import org.apache.activemq.utils.DataConstants;
 
 /**
@@ -183,19 +183,19 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
          }
          createBody((int)bodySize);
 
-         bodyBuffer = new ResetLimitWrappedHornetQBuffer(BODY_OFFSET, buffer, this);
+         bodyBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer, this);
 
-         largeMessageController.saveBuffer(new HornetQOutputStream(bodyBuffer));
+         largeMessageController.saveBuffer(new ActiveMQOutputStream(bodyBuffer));
       }
    }
 
    // Inner classes -------------------------------------------------
 
-   private static class HornetQOutputStream extends OutputStream
+   private static class ActiveMQOutputStream extends OutputStream
    {
       private final ActiveMQBuffer bufferOut;
 
-      HornetQOutputStream(ActiveMQBuffer out)
+      ActiveMQOutputStream(ActiveMQBuffer out)
       {
          this.bufferOut = out;
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientMessageImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientMessageImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientMessageImpl.java
index 715837a..000bddd 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientMessageImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientMessageImpl.java
@@ -23,7 +23,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.message.BodyEncoder;
 import org.apache.activemq.core.message.impl.MessageImpl;
 import org.apache.activemq.reader.MessageUtil;
@@ -173,7 +173,7 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
       }
       catch (IOException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.errorSavingBody(e);
+         throw ActiveMQClientMessageBundle.BUNDLE.errorSavingBody(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerCreditsImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerCreditsImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerCreditsImpl.java
index e037136..590ce68 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerCreditsImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerCreditsImpl.java
@@ -14,8 +14,8 @@ package org.apache.activemq.core.client.impl;
 
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.spi.core.remoting.SessionContext;
 
 import java.util.concurrent.Semaphore;
@@ -99,7 +99,7 @@ public class ClientProducerCreditsImpl implements ClientProducerCredits
                {
                   // I'm using string concatenation here in case address is null
                   // better getting a "null" string than a NPE
-                  HornetQClientLogger.LOGGER.outOfCreditOnFlowControl("" + address);
+                  ActiveMQClientLogger.LOGGER.outOfCreditOnFlowControl("" + address);
                }
             }
             finally
@@ -127,7 +127,7 @@ public class ClientProducerCreditsImpl implements ClientProducerCredits
             pendingCredits = 0;
             arriving = 0;
 
-            throw HornetQClientMessageBundle.BUNDLE.addressIsFull(address.toString(), credits);
+            throw ActiveMQClientMessageBundle.BUNDLE.addressIsFull(address.toString(), credits);
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerImpl.java
index 1c99da1..45cac1b 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientProducerImpl.java
@@ -23,13 +23,13 @@ import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.message.BodyEncoder;
 import org.apache.activemq.core.message.impl.MessageInternal;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
 import org.apache.activemq.spi.core.remoting.SessionContext;
 import org.apache.activemq.utils.DeflaterReader;
-import org.apache.activemq.utils.HornetQBufferInputStream;
+import org.apache.activemq.utils.ActiveMQBufferInputStream;
 import org.apache.activemq.utils.TokenBucketLimiter;
 import org.apache.activemq.utils.UUIDGenerator;
 
@@ -333,7 +333,7 @@ public class ClientProducerImpl implements ClientProducerInternal
    {
       if (closed)
       {
-         throw HornetQClientMessageBundle.BUNDLE.producerClosed();
+         throw ActiveMQClientMessageBundle.BUNDLE.producerClosed();
       }
    }
 
@@ -351,7 +351,7 @@ public class ClientProducerImpl implements ClientProducerInternal
 
       if (msgI.getHeadersAndPropertiesEncodeSize() >= minLargeMessageSize)
       {
-         throw HornetQClientMessageBundle.BUNDLE.headerSizeTooBig(headerSize);
+         throw ActiveMQClientMessageBundle.BUNDLE.headerSizeTooBig(headerSize);
       }
 
       // msg.getBody() could be Null on LargeServerMessage
@@ -459,7 +459,7 @@ public class ClientProducerImpl implements ClientProducerInternal
                             final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws ActiveMQException
    {
       msgI.getBodyBuffer().readerIndex(0);
-      largeMessageSendStreamed(sendBlocking, msgI, new HornetQBufferInputStream(msgI.getBodyBuffer()), credits,
+      largeMessageSendStreamed(sendBlocking, msgI, new ActiveMQBufferInputStream(msgI.getBodyBuffer()), credits,
                                handler);
    }
 
@@ -513,7 +513,7 @@ public class ClientProducerImpl implements ClientProducerInternal
             }
             catch (IOException e)
             {
-               throw HornetQClientMessageBundle.BUNDLE.errorReadingBody(e);
+               throw ActiveMQClientMessageBundle.BUNDLE.errorReadingBody(e);
             }
 
             if (numberOfBytesRead == -1)
@@ -601,7 +601,7 @@ public class ClientProducerImpl implements ClientProducerInternal
       }
       catch (IOException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.errorClosingLargeMessage(e);
+         throw ActiveMQClientMessageBundle.BUNDLE.errorClosingLargeMessage(e);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionFactoryImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionFactoryImpl.java
index 432234f..4b75160 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionFactoryImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionFactoryImpl.java
@@ -38,14 +38,14 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.FailoverEventListener;
 import org.apache.activemq.api.core.client.FailoverEventType;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.ServerLocator;
 import org.apache.activemq.api.core.client.SessionFailureListener;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.core.remoting.FailureListener;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.BufferHandler;
 import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
@@ -74,9 +74,9 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
    // Constants
    // ------------------------------------------------------------------------------------
 
-   private static final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
-   private static final boolean isDebug = HornetQClientLogger.LOGGER.isDebugEnabled();
+   private static final boolean isDebug = ActiveMQClientLogger.LOGGER.isDebugEnabled();
 
    // Attributes
    // -----------------------------------------------------------------------------------
@@ -189,11 +189,11 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
       // HORNETQ-1314 - if this in an in-vm connection then disable connection monitoring
       if (connectorFactory.isReliable() &&
-         clientFailureCheckPeriod == HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD &&
-         connectionTTL == HornetQClient.DEFAULT_CONNECTION_TTL)
+         clientFailureCheckPeriod == ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD &&
+         connectionTTL == ActiveMQClient.DEFAULT_CONNECTION_TTL)
       {
-         this.clientFailureCheckPeriod = HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM;
-         this.connectionTTL = HornetQClient.DEFAULT_CONNECTION_TTL_INVM;
+         this.clientFailureCheckPeriod = ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM;
+         this.connectionTTL = ActiveMQClient.DEFAULT_CONNECTION_TTL_INVM;
       }
       else
       {
@@ -282,7 +282,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isDebug)
          {
-            HornetQClientLogger.LOGGER.debug("Setting up backup config = " + backUp + " for live = " + live);
+            ActiveMQClientLogger.LOGGER.debug("Setting up backup config = " + backUp + " for live = " + live);
          }
          backupConfig = backUp;
       }
@@ -290,7 +290,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isDebug)
          {
-            HornetQClientLogger.LOGGER.debug("ClientSessionFactoryImpl received backup update for live/backup pair = " + live +
+            ActiveMQClientLogger.LOGGER.debug("ClientSessionFactoryImpl received backup update for live/backup pair = " + live +
                                                 " / " +
                                                 backUp +
                                                 " but it didn't belong to " +
@@ -405,7 +405,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
    // ConnectionLifeCycleListener implementation --------------------------------------------------
 
-   public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+   public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
    {
    }
 
@@ -413,7 +413,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
    {
       // The exception has to be created in the same thread where it's being called
       // as to avoid a different stack trace cause
-      final ActiveMQException ex = HornetQClientMessageBundle.BUNDLE.channelDisconnected();
+      final ActiveMQException ex = ActiveMQClientMessageBundle.BUNDLE.channelDisconnected();
 
       // It has to use the same executor as the disconnect message is being sent through
 
@@ -516,7 +516,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
          }
          catch (Exception e1)
          {
-            HornetQClientLogger.LOGGER.unableToCloseSession(e1);
+            ActiveMQClientLogger.LOGGER.unableToCloseSession(e1);
          }
       }
       checkCloseConnection();
@@ -573,12 +573,12 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       catch (ActiveMQInterruptedException e1)
       {
          // this is just a debug, since an interrupt is an expected event (in case of a shutdown)
-         HornetQClientLogger.LOGGER.debug(e1.getMessage(), e1);
+         ActiveMQClientLogger.LOGGER.debug(e1.getMessage(), e1);
       }
    }
 
    /**
-    * TODO: Maybe this belongs to HornetQClientProtocolManager
+    * TODO: Maybe this belongs to ActiveMQClientProtocolManager
     * @param connectionID
     * @param me
     */
@@ -602,7 +602,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
          if (ClientSessionFactoryImpl.isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Client Connection failed, calling failure listeners and trying to reconnect, reconnectAttempts=" + reconnectAttempts);
+            ActiveMQClientLogger.LOGGER.trace("Client Connection failed, calling failure listeners and trying to reconnect, reconnectAttempts=" + reconnectAttempts);
          }
 
          callFailoverListeners(FailoverEventType.FAILURE_DETECTED);
@@ -728,7 +728,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             }
             catch (Exception cause)
             {
-               HornetQClientLogger.LOGGER.failedToCleanupSession(cause);
+               ActiveMQClientLogger.LOGGER.failedToCleanupSession(cause);
             }
          }
       }
@@ -824,7 +824,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQClientLogger.LOGGER.failedToExecuteListener(t);
+            ActiveMQClientLogger.LOGGER.failedToExecuteListener(t);
          }
       }
    }
@@ -844,7 +844,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQClientLogger.LOGGER.failedToExecuteListener(t);
+            ActiveMQClientLogger.LOGGER.failedToExecuteListener(t);
          }
       }
    }
@@ -870,7 +870,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       if (connection == null)
       {
          if (!clientProtocolManager.isAlive())
-            HornetQClientLogger.LOGGER.failedToConnectToServer();
+            ActiveMQClientLogger.LOGGER.failedToConnectToServer();
 
          return;
       }
@@ -907,9 +907,9 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
    {
       if (!clientProtocolManager.isAlive())
          return;
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("getConnectionWithRetry::" + reconnectAttempts +
+         ActiveMQClientLogger.LOGGER.trace("getConnectionWithRetry::" + reconnectAttempts +
                                              " with retryInterval = " +
                                              retryInterval +
                                              " multiplier = " +
@@ -924,14 +924,14 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isDebug)
          {
-            HornetQClientLogger.LOGGER.debug("Trying reconnection attempt " + count + "/" + reconnectAttempts);
+            ActiveMQClientLogger.LOGGER.debug("Trying reconnection attempt " + count + "/" + reconnectAttempts);
          }
 
          if (getConnection() != null)
          {
-            if (HornetQClientLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
             {
-               HornetQClientLogger.LOGGER.debug("Reconnection successful");
+               ActiveMQClientLogger.LOGGER.debug("Reconnection successful");
             }
             return;
          }
@@ -947,7 +947,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
                {
                   if (reconnectAttempts != 1)
                   {
-                     HornetQClientLogger.LOGGER.failedToConnectToServer(reconnectAttempts);
+                     ActiveMQClientLogger.LOGGER.failedToConnectToServer(reconnectAttempts);
                   }
 
                   return;
@@ -955,7 +955,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
                if (ClientSessionFactoryImpl.isTrace)
                {
-                  HornetQClientLogger.LOGGER.waitingForRetry(interval, retryInterval, retryIntervalMultiplier);
+                  ActiveMQClientLogger.LOGGER.waitingForRetry(interval, retryInterval, retryIntervalMultiplier);
                }
 
                try
@@ -982,7 +982,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             }
             else
             {
-               HornetQClientLogger.LOGGER.debug("Could not connect to any server. Didn't have reconnection configured on the ClientSessionFactory");
+               ActiveMQClientLogger.LOGGER.debug("Could not connect to any server. Didn't have reconnection configured on the ClientSessionFactory");
                return;
             }
          }
@@ -1086,14 +1086,14 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
                {
                   if (ClientSessionFactoryImpl.isTrace)
                   {
-                     HornetQClientLogger.LOGGER.trace(this + "::Subscribing Topology");
+                     ActiveMQClientLogger.LOGGER.trace(this + "::Subscribing Topology");
                   }
                   clientProtocolManager.sendSubscribeTopology(serverLocator.isClusterConnection());
                }
             }
             else
             {
-               HornetQClientLogger.LOGGER.debug("serverLocator@" + System.identityHashCode(serverLocator + " had no topology"));
+               ActiveMQClientLogger.LOGGER.debug("serverLocator@" + System.identityHashCode(serverLocator + " had no topology"));
             }
 
             return connection;
@@ -1133,7 +1133,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
    {
       if (!closed && finalizeCheck)
       {
-         HornetQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this));
+         ActiveMQClientLogger.LOGGER.factoryLeftOpen(createTrace, System.identityHashCode(this));
 
          close();
       }
@@ -1184,11 +1184,11 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             CLOSE_RUNNABLES.add(this);
             if (scaleDownTargetNodeID == null)
             {
-               conn.fail(HornetQClientMessageBundle.BUNDLE.disconnected());
+               conn.fail(ActiveMQClientMessageBundle.BUNDLE.disconnected());
             }
             else
             {
-               conn.fail(HornetQClientMessageBundle.BUNDLE.disconnected(), scaleDownTargetNodeID);
+               conn.fail(ActiveMQClientMessageBundle.BUNDLE.disconnected(), scaleDownTargetNodeID);
             }
          }
          finally
@@ -1234,7 +1234,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isDebug)
          {
-            HornetQClientLogger.LOGGER.debug("Connector towards " + connector + " failed");
+            ActiveMQClientLogger.LOGGER.debug("Connector towards " + connector + " failed");
          }
 
          try
@@ -1291,7 +1291,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isDebug)
          {
-            HornetQClientLogger.LOGGER.debug("Trying to connect with connector = " + connectorFactory +
+            ActiveMQClientLogger.LOGGER.debug("Trying to connect with connector = " + connectorFactory +
                                                 ", parameters = " +
                                                 connectorConfig.getParams() +
                                                 " connector = " +
@@ -1310,7 +1310,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
          {
             if (ClientSessionFactoryImpl.isDebug)
             {
-               HornetQClientLogger.LOGGER.debug("Trying backup config = " + backupConfig);
+               ActiveMQClientLogger.LOGGER.debug("Trying backup config = " + backupConfig);
             }
 
             ConnectorFactory backupConnectorFactory = instantiateConnectorFactory(backupConfig.getFactoryClassName());
@@ -1325,7 +1325,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
                if (ClientSessionFactoryImpl.isDebug)
                {
-                  HornetQClientLogger.LOGGER.debug("Connected to the backup at " + backupConfig);
+                  ActiveMQClientLogger.LOGGER.debug("Connected to the backup at " + backupConfig);
                }
 
                // Switching backup as live
@@ -1338,7 +1338,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
             {
                if (ClientSessionFactoryImpl.isDebug)
                {
-                  HornetQClientLogger.LOGGER.debug("Backup is not active yet");
+                  ActiveMQClientLogger.LOGGER.debug("Backup is not active yet");
                }
             }
 
@@ -1348,7 +1348,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          // Sanity catch for badly behaved remoting plugins
 
-         HornetQClientLogger.LOGGER.createConnectorException(cause);
+         ActiveMQClientLogger.LOGGER.createConnectorException(cause);
 
          if (transportConnection != null)
          {
@@ -1392,7 +1392,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
          }
          else
          {
-            HornetQClientLogger.LOGGER.debug("TheConn == null on ClientSessionFactoryImpl::DelegatingBufferHandler, ignoring packet");
+            ActiveMQClientLogger.LOGGER.debug("TheConn == null on ClientSessionFactoryImpl::DelegatingBufferHandler, ignoring packet");
          }
       }
    }
@@ -1473,7 +1473,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
                // We use a different thread to send the fail
                // but the exception has to be created here to preserve the stack trace
-               final ActiveMQException me = HornetQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection());
+               final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection());
 
                cancelled = true;
 
@@ -1521,7 +1521,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       {
          if (ClientSessionFactoryImpl.isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("Neither backup or live were active, will just give up now");
+            ActiveMQClientLogger.LOGGER.trace("Neither backup or live were active, will just give up now");
          }
          return null;
       }
@@ -1535,9 +1535,9 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
 
       schedulePing();
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("returning " + connection);
+         ActiveMQClientLogger.LOGGER.trace("returning " + connection);
       }
 
       return newConnection;
@@ -1573,9 +1573,9 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
       public void nodeDisconnected(RemotingConnection conn, String nodeID, String scaleDownTargetNodeID)
       {
 
-         if (HornetQClientLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
          {
-            HornetQClientLogger.LOGGER.trace("Disconnect being called on client:" +
+            ActiveMQClientLogger.LOGGER.trace("Disconnect being called on client:" +
                                                 " server locator = " +
                                                 serverLocator +
                                                 " notifying node " +

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java
index 8b95874..65c5eaf 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ClientSessionImpl.java
@@ -36,8 +36,8 @@ import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.api.core.client.FailoverEventListener;
 import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
 import org.apache.activemq.api.core.client.SessionFailureListener;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.ConsumerContext;
@@ -492,19 +492,19 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
       if (outcomeKnown)
       {
-         throw HornetQClientMessageBundle.BUNDLE.txRolledBack();
+         throw ActiveMQClientMessageBundle.BUNDLE.txRolledBack();
       }
 
-      throw HornetQClientMessageBundle.BUNDLE.txOutcomeUnknown();
+      throw ActiveMQClientMessageBundle.BUNDLE.txOutcomeUnknown();
    }
 
    public void commit() throws ActiveMQException
    {
       checkClosed();
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Sending commit");
+         ActiveMQClientLogger.LOGGER.trace("Sending commit");
       }
 
       /*
@@ -565,9 +565,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    public void rollback(final boolean isLastMessageAsDelivered) throws ActiveMQException
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("calling rollback(isLastMessageAsDelivered=" + isLastMessageAsDelivered + ")");
+         ActiveMQClientLogger.LOGGER.trace("calling rollback(isLastMessageAsDelivered=" + isLastMessageAsDelivered + ")");
       }
       checkClosed();
 
@@ -651,7 +651,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       if (rollbackOnly)
       {
-         HornetQClientLogger.LOGGER.resettingSessionAfterFailure();
+         ActiveMQClientLogger.LOGGER.resettingSessionAfterFailure();
          rollback(false);
       }
    }
@@ -771,9 +771,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       }
 
       checkClosed();
-      if (HornetQClientLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
       {
-         HornetQClientLogger.LOGGER.debug("client ack messageID = " + message.getMessageID());
+         ActiveMQClientLogger.LOGGER.debug("client ack messageID = " + message.getMessageID());
       }
 
       startCall();
@@ -900,7 +900,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
                }
                catch (ActiveMQException e)
                {
-                  HornetQClientLogger.LOGGER.unableToCloseConsumer(e);
+                  ActiveMQClientLogger.LOGGER.unableToCloseConsumer(e);
                }
             }
          });
@@ -911,13 +911,13 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       if (closed)
       {
-         HornetQClientLogger.LOGGER.debug("Session was already closed, giving up now, this=" + this);
+         ActiveMQClientLogger.LOGGER.debug("Session was already closed, giving up now, this=" + this);
          return;
       }
 
-      if (HornetQClientLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
       {
-         HornetQClientLogger.LOGGER.debug("Calling close on session " + this);
+         ActiveMQClientLogger.LOGGER.debug("Calling close on session " + this);
       }
 
       try
@@ -936,7 +936,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
          // Session close should always return without exception
 
          // Note - we only log at trace
-         HornetQClientLogger.LOGGER.trace("Failed to close session", e);
+         ActiveMQClientLogger.LOGGER.trace("Failed to close session", e);
       }
 
       doCleanup(false);
@@ -993,9 +993,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
             if (!reattached)
             {
 
-               if (HornetQClientLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                {
-                  HornetQClientLogger.LOGGER.debug("ClientSession couldn't be reattached, creating a new session");
+                  ActiveMQClientLogger.LOGGER.debug("ClientSession couldn't be reattached, creating a new session");
                }
 
                for (ClientConsumerInternal consumer : cloneConsumers())
@@ -1061,7 +1061,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
          }
          catch (Throwable t)
          {
-            HornetQClientLogger.LOGGER.failedToHandleFailover(t);
+            ActiveMQClientLogger.LOGGER.failedToHandleFailover(t);
          }
          finally
          {
@@ -1179,7 +1179,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       if (concurrentCall.incrementAndGet() > 1)
       {
-         HornetQClientLogger.LOGGER.invalidConcurrentSessionUsage(new Exception("trace"));
+         ActiveMQClientLogger.LOGGER.invalidConcurrentSessionUsage(new Exception("trace"));
       }
    }
 
@@ -1197,16 +1197,16 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    public void commit(final Xid xid, final boolean onePhase) throws XAException
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("call commit(xid=" + convert(xid));
+         ActiveMQClientLogger.LOGGER.trace("call commit(xid=" + convert(xid));
       }
       checkXA();
 
       // we should never throw rollback if we have already prepared
       if (rollbackOnly)
       {
-         HornetQClientLogger.LOGGER.commitAfterFailover();
+         ActiveMQClientLogger.LOGGER.commitAfterFailover();
       }
 
       // Note - don't need to flush acks since the previous end would have
@@ -1224,7 +1224,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       }
       catch (Throwable t)
       {
-         HornetQClientLogger.LOGGER.failoverDuringCommit();
+         ActiveMQClientLogger.LOGGER.failoverDuringCommit();
 
          // Any error on commit -> RETRY
          // We can't rollback a Prepared TX for definition
@@ -1240,9 +1240,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    public void end(final Xid xid, final int flags) throws XAException
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Calling end:: " + convert(xid) + ", flags=" + convertTXFlag(flags));
+         ActiveMQClientLogger.LOGGER.trace("Calling end:: " + convert(xid) + ", flags=" + convertTXFlag(flags));
       }
 
       checkXA();
@@ -1257,7 +1257,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
             }
             catch (Throwable ignored)
             {
-               HornetQClientLogger.LOGGER.debug("Error on rollback during end call!", ignored);
+               ActiveMQClientLogger.LOGGER.debug("Error on rollback during end call!", ignored);
             }
             throw new XAException(XAException.XA_RBOTHER);
          }
@@ -1282,7 +1282,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
          }
          catch (Throwable t)
          {
-            HornetQClientLogger.LOGGER.errorCallingEnd(t);
+            ActiveMQClientLogger.LOGGER.errorCallingEnd(t);
             // This could occur if the TM interrupts the thread
             XAException xaException = new XAException(XAException.XAER_RMERR);
             xaException.initCause(t);
@@ -1392,9 +1392,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       {
          return (ClientSessionInternal) xares;
       }
-      else if (xares instanceof HornetQXAResource)
+      else if (xares instanceof ActiveMQXAResource)
       {
-         return getSessionInternalFromXAResource(((HornetQXAResource)xares).getResource());
+         return getSessionInternalFromXAResource(((ActiveMQXAResource)xares).getResource());
       }
       return null;
    }
@@ -1402,9 +1402,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    public int prepare(final Xid xid) throws XAException
    {
       checkXA();
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Calling prepare:: " + convert(xid));
+         ActiveMQClientLogger.LOGGER.trace("Calling prepare:: " + convert(xid));
       }
 
 
@@ -1439,7 +1439,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
             {
                // ignore and rollback
             }
-            HornetQClientLogger.LOGGER.failoverDuringPrepareRollingBack();
+            ActiveMQClientLogger.LOGGER.failoverDuringPrepareRollingBack();
             try
             {
                rollback(false);
@@ -1452,12 +1452,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
                throw xaException;
             }
 
-            HornetQClientLogger.LOGGER.errorDuringPrepare(e);
+            ActiveMQClientLogger.LOGGER.errorDuringPrepare(e);
 
             throw new XAException(XAException.XA_RBOTHER);
          }
 
-         HornetQClientLogger.LOGGER.errorDuringPrepare(e);
+         ActiveMQClientLogger.LOGGER.errorDuringPrepare(e);
 
          // This should never occur
          XAException xaException = new XAException(XAException.XAER_RMERR);
@@ -1466,7 +1466,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       }
       catch (Throwable t)
       {
-         HornetQClientLogger.LOGGER.errorDuringPrepare(t);
+         ActiveMQClientLogger.LOGGER.errorDuringPrepare(t);
 
          // This could occur if the TM interrupts the thread
          XAException xaException = new XAException(XAException.XAER_RMERR);
@@ -1505,9 +1505,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       checkXA();
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Calling rollback:: " + convert(xid));
+         ActiveMQClientLogger.LOGGER.trace("Calling rollback:: " + convert(xid));
       }
 
       try
@@ -1569,9 +1569,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    public void start(final Xid xid, final int flags) throws XAException
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Calling start:: " + convert(xid) + " clientXID=" + xid + " flags = " + convertTXFlag(flags));
+         ActiveMQClientLogger.LOGGER.trace("Calling start:: " + convert(xid) + " clientXID=" + xid + " flags = " + convertTXFlag(flags));
       }
 
       checkXA();
@@ -1632,7 +1632,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       }
       catch (Exception e)
       {
-         HornetQClientLogger.LOGGER.failedToCleanupSession(e);
+         ActiveMQClientLogger.LOGGER.failedToCleanupSession(e);
       }
    }
 
@@ -1742,7 +1742,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
       if (durable && temp)
       {
-         throw HornetQClientMessageBundle.BUNDLE.queueMisConfigured();
+         throw ActiveMQClientMessageBundle.BUNDLE.queueMisConfigured();
       }
 
       startCall();
@@ -1760,7 +1760,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       if (!xa)
       {
-         HornetQClientLogger.LOGGER.sessionNotXA();
+         ActiveMQClientLogger.LOGGER.sessionNotXA();
          throw new XAException(XAException.XAER_RMERR);
       }
    }
@@ -1769,7 +1769,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    {
       if (closed || inClose)
       {
-         throw HornetQClientMessageBundle.BUNDLE.sessionClosed();
+         throw ActiveMQClientMessageBundle.BUNDLE.sessionClosed();
       }
    }
 
@@ -1784,9 +1784,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    private void doCleanup(boolean failingOver)
    {
-      if (HornetQClientLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
       {
-         HornetQClientLogger.LOGGER.debug("calling cleanup on " + this);
+         ActiveMQClientLogger.LOGGER.debug("calling cleanup on " + this);
       }
 
       synchronized (this)
@@ -1936,7 +1936,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
       {
          if (!confirmationWindowWarning.warningIssued.get())
          {
-            HornetQClientLogger.LOGGER.confirmationWindowDisabledWarning();
+            ActiveMQClientLogger.LOGGER.confirmationWindowDisabledWarning();
             confirmationWindowWarning.warningIssued.set(true);
          }
          return false;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/CompressedLargeMessageControllerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/CompressedLargeMessageControllerImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/CompressedLargeMessageControllerImpl.java
index acadf1a..023f69d 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/CompressedLargeMessageControllerImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/CompressedLargeMessageControllerImpl.java
@@ -22,9 +22,9 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQBuffers;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.apache.activemq.utils.DataConstants;
-import org.apache.activemq.utils.HornetQBufferInputStream;
+import org.apache.activemq.utils.ActiveMQBufferInputStream;
 import org.apache.activemq.utils.InflaterReader;
 import org.apache.activemq.utils.InflaterWriter;
 import org.apache.activemq.utils.UTF8Util;
@@ -102,7 +102,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
       {
          try
          {
-            InputStream input = new HornetQBufferInputStream(bufferDelegate);
+            InputStream input = new ActiveMQBufferInputStream(bufferDelegate);
 
             dataInput = new DataInputStream(new InflaterReader(input));
          }
@@ -432,7 +432,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
          int nReadBytes = getStream().read(dst, dstIndex, length);
          if (nReadBytes < length)
          {
-            HornetQClientLogger.LOGGER.compressedLargeMessageError(length, nReadBytes);
+            ActiveMQClientLogger.LOGGER.compressedLargeMessageError(length, nReadBytes);
          }
       }
       catch (Exception e)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/DelegatingSession.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/DelegatingSession.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/DelegatingSession.java
index f13de61..9a034cf 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/DelegatingSession.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/DelegatingSession.java
@@ -27,7 +27,7 @@ import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.api.core.client.FailoverEventListener;
 import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
 import org.apache.activemq.api.core.client.SessionFailureListener;
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.ConsumerContext;
 import org.apache.activemq.utils.ConcurrentHashSet;
@@ -55,11 +55,11 @@ public class DelegatingSession implements ClientSessionInternal
 
    public static void dumpSessionCreationStacks()
    {
-      HornetQClientLogger.LOGGER.dumpingSessionStacks();
+      ActiveMQClientLogger.LOGGER.dumpingSessionStacks();
 
       for (DelegatingSession session : DelegatingSession.sessions)
       {
-         HornetQClientLogger.LOGGER.dumpingSessionStack(session.creationStack);
+         ActiveMQClientLogger.LOGGER.dumpingSessionStack(session.creationStack);
       }
    }
 
@@ -76,7 +76,7 @@ public class DelegatingSession implements ClientSessionInternal
       //
       if (!closed && !session.isClosed())
       {
-         HornetQClientLogger.LOGGER.clientSessionNotClosed(creationStack, System.identityHashCode(this));
+         ActiveMQClientLogger.LOGGER.clientSessionNotClosed(creationStack, System.identityHashCode(this));
 
          close();
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/HornetQXAResource.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/HornetQXAResource.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/HornetQXAResource.java
deleted file mode 100644
index 31ff43d..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/HornetQXAResource.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.client.impl;
-
-import javax.transaction.xa.XAResource;
-
-public interface HornetQXAResource extends XAResource
-{
-   XAResource getResource();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/LargeMessageControllerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/LargeMessageControllerImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/LargeMessageControllerImpl.java
index ff14363..06ce5ec 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/LargeMessageControllerImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/LargeMessageControllerImpl.java
@@ -32,8 +32,8 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQExceptionType;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.utils.DataConstants;
 import org.apache.activemq.utils.UTF8Util;
 
@@ -191,7 +191,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorAddingPacket(e);
+               ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
                handledException = e;
             }
          }
@@ -205,7 +205,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
                }
                catch (Exception e)
                {
-                  HornetQClientLogger.LOGGER.errorAddingPacket(e);
+                  ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
                   handledException = e;
                }
             }
@@ -223,7 +223,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
          }
          catch (Exception e)
          {
-            HornetQClientLogger.LOGGER.errorAddingPacket(e);
+            ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
             handledException = e;
          }
       }
@@ -231,7 +231,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
 
    public void cancel()
    {
-      this.handledException = HornetQClientMessageBundle.BUNDLE.largeMessageInterrupted();
+      this.handledException = ActiveMQClientMessageBundle.BUNDLE.largeMessageInterrupted();
 
       synchronized (this)
       {
@@ -249,7 +249,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
          catch (Exception ignored)
          {
             // what else can we do here?
-            HornetQClientLogger.LOGGER.errorCallingCancel(ignored);
+            ActiveMQClientLogger.LOGGER.errorCallingCancel(ignored);
          }
 
          largeMessageData.offer(new LargeData());
@@ -308,7 +308,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
    {
       if (streamClosed)
       {
-         throw HornetQClientMessageBundle.BUNDLE.largeMessageLostSession();
+         throw ActiveMQClientMessageBundle.BUNDLE.largeMessageLostSession();
       }
       setOutputStream(output);
       waitCompletion(0);
@@ -354,11 +354,11 @@ public class LargeMessageControllerImpl implements LargeMessageController
          {
             if (timeWait != 0 && System.currentTimeMillis() > timeOut)
             {
-               throw HornetQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
+               throw ActiveMQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
             }
             else if (System.currentTimeMillis() > timeOut && !packetAdded)
             {
-               throw HornetQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
+               throw ActiveMQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
             }
          }
       }
@@ -613,7 +613,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
       }
       catch (Exception e)
       {
-         HornetQClientLogger.LOGGER.errorReadingIndex(e);
+         ActiveMQClientLogger.LOGGER.errorReadingIndex(e);
          throw new RuntimeException(e.getMessage(), e);
       }
       this.readerIndex = readerIndex;
@@ -642,7 +642,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
       }
       catch (Exception e)
       {
-         HornetQClientLogger.LOGGER.errorSettingIndex(e);
+         ActiveMQClientLogger.LOGGER.errorSettingIndex(e);
          throw new RuntimeException(e.getMessage(), e);
       }
       this.readerIndex = readerIndex;
@@ -694,7 +694,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
       }
       catch (Exception e)
       {
-         HornetQClientLogger.LOGGER.errorReSettingIndex(e);
+         ActiveMQClientLogger.LOGGER.errorReSettingIndex(e);
          throw new RuntimeException(e.getMessage(), e);
       }
    }
@@ -1199,7 +1199,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
       }
       catch (IOException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e);
+         throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e);
       }
    }
 
@@ -1327,7 +1327,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
          }
          catch (Exception e)
          {
-            HornetQClientLogger.LOGGER.errorReadingCache(e);
+            ActiveMQClientLogger.LOGGER.errorReadingCache(e);
             throw new RuntimeException(e.getMessage(), e);
          }
          finally
@@ -1377,7 +1377,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorClosingCache(e);
+               ActiveMQClientLogger.LOGGER.errorClosingCache(e);
             }
             cachedChannel = null;
          }
@@ -1390,7 +1390,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorClosingCache(e);
+               ActiveMQClientLogger.LOGGER.errorClosingCache(e);
             }
             cachedRAFile = null;
          }
@@ -1409,7 +1409,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorFinalisingCache(e);
+               ActiveMQClientLogger.LOGGER.errorFinalisingCache(e);
             }
          }
       }


[43/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnector.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnector.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnector.java
index f6defe9..b4ea7b5 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnector.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnector.java
@@ -97,12 +97,12 @@ import io.netty.util.concurrent.Future;
 import io.netty.util.concurrent.GlobalEventExecutor;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.client.impl.ClientSessionFactoryImpl;
-import org.apache.activemq.core.protocol.core.impl.HornetQClientProtocolManager;
+import org.apache.activemq.core.protocol.core.impl.ActiveMQClientProtocolManager;
 import org.apache.activemq.core.remoting.impl.ssl.SSLSupport;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.spi.core.remoting.AbstractConnector;
 import org.apache.activemq.spi.core.remoting.BufferHandler;
 import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
@@ -128,22 +128,22 @@ public class NettyConnector extends AbstractConnector
    public static final String JAVAX_KEYSTORE_PASSWORD_PROP_NAME = "javax.net.ssl.keyStorePassword";
    public static final String JAVAX_TRUSTSTORE_PATH_PROP_NAME = "javax.net.ssl.trustStore";
    public static final String JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME = "javax.net.ssl.trustStorePassword";
-   public static final String HORNETQ_KEYSTORE_PROVIDER_PROP_NAME = "org.apache.activemq.ssl.keyStoreProvider";
-   public static final String HORNETQ_KEYSTORE_PATH_PROP_NAME = "org.apache.activemq.ssl.keyStore";
-   public static final String HORNETQ_KEYSTORE_PASSWORD_PROP_NAME = "org.apache.activemq.ssl.keyStorePassword";
-   public static final String HORNETQ_TRUSTSTORE_PROVIDER_PROP_NAME = "org.apache.activemq.ssl.trustStoreProvider";
-   public static final String HORNETQ_TRUSTSTORE_PATH_PROP_NAME = "org.apache.activemq.ssl.trustStore";
-   public static final String HORNETQ_TRUSTSTORE_PASSWORD_PROP_NAME = "org.apache.activemq.ssl.trustStorePassword";
+   public static final String ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME = "org.apache.activemq.ssl.keyStoreProvider";
+   public static final String ACTIVEMQ_KEYSTORE_PATH_PROP_NAME = "org.apache.activemq.ssl.keyStore";
+   public static final String ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME = "org.apache.activemq.ssl.keyStorePassword";
+   public static final String ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME = "org.apache.activemq.ssl.trustStoreProvider";
+   public static final String ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME = "org.apache.activemq.ssl.trustStore";
+   public static final String ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME = "org.apache.activemq.ssl.trustStorePassword";
 
    // Constants for HTTP upgrade
    // These constants are exposed publicly as they are used on the server-side to fetch
    // headers from the HTTP request, compute some values and fill the HTTP response
    public static final String MAGIC_NUMBER = "CF70DEB8-70F9-4FBA-8B4F-DFC3E723B4CD";
-   public static final String SEC_HORNETQ_REMOTING_KEY = "Sec-HornetQRemoting-Key";
-   public static final String SEC_HORNETQ_REMOTING_ACCEPT = "Sec-HornetQRemoting-Accept";
-   public static final String HORNETQ_REMOTING = "hornetq-remoting";
+   public static final String SEC_ACTIVEMQ_REMOTING_KEY = "Sec-ActiveMQRemoting-Key";
+   public static final String SEC_ACTIVEMQ_REMOTING_ACCEPT = "Sec-ActiveMQRemoting-Accept";
+   public static final String ACTIVEMQ_REMOTING = "activemq-remoting";
 
-   private static final AttributeKey<String> REMOTING_KEY = AttributeKey.valueOf(SEC_HORNETQ_REMOTING_KEY);
+   private static final AttributeKey<String> REMOTING_KEY = AttributeKey.valueOf(SEC_ACTIVEMQ_REMOTING_KEY);
 
    // Default Configuration
    public static final Map<String, Object> DEFAULT_CONFIG;
@@ -183,7 +183,7 @@ public class NettyConnector extends AbstractConnector
    private final boolean httpRequiresSessionId;
 
    // if true, after the connection, the connector will send
-   // a HTTP GET request (+ Upgrade: hornetq-remoting) that
+   // a HTTP GET request (+ Upgrade: activemq-remoting) that
    // will be handled by the server's http server.
    private final boolean httpUpgradeEnabled;
 
@@ -255,7 +255,7 @@ public class NettyConnector extends AbstractConnector
                          final Executor threadPool,
                          final ScheduledExecutorService scheduledThreadPool)
    {
-      this(configuration, handler, listener, closeExecutor, threadPool, scheduledThreadPool, new HornetQClientProtocolManager());
+      this(configuration, handler, listener, closeExecutor, threadPool, scheduledThreadPool, new ActiveMQClientProtocolManager());
    }
 
 
@@ -273,12 +273,12 @@ public class NettyConnector extends AbstractConnector
 
       if (listener == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.nullListener();
+         throw ActiveMQClientMessageBundle.BUNDLE.nullListener();
       }
 
       if (handler == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.nullHandler();
+         throw ActiveMQClientMessageBundle.BUNDLE.nullHandler();
       }
 
       this.listener = listener;
@@ -487,7 +487,7 @@ public class NettyConnector extends AbstractConnector
       bootstrap.option(ChannelOption.SO_KEEPALIVE, true);
       bootstrap.option(ChannelOption.SO_REUSEADDR, true);
       bootstrap.option(ChannelOption.ALLOCATOR, new UnpooledByteBufAllocator(false));
-      channelGroup = new DefaultChannelGroup("hornetq-connector", GlobalEventExecutor.INSTANCE);
+      channelGroup = new DefaultChannelGroup("activemq-connector", GlobalEventExecutor.INSTANCE);
 
       final SSLContext context;
       if (sslEnabled)
@@ -507,17 +507,17 @@ public class NettyConnector extends AbstractConnector
                realKeyStorePassword = System.getProperty(JAVAX_KEYSTORE_PASSWORD_PROP_NAME);
             }
 
-            if (System.getProperty(HORNETQ_KEYSTORE_PROVIDER_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME) != null)
             {
-               realKeyStoreProvider = System.getProperty(HORNETQ_KEYSTORE_PROVIDER_PROP_NAME);
+               realKeyStoreProvider = System.getProperty(ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME);
             }
-            if (System.getProperty(HORNETQ_KEYSTORE_PATH_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_KEYSTORE_PATH_PROP_NAME) != null)
             {
-               realKeyStorePath = System.getProperty(HORNETQ_KEYSTORE_PATH_PROP_NAME);
+               realKeyStorePath = System.getProperty(ACTIVEMQ_KEYSTORE_PATH_PROP_NAME);
             }
-            if (System.getProperty(HORNETQ_KEYSTORE_PASSWORD_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME) != null)
             {
-               realKeyStorePassword = System.getProperty(HORNETQ_KEYSTORE_PASSWORD_PROP_NAME);
+               realKeyStorePassword = System.getProperty(ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME);
             }
 
             String realTrustStorePath = trustStorePath;
@@ -532,17 +532,17 @@ public class NettyConnector extends AbstractConnector
                realTrustStorePassword = System.getProperty(JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME);
             }
 
-            if (System.getProperty(HORNETQ_TRUSTSTORE_PROVIDER_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME) != null)
             {
-               realTrustStoreProvider = System.getProperty(HORNETQ_TRUSTSTORE_PROVIDER_PROP_NAME);
+               realTrustStoreProvider = System.getProperty(ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME);
             }
-            if (System.getProperty(HORNETQ_TRUSTSTORE_PATH_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME) != null)
             {
-               realTrustStorePath = System.getProperty(HORNETQ_TRUSTSTORE_PATH_PROP_NAME);
+               realTrustStorePath = System.getProperty(ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME);
             }
-            if (System.getProperty(HORNETQ_TRUSTSTORE_PASSWORD_PROP_NAME) != null)
+            if (System.getProperty(ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME) != null)
             {
-               realTrustStorePassword = System.getProperty(HORNETQ_TRUSTSTORE_PASSWORD_PROP_NAME);
+               realTrustStorePassword = System.getProperty(ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME);
             }
             context = SSLSupport.createContext(realKeyStoreProvider, realKeyStorePath, realKeyStorePassword, realTrustStoreProvider, realTrustStorePath, realTrustStorePassword);
          }
@@ -591,7 +591,7 @@ public class NettyConnector extends AbstractConnector
                   }
                   catch (IllegalArgumentException e)
                   {
-                     HornetQClientLogger.LOGGER.invalidCipherSuite(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedCipherSuites()));
+                     ActiveMQClientLogger.LOGGER.invalidCipherSuite(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedCipherSuites()));
                      throw e;
                   }
                }
@@ -604,7 +604,7 @@ public class NettyConnector extends AbstractConnector
                   }
                   catch (IllegalArgumentException e)
                   {
-                     HornetQClientLogger.LOGGER.invalidProtocol(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedProtocols()));
+                     ActiveMQClientLogger.LOGGER.invalidProtocol(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedProtocols()));
                      throw e;
                   }
                }
@@ -639,7 +639,7 @@ public class NettyConnector extends AbstractConnector
 
             protocolManager.addChannelHandlers(pipeline);
 
-            pipeline.addLast(new HornetQClientChannelHandler(channelGroup, handler, new Listener()));
+            pipeline.addLast(new ActiveMQClientChannelHandler(channelGroup, handler, new Listener()));
          }
       });
 
@@ -650,7 +650,7 @@ public class NettyConnector extends AbstractConnector
          batchFlusherFuture = scheduledThreadPool.scheduleWithFixedDelay(flusher, batchDelay, batchDelay, TimeUnit.MILLISECONDS);
       }
 
-      HornetQClientLogger.LOGGER.debug("Started Netty Connector version " + TransportConstants.NETTY_VERSION);
+      ActiveMQClientLogger.LOGGER.debug("Started Netty Connector version " + TransportConstants.NETTY_VERSION);
    }
 
    public synchronized void close()
@@ -719,7 +719,7 @@ public class NettyConnector extends AbstractConnector
          }
       }
 
-      HornetQClientLogger.LOGGER.debug("Remote destination: " + remoteDestination);
+      ActiveMQClientLogger.LOGGER.debug("Remote destination: " + remoteDestination);
 
       ChannelFuture future;
       //port 0 does not work so only use local address if set
@@ -755,13 +755,13 @@ public class NettyConnector extends AbstractConnector
                if (handshakeFuture.isSuccess())
                {
                   ChannelPipeline channelPipeline = ch.pipeline();
-                  HornetQChannelHandler channelHandler = channelPipeline.get(HornetQChannelHandler.class);
+                  ActiveMQChannelHandler channelHandler = channelPipeline.get(ActiveMQChannelHandler.class);
                   channelHandler.active = true;
                }
                else
                {
                   ch.close().awaitUninterruptibly();
-                  HornetQClientLogger.LOGGER.errorCreatingNettyConnection(handshakeFuture.cause());
+                  ActiveMQClientLogger.LOGGER.errorCreatingNettyConnection(handshakeFuture.cause());
                   return null;
                }
             }
@@ -783,7 +783,7 @@ public class NettyConnector extends AbstractConnector
                URI uri = new URI("http", null, host, port, null, null, null);
                HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath());
                request.headers().set(HttpHeaders.Names.HOST, host);
-               request.headers().set(HttpHeaders.Names.UPGRADE, HORNETQ_REMOTING);
+               request.headers().set(HttpHeaders.Names.UPGRADE, ACTIVEMQ_REMOTING);
                request.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.UPGRADE);
 
                final String endpoint = ConfigurationHelper.getStringProperty(TransportConstants.HTTP_UPGRADE_ENDPOINT_PROP_NAME,
@@ -797,10 +797,10 @@ public class NettyConnector extends AbstractConnector
                // Get 16 bit nonce and base 64 encode it
                byte[] nonce = randomBytes(16);
                String key = base64(nonce);
-               request.headers().set(SEC_HORNETQ_REMOTING_KEY, key);
+               request.headers().set(SEC_ACTIVEMQ_REMOTING_KEY, key);
                ch.attr(REMOTING_KEY).set(key);
 
-               HornetQClientLogger.LOGGER.debugf("Sending HTTP request %s", request);
+               ActiveMQClientLogger.LOGGER.debugf("Sending HTTP request %s", request);
 
                // Send the HTTP request.
                ch.writeAndFlush(request);
@@ -812,14 +812,14 @@ public class NettyConnector extends AbstractConnector
             }
             catch (URISyntaxException e)
             {
-               HornetQClientLogger.LOGGER.errorCreatingNettyConnection(e);
+               ActiveMQClientLogger.LOGGER.errorCreatingNettyConnection(e);
                return null;
             }
          }
          else
          {
             ChannelPipeline channelPipeline = ch.pipeline();
-            HornetQChannelHandler channelHandler = channelPipeline.get(HornetQChannelHandler.class);
+            ActiveMQChannelHandler channelHandler = channelPipeline.get(ActiveMQChannelHandler.class);
             channelHandler.active = true;
          }
 
@@ -835,7 +835,7 @@ public class NettyConnector extends AbstractConnector
 
          if (t != null && !(t instanceof ConnectException))
          {
-            HornetQClientLogger.LOGGER.errorCreatingNettyConnection(future.cause());
+            ActiveMQClientLogger.LOGGER.errorCreatingNettyConnection(future.cause());
          }
 
          return null;
@@ -852,11 +852,11 @@ public class NettyConnector extends AbstractConnector
 
    // Inner classes -------------------------------------------------
 
-   private static final class HornetQClientChannelHandler extends HornetQChannelHandler
+   private static final class ActiveMQClientChannelHandler extends ActiveMQChannelHandler
    {
-      HornetQClientChannelHandler(final ChannelGroup group,
-                                  final BufferHandler handler,
-                                  final ConnectionLifeCycleListener listener)
+      ActiveMQClientChannelHandler(final ChannelGroup group,
+                                   final BufferHandler handler,
+                                   final ConnectionLifeCycleListener listener)
       {
          super(group, handler, listener);
       }
@@ -882,29 +882,29 @@ public class NettyConnector extends AbstractConnector
          {
             HttpResponse response = (HttpResponse) msg;
             if (response.getStatus().code() == HttpResponseStatus.SWITCHING_PROTOCOLS.code()
-               && response.headers().get(HttpHeaders.Names.UPGRADE).equals(HORNETQ_REMOTING))
+               && response.headers().get(HttpHeaders.Names.UPGRADE).equals(ACTIVEMQ_REMOTING))
             {
-               String accept = response.headers().get(SEC_HORNETQ_REMOTING_ACCEPT);
+               String accept = response.headers().get(SEC_ACTIVEMQ_REMOTING_ACCEPT);
                String expectedResponse = createExpectedResponse(MAGIC_NUMBER, ctx.channel().attr(REMOTING_KEY).get());
 
                if (expectedResponse.equals(accept))
                {
-                  // remove the http handlers and flag the hornetq channel handler as active
+                  // remove the http handlers and flag the activemq channel handler as active
                   pipeline.remove(httpClientCodec);
                   pipeline.remove(this);
                   handshakeComplete = true;
-                  HornetQChannelHandler channelHandler = pipeline.get(HornetQChannelHandler.class);
+                  ActiveMQChannelHandler channelHandler = pipeline.get(ActiveMQChannelHandler.class);
                   channelHandler.active = true;
                }
                else
                {
-                  HornetQClientLogger.LOGGER.httpHandshakeFailed(accept, expectedResponse);
+                  ActiveMQClientLogger.LOGGER.httpHandshakeFailed(accept, expectedResponse);
                   ctx.close();
                }
             }
             else if (response.getStatus().code() == HttpResponseStatus.FORBIDDEN.code())
             {
-               HornetQClientLogger.LOGGER.httpUpgradeNotSupportedByRemoteAcceptor();
+               ActiveMQClientLogger.LOGGER.httpUpgradeNotSupportedByRemoteAcceptor();
                ctx.close();
             }
             latch.countDown();
@@ -914,7 +914,7 @@ public class NettyConnector extends AbstractConnector
       @Override
       public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
       {
-         HornetQClientLogger.LOGGER.errorCreatingNettyConnection(cause);
+         ActiveMQClientLogger.LOGGER.errorCreatingNettyConnection(cause);
          ctx.close();
       }
 
@@ -1087,11 +1087,11 @@ public class NettyConnector extends AbstractConnector
 
    private class Listener implements ConnectionLifeCycleListener
    {
-      public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+      public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
       {
          if (connections.putIfAbsent(connection.getID(), connection) != null)
          {
-            throw HornetQClientMessageBundle.BUNDLE.connectionExists(connection.getID());
+            throw ActiveMQClientMessageBundle.BUNDLE.connectionExists(connection.getID());
          }
       }
 
@@ -1173,13 +1173,13 @@ public class NettyConnector extends AbstractConnector
          InetAddress inetAddr2 = InetAddress.getByName(this.host);
          String ip1 = inetAddr1.getHostAddress();
          String ip2 = inetAddr2.getHostAddress();
-         HornetQClientLogger.LOGGER.debug(this + " host 1: " + host + " ip address: " + ip1 + " host 2: " + this.host + " ip address: " + ip2);
+         ActiveMQClientLogger.LOGGER.debug(this + " host 1: " + host + " ip address: " + ip1 + " host 2: " + this.host + " ip address: " + ip2);
 
          result = ip1.equals(ip2);
       }
       catch (UnknownHostException e)
       {
-         HornetQClientLogger.LOGGER.error("Cannot resolve host", e);
+         ActiveMQClientLogger.LOGGER.error("Cannot resolve host", e);
       }
 
       return result;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/SharedNioEventLoopGroup.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/SharedNioEventLoopGroup.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/SharedNioEventLoopGroup.java
index 07fc89b..c7ce7f9 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/SharedNioEventLoopGroup.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/SharedNioEventLoopGroup.java
@@ -31,7 +31,7 @@ import io.netty.util.concurrent.FutureListener;
 import io.netty.util.concurrent.ImmediateEventExecutor;
 import io.netty.util.concurrent.Promise;
 import org.apache.activemq.core.client.impl.ClientSessionFactoryImpl;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -90,7 +90,7 @@ public class SharedNioEventLoopGroup extends NioEventLoopGroup
       }
       else
       {
-         instance = new SharedNioEventLoopGroup(numThreads, new HornetQThreadFactory("HornetQ-client-netty-threads", true, getThisClassLoader()));
+         instance = new SharedNioEventLoopGroup(numThreads, new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, getThisClassLoader()));
       }
       instance.nioChannelFactoryCount.incrementAndGet();
       return instance;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/TransportConstants.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/TransportConstants.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/TransportConstants.java
index 172ce8c..4c38dad 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/TransportConstants.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/TransportConstants.java
@@ -172,7 +172,7 @@ public class TransportConstants
 
    public static final boolean DEFAULT_HTTP_UPGRADE_ENABLED = false;
 
-   public static final String DEFAULT_SERVLET_PATH = "/messaging/HornetQServlet";
+   public static final String DEFAULT_SERVLET_PATH = "/messaging/ActiveMQServlet";
 
    public static final long DEFAULT_BATCH_DELAY = 0;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/ssl/SSLSupport.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/ssl/SSLSupport.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/ssl/SSLSupport.java
index 7fab3cf..4d89779 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/ssl/SSLSupport.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/ssl/SSLSupport.java
@@ -34,7 +34,7 @@ import org.apache.activemq.utils.ClassloadingUtil;
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  * @author Justin Bertram
  *
- * Please note, this class supports PKCS#11 keystores, but there are no specific tests in the HornetQ test-suite to
+ * Please note, this class supports PKCS#11 keystores, but there are no specific tests in the ActiveMQ test-suite to
  * validate/verify this works because this requires a functioning PKCS#11 provider which is not available by default
  * (see java.security.Security#getProviders()).  The main thing to keep in mind is that PKCS#11 keystores will have a
  * null keystore path.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/package-info.java
index 38339fc..3de0e2e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/package-info.java
@@ -13,7 +13,7 @@
 /**
  * Remoting API.
  * <br>
- * This package defines the API used by HornetQ for remoting.
+ * This package defines the API used by ActiveMQ for remoting.
  */
 package org.apache.activemq.core.remoting;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/security/ActiveMQPrincipal.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/security/ActiveMQPrincipal.java b/activemq-core-client/src/main/java/org/apache/activemq/core/security/ActiveMQPrincipal.java
new file mode 100644
index 0000000..e8e9462
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/security/ActiveMQPrincipal.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.security;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         1/30/12
+ */
+public class ActiveMQPrincipal
+{
+   private final String userName;
+
+   private final String password;
+
+   public ActiveMQPrincipal(String userName, String password)
+   {
+      this.userName = userName;
+      this.password = password;
+   }
+
+   public String getUserName()
+   {
+      return userName;
+   }
+
+   public String getPassword()
+   {
+      return password;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/security/HornetQPrincipal.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/security/HornetQPrincipal.java b/activemq-core-client/src/main/java/org/apache/activemq/core/security/HornetQPrincipal.java
deleted file mode 100644
index b3e16fa..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/security/HornetQPrincipal.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.security;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         1/30/12
- */
-public class HornetQPrincipal
-{
-   private final String userName;
-
-   private final String password;
-
-   public HornetQPrincipal(String userName, String password)
-   {
-      this.userName = userName;
-      this.password = password;
-   }
-
-   public String getUserName()
-   {
-      return userName;
-   }
-
-   public String getPassword()
-   {
-      return password;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/AbstractRemotingConnection.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/AbstractRemotingConnection.java b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/AbstractRemotingConnection.java
index 28b3c90..5911c3d 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/AbstractRemotingConnection.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/AbstractRemotingConnection.java
@@ -21,8 +21,8 @@ import java.util.concurrent.Executor;
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.remoting.CloseListener;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.spi.core.remoting.Connection;
@@ -65,14 +65,14 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
          catch (ActiveMQInterruptedException interrupted)
          {
             // this is an expected behaviour.. no warn or error here
-            HornetQClientLogger.LOGGER.debug("thread interrupted", interrupted);
+            ActiveMQClientLogger.LOGGER.debug("thread interrupted", interrupted);
          }
          catch (final Throwable t)
          {
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQClientLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQClientLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -93,7 +93,7 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQClientLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQClientLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -119,7 +119,7 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
    {
       if (listener == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.failListenerCannotBeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.failListenerCannotBeNull();
       }
       failureListeners.add(listener);
    }
@@ -128,7 +128,7 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
    {
       if (listener == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.failListenerCannotBeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.failListenerCannotBeNull();
       }
 
       return failureListeners.remove(listener);
@@ -138,7 +138,7 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
    {
       if (listener == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.closeListenerCannotBeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.closeListenerCannotBeNull();
       }
 
       closeListeners.add(listener);
@@ -148,7 +148,7 @@ public abstract class AbstractRemotingConnection implements RemotingConnection
    {
       if (listener == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.closeListenerCannotBeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.closeListenerCannotBeNull();
       }
 
       return closeListeners.remove(listener);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/RemotingConnection.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/RemotingConnection.java b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/RemotingConnection.java
index 95d7dc6..7547b4c 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/RemotingConnection.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/protocol/RemotingConnection.java
@@ -110,7 +110,7 @@ public interface RemotingConnection extends BufferHandler
    void setFailureListeners(List<FailureListener> listeners);
 
    /**
-    * creates a new HornetQBuffer of the specified size.
+    * creates a new ActiveMQBuffer of the specified size.
     *
     * @param size the size of buffer required
     * @return the buffer

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/Connection.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/Connection.java b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/Connection.java
index ae2db0b..5f4656c 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/Connection.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/Connection.java
@@ -15,7 +15,7 @@ package org.apache.activemq.spi.core.remoting;
 import io.netty.channel.ChannelFutureListener;
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.core.security.HornetQPrincipal;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 
 /**
@@ -27,7 +27,7 @@ import org.apache.activemq.spi.core.protocol.RemotingConnection;
 public interface Connection
 {
    /**
-    * Create a new HornetQBuffer of the given size.
+    * Create a new ActiveMQBuffer of the given size.
     *
     * @param size the size of buffer to create
     * @return the new buffer.
@@ -106,7 +106,7 @@ public interface Connection
     */
    TransportConfiguration getConnectorConfig();
 
-   HornetQPrincipal getDefaultHornetQPrincipal();
+   ActiveMQPrincipal getDefaultActiveMQPrincipal();
 
    /**
     * the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/ConnectionLifeCycleListener.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/ConnectionLifeCycleListener.java b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/ConnectionLifeCycleListener.java
index f079bcd..a1b287a 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/ConnectionLifeCycleListener.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/ConnectionLifeCycleListener.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.spi.core.remoting;
 
 import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 
 /**
  * A ConnectionLifeCycleListener is called by the remoting implementation to notify of connection events.
@@ -29,14 +29,14 @@ public interface ConnectionLifeCycleListener
     * <p>
     * Leaving this method here and adding a different one at
     * {@code ServerConnectionLifeCycleListener} is a compromise for a reasonable split between the
-    * hornetq-server and hornetq-client packages while avoiding to pull too much into hornetq-core.
+    * activemq-server and activemq-client packages while avoiding to pull too much into activemq-core.
     * The pivotal point keeping us from removing the method is {@link ConnectorFactory} and the
     * usage of it.
     * @param component This will probably be an {@code Acceptor} and only used on the server side.
     * @param connection the connection that has been created
     * @param protocol the messaging protocol type this connection uses
     */
-   void connectionCreated(HornetQComponent component, Connection connection, String protocol);
+   void connectionCreated(ActiveMQComponent component, Connection connection, String protocol);
 
    /**
     * Called when a connection is destroyed.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/package-info.java
index d51337d..c235a38 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/spi/core/remoting/package-info.java
@@ -14,7 +14,7 @@
  * Remoting SPI.
  * <br>
  * This package defines the Service Provide Interface that
- * remoting providers must implement to be supported by HornetQ.
+ * remoting providers must implement to be supported by ActiveMQ.
  */
 package org.apache.activemq.spi.core.remoting;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/ActiveMQBufferInputStream.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/ActiveMQBufferInputStream.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/ActiveMQBufferInputStream.java
new file mode 100644
index 0000000..81fa38e
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/ActiveMQBufferInputStream.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+
+/**
+ * Used to send large messages
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ActiveMQBufferInputStream extends InputStream
+{
+
+   /* (non-Javadoc)
+    * @see java.io.InputStream#read()
+    */
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+   private ActiveMQBuffer bb;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public ActiveMQBufferInputStream(final ActiveMQBuffer paramByteBuffer)
+   {
+      bb = paramByteBuffer;
+   }
+
+   @Override
+   public int read() throws IOException
+   {
+      if (bb == null)
+      {
+         throw new IOException("read on a closed InputStream");
+      }
+
+      if (remainingBytes() == 0)
+      {
+         return -1;
+      }
+      else
+      {
+         return bb.readByte() & 0xFF;
+      }
+   }
+
+   @Override
+   public int read(final byte[] byteArray) throws IOException
+   {
+      if (bb == null)
+      {
+         throw new IOException("read on a closed InputStream");
+      }
+
+      return read(byteArray, 0, byteArray.length);
+   }
+
+   @Override
+   public int read(final byte[] byteArray, final int off, final int len) throws IOException
+   {
+      if (bb == null)
+      {
+         throw new IOException("read on a closed InputStream");
+      }
+
+      if (byteArray == null)
+      {
+         throw new NullPointerException();
+      }
+      if (off < 0 || off > byteArray.length || len < 0 || off + len > byteArray.length || off + len < 0)
+      {
+         throw new IndexOutOfBoundsException();
+      }
+      if (len == 0)
+      {
+         return 0;
+      }
+
+      int size = Math.min(remainingBytes(), len);
+
+      if (size == 0)
+      {
+         return -1;
+      }
+
+      bb.readBytes(byteArray, off, size);
+      return size;
+   }
+
+   @Override
+   public long skip(final long len) throws IOException
+   {
+      if (bb == null)
+      {
+         throw new IOException("skip on a closed InputStream");
+      }
+
+      if (len <= 0L)
+      {
+         return 0L;
+      }
+
+      int size = Math.min(remainingBytes(), (int) len);
+
+      bb.skipBytes(size);
+
+      return size;
+   }
+
+   @Override
+   public int available() throws IOException
+   {
+      if (bb == null)
+      {
+         throw new IOException("available on a closed InputStream");
+      }
+
+      return remainingBytes();
+   }
+
+   @Override
+   public void close() throws IOException
+   {
+      bb = null;
+   }
+
+   @Override
+   public synchronized void mark(final int paramInt)
+   {
+   }
+
+   @Override
+   public synchronized void reset() throws IOException
+   {
+      throw new IOException("mark/reset not supported");
+   }
+
+   @Override
+   public boolean markSupported()
+   {
+      return false;
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   /**
+    * @return
+    */
+   private int remainingBytes()
+   {
+      return bb.writerIndex() - bb.readerIndex();
+   }
+
+
+   // Inner classes -------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/BufferHelper.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/BufferHelper.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/BufferHelper.java
index ca741fa..bb64f0f 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/BufferHelper.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/BufferHelper.java
@@ -16,7 +16,7 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.SimpleString;
 
 /**
- * Helper methods to read and write from HornetQBuffer.
+ * Helper methods to read and write from ActiveMQBuffer.
  *
  * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
  *

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/ConfigurationHelper.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/ConfigurationHelper.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/ConfigurationHelper.java
index 90f3a89..712f606 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/ConfigurationHelper.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/ConfigurationHelper.java
@@ -13,8 +13,8 @@
 package org.apache.activemq.utils;
 
 import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 
 import java.util.HashSet;
 import java.util.Map;
@@ -76,7 +76,7 @@ public class ConfigurationHelper
          }
          else if (prop instanceof Number == false)
          {
-            HornetQClientLogger.LOGGER.propertyNotInteger(propName, prop.getClass().getName());
+            ActiveMQClientLogger.LOGGER.propertyNotInteger(propName, prop.getClass().getName());
 
             return def;
          }
@@ -109,7 +109,7 @@ public class ConfigurationHelper
          }
          else if (prop instanceof Number == false)
          {
-            HornetQClientLogger.LOGGER.propertyNotLong(propName, prop.getClass().getName());
+            ActiveMQClientLogger.LOGGER.propertyNotLong(propName, prop.getClass().getName());
 
             return def;
          }
@@ -142,7 +142,7 @@ public class ConfigurationHelper
          }
          else if (prop instanceof Boolean == false)
          {
-            HornetQClientLogger.LOGGER.propertyNotBoolean(propName, prop.getClass().getName());
+            ActiveMQClientLogger.LOGGER.propertyNotBoolean(propName, prop.getClass().getName());
 
             return def;
          }
@@ -224,7 +224,7 @@ public class ConfigurationHelper
 
       if (classImpl == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.noCodec();
+         throw ActiveMQClientMessageBundle.BUNDLE.noCodec();
       }
 
       SensitiveDataCodec<String> codec = null;
@@ -234,7 +234,7 @@ public class ConfigurationHelper
       }
       catch (ActiveMQException e1)
       {
-         throw HornetQClientMessageBundle.BUNDLE.failedToGetDecoder(e1);
+         throw ActiveMQClientMessageBundle.BUNDLE.failedToGetDecoder(e1);
       }
 
       try
@@ -243,7 +243,7 @@ public class ConfigurationHelper
       }
       catch (Exception e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.errordecodingPassword(e);
+         throw ActiveMQClientMessageBundle.BUNDLE.errordecodingPassword(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/HornetQBufferInputStream.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/HornetQBufferInputStream.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/HornetQBufferInputStream.java
deleted file mode 100644
index a5ef9d2..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/HornetQBufferInputStream.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-
-/**
- * Used to send large messages
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class HornetQBufferInputStream extends InputStream
-{
-
-   /* (non-Javadoc)
-    * @see java.io.InputStream#read()
-    */
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-   private ActiveMQBuffer bb;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public HornetQBufferInputStream(final ActiveMQBuffer paramByteBuffer)
-   {
-      bb = paramByteBuffer;
-   }
-
-   @Override
-   public int read() throws IOException
-   {
-      if (bb == null)
-      {
-         throw new IOException("read on a closed InputStream");
-      }
-
-      if (remainingBytes() == 0)
-      {
-         return -1;
-      }
-      else
-      {
-         return bb.readByte() & 0xFF;
-      }
-   }
-
-   @Override
-   public int read(final byte[] byteArray) throws IOException
-   {
-      if (bb == null)
-      {
-         throw new IOException("read on a closed InputStream");
-      }
-
-      return read(byteArray, 0, byteArray.length);
-   }
-
-   @Override
-   public int read(final byte[] byteArray, final int off, final int len) throws IOException
-   {
-      if (bb == null)
-      {
-         throw new IOException("read on a closed InputStream");
-      }
-
-      if (byteArray == null)
-      {
-         throw new NullPointerException();
-      }
-      if (off < 0 || off > byteArray.length || len < 0 || off + len > byteArray.length || off + len < 0)
-      {
-         throw new IndexOutOfBoundsException();
-      }
-      if (len == 0)
-      {
-         return 0;
-      }
-
-      int size = Math.min(remainingBytes(), len);
-
-      if (size == 0)
-      {
-         return -1;
-      }
-
-      bb.readBytes(byteArray, off, size);
-      return size;
-   }
-
-   @Override
-   public long skip(final long len) throws IOException
-   {
-      if (bb == null)
-      {
-         throw new IOException("skip on a closed InputStream");
-      }
-
-      if (len <= 0L)
-      {
-         return 0L;
-      }
-
-      int size = Math.min(remainingBytes(), (int) len);
-
-      bb.skipBytes(size);
-
-      return size;
-   }
-
-   @Override
-   public int available() throws IOException
-   {
-      if (bb == null)
-      {
-         throw new IOException("available on a closed InputStream");
-      }
-
-      return remainingBytes();
-   }
-
-   @Override
-   public void close() throws IOException
-   {
-      bb = null;
-   }
-
-   @Override
-   public synchronized void mark(final int paramInt)
-   {
-   }
-
-   @Override
-   public synchronized void reset() throws IOException
-   {
-      throw new IOException("mark/reset not supported");
-   }
-
-   @Override
-   public boolean markSupported()
-   {
-      return false;
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   /**
-    * @return
-    */
-   private int remainingBytes()
-   {
-      return bb.writerIndex() - bb.readerIndex();
-   }
-
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/MemorySize.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/MemorySize.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/MemorySize.java
index e1e6f40..5ca3152 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/MemorySize.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/MemorySize.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.utils;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 
 import java.lang.ref.WeakReference;
 
@@ -105,7 +105,7 @@ public class MemorySize
          // throw new IllegalStateException("Warning: JVM allocated more data what would make results invalid " +
          // totalMemory1 + ":" + totalMemory2);
 
-         HornetQClientLogger.LOGGER.jvmAllocatedMoreMemory(totalMemory1, totalMemory2);
+         ActiveMQClientLogger.LOGGER.jvmAllocatedMoreMemory(totalMemory1, totalMemory2);
       }
 
       return size;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/OrderedExecutorFactory.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/OrderedExecutorFactory.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/OrderedExecutorFactory.java
index e6debde..991e72e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/OrderedExecutorFactory.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/OrderedExecutorFactory.java
@@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.Executor;
 
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 
 
 /**
@@ -106,11 +106,11 @@ public final class OrderedExecutorFactory implements ExecutorFactory
                   catch (ActiveMQInterruptedException e)
                   {
                      // This could happen during shutdowns. Nothing to be concerned about here
-                     HornetQClientLogger.LOGGER.debug("Interrupted Thread", e);
+                     ActiveMQClientLogger.LOGGER.debug("Interrupted Thread", e);
                   }
                   catch (Throwable t)
                   {
-                     HornetQClientLogger.LOGGER.caughtunexpectedThrowable(t);
+                     ActiveMQClientLogger.LOGGER.caughtunexpectedThrowable(t);
                   }
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/SoftValueHashMap.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/SoftValueHashMap.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/SoftValueHashMap.java
index d0eef04..304fddf 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/SoftValueHashMap.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/SoftValueHashMap.java
@@ -24,7 +24,7 @@ import java.util.Set;
 import java.util.TreeSet;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 
 /**
  * A SoftValueHashMap
@@ -35,7 +35,7 @@ import org.apache.activemq.core.client.HornetQClientLogger;
  */
 public class SoftValueHashMap<K, V extends SoftValueHashMap.ValueCache> implements Map<K, V>
 {
-   private final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
    // The soft references that are already good.
    // too bad there's no way to override the queue method on ReferenceQueue, so I wouldn't need this
@@ -190,7 +190,7 @@ public class SoftValueHashMap<K, V extends SoftValueHashMap.ValueCache> implemen
 
                if (isTrace)
                {
-                  HornetQClientLogger.LOGGER.trace("Removing " + removed + " with id = " + ref.key + " from SoftValueHashMap");
+                  ActiveMQClientLogger.LOGGER.trace("Removing " + removed + " with id = " + ref.key + " from SoftValueHashMap");
                }
 
                if (mapDelegate.size() <= maxElements)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/VersionLoader.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/VersionLoader.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/VersionLoader.java
index 2710d8f..a9fb2c6 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/VersionLoader.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/VersionLoader.java
@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.apache.activemq.core.version.Version;
 import org.apache.activemq.core.version.impl.VersionImpl;
 
@@ -38,9 +38,9 @@ import org.apache.activemq.core.version.impl.VersionImpl;
  */
 public final class VersionLoader
 {
-   public static final String VERSION_PROP_FILE_KEY = "hornetq.version.property.filename";
+   public static final String VERSION_PROP_FILE_KEY = "activemq.version.property.filename";
 
-   public static final String DEFAULT_PROP_FILE_NAME = "hornetq-version.properties";
+   public static final String DEFAULT_PROP_FILE_NAME = "activemq-version.properties";
 
    private static String PROP_FILE_NAME;
 
@@ -63,7 +63,7 @@ public final class VersionLoader
          }
          catch (Throwable e)
          {
-            HornetQClientLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
             PROP_FILE_NAME = null;
          }
 
@@ -77,7 +77,7 @@ public final class VersionLoader
       catch (Throwable e)
       {
          VersionLoader.versions = null;
-         HornetQClientLogger.LOGGER.error(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.error(e.getMessage(), e);
       }
 
    }
@@ -123,19 +123,19 @@ public final class VersionLoader
       {
          if (in == null)
          {
-            HornetQClientLogger.LOGGER.noVersionOnClasspath(getClasspathString());
+            ActiveMQClientLogger.LOGGER.noVersionOnClasspath(getClasspathString());
             throw new RuntimeException(VersionLoader.PROP_FILE_NAME + " is not available");
          }
          try
          {
             versionProps.load(in);
-            String versionName = versionProps.getProperty("hornetq.version.versionName");
-            int majorVersion = Integer.valueOf(versionProps.getProperty("hornetq.version.majorVersion"));
-            int minorVersion = Integer.valueOf(versionProps.getProperty("hornetq.version.minorVersion"));
-            int microVersion = Integer.valueOf(versionProps.getProperty("hornetq.version.microVersion"));
-            int[] incrementingVersions = parseCompatibleVersionList(versionProps.getProperty("hornetq.version.incrementingVersion"));
-            String versionSuffix = versionProps.getProperty("hornetq.version.versionSuffix");
-            int[] compatibleVersionArray = parseCompatibleVersionList(versionProps.getProperty("hornetq.version.compatibleVersionList"));
+            String versionName = versionProps.getProperty("activemq.version.versionName");
+            int majorVersion = Integer.valueOf(versionProps.getProperty("activemq.version.majorVersion"));
+            int minorVersion = Integer.valueOf(versionProps.getProperty("activemq.version.minorVersion"));
+            int microVersion = Integer.valueOf(versionProps.getProperty("activemq.version.microVersion"));
+            int[] incrementingVersions = parseCompatibleVersionList(versionProps.getProperty("activemq.version.incrementingVersion"));
+            String versionSuffix = versionProps.getProperty("activemq.version.versionSuffix");
+            int[] compatibleVersionArray = parseCompatibleVersionList(versionProps.getProperty("activemq.version.compatibleVersionList"));
             List<Version> definedVersions = new ArrayList<Version>(incrementingVersions.length);
             for (int incrementingVersion : incrementingVersions)
             {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/XMLUtil.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/XMLUtil.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/XMLUtil.java
index 48bdec4..5f1fa7e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/XMLUtil.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/XMLUtil.java
@@ -29,8 +29,8 @@ import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
@@ -210,7 +210,7 @@ public final class XMLUtil
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.errorOnXMLTransform(e, n);
+               ActiveMQClientLogger.LOGGER.errorOnXMLTransform(e, n);
                return null;
             }
          }
@@ -265,17 +265,17 @@ public final class XMLUtil
    {
       if (node == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.firstNodeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.firstNodeNull();
       }
 
       if (node2 == null)
       {
-         throw HornetQClientMessageBundle.BUNDLE.secondNodeNull();
+         throw ActiveMQClientMessageBundle.BUNDLE.secondNodeNull();
       }
 
       if (!node.getNodeName().equals(node2.getNodeName()))
       {
-         throw HornetQClientMessageBundle.BUNDLE.nodeHaveDifferentNames();
+         throw ActiveMQClientMessageBundle.BUNDLE.nodeHaveDifferentNames();
       }
 
       int attrCount = 0;
@@ -294,7 +294,7 @@ public final class XMLUtil
 
       if (attrCount != attrCount2)
       {
-         throw HornetQClientMessageBundle.BUNDLE.nodeHaveDifferentAttNumber();
+         throw ActiveMQClientMessageBundle.BUNDLE.nodeHaveDifferentAttNumber();
       }
 
    outer:
@@ -315,14 +315,14 @@ public final class XMLUtil
                continue outer;
             }
          }
-         throw HornetQClientMessageBundle.BUNDLE.attsDontMatch(name, value);
+         throw ActiveMQClientMessageBundle.BUNDLE.attsDontMatch(name, value);
       }
 
       boolean hasChildren = node.hasChildNodes();
 
       if (hasChildren != node2.hasChildNodes())
       {
-         throw HornetQClientMessageBundle.BUNDLE.oneNodeHasChildren();
+         throw ActiveMQClientMessageBundle.BUNDLE.oneNodeHasChildren();
       }
 
       if (hasChildren)
@@ -338,7 +338,7 @@ public final class XMLUtil
 
          if (length != nodes2.size())
          {
-            throw HornetQClientMessageBundle.BUNDLE.nodeHasDifferentChildNumber();
+            throw ActiveMQClientMessageBundle.BUNDLE.nodeHasDifferentChildNumber();
          }
 
          for (int i = 0; i < length; i++)
@@ -402,7 +402,7 @@ public final class XMLUtil
             val = parts[1].trim();
          }
          String sysProp = System.getProperty(prop, val);
-         HornetQClientLogger.LOGGER.debug("replacing " + subString + " with " + sysProp);
+         ActiveMQClientLogger.LOGGER.debug("replacing " + subString + " with " + sysProp);
          xml = xml.replace(subString, sysProp);
 
       }
@@ -419,7 +419,7 @@ public final class XMLUtil
       }
       catch (NumberFormatException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.mustBeLong(elem, value);
+         throw ActiveMQClientMessageBundle.BUNDLE.mustBeLong(elem, value);
       }
    }
 
@@ -433,7 +433,7 @@ public final class XMLUtil
       }
       catch (NumberFormatException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.mustBeInteger(elem, value);
+         throw ActiveMQClientMessageBundle.BUNDLE.mustBeInteger(elem, value);
       }
    }
 
@@ -447,7 +447,7 @@ public final class XMLUtil
       }
       catch (NumberFormatException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.mustBeBoolean(elem, value);
+         throw ActiveMQClientMessageBundle.BUNDLE.mustBeBoolean(elem, value);
       }
    }
 
@@ -461,7 +461,7 @@ public final class XMLUtil
       }
       catch (NumberFormatException e)
       {
-         throw HornetQClientMessageBundle.BUNDLE.mustBeDouble(elem, value);
+         throw ActiveMQClientMessageBundle.BUNDLE.mustBeDouble(elem, value);
       }
    }
 
@@ -479,7 +479,7 @@ public final class XMLUtil
       }
       catch (SAXException e)
       {
-         HornetQClientLogger.LOGGER.errorOnXMLTransformInvalidConf(e);
+         ActiveMQClientLogger.LOGGER.errorOnXMLTransformInvalidConf(e);
 
          throw new IllegalStateException("Invalid configuration", e);
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/utils/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/utils/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/utils/package-info.java
index eef54c6..df23f67 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/utils/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/utils/package-info.java
@@ -13,7 +13,7 @@
 /**
  * Utilities and helper classes.
  * <br>
- * This package defines the utilities class used by HornetQ.
+ * This package defines the utilities class used by ActiveMQ.
  */
 package org.apache.activemq.utils;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/resources/activemq-version.properties
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/resources/activemq-version.properties b/activemq-core-client/src/main/resources/activemq-version.properties
new file mode 100644
index 0000000..860a573
--- /dev/null
+++ b/activemq-core-client/src/main/resources/activemq-version.properties
@@ -0,0 +1,9 @@
+activemq.version.versionName=${activemq.version.versionName}
+activemq.version.majorVersion=${activemq.version.majorVersion}
+activemq.version.minorVersion=${activemq.version.minorVersion}
+activemq.version.microVersion=${activemq.version.microVersion}
+activemq.version.incrementingVersion=${activemq.version.incrementingVersion}
+activemq.version.versionSuffix=${activemq.version.versionSuffix}
+activemq.version.versionTag=${activemq.version.versionTag}
+activemq.netty.version=${netty.version.string}
+activemq.version.compatibleVersionList=121,122,123,124,125

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/resources/hornetq-version.properties
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/resources/hornetq-version.properties b/activemq-core-client/src/main/resources/hornetq-version.properties
deleted file mode 100644
index 53cf7c7..0000000
--- a/activemq-core-client/src/main/resources/hornetq-version.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-hornetq.version.versionName=${hornetq.version.versionName}
-hornetq.version.majorVersion=${hornetq.version.majorVersion}
-hornetq.version.minorVersion=${hornetq.version.minorVersion}
-hornetq.version.microVersion=${hornetq.version.microVersion}
-hornetq.version.incrementingVersion=${hornetq.version.incrementingVersion}
-hornetq.version.versionSuffix=${hornetq.version.versionSuffix}
-hornetq.version.versionTag=${hornetq.version.versionTag}
-hornetq.netty.version=${netty.version.string}
-hornetq.version.compatibleVersionList=121,122,123,124,125

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/test/java/org/apache/activemq/tests/CoreUnitTestCase.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/test/java/org/apache/activemq/tests/CoreUnitTestCase.java b/activemq-core-client/src/test/java/org/apache/activemq/tests/CoreUnitTestCase.java
index 327325a..c067882 100644
--- a/activemq-core-client/src/test/java/org/apache/activemq/tests/CoreUnitTestCase.java
+++ b/activemq-core-client/src/test/java/org/apache/activemq/tests/CoreUnitTestCase.java
@@ -16,7 +16,7 @@ package org.apache.activemq.tests;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.rules.TestRule;
@@ -33,7 +33,7 @@ public abstract class CoreUnitTestCase extends Assert
       }
    }
 
-   private static final HornetQClientLogger log = HornetQClientLogger.LOGGER;
+   private static final ActiveMQClientLogger log = ActiveMQClientLogger.LOGGER;
 
    @Rule
    public TestRule watcher = new TestWatcher()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java
----------------------------------------------------------------------
diff --git a/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java b/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java
index 32ae14a..eb1cec0 100644
--- a/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java
+++ b/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java
@@ -86,7 +86,7 @@ public class XmlUtil
       Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
       SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
       sf.setFeature("http://apache.org/xml/features/validation/schema-full-checking", false);
-      InputStream xsdStream = XmlUtil.class.getClassLoader().getResourceAsStream("org.apache.activemq/dto/hornetq.xsd");
+      InputStream xsdStream = XmlUtil.class.getClassLoader().getResourceAsStream("org.apache.activemq/dto/activemq.xsd");
       StreamSource xsdSource = new StreamSource(xsdStream);
       Schema schema = sf.newSchema(xsdSource);
       unmarshaller.setSchema(schema);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-dto/src/main/java/org/apache/activemq/dto/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-dto/src/main/java/org/apache/activemq/dto/package-info.java b/activemq-dto/src/main/java/org/apache/activemq/dto/package-info.java
index 4900d55..5be7441 100644
--- a/activemq-dto/src/main/java/org/apache/activemq/dto/package-info.java
+++ b/activemq-dto/src/main/java/org/apache/activemq/dto/package-info.java
@@ -11,9 +11,9 @@
  * permissions and limitations under the License.
  */
 /**
- * The JAXB POJOs for the XML configuration of HornetQ broker
+ * The JAXB POJOs for the XML configuration of ActiveMQ broker
  */
 @javax.xml.bind.annotation.XmlSchema(
-        namespace = "http://hornetq.org/schema",
+        namespace = "http://activemq.org/schema",
         elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
 package org.apache.activemq.dto;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSClient.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSClient.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSClient.java
new file mode 100644
index 0000000..dcc4dc6
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSClient.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.api.jms;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQJMSConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQQueueConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQTopicConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQXAConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQXAQueueConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQXATopicConnectionFactory;
+
+/**
+ * A utility class for creating ActiveMQ client-side JMS managed resources.
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ActiveMQJMSClient
+{
+
+   /**
+    * Creates a ActiveMQConnectionFactory that receives cluster topology updates from the cluster as
+    * servers leave or join and new backups are appointed or removed.
+    * <p>
+    * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP
+    * broadcasts which contain connection information for members of the cluster. The broadcasted
+    * connection information is simply used to make an initial connection to the cluster, once that
+    * connection is made, up to date cluster topology information is downloaded and automatically
+    * updated whenever the cluster topology changes. If the topology includes backup servers that
+    * information is also propagated to the client so that it can know which server to failover onto
+    * in case of live server failure.
+    * @param discoveryAddress The UDP group address to listen for updates
+    * @param discoveryPort the UDP port to listen for updates
+    * @return the ActiveMQConnectionFactory
+    */
+   public static ActiveMQConnectionFactory createConnectionFactoryWithHA(final DiscoveryGroupConfiguration groupConfiguration, JMSFactoryType jmsFactoryType)
+   {
+      ActiveMQConnectionFactory factory = null;
+      if (jmsFactoryType.equals(JMSFactoryType.CF))
+      {
+         factory = new ActiveMQJMSConnectionFactory(true, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
+      {
+         factory = new ActiveMQQueueConnectionFactory(true, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
+      {
+         factory = new ActiveMQTopicConnectionFactory(true, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
+      {
+         factory = new ActiveMQXAConnectionFactory(true, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
+      {
+         factory = new ActiveMQXAQueueConnectionFactory(true, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
+      {
+         factory = new ActiveMQXATopicConnectionFactory(true, groupConfiguration);
+      }
+
+      return factory;
+   }
+
+   /**
+    * Create a ActiveMQConnectionFactory which creates session factories from a set of live servers, no HA backup information is propagated to the client
+    *
+    * The UDP address and port are used to listen for live servers in the cluster
+    *
+    * @param discoveryAddress The UDP group address to listen for updates
+    * @param discoveryPort the UDP port to listen for updates
+    * @return the ActiveMQConnectionFactory
+    */
+   public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration, JMSFactoryType jmsFactoryType)
+   {
+      ActiveMQConnectionFactory factory = null;
+      if (jmsFactoryType.equals(JMSFactoryType.CF))
+      {
+         factory = new ActiveMQJMSConnectionFactory(false, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
+      {
+         factory = new ActiveMQQueueConnectionFactory(false, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
+      {
+         factory = new ActiveMQTopicConnectionFactory(false, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
+      {
+         factory = new ActiveMQXAConnectionFactory(false, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
+      {
+         factory = new ActiveMQXAQueueConnectionFactory(false, groupConfiguration);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
+      {
+         factory = new ActiveMQXATopicConnectionFactory(false, groupConfiguration);
+      }
+
+      return factory;
+   }
+
+   /**
+    * Create a ActiveMQConnectionFactory which will receive cluster topology updates from the cluster
+    * as servers leave or join and new backups are appointed or removed.
+    * <p>
+    * The initial list of servers supplied in this method is simply to make an initial connection to
+    * the cluster, once that connection is made, up to date cluster topology information is
+    * downloaded and automatically updated whenever the cluster topology changes. If the topology
+    * includes backup servers that information is also propagated to the client so that it can know
+    * which server to failover onto in case of live server failure.
+    * @param initialServers The initial set of servers used to make a connection to the cluster.
+    *           Each one is tried in turn until a successful connection is made. Once a connection
+    *           is made, the cluster topology is downloaded and the rest of the list is ignored.
+    * @return the ActiveMQConnectionFactory
+    */
+   public static ActiveMQConnectionFactory createConnectionFactoryWithHA(JMSFactoryType jmsFactoryType, final TransportConfiguration... initialServers)
+   {
+      ActiveMQConnectionFactory factory = null;
+      if (jmsFactoryType.equals(JMSFactoryType.CF))
+      {
+         factory = new ActiveMQJMSConnectionFactory(true, initialServers);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
+      {
+         factory = new ActiveMQQueueConnectionFactory(true, initialServers);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
+      {
+         factory = new ActiveMQTopicConnectionFactory(true, initialServers);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
+      {
+         factory = new ActiveMQXAConnectionFactory(true, initialServers);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
+      {
+         factory = new ActiveMQXAQueueConnectionFactory(true, initialServers);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
+      {
+         factory = new ActiveMQXATopicConnectionFactory(true, initialServers);
+      }
+
+      return factory;
+   }
+
+   /**
+    * Create a ActiveMQConnectionFactory which creates session factories using a static list of
+    * transportConfigurations.
+    * <p>
+    * The ActiveMQConnectionFactory is not updated automatically as the cluster topology changes, and
+    * no HA backup information is propagated to the client
+    * @param transportConfigurations
+    * @return the ActiveMQConnectionFactory
+    */
+   public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(JMSFactoryType jmsFactoryType, final TransportConfiguration... transportConfigurations)
+   {
+      ActiveMQConnectionFactory factory = null;
+      if (jmsFactoryType.equals(JMSFactoryType.CF))
+      {
+         factory = new ActiveMQJMSConnectionFactory(false, transportConfigurations);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
+      {
+         factory = new ActiveMQQueueConnectionFactory(false, transportConfigurations);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
+      {
+         factory = new ActiveMQTopicConnectionFactory(false, transportConfigurations);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
+      {
+         factory = new ActiveMQXAConnectionFactory(false, transportConfigurations);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
+      {
+         factory = new ActiveMQXAQueueConnectionFactory(false, transportConfigurations);
+      }
+      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
+      {
+         factory = new ActiveMQXATopicConnectionFactory(false, transportConfigurations);
+      }
+
+      return factory;
+   }
+
+   /**
+    * Creates a client-side representation of a JMS Topic.
+    *
+    * @param name the name of the topic
+    * @return The Topic
+    */
+   public static Topic createTopic(final String name)
+   {
+      return ActiveMQDestination.createTopic(name);
+   }
+
+   /**
+    * Creates a client-side representation of a JMS Queue.
+    *
+    * @param name the name of the queue
+    * @return The Queue
+    */
+   public static Queue createQueue(final String name)
+   {
+      return ActiveMQDestination.createQueue(name);
+   }
+
+   private ActiveMQJMSClient()
+   {
+      // Utility class
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSConstants.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSConstants.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSConstants.java
new file mode 100644
index 0000000..7a7acf1
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/ActiveMQJMSConstants.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.api.jms;
+
+/**
+ * Constants for ActiveMQ for property keys used for ActiveMQ specific extensions to JMS.
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class ActiveMQJMSConstants
+{
+   public static final String JMS_ACTIVEMQ_INPUT_STREAM = "JMS_HQ_InputStream";
+
+   public static final String JMS_ACTIVEMQ_OUTPUT_STREAM = "JMS_HQ_OutputStream";
+
+   public static final String JMS_ACTIVEMQ_SAVE_STREAM = "JMS_HQ_SaveStream";
+
+   public static final String JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST = "HQ_BRIDGE_MSG_ID_LIST";
+
+   public static final int PRE_ACKNOWLEDGE = 100;
+
+   public static final int INDIVIDUAL_ACKNOWLEDGE = 101;
+
+   public static final String JMS_ACTIVEMQ_ENABLE_BYTE_ARRAY_JMS_CORRELATION_ID_PROPERTY_NAME =
+      "amq.jms.support-bytes-id";
+}


[08/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/ServerSessionPacketHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/ServerSessionPacketHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/ServerSessionPacketHandler.java
index 0290427..764fbb8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/ServerSessionPacketHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/ServerSessionPacketHandler.java
@@ -54,13 +54,13 @@ import javax.transaction.xa.Xid;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQExceptionType;
 import org.apache.activemq.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.core.exception.HornetQXAException;
+import org.apache.activemq.core.exception.ActiveMQXAException;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.core.protocol.core.impl.wireformat.CreateQueueMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.NullResponseMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.RollbackMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
@@ -99,9 +99,9 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAStartMess
 import org.apache.activemq.core.remoting.CloseListener;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.core.remoting.impl.netty.NettyConnection;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.BindingQueryResult;
-import org.apache.activemq.core.server.HornetQServerLogger;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.QueueQueryResult;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.ServerSession;
@@ -164,7 +164,7 @@ public class ServerSessionPacketHandler implements ChannelHandler
 
    public void connectionFailed(final ActiveMQException exception, boolean failedOver)
    {
-      HornetQServerLogger.LOGGER.clientConnectionFailed(session.getName());
+      ActiveMQServerLogger.LOGGER.clientConnectionFailed(session.getName());
 
       try
       {
@@ -172,10 +172,10 @@ public class ServerSessionPacketHandler implements ChannelHandler
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.errorClosingSession(e);
+         ActiveMQServerLogger.LOGGER.errorClosingSession(e);
       }
 
-      HornetQServerLogger.LOGGER.clearingUpSession(session.getName());
+      ActiveMQServerLogger.LOGGER.clearingUpSession(session.getName());
    }
 
    public void close()
@@ -188,7 +188,7 @@ public class ServerSessionPacketHandler implements ChannelHandler
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.errorClosingSession(e);
+         ActiveMQServerLogger.LOGGER.errorClosingSession(e);
       }
    }
 
@@ -529,40 +529,40 @@ public class ServerSessionPacketHandler implements ChannelHandler
                   }
                   else
                   {
-                     response = new HornetQExceptionMessage(HornetQMessageBundle.BUNDLE.duplicateMetadata(message.getKey(), message.getData()));
+                     response = new ActiveMQExceptionMessage(ActiveMQMessageBundle.BUNDLE.duplicateMetadata(message.getKey(), message.getData()));
                   }
                   break;
                }
             }
          }
-         catch (HornetQXAException e)
+         catch (ActiveMQXAException e)
          {
             if (requiresResponse)
             {
-               HornetQServerLogger.LOGGER.debug("Sending exception to client", e);
+               ActiveMQServerLogger.LOGGER.debug("Sending exception to client", e);
                response = new SessionXAResponseMessage(true, e.errorCode, e.getMessage());
             }
             else
             {
-               HornetQServerLogger.LOGGER.caughtXaException(e);
+               ActiveMQServerLogger.LOGGER.caughtXaException(e);
             }
          }
          catch (ActiveMQException e)
          {
             if (requiresResponse)
             {
-               HornetQServerLogger.LOGGER.debug("Sending exception to client", e);
-               response = new HornetQExceptionMessage(e);
+               ActiveMQServerLogger.LOGGER.debug("Sending exception to client", e);
+               response = new ActiveMQExceptionMessage(e);
             }
             else
             {
                if (e.getType() == ActiveMQExceptionType.QUEUE_EXISTS)
                {
-                  HornetQServerLogger.LOGGER.debug("Caught exception", e);
+                  ActiveMQServerLogger.LOGGER.debug("Caught exception", e);
                }
                else
                {
-                  HornetQServerLogger.LOGGER.caughtException(e);
+                  ActiveMQServerLogger.LOGGER.caughtException(e);
                }
             }
          }
@@ -570,14 +570,14 @@ public class ServerSessionPacketHandler implements ChannelHandler
          {
             if (requiresResponse)
             {
-               HornetQServerLogger.LOGGER.warn("Sending unexpected exception to the client", t);
-               ActiveMQException hqe = new ActiveMQInternalErrorException();
-               hqe.initCause(t);
-               response = new HornetQExceptionMessage(hqe);
+               ActiveMQServerLogger.LOGGER.warn("Sending unexpected exception to the client", t);
+               ActiveMQException activeMQInternalErrorException = new ActiveMQInternalErrorException();
+               activeMQInternalErrorException.initCause(t);
+               response = new ActiveMQExceptionMessage(activeMQInternalErrorException);
             }
             else
             {
-               HornetQServerLogger.LOGGER.caughtException(t);
+               ActiveMQServerLogger.LOGGER.caughtException(t);
             }
          }
 
@@ -598,9 +598,9 @@ public class ServerSessionPacketHandler implements ChannelHandler
       {
          public void onError(final int errorCode, final String errorMessage)
          {
-            HornetQServerLogger.LOGGER.errorProcessingIOCallback(errorCode, errorMessage);
+            ActiveMQServerLogger.LOGGER.errorProcessingIOCallback(errorCode, errorMessage);
 
-            HornetQExceptionMessage exceptionMessage = new HornetQExceptionMessage( ActiveMQExceptionType.createException(errorCode, errorMessage));
+            ActiveMQExceptionMessage exceptionMessage = new ActiveMQExceptionMessage( ActiveMQExceptionType.createException(errorCode, errorMessage));
 
             doConfirmAndResponse(confirmPacket, exceptionMessage, flush, closeChannel);
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQPacketHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQPacketHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQPacketHandler.java
new file mode 100644
index 0000000..1b7b9af
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQPacketHandler.java
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.protocol.core.impl;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.ActiveMQInternalErrorException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.protocol.core.Channel;
+import org.apache.activemq.core.protocol.core.ChannelHandler;
+import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
+import org.apache.activemq.core.protocol.core.Packet;
+import org.apache.activemq.core.protocol.core.ServerSessionPacketHandler;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverReplyMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
+import org.apache.activemq.core.server.ServerSession;
+import org.apache.activemq.core.version.Version;
+
+/**
+ * A packet handler for all packets that need to be handled at the server level
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="ataylor@redhat.com">Andy Taylor</a>
+ */
+public class ActiveMQPacketHandler implements ChannelHandler
+{
+   private final ActiveMQServer server;
+
+   private final Channel channel1;
+
+   private final CoreRemotingConnection connection;
+
+   private final CoreProtocolManager protocolManager;
+
+   public ActiveMQPacketHandler(final CoreProtocolManager protocolManager,
+                                final ActiveMQServer server,
+                                final Channel channel1,
+                                final CoreRemotingConnection connection)
+   {
+      this.protocolManager = protocolManager;
+
+      this.server = server;
+
+      this.channel1 = channel1;
+
+      this.connection = connection;
+   }
+
+   public void handlePacket(final Packet packet)
+   {
+      byte type = packet.getType();
+
+      switch (type)
+      {
+         case PacketImpl.CREATESESSION:
+         {
+            CreateSessionMessage request = (CreateSessionMessage) packet;
+
+            handleCreateSession(request);
+
+            break;
+         }
+         case PacketImpl.CHECK_FOR_FAILOVER:
+         {
+            CheckFailoverMessage request = (CheckFailoverMessage) packet;
+
+            handleCheckForFailover(request);
+
+            break;
+         }
+         case PacketImpl.REATTACH_SESSION:
+         {
+            ReattachSessionMessage request = (ReattachSessionMessage) packet;
+
+            handleReattachSession(request);
+
+            break;
+         }
+         case PacketImpl.CREATE_QUEUE:
+         {
+            // Create queue can also be fielded here in the case of a replicated store and forward queue creation
+
+            CreateQueueMessage request = (CreateQueueMessage) packet;
+
+            handleCreateQueue(request);
+
+            break;
+         }
+         default:
+         {
+            ActiveMQServerLogger.LOGGER.invalidPacket(packet);
+         }
+      }
+   }
+
+   private void handleCheckForFailover(CheckFailoverMessage failoverMessage)
+   {
+      String nodeID = failoverMessage.getNodeID();
+      boolean okToFailover = nodeID == null ||
+            !(server.getHAPolicy().canScaleDown() && !server.hasScaledDown(new SimpleString(nodeID)));
+      channel1.send(new CheckFailoverReplyMessage(okToFailover));
+   }
+
+   private void handleCreateSession(final CreateSessionMessage request)
+   {
+      boolean incompatibleVersion = false;
+      Packet response;
+      try
+      {
+         Version version = server.getVersion();
+         if (!version.isCompatible(request.getVersion()))
+         {
+            throw ActiveMQMessageBundle.BUNDLE.incompatibleClientServer();
+         }
+
+         if (!server.isStarted())
+         {
+            throw ActiveMQMessageBundle.BUNDLE.serverNotStarted();
+         }
+
+         // XXX HORNETQ-720 Taylor commented out this test. Should be verified.
+         /*if (!server.checkActivate())
+         {
+            throw new ActiveMQException(ActiveMQException.SESSION_CREATION_REJECTED,
+                                       "Server will not accept create session requests");
+         }*/
+
+
+         if (connection.getClientVersion() == 0)
+         {
+            connection.setClientVersion(request.getVersion());
+         }
+         else if (connection.getClientVersion() != request.getVersion())
+         {
+            ActiveMQServerLogger.LOGGER.incompatibleVersionAfterConnect(request.getVersion(), connection.getClientVersion());
+         }
+
+         Channel channel = connection.getChannel(request.getSessionChannelID(), request.getWindowSize());
+
+         ActiveMQPrincipal activeMQPrincipal = null;
+
+         if (request.getUsername() == null)
+         {
+            activeMQPrincipal = connection.getDefaultActiveMQPrincipal();
+         }
+
+         ServerSession session = server.createSession(request.getName(),
+                                                      activeMQPrincipal == null ? request.getUsername() : activeMQPrincipal.getUserName(),
+                                                      activeMQPrincipal == null ? request.getPassword() : activeMQPrincipal.getPassword(),
+                                                      request.getMinLargeMessageSize(),
+                                                      connection,
+                                                      request.isAutoCommitSends(),
+                                                      request.isAutoCommitAcks(),
+                                                      request.isPreAcknowledge(),
+                                                      request.isXA(),
+                                                      request.getDefaultAddress(),
+                                                      new CoreSessionCallback(request.getName(),
+                                                                              protocolManager,
+                                                                              channel), null);
+
+         ServerSessionPacketHandler handler = new ServerSessionPacketHandler(session,
+                                                                             server.getStorageManager(),
+                                                                             channel);
+         channel.setHandler(handler);
+
+         // TODO - where is this removed?
+         protocolManager.addSessionHandler(request.getName(), handler);
+
+         response = new CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
+      }
+      catch (ActiveMQException e)
+      {
+         if (e.getType() == ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
+         {
+            incompatibleVersion = true;
+            ActiveMQServerLogger.LOGGER.debug("Sending ActiveMQException after Incompatible client", e);
+         }
+         else
+         {
+            ActiveMQServerLogger.LOGGER.failedToCreateSession(e);
+         }
+
+         response = new ActiveMQExceptionMessage(e);
+      }
+      catch (Exception e)
+      {
+         ActiveMQServerLogger.LOGGER.failedToCreateSession(e);
+
+         response = new ActiveMQExceptionMessage(new ActiveMQInternalErrorException());
+      }
+
+      // send the exception to the client and destroy
+      // the connection if the client and server versions
+      // are not compatible
+      if (incompatibleVersion)
+      {
+         channel1.sendAndFlush(response);
+      }
+      else
+      {
+         channel1.send(response);
+      }
+   }
+
+   private void handleReattachSession(final ReattachSessionMessage request)
+   {
+      Packet response = null;
+
+      try
+      {
+
+         if (!server.isStarted())
+         {
+            response = new ReattachSessionResponseMessage(-1, false);
+         }
+
+         ActiveMQServerLogger.LOGGER.debug("Reattaching request from " + connection.getRemoteAddress());
+
+
+         ServerSessionPacketHandler sessionHandler = protocolManager.getSessionHandler(request.getName());
+
+         // HORNETQ-720 XXX ataylor?
+         if (/*!server.checkActivate() || */ sessionHandler == null)
+         {
+            response = new ReattachSessionResponseMessage(-1, false);
+         }
+         else
+         {
+            if (sessionHandler.getChannel().getConfirmationWindowSize() == -1)
+            {
+               // Even though session exists, we can't reattach since confi window size == -1,
+               // i.e. we don't have a resend cache for commands, so we just close the old session
+               // and let the client recreate
+
+               ActiveMQServerLogger.LOGGER.reattachRequestFailed(connection.getRemoteAddress());
+
+               sessionHandler.closeListeners();
+               sessionHandler.close();
+
+               response = new ReattachSessionResponseMessage(-1, false);
+            }
+            else
+            {
+               // Reconnect the channel to the new connection
+               int serverLastConfirmedCommandID = sessionHandler.transferConnection(connection,
+                                                                                    request.getLastConfirmedCommandID());
+
+               response = new ReattachSessionResponseMessage(serverLastConfirmedCommandID, true);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         ActiveMQServerLogger.LOGGER.failedToReattachSession(e);
+
+         response = new ActiveMQExceptionMessage(new ActiveMQInternalErrorException());
+      }
+
+      channel1.send(response);
+   }
+
+   private void handleCreateQueue(final CreateQueueMessage request)
+   {
+      try
+      {
+         server.createQueue(request.getAddress(),
+                            request.getQueueName(),
+                            request.getFilterString(),
+                            request.isDurable(),
+                            request.isTemporary());
+      }
+      catch (Exception e)
+      {
+         ActiveMQServerLogger.LOGGER.failedToHandleCreateQueue(e);
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManager.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManager.java
index 956b67d..add0cbe 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManager.java
@@ -25,7 +25,7 @@ import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.TopologyMember;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.protocol.ServerPacketDecoder;
@@ -42,10 +42,10 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.Ping;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SubscribeClusterTopologyUpdatesMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SubscribeClusterTopologyUpdatesMessageV2;
 import org.apache.activemq.core.remoting.CloseListener;
-import org.apache.activemq.core.remoting.impl.netty.HornetQFrameDecoder2;
+import org.apache.activemq.core.remoting.impl.netty.ActiveMQFrameDecoder2;
 import org.apache.activemq.core.remoting.impl.netty.NettyServerConnection;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.spi.core.protocol.ConnectionEntry;
 import org.apache.activemq.spi.core.protocol.MessageConverter;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
@@ -60,15 +60,15 @@ import org.apache.activemq.spi.core.remoting.Connection;
  */
 class CoreProtocolManager implements ProtocolManager
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final List<Interceptor> incomingInterceptors;
 
    private final List<Interceptor> outgoingInterceptors;
 
-   CoreProtocolManager(final HornetQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
+   CoreProtocolManager(final ActiveMQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
    {
       this.server = server;
 
@@ -102,11 +102,11 @@ class CoreProtocolManager implements ProtocolManager
 
       Channel channel1 = rc.getChannel(CHANNEL_ID.SESSION.id, -1);
 
-      ChannelHandler handler = new HornetQPacketHandler(this, server, channel1, rc);
+      ChannelHandler handler = new ActiveMQPacketHandler(this, server, channel1, rc);
 
       channel1.setHandler(handler);
 
-      long ttl = HornetQClient.DEFAULT_CONNECTION_TTL;
+      long ttl = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 
       if (config.getConnectionTTLOverride() != -1)
       {
@@ -148,30 +148,31 @@ class CoreProtocolManager implements ProtocolManager
    @Override
    public void addChannelHandlers(ChannelPipeline pipeline)
    {
-      pipeline.addLast("hornetq-decoder", new HornetQFrameDecoder2());
+      pipeline.addLast("activemq-decoder", new ActiveMQFrameDecoder2());
    }
 
    @Override
    public boolean isProtocol(byte[] array)
    {
       String frameStart = new String(array, StandardCharsets.US_ASCII);
-      return frameStart.startsWith("HORNETQ");
+      return frameStart.startsWith("ACTIVEMQ");
    }
 
    @Override
    public void handshake(NettyServerConnection connection, ActiveMQBuffer buffer)
    {
       //if we are not an old client then handshake
-      if (buffer.getByte(0) == 'H' &&
-         buffer.getByte(1) == 'O' &&
-         buffer.getByte(2) == 'R' &&
-         buffer.getByte(3) == 'N' &&
-         buffer.getByte(4) == 'E' &&
-         buffer.getByte(5) == 'T' &&
-         buffer.getByte(6) == 'Q')
+      if (buffer.getByte(0) == 'A' &&
+         buffer.getByte(1) == 'C' &&
+         buffer.getByte(2) == 'T' &&
+         buffer.getByte(3) == 'I' &&
+         buffer.getByte(4) == 'V' &&
+         buffer.getByte(5) == 'E' &&
+         buffer.getByte(6) == 'M' &&
+         buffer.getByte(7) == 'Q')
       {
          //todo add some handshaking
-         buffer.readBytes(7);
+         buffer.readBytes(8);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManagerFactory.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManagerFactory.java
index 43af54c..69302b8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManagerFactory.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreProtocolManagerFactory.java
@@ -15,8 +15,8 @@ package org.apache.activemq.core.protocol.core.impl;
 import java.util.List;
 
 import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.api.core.client.HornetQClient;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.api.core.client.ActiveMQClient;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
 
@@ -29,9 +29,9 @@ import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
  */
 public class CoreProtocolManagerFactory implements ProtocolManagerFactory
 {
-   private static String[] SUPPORTED_PROTOCOLS = {HornetQClient.DEFAULT_CORE_PROTOCOL};
+   private static String[] SUPPORTED_PROTOCOLS = {ActiveMQClient.DEFAULT_CORE_PROTOCOL};
 
-   public ProtocolManager createProtocolManager(final HornetQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
+   public ProtocolManager createProtocolManager(final ActiveMQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
    {
       return new CoreProtocolManager(server, incomingInterceptors, outgoingInterceptors);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreSessionCallback.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreSessionCallback.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreSessionCallback.java
index f0933fd..f5763ed 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreSessionCallback.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/CoreSessionCallback.java
@@ -21,7 +21,7 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.SessionProducerCre
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerConsumer;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
@@ -121,7 +121,7 @@ public final class CoreSessionCallback implements SessionCallback
       }
       else
       {
-         HornetQServerLogger.LOGGER.warnDisconnectOldClient(queueName);
+         ActiveMQServerLogger.LOGGER.warnDisconnectOldClient(queueName);
       }
    }
 
@@ -130,7 +130,7 @@ public final class CoreSessionCallback implements SessionCallback
    public boolean hasCredits(ServerConsumer consumer)
    {
       // This one will always return has credits
-      // as the flow control is done by hornetq
+      // as the flow control is done by activemq
       return true;
    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQPacketHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQPacketHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQPacketHandler.java
deleted file mode 100644
index 231b2c6..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQPacketHandler.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.protocol.core.impl;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.protocol.core.Channel;
-import org.apache.activemq.core.protocol.core.ChannelHandler;
-import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
-import org.apache.activemq.core.protocol.core.Packet;
-import org.apache.activemq.core.protocol.core.ServerSessionPacketHandler;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverReplyMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateQueueMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
-import org.apache.activemq.core.security.HornetQPrincipal;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
-import org.apache.activemq.core.server.ServerSession;
-import org.apache.activemq.core.version.Version;
-
-/**
- * A packet handler for all packets that need to be handled at the server level
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="ataylor@redhat.com">Andy Taylor</a>
- */
-public class HornetQPacketHandler implements ChannelHandler
-{
-   private final HornetQServer server;
-
-   private final Channel channel1;
-
-   private final CoreRemotingConnection connection;
-
-   private final CoreProtocolManager protocolManager;
-
-   public HornetQPacketHandler(final CoreProtocolManager protocolManager,
-                               final HornetQServer server,
-                               final Channel channel1,
-                               final CoreRemotingConnection connection)
-   {
-      this.protocolManager = protocolManager;
-
-      this.server = server;
-
-      this.channel1 = channel1;
-
-      this.connection = connection;
-   }
-
-   public void handlePacket(final Packet packet)
-   {
-      byte type = packet.getType();
-
-      switch (type)
-      {
-         case PacketImpl.CREATESESSION:
-         {
-            CreateSessionMessage request = (CreateSessionMessage) packet;
-
-            handleCreateSession(request);
-
-            break;
-         }
-         case PacketImpl.CHECK_FOR_FAILOVER:
-         {
-            CheckFailoverMessage request = (CheckFailoverMessage) packet;
-
-            handleCheckForFailover(request);
-
-            break;
-         }
-         case PacketImpl.REATTACH_SESSION:
-         {
-            ReattachSessionMessage request = (ReattachSessionMessage) packet;
-
-            handleReattachSession(request);
-
-            break;
-         }
-         case PacketImpl.CREATE_QUEUE:
-         {
-            // Create queue can also be fielded here in the case of a replicated store and forward queue creation
-
-            CreateQueueMessage request = (CreateQueueMessage) packet;
-
-            handleCreateQueue(request);
-
-            break;
-         }
-         default:
-         {
-            HornetQServerLogger.LOGGER.invalidPacket(packet);
-         }
-      }
-   }
-
-   private void handleCheckForFailover(CheckFailoverMessage failoverMessage)
-   {
-      String nodeID = failoverMessage.getNodeID();
-      boolean okToFailover = nodeID == null ||
-            !(server.getHAPolicy().canScaleDown() && !server.hasScaledDown(new SimpleString(nodeID)));
-      channel1.send(new CheckFailoverReplyMessage(okToFailover));
-   }
-
-   private void handleCreateSession(final CreateSessionMessage request)
-   {
-      boolean incompatibleVersion = false;
-      Packet response;
-      try
-      {
-         Version version = server.getVersion();
-         if (!version.isCompatible(request.getVersion()))
-         {
-            throw HornetQMessageBundle.BUNDLE.incompatibleClientServer();
-         }
-
-         if (!server.isStarted())
-         {
-            throw HornetQMessageBundle.BUNDLE.serverNotStarted();
-         }
-
-         // XXX HORNETQ-720 Taylor commented out this test. Should be verified.
-         /*if (!server.checkActivate())
-         {
-            throw new ActiveMQException(ActiveMQException.SESSION_CREATION_REJECTED,
-                                       "Server will not accept create session requests");
-         }*/
-
-
-         if (connection.getClientVersion() == 0)
-         {
-            connection.setClientVersion(request.getVersion());
-         }
-         else if (connection.getClientVersion() != request.getVersion())
-         {
-            HornetQServerLogger.LOGGER.incompatibleVersionAfterConnect(request.getVersion(), connection.getClientVersion());
-         }
-
-         Channel channel = connection.getChannel(request.getSessionChannelID(), request.getWindowSize());
-
-         HornetQPrincipal hornetQPrincipal = null;
-
-         if (request.getUsername() == null)
-         {
-            hornetQPrincipal = connection.getDefaultHornetQPrincipal();
-         }
-
-         ServerSession session = server.createSession(request.getName(),
-                                                      hornetQPrincipal == null ? request.getUsername() : hornetQPrincipal.getUserName(),
-                                                      hornetQPrincipal == null ? request.getPassword() : hornetQPrincipal.getPassword(),
-                                                      request.getMinLargeMessageSize(),
-                                                      connection,
-                                                      request.isAutoCommitSends(),
-                                                      request.isAutoCommitAcks(),
-                                                      request.isPreAcknowledge(),
-                                                      request.isXA(),
-                                                      request.getDefaultAddress(),
-                                                      new CoreSessionCallback(request.getName(),
-                                                                              protocolManager,
-                                                                              channel), null);
-
-         ServerSessionPacketHandler handler = new ServerSessionPacketHandler(session,
-                                                                             server.getStorageManager(),
-                                                                             channel);
-         channel.setHandler(handler);
-
-         // TODO - where is this removed?
-         protocolManager.addSessionHandler(request.getName(), handler);
-
-         response = new CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
-      }
-      catch (ActiveMQException e)
-      {
-         if (e.getType() == ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
-         {
-            incompatibleVersion = true;
-            HornetQServerLogger.LOGGER.debug("Sending ActiveMQException after Incompatible client", e);
-         }
-         else
-         {
-            HornetQServerLogger.LOGGER.failedToCreateSession(e);
-         }
-
-         response = new HornetQExceptionMessage(e);
-      }
-      catch (Exception e)
-      {
-         HornetQServerLogger.LOGGER.failedToCreateSession(e);
-
-         response = new HornetQExceptionMessage(new ActiveMQInternalErrorException());
-      }
-
-      // send the exception to the client and destroy
-      // the connection if the client and server versions
-      // are not compatible
-      if (incompatibleVersion)
-      {
-         channel1.sendAndFlush(response);
-      }
-      else
-      {
-         channel1.send(response);
-      }
-   }
-
-   private void handleReattachSession(final ReattachSessionMessage request)
-   {
-      Packet response = null;
-
-      try
-      {
-
-         if (!server.isStarted())
-         {
-            response = new ReattachSessionResponseMessage(-1, false);
-         }
-
-         HornetQServerLogger.LOGGER.debug("Reattaching request from " + connection.getRemoteAddress());
-
-
-         ServerSessionPacketHandler sessionHandler = protocolManager.getSessionHandler(request.getName());
-
-         // HORNETQ-720 XXX ataylor?
-         if (/*!server.checkActivate() || */ sessionHandler == null)
-         {
-            response = new ReattachSessionResponseMessage(-1, false);
-         }
-         else
-         {
-            if (sessionHandler.getChannel().getConfirmationWindowSize() == -1)
-            {
-               // Even though session exists, we can't reattach since confi window size == -1,
-               // i.e. we don't have a resend cache for commands, so we just close the old session
-               // and let the client recreate
-
-               HornetQServerLogger.LOGGER.reattachRequestFailed(connection.getRemoteAddress());
-
-               sessionHandler.closeListeners();
-               sessionHandler.close();
-
-               response = new ReattachSessionResponseMessage(-1, false);
-            }
-            else
-            {
-               // Reconnect the channel to the new connection
-               int serverLastConfirmedCommandID = sessionHandler.transferConnection(connection,
-                                                                                    request.getLastConfirmedCommandID());
-
-               response = new ReattachSessionResponseMessage(serverLastConfirmedCommandID, true);
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         HornetQServerLogger.LOGGER.failedToReattachSession(e);
-
-         response = new HornetQExceptionMessage(new ActiveMQInternalErrorException());
-      }
-
-      channel1.send(response);
-   }
-
-   private void handleCreateQueue(final CreateQueueMessage request)
-   {
-      try
-      {
-         server.createQueue(request.getAddress(),
-                            request.getQueueName(),
-                            request.getFilterString(),
-                            request.isDurable(),
-                            request.isTemporary());
-      }
-      catch (Exception e)
-      {
-         HornetQServerLogger.LOGGER.failedToHandleCreateQueue(e);
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
index 430b3f5..968f1eb 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java
@@ -18,7 +18,7 @@ import org.apache.activemq.core.protocol.core.impl.PacketImpl;
 
 /**
  * Registers a given backup-server as the replicating backup of a live server (i.e. a regular
- * HornetQ).
+ * ActiveMQ).
  * <p>
  * If it succeeds the backup will start synchronization of its state with the new backup node, and
  * replicating any new data. If it fails the backup server will receive a message indicating

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/stomp/WebSocketServerHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/stomp/WebSocketServerHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/stomp/WebSocketServerHandler.java
index 16bd901..6a089d7 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/stomp/WebSocketServerHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/stomp/WebSocketServerHandler.java
@@ -101,7 +101,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
             {
                if (future.isSuccess())
                {
-                  // we need to insert an encoder that takes the underlying ChannelBuffer of a StompFrame.toHornetQBuffer and
+                  // we need to insert an encoder that takes the underlying ChannelBuffer of a StompFrame.toActiveMQBuffer and
                   // wrap it in a binary web socket frame before letting the wsencoder send it on the wire
                   future.channel().pipeline().addAfter("wsencoder", "binary-websocket-encoder", BINARY_WEBSOCKET_ENCODER);
                }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMAcceptor.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMAcceptor.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMAcceptor.java
index c573cab..75e0f60 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMAcceptor.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMAcceptor.java
@@ -19,11 +19,11 @@ import java.util.concurrent.Executor;
 
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.management.CoreNotificationType;
-import org.apache.activemq.core.security.HornetQPrincipal;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.core.server.cluster.ClusterConnection;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.server.management.NotificationService;
@@ -63,7 +63,7 @@ public final class InVMAcceptor implements Acceptor
 
    private final Map<String, Object> configuration;
 
-   private HornetQPrincipal defaultHornetQPrincipal;
+   private ActiveMQPrincipal defaultActiveMQPrincipal;
 
    public InVMAcceptor(final ClusterConnection clusterConnection,
                        final Map<String, Object> configuration,
@@ -212,9 +212,9 @@ public final class InVMAcceptor implements Acceptor
 
       Listener connectionListener = new Listener(connector);
 
-      InVMConnection inVMConnection = new InVMConnection(id, connectionID, remoteHandler, connectionListener, clientExecutor, defaultHornetQPrincipal);
+      InVMConnection inVMConnection = new InVMConnection(id, connectionID, remoteHandler, connectionListener, clientExecutor, defaultActiveMQPrincipal);
 
-      connectionListener.connectionCreated(this, inVMConnection, HornetQClient.DEFAULT_CORE_PROTOCOL);
+      connectionListener.connectionCreated(this, inVMConnection, ActiveMQClient.DEFAULT_CORE_PROTOCOL);
    }
 
    public void disconnect(final String connectionID)
@@ -242,9 +242,9 @@ public final class InVMAcceptor implements Acceptor
       return true;
    }
 
-   public void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal)
+   public void setDefaultActiveMQPrincipal(ActiveMQPrincipal defaultActiveMQPrincipal)
    {
-      this.defaultHornetQPrincipal = defaultHornetQPrincipal;
+      this.defaultActiveMQPrincipal = defaultActiveMQPrincipal;
    }
 
    private class Listener implements ConnectionLifeCycleListener
@@ -258,11 +258,11 @@ public final class InVMAcceptor implements Acceptor
          this.connector = connector;
       }
 
-      public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+      public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
       {
          if (connections.putIfAbsent((String) connection.getID(), connection) != null)
          {
-            throw HornetQMessageBundle.BUNDLE.connectionExists(connection.getID());
+            throw ActiveMQMessageBundle.BUNDLE.connectionExists(connection.getID());
          }
 
          listener.connectionCreated(component, connection, protocol);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnection.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnection.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnection.java
index ec4ae0a..0a2d027 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnection.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnection.java
@@ -24,8 +24,8 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQBuffers;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.core.security.HornetQPrincipal;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.BufferHandler;
 import org.apache.activemq.spi.core.remoting.Connection;
@@ -40,7 +40,7 @@ import org.apache.activemq.utils.UUIDGenerator;
  */
 public class InVMConnection implements Connection
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final BufferHandler handler;
 
@@ -59,7 +59,7 @@ public class InVMConnection implements Connection
 
    private volatile boolean closing;
 
-   private final HornetQPrincipal defaultHornetQPrincipal;
+   private final ActiveMQPrincipal defaultActiveMQPrincipal;
 
    private RemotingConnection protocolConnection;
 
@@ -85,7 +85,7 @@ public class InVMConnection implements Connection
                          final BufferHandler handler,
                          final ConnectionLifeCycleListener listener,
                          final Executor executor,
-                         final HornetQPrincipal defaultHornetQPrincipal)
+                         final ActiveMQPrincipal defaultActiveMQPrincipal)
    {
       this.serverID = serverID;
 
@@ -97,7 +97,7 @@ public class InVMConnection implements Connection
 
       this.executor = executor;
 
-      this.defaultHornetQPrincipal = defaultHornetQPrincipal;
+      this.defaultActiveMQPrincipal = defaultActiveMQPrincipal;
    }
 
 
@@ -181,7 +181,7 @@ public class InVMConnection implements Connection
                      copied.readInt(); // read and discard
                      if (isTrace)
                      {
-                        HornetQServerLogger.LOGGER.trace(InVMConnection.this + "::Sending inVM packet");
+                        ActiveMQServerLogger.LOGGER.trace(InVMConnection.this + "::Sending inVM packet");
                      }
                      handler.bufferReceived(id, copied);
                      if (futureListener != null)
@@ -194,14 +194,14 @@ public class InVMConnection implements Connection
                catch (Exception e)
                {
                   final String msg = "Failed to write to handler on connector " + this;
-                  HornetQServerLogger.LOGGER.errorWritingToInvmConnector(e, this);
+                  ActiveMQServerLogger.LOGGER.errorWritingToInvmConnector(e, this);
                   throw new IllegalStateException(msg, e);
                }
                finally
                {
                   if (isTrace)
                   {
-                     HornetQServerLogger.LOGGER.trace(InVMConnection.this + "::packet sent done");
+                     ActiveMQServerLogger.LOGGER.trace(InVMConnection.this + "::packet sent done");
                   }
                }
             }
@@ -222,7 +222,7 @@ public class InVMConnection implements Connection
             {
                if (!latch.await(10, TimeUnit.SECONDS))
                {
-                  HornetQServerLogger.LOGGER.timedOutFlushingInvmChannel();
+                  ActiveMQServerLogger.LOGGER.timedOutFlushingInvmChannel();
                }
             }
             catch (InterruptedException e)
@@ -262,9 +262,9 @@ public class InVMConnection implements Connection
       return false;
    }
 
-   public HornetQPrincipal getDefaultHornetQPrincipal()
+   public ActiveMQPrincipal getDefaultActiveMQPrincipal()
    {
-      return defaultHornetQPrincipal;
+      return defaultActiveMQPrincipal;
    }
 
    public static void setFlushEnabled(boolean enable)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnector.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnector.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnector.java
index d5f9480..6e187af 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnector.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMConnector.java
@@ -20,9 +20,9 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.Executor;
 
 import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServerLogger;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.spi.core.remoting.AbstractConnector;
 import org.apache.activemq.spi.core.remoting.Acceptor;
 import org.apache.activemq.spi.core.remoting.BufferHandler;
@@ -147,7 +147,7 @@ public class InVMConnector extends AbstractConnector
       {
          InVMConnector.incFailures();
 
-         HornetQServerLogger.LOGGER.debug("Returning null on InVMConnector for tests");
+         ActiveMQServerLogger.LOGGER.debug("Returning null on InVMConnector for tests");
          // For testing only
          return null;
       }
@@ -211,11 +211,11 @@ public class InVMConnector extends AbstractConnector
 
    private class Listener implements ConnectionLifeCycleListener
    {
-      public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+      public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
       {
          if (connections.putIfAbsent((String)connection.getID(), connection) != null)
          {
-            throw HornetQMessageBundle.BUNDLE.connectionExists(connection.getID());
+            throw ActiveMQMessageBundle.BUNDLE.connectionExists(connection.getID());
          }
 
          listener.connectionCreated(component, connection, protocol);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMRegistry.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMRegistry.java
index 4247aad..255bf31 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMRegistry.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/invm/InVMRegistry.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.core.remoting.impl.invm;
 
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -33,7 +33,7 @@ public final class InVMRegistry
    {
       if (acceptors.putIfAbsent(id, acceptor) != null)
       {
-         throw HornetQMessageBundle.BUNDLE.acceptorExists(id);
+         throw ActiveMQMessageBundle.BUNDLE.acceptorExists(id);
       }
    }
 
@@ -41,7 +41,7 @@ public final class InVMRegistry
    {
       if (acceptors.remove(id) == null)
       {
-         throw HornetQMessageBundle.BUNDLE.acceptorNotExists(id);
+         throw ActiveMQMessageBundle.BUNDLE.acceptorNotExists(id);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
index b490ce1..4ad7c10 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyAcceptor.java
@@ -58,10 +58,10 @@ import org.apache.activemq.api.core.management.CoreNotificationType;
 import org.apache.activemq.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.core.protocol.ProtocolHandler;
 import org.apache.activemq.core.remoting.impl.ssl.SSLSupport;
-import org.apache.activemq.core.security.HornetQPrincipal;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.cluster.ClusterConnection;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.server.management.NotificationService;
@@ -71,7 +71,7 @@ import org.apache.activemq.spi.core.remoting.BufferHandler;
 import org.apache.activemq.spi.core.remoting.Connection;
 import org.apache.activemq.spi.core.remoting.ConnectionLifeCycleListener;
 import org.apache.activemq.utils.ConfigurationHelper;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 import org.apache.activemq.utils.TypedProperties;
 
 /**
@@ -316,7 +316,7 @@ public class NettyAcceptor implements Acceptor
             threadsToUse = this.nioRemotingThreads;
          }
          channelClazz = NioServerSocketChannel.class;
-         eventLoopGroup = new NioEventLoopGroup(threadsToUse, new HornetQThreadFactory("hornetq-netty-threads", true, getThisClassLoader()));
+         eventLoopGroup = new NioEventLoopGroup(threadsToUse, new ActiveMQThreadFactory("activemq-netty-threads", true, getThisClassLoader()));
       }
 
       bootstrap = new ServerBootstrap();
@@ -374,7 +374,7 @@ public class NettyAcceptor implements Acceptor
                   }
                   catch (IllegalArgumentException e)
                   {
-                     HornetQServerLogger.LOGGER.invalidCipherSuite(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedCipherSuites()));
+                     ActiveMQServerLogger.LOGGER.invalidCipherSuite(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedCipherSuites()));
                      throw e;
                   }
                }
@@ -387,7 +387,7 @@ public class NettyAcceptor implements Acceptor
                   }
                   catch (IllegalArgumentException e)
                   {
-                     HornetQServerLogger.LOGGER.invalidProtocol(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedProtocols()));
+                     ActiveMQServerLogger.LOGGER.invalidProtocol(SSLSupport.parseArrayIntoCommandSeparatedList(engine.getSupportedProtocols()));
                      throw e;
                   }
                }
@@ -404,7 +404,7 @@ public class NettyAcceptor implements Acceptor
                {
                   if (s.equals("SSLv3") || s.equals("SSLv2Hello"))
                   {
-                     HornetQServerLogger.LOGGER.disallowedProtocol(s);
+                     ActiveMQServerLogger.LOGGER.disallowedProtocol(s);
                      continue;
                   }
                   set.add(s);
@@ -438,9 +438,9 @@ public class NettyAcceptor implements Acceptor
       bootstrap.childOption(ChannelOption.SO_REUSEADDR, true);
       bootstrap.childOption(ChannelOption.SO_KEEPALIVE, true);
       bootstrap.childOption(ChannelOption.ALLOCATOR, PartialPooledByteBufAllocator.INSTANCE);
-      channelGroup = new DefaultChannelGroup("hornetq-accepted-channels", GlobalEventExecutor.INSTANCE);
+      channelGroup = new DefaultChannelGroup("activemq-accepted-channels", GlobalEventExecutor.INSTANCE);
 
-      serverChannelGroup = new DefaultChannelGroup("hornetq-acceptor-channels", GlobalEventExecutor.INSTANCE);
+      serverChannelGroup = new DefaultChannelGroup("activemq-acceptor-channels", GlobalEventExecutor.INSTANCE);
 
       if (httpUpgradeEnabled)
       {
@@ -474,7 +474,7 @@ public class NettyAcceptor implements Acceptor
                                                                             TimeUnit.MILLISECONDS);
          }
 
-         HornetQServerLogger.LOGGER.startedNettyAcceptor(TransportConstants.NETTY_VERSION, host, port);
+         ActiveMQServerLogger.LOGGER.startedNettyAcceptor(TransportConstants.NETTY_VERSION, host, port);
       }
    }
 
@@ -543,14 +543,14 @@ public class NettyAcceptor implements Acceptor
 
       if (!future.isSuccess())
       {
-         HornetQServerLogger.LOGGER.nettyChannelGroupError();
+         ActiveMQServerLogger.LOGGER.nettyChannelGroupError();
          Iterator<Channel> iterator = future.group().iterator();
          while (iterator.hasNext())
          {
             Channel channel = iterator.next();
             if (channel.isActive())
             {
-               HornetQServerLogger.LOGGER.nettyChannelStillOpen(channel, channel.remoteAddress());
+               ActiveMQServerLogger.LOGGER.nettyChannelStillOpen(channel, channel.remoteAddress());
             }
          }
       }
@@ -612,14 +612,14 @@ public class NettyAcceptor implements Acceptor
       ChannelGroupFuture future = serverChannelGroup.close().awaitUninterruptibly();
       if (!future.isSuccess())
       {
-         HornetQServerLogger.LOGGER.nettyChannelGroupBindError();
+         ActiveMQServerLogger.LOGGER.nettyChannelGroupBindError();
          Iterator<Channel> iterator = future.group().iterator();
          while (iterator.hasNext())
          {
             Channel channel = iterator.next();
             if (channel.isActive())
             {
-               HornetQServerLogger.LOGGER.nettyChannelStillBound(channel, channel.remoteAddress());
+               ActiveMQServerLogger.LOGGER.nettyChannelStillBound(channel, channel.remoteAddress());
             }
          }
       }
@@ -634,9 +634,9 @@ public class NettyAcceptor implements Acceptor
    /**
     * not allowed
     *
-    * @param defaultHornetQPrincipal
+    * @param defaultActiveMQPrincipal
     */
-   public void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal)
+   public void setDefaultActiveMQPrincipal(ActiveMQPrincipal defaultActiveMQPrincipal)
    {
       throw new IllegalStateException("unsecure connections not allowed");
    }
@@ -659,17 +659,17 @@ public class NettyAcceptor implements Acceptor
 
    public ConnectionCreator createConnectionCreator()
    {
-      return new HornetQServerChannelHandler(channelGroup, handler, new Listener());
+      return new ActiveMQServerChannelHandler(channelGroup, handler, new Listener());
    }
 
    // Inner classes -----------------------------------------------------------------------------
 
-   private final class HornetQServerChannelHandler extends HornetQChannelHandler implements ConnectionCreator
+   private final class ActiveMQServerChannelHandler extends ActiveMQChannelHandler implements ConnectionCreator
    {
 
-      HornetQServerChannelHandler(final ChannelGroup group,
-                                  final BufferHandler handler,
-                                  final ConnectionLifeCycleListener listener)
+      ActiveMQServerChannelHandler(final ChannelGroup group,
+                                   final BufferHandler handler,
+                                   final ConnectionLifeCycleListener listener)
       {
          super(group, handler, listener);
       }
@@ -711,11 +711,11 @@ public class NettyAcceptor implements Acceptor
 
    private class Listener implements ConnectionLifeCycleListener
    {
-      public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+      public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
       {
          if (connections.putIfAbsent(connection.getID(), (NettyServerConnection) connection) != null)
          {
-            throw HornetQMessageBundle.BUNDLE.connectionExists(connection.getID());
+            throw ActiveMQMessageBundle.BUNDLE.connectionExists(connection.getID());
          }
 
          listener.connectionCreated(component, connection, protocol);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/RemotingService.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/RemotingService.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/RemotingService.java
index cf0b0db..f73a2ba 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/RemotingService.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/RemotingService.java
@@ -16,7 +16,7 @@ import java.util.Set;
 
 import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
-import org.apache.activemq.core.security.HornetQPrincipal;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.Acceptor;
 
@@ -60,7 +60,7 @@ public interface RemotingService
     *
     * @param principal
     */
-   void allowInvmSecurityOverride(HornetQPrincipal principal);
+   void allowInvmSecurityOverride(ActiveMQPrincipal principal);
 
    /**
     * Freezes and then disconnects all connections except the given one and tells the client where else

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/impl/RemotingServiceImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/impl/RemotingServiceImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/impl/RemotingServiceImpl.java
index 7fd9a46..2ee1c3e 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/impl/RemotingServiceImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/remoting/server/impl/RemotingServiceImpl.java
@@ -42,11 +42,11 @@ import org.apache.activemq.core.protocol.core.impl.CoreProtocolManagerFactory;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.core.remoting.server.RemotingService;
-import org.apache.activemq.core.security.HornetQPrincipal;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.cluster.ClusterConnection;
 import org.apache.activemq.core.server.cluster.ClusterManager;
 import org.apache.activemq.core.server.impl.ServiceRegistry;
@@ -63,7 +63,7 @@ import org.apache.activemq.spi.core.remoting.Connection;
 import org.apache.activemq.spi.core.remoting.ConnectionLifeCycleListener;
 import org.apache.activemq.utils.ClassloadingUtil;
 import org.apache.activemq.utils.ConfigurationHelper;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 
 /**
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
@@ -75,7 +75,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 {
    // Constants -----------------------------------------------------
 
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    public static final long CONNECTION_TTL_CHECK_INTERVAL = 2000;
 
@@ -93,7 +93,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
    private final Map<Object, ConnectionEntry> connections = new ConcurrentHashMap<Object, ConnectionEntry>();
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final ManagementService managementService;
 
@@ -109,7 +109,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
    private final Map<String, ProtocolManager> protocolMap = new ConcurrentHashMap();
 
-   private HornetQPrincipal defaultInvmSecurityPrincipal;
+   private ActiveMQPrincipal defaultInvmSecurityPrincipal;
 
    private ServiceRegistry serviceRegistry;
 
@@ -119,7 +119,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
    public RemotingServiceImpl(final ClusterManager clusterManager,
                               final Configuration config,
-                              final HornetQServer server,
+                              final ActiveMQServer server,
                               final ManagementService managementService,
                               final ScheduledExecutorService scheduledThreadPool,
                               List<ProtocolManagerFactory> protocolManagerFactories,
@@ -144,7 +144,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       //i know there is only 1
       this.flushExecutor = flushExecutor;
 
-      HornetQServerLogger.LOGGER.addingProtocolSupport(coreProtocolManagerFactory.getProtocols()[0]);
+      ActiveMQServerLogger.LOGGER.addingProtocolSupport(coreProtocolManagerFactory.getProtocols()[0]);
       this.protocolMap.put(coreProtocolManagerFactory.getProtocols()[0],
                            coreProtocolManagerFactory.createProtocolManager(server, incomingInterceptors, outgoingInterceptors));
 
@@ -158,7 +158,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
                String[] protocols = next.getProtocols();
                for (String protocol : protocols)
                {
-                  HornetQServerLogger.LOGGER.addingProtocolSupport(protocol);
+                  ActiveMQServerLogger.LOGGER.addingProtocolSupport(protocol);
                   protocolMap.put(protocol, next.createProtocolManager(server, incomingInterceptors, outgoingInterceptors));
                }
             }
@@ -172,7 +172,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
             String[] protocols = protocolManagerFactory.getProtocols();
             for (String protocol : protocols)
             {
-               HornetQServerLogger.LOGGER.addingProtocolSupport(protocol);
+               ActiveMQServerLogger.LOGGER.addingProtocolSupport(protocol);
                protocolMap.put(protocol, protocolManagerFactory.createProtocolManager(server, incomingInterceptors, outgoingInterceptors));
             }
          }
@@ -219,7 +219,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       // This needs to be a different thread pool to the main thread pool especially for OIO where we may need
       // to support many hundreds of connections, but the main thread pool must be kept small for better performance
 
-      ThreadFactory tFactory = new HornetQThreadFactory("HornetQ-remoting-threads-" + server.toString() +
+      ThreadFactory tFactory = new ActiveMQThreadFactory("ActiveMQ-remoting-threads-" + server.toString() +
                                                            "-" +
                                                            System.identityHashCode(this), false, tccl);
 
@@ -244,7 +244,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
                if (!invalid.isEmpty())
                {
-                  HornetQServerLogger.LOGGER.invalidAcceptorKeys(ConfigurationHelper.stringSetToCommaListString(invalid));
+                  ActiveMQServerLogger.LOGGER.invalidAcceptorKeys(ConfigurationHelper.stringSetToCommaListString(invalid));
 
                   continue;
                }
@@ -257,12 +257,12 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
             if (protocol != null)
             {
-               HornetQServerLogger.LOGGER.warnDeprecatedProtocol();
+               ActiveMQServerLogger.LOGGER.warnDeprecatedProtocol();
                ProtocolManager protocolManager = protocolMap.get(protocol);
 
                if (protocolManager == null)
                {
-                  throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(protocol);
+                  throw ActiveMQMessageBundle.BUNDLE.noProtocolManagerFound(protocol);
                }
                else
                {
@@ -285,7 +285,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
                      if (protocolManager == null)
                      {
-                        throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(actualProtocol);
+                        throw ActiveMQMessageBundle.BUNDLE.noProtocolManagerFound(actualProtocol);
                      }
                      else
                      {
@@ -308,7 +308,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
             if (defaultInvmSecurityPrincipal != null && acceptor.isUnsecurable())
             {
-               acceptor.setDefaultHornetQPrincipal(defaultInvmSecurityPrincipal);
+               acceptor.setDefaultActiveMQPrincipal(defaultInvmSecurityPrincipal);
             }
 
             acceptors.put(info.getName(), acceptor);
@@ -322,7 +322,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorCreatingAcceptor(e, info.getFactoryClassName());
+            ActiveMQServerLogger.LOGGER.errorCreatingAcceptor(e, info.getFactoryClassName());
          }
       }
 
@@ -339,14 +339,14 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       started = true;
    }
 
-   public synchronized void allowInvmSecurityOverride(HornetQPrincipal principal)
+   public synchronized void allowInvmSecurityOverride(ActiveMQPrincipal principal)
    {
       defaultInvmSecurityPrincipal = principal;
       for (Acceptor acceptor : acceptors.values())
       {
          if (acceptor.isUnsecurable())
          {
-            acceptor.setDefaultHornetQPrincipal(principal);
+            acceptor.setDefaultActiveMQPrincipal(principal);
          }
       }
    }
@@ -365,7 +365,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorStoppingAcceptor();
+            ActiveMQServerLogger.LOGGER.errorStoppingAcceptor();
          }
       }
       HashMap<Object, ConnectionEntry> connectionEntries = new HashMap<Object, ConnectionEntry>(connections);
@@ -379,9 +379,9 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
          if (conn.equals(connectionToKeepOpen))
             continue;
 
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
+            ActiveMQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
          }
 
          if (!conn.isClient())
@@ -404,16 +404,16 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       // We need to stop them accepting first so no new connections are accepted after we send the disconnect message
       for (Acceptor acceptor : acceptors.values())
       {
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug("Pausing acceptor " + acceptor);
+            ActiveMQServerLogger.LOGGER.debug("Pausing acceptor " + acceptor);
          }
          acceptor.pause();
       }
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Sending disconnect on live connections");
+         ActiveMQServerLogger.LOGGER.debug("Sending disconnect on live connections");
       }
 
       HashSet<ConnectionEntry> connectionEntries = new HashSet<ConnectionEntry>(connections.values());
@@ -424,9 +424,9 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       {
          RemotingConnection conn = entry.connection;
 
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
+            ActiveMQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
          }
 
          conn.disconnect(criticalError);
@@ -454,7 +454,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
          if (!ok)
          {
-            HornetQServerLogger.LOGGER.timeoutRemotingThreadPool();
+            ActiveMQServerLogger.LOGGER.timeoutRemotingThreadPool();
          }
       }
 
@@ -484,7 +484,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       }
       else
       {
-         HornetQServerLogger.LOGGER.errorRemovingConnection();
+         ActiveMQServerLogger.LOGGER.errorRemovingConnection();
 
          return null;
       }
@@ -500,7 +500,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       }
       else
       {
-         HornetQServerLogger.LOGGER.errorRemovingConnection();
+         ActiveMQServerLogger.LOGGER.errorRemovingConnection();
 
          return null;
       }
@@ -525,7 +525,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       return protocolMap.get(protocol);
    }
 
-   public void connectionCreated(final HornetQComponent component, final Connection connection, final String protocol)
+   public void connectionCreated(final ActiveMQComponent component, final Connection connection, final String protocol)
    {
       if (server == null)
       {
@@ -536,14 +536,14 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
       if (pmgr == null)
       {
-         throw HornetQMessageBundle.BUNDLE.unknownProtocol(protocol);
+         throw ActiveMQMessageBundle.BUNDLE.unknownProtocol(protocol);
       }
 
       ConnectionEntry entry = pmgr.createConnectionEntry((Acceptor) component, connection);
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Connection created " + connection);
+         ActiveMQServerLogger.LOGGER.trace("Connection created " + connection);
       }
 
       connections.put(connection.getID(), entry);
@@ -554,7 +554,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Connection removed " + connectionID + " from server " + this.server, new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace("Connection removed " + connectionID + " from server " + this.server, new Exception("trace"));
       }
 
       ConnectionEntry conn = connections.get(connectionID);
@@ -662,9 +662,9 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
          }
          else
          {
-            if (HornetQServerLogger.LOGGER.isTraceEnabled())
+            if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
             {
-               HornetQServerLogger.LOGGER.trace("ConnectionID = " + connectionID + " was already closed, so ignoring packet");
+               ActiveMQServerLogger.LOGGER.trace("ConnectionID = " + connectionID + " was already closed, so ignoring packet");
             }
          }
       }
@@ -679,7 +679,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
 
       FailureCheckAndFlushThread(final long pauseInterval)
       {
-         super("hornetq-failure-check-thread");
+         super("activemq-failure-check-thread");
 
          this.pauseInterval = pauseInterval;
       }
@@ -752,7 +752,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
                            }
                            catch (Throwable e)
                            {
-                              HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+                              ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
                            }
 
                         }
@@ -765,7 +765,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
                   RemotingConnection conn = getConnection(id);
                   if (conn != null)
                   {
-                     conn.fail(HornetQMessageBundle.BUNDLE.clientExited(conn.getRemoteAddress()));
+                     conn.fail(ActiveMQMessageBundle.BUNDLE.clientExited(conn.getRemoteAddress()));
                      removeConnection(id);
                   }
                }
@@ -775,7 +775,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
             }
             catch (Throwable e)
             {
-               HornetQServerLogger.LOGGER.errorOnFailureCheck(e);
+               ActiveMQServerLogger.LOGGER.errorOnFailureCheck(e);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicatedJournal.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicatedJournal.java b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicatedJournal.java
index eb8e2d5..765edb3 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicatedJournal.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicatedJournal.java
@@ -439,7 +439,7 @@ public class ReplicatedJournal implements Journal
 
    /**
     * @throws Exception
-    * @see org.apache.activemq.core.server.HornetQComponent#start()
+    * @see org.apache.activemq.core.server.ActiveMQComponent#start()
     */
    public void start() throws Exception
    {
@@ -448,7 +448,7 @@ public class ReplicatedJournal implements Journal
 
    /**
     * @throws Exception
-    * @see org.apache.activemq.core.server.HornetQComponent#stop()
+    * @see org.apache.activemq.core.server.ActiveMQComponent#stop()
     */
    public void stop() throws Exception
    {


[33/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSTopicControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSTopicControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSTopicControlImpl.java
index 298071c..94ac46b 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSTopicControlImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSTopicControlImpl.java
@@ -23,14 +23,14 @@ import javax.management.StandardMBean;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.management.AddressControl;
-import org.apache.activemq.api.core.management.HornetQServerControl;
+import org.apache.activemq.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.api.core.management.QueueControl;
 import org.apache.activemq.api.core.management.ResourceNames;
 import org.apache.activemq.api.jms.management.TopicControl;
 import org.apache.activemq.core.management.impl.MBeanInfoHelper;
 import org.apache.activemq.core.server.management.ManagementService;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQMessage;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQMessage;
 import org.apache.activemq.jms.client.SelectorTranslator;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.utils.json.JSONArray;
@@ -43,7 +43,7 @@ import org.apache.activemq.utils.json.JSONObject;
  */
 public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 {
-   private final HornetQDestination managedTopic;
+   private final ActiveMQDestination managedTopic;
 
    private final AddressControl addressControl;
 
@@ -56,12 +56,12 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
    public static String createFilterFromJMSSelector(final String selectorStr) throws ActiveMQException
    {
       return selectorStr == null || selectorStr.trim().length() == 0 ? null
-                                                                    : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+                                                                    : SelectorTranslator.convertToActiveMQFilterString(selectorStr);
    }
 
    // Constructors --------------------------------------------------
 
-   public JMSTopicControlImpl(final HornetQDestination topic,
+   public JMSTopicControlImpl(final ActiveMQDestination topic,
                               final JMSServerManager jmsServerManager,
                               final AddressControl addressControl,
                               final ManagementService managementService) throws Exception
@@ -199,7 +199,7 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 
       for (Map<String, Object> coreMessage : coreMessages)
       {
-         jmsMessages[i++] = HornetQMessage.coreMaptoJMSMap(coreMessage);
+         jmsMessages[i++] = ActiveMQMessage.coreMaptoJMSMap(coreMessage);
       }
       return jmsMessages;
    }
@@ -211,7 +211,7 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 
    public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
    {
-      String queueName = HornetQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName);
+      String queueName = ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName);
       QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
       if (coreQueueControl == null)
       {
@@ -240,19 +240,19 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 
    public void dropDurableSubscription(final String clientID, final String subscriptionName) throws Exception
    {
-      String queueName = HornetQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName);
+      String queueName = ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName);
       QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
       if (coreQueueControl == null)
       {
          throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
       }
-      HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+      ActiveMQServerControl serverControl = (ActiveMQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
       serverControl.destroyQueue(queueName);
    }
 
    public void dropAllSubscriptions() throws Exception
    {
-      HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+      ActiveMQServerControl serverControl = (ActiveMQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
       String[] queues = addressControl.getQueueNames();
       for (String queue : queues)
       {
@@ -283,8 +283,8 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 
          if (queue.isDurable())
          {
-            Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
-                                                                                                         .toString());
+            Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
+                                                                                                        .toString());
             clientID = pair.getA();
             subName = pair.getB();
          }
@@ -317,8 +317,8 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
 
             if (queue.isDurable() && !queue.getName().startsWith(ResourceNames.JMS_TOPIC))
             {
-               Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
-                                                                                                            .toString());
+               Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
+                                                                                                           .toString());
                clientID = pair.getA();
                subName = pair.getB();
             }
@@ -327,8 +327,8 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl
                // in the case of heirarchical topics the queue name will not follow the <part>.<part> pattern of normal
                // durable subscribers so skip decomposing the name for the client ID and subscription name and just
                // hard-code it
-               clientID = "HornetQ";
-               subName = "HornetQ";
+               clientID = "ActiveMQ";
+               subName = "ActiveMQ";
             }
 
             String filter = queue.getFilter() != null ? queue.getFilter() : null;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/JMSStorageManager.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/JMSStorageManager.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/JMSStorageManager.java
index cf0ae3f..1487e71 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/JMSStorageManager.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/JMSStorageManager.java
@@ -14,7 +14,7 @@ package org.apache.activemq.jms.persistence;
 
 import java.util.List;
 
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.jms.persistence.config.PersistedConnectionFactory;
 import org.apache.activemq.jms.persistence.config.PersistedDestination;
 import org.apache.activemq.jms.persistence.config.PersistedJNDI;
@@ -27,7 +27,7 @@ import org.apache.activemq.jms.persistence.config.PersistedType;
  *
  *
  */
-public interface JMSStorageManager extends HornetQComponent
+public interface JMSStorageManager extends ActiveMQComponent
 {
 
    void load() throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
index f3efc5c..e0f414d 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
@@ -101,7 +101,7 @@ public final class JMSJournalStorageManagerImpl implements JMSStorageManager
                                          config.getJournalCompactMinFiles(),
                                          config.getJournalCompactPercentage(),
                                          bindingsJMS,
-                                         "hornetq-jms",
+                                         "activemq-jms",
                                          "jms",
                                          1);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerBundle.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerBundle.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerBundle.java
new file mode 100644
index 0000000..25f5d5c
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerBundle.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server;
+
+
+import org.apache.activemq.api.core.ActiveMQAddressExistsException;
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.apache.activemq.api.core.ActiveMQInternalErrorException;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 12
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
+ *
+ * so 129000 to 129999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQJMSServerBundle
+{
+   ActiveMQJMSServerBundle BUNDLE = Messages.getBundle(ActiveMQJMSServerBundle.class);
+
+   @Message(id = 129000, value =  "Connection Factory {0} does not exist" , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException cfDoesntExist(String name);
+
+   @Message(id = 129001, value =  "Invalid signature {0} parsing Connection Factory" , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException invalidSignatureParsingCF(String sig);
+
+   @Message(id = 129002, value = "Invalid node {0} parsing Connection Factory", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException invalidNodeParsingCF(String name);
+
+   @Message(id = 129003, value = "Discovery Group ''{0}'' does not exist on main config", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException discoveryGroupDoesntExist(String name);
+
+   @Message(id = 129004, value = "No Connector name configured on create ConnectionFactory", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException noConnectorNameOnCF();
+
+   @Message(id = 129005, value = "Connector ''{0}'' not found on the main configuration file" , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException noConnectorNameConfiguredOnCF(String name);
+
+   @Message(id = 129006, value =  "JNDI {0} is already being used by another connection factory", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAddressExistsException cfJndiExists(String name);
+
+   @Message(id = 129007, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerLogger.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerLogger.java
new file mode 100644
index 0000000..379f079
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/ActiveMQJMSServerLogger.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server;
+
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+import org.w3c.dom.Node;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ *
+ * Logger Code 12
+ *
+ * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 121000 to 121999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQJMSServerLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQJMSServerLogger LOGGER = Logger.getMessageLogger(ActiveMQJMSServerLogger.class, ActiveMQJMSServerLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 121003, value = "JMS Server Manager Running cached command for {0}" , format = Message.Format.MESSAGE_FORMAT)
+   void serverRunningCachedCommand(Runnable run);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 121004, value = "JMS Server Manager Caching command for {0} since the JMS Server is not active yet",
+            format = Message.Format.MESSAGE_FORMAT)
+   void serverCachingCommand(Object runnable);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 121005, value = "Invalid \"host\" value \"0.0.0.0\" detected for \"{0}\" connector. Switching to \"{1}\". If this new address is incorrect please manually configure the connector to use the proper one.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void invalidHostForConnector(String name, String newHost);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122007, value = "Queue {0} does not exist on the topic {1}. It was deleted manually probably." , format = Message.Format.MESSAGE_FORMAT)
+   void noQueueOnTopic(String queueName, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122008, value = "XA Recovery can not connect to any ActiveMQ server on recovery {0}"  , format = Message.Format.MESSAGE_FORMAT)
+   void recoveryConnectFailed(String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122011, value = "error unbinding {0} from JNDI" , format = Message.Format.MESSAGE_FORMAT)
+   void jndiUnbindError(@Cause Exception e, String key);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122012, value = "JMS Server Manager error" , format = Message.Format.MESSAGE_FORMAT)
+   void jmsServerError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122013, value = "Error in XA Recovery recover" , format = Message.Format.MESSAGE_FORMAT)
+   void xaRecoverError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122014, value = "Notified of connection failure in xa recovery connectionFactory for provider {0} will attempt reconnect on next pass",
+            format = Message.Format.MESSAGE_FORMAT)
+   void xaRecoverConnectionError(@Cause Exception e, ClientSessionFactory csf);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122015, value = "Can not connect to {0} on auto-generated resource recovery",
+            format = Message.Format.MESSAGE_FORMAT)
+   void xaRecoverAutoConnectionError(@Cause Throwable e, XARecoveryConfig csf);
+
+   @LogMessage(level = Logger.Level.DEBUG)
+   @Message(id = 122016, value = "Error in XA Recovery" , format = Message.Format.MESSAGE_FORMAT)
+   void xaRecoveryError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122017, value = "Tried to correct invalid \"host\" value \"0.0.0.0\" for \"{0}\" connector, but received an exception.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void failedToCorrectHost(@Cause Exception e, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122018, value = "Could not start recovery discovery on {0}, we will retry every recovery scan until the server is available",
+            format = Message.Format.MESSAGE_FORMAT)
+   void xaRecoveryStartError(XARecoveryConfig e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124000, value = "key attribute missing for JMS configuration {0}" , format = Message.Format.MESSAGE_FORMAT)
+   void jmsConfigMissingKey(Node e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124002, value = "Failed to start JMS deployer" , format = Message.Format.MESSAGE_FORMAT)
+   void jmsDeployerStartError(@Cause Exception e);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerBundle.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerBundle.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerBundle.java
deleted file mode 100644
index 474c990..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerBundle.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server;
-
-
-import org.apache.activemq.api.core.ActiveMQAddressExistsException;
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.apache.activemq.api.core.ActiveMQInternalErrorException;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 12
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
- *
- * so 129000 to 129999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQJMSServerBundle
-{
-   HornetQJMSServerBundle BUNDLE = Messages.getBundle(HornetQJMSServerBundle.class);
-
-   @Message(id = 129000, value =  "Connection Factory {0} does not exist" , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException cfDoesntExist(String name);
-
-   @Message(id = 129001, value =  "Invalid signature {0} parsing Connection Factory" , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException invalidSignatureParsingCF(String sig);
-
-   @Message(id = 129002, value = "Invalid node {0} parsing Connection Factory", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException invalidNodeParsingCF(String name);
-
-   @Message(id = 129003, value = "Discovery Group ''{0}'' does not exist on main config", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException discoveryGroupDoesntExist(String name);
-
-   @Message(id = 129004, value = "No Connector name configured on create ConnectionFactory", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException noConnectorNameOnCF();
-
-   @Message(id = 129005, value = "Connector ''{0}'' not found on the main configuration file" , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException noConnectorNameConfiguredOnCF(String name);
-
-   @Message(id = 129006, value =  "JNDI {0} is already being used by another connection factory", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQAddressExistsException cfJndiExists(String name);
-
-   @Message(id = 129007, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerLogger.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerLogger.java
deleted file mode 100644
index 89af42f..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/HornetQJMSServerLogger.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server;
-
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-import org.w3c.dom.Node;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- *
- * Logger Code 12
- *
- * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 121000 to 121999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQJMSServerLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQJMSServerLogger LOGGER = Logger.getMessageLogger(HornetQJMSServerLogger.class, HornetQJMSServerLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 121003, value = "JMS Server Manager Running cached command for {0}" , format = Message.Format.MESSAGE_FORMAT)
-   void serverRunningCachedCommand(Runnable run);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 121004, value = "JMS Server Manager Caching command for {0} since the JMS Server is not active yet",
-            format = Message.Format.MESSAGE_FORMAT)
-   void serverCachingCommand(Object runnable);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 121005, value = "Invalid \"host\" value \"0.0.0.0\" detected for \"{0}\" connector. Switching to \"{1}\". If this new address is incorrect please manually configure the connector to use the proper one.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void invalidHostForConnector(String name, String newHost);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122007, value = "Queue {0} does not exist on the topic {1}. It was deleted manually probably." , format = Message.Format.MESSAGE_FORMAT)
-   void noQueueOnTopic(String queueName, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122008, value = "XA Recovery can not connect to any hornetq server on recovery {0}"  , format = Message.Format.MESSAGE_FORMAT)
-   void recoveryConnectFailed(String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122011, value = "error unbinding {0} from JNDI" , format = Message.Format.MESSAGE_FORMAT)
-   void jndiUnbindError(@Cause Exception e, String key);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122012, value = "JMS Server Manager error" , format = Message.Format.MESSAGE_FORMAT)
-   void jmsServerError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122013, value = "Error in XA Recovery recover" , format = Message.Format.MESSAGE_FORMAT)
-   void xaRecoverError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122014, value = "Notified of connection failure in xa recovery connectionFactory for provider {0} will attempt reconnect on next pass",
-            format = Message.Format.MESSAGE_FORMAT)
-   void xaRecoverConnectionError(@Cause Exception e, ClientSessionFactory csf);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122015, value = "Can not connect to {0} on auto-generated resource recovery",
-            format = Message.Format.MESSAGE_FORMAT)
-   void xaRecoverAutoConnectionError(@Cause Throwable e, XARecoveryConfig csf);
-
-   @LogMessage(level = Logger.Level.DEBUG)
-   @Message(id = 122016, value = "Error in XA Recovery" , format = Message.Format.MESSAGE_FORMAT)
-   void xaRecoveryError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122017, value = "Tried to correct invalid \"host\" value \"0.0.0.0\" for \"{0}\" connector, but received an exception.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void failedToCorrectHost(@Cause Exception e, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122018, value = "Could not start recovery discovery on {0}, we will retry every recovery scan until the server is available",
-            format = Message.Format.MESSAGE_FORMAT)
-   void xaRecoveryStartError(XARecoveryConfig e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124000, value = "key attribute missing for JMS configuration {0}" , format = Message.Format.MESSAGE_FORMAT)
-   void jmsConfigMissingKey(Node e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124002, value = "Failed to start JMS deployer" , format = Message.Format.MESSAGE_FORMAT)
-   void jmsDeployerStartError(@Cause Exception e);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/JMSServerManager.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/JMSServerManager.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/JMSServerManager.java
index fd82e69..d3548f1 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/JMSServerManager.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/JMSServerManager.java
@@ -19,10 +19,10 @@ import javax.naming.Context;
 
 import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.security.Role;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.settings.impl.AddressSettings;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.spi.core.naming.BindingRegistry;
 
@@ -33,7 +33,7 @@ import org.apache.activemq.spi.core.naming.BindingRegistry;
  * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */
-public interface JMSServerManager extends HornetQComponent
+public interface JMSServerManager extends ActiveMQComponent
 {
    String getVersion();
 
@@ -183,7 +183,7 @@ public interface JMSServerManager extends HornetQComponent
 
    /** Call this method to have a CF rebound to JNDI and stored on the Journal
     * @throws Exception */
-   HornetQConnectionFactory recreateCF(String name,  ConnectionFactoryConfiguration cf) throws Exception;
+   ActiveMQConnectionFactory recreateCF(String name,  ConnectionFactoryConfiguration cf) throws Exception;
 
    void createConnectionFactory(String name, boolean ha, JMSFactoryType cfType, String discoveryGroupName, String ... jndiBindings) throws Exception;
 
@@ -298,7 +298,7 @@ public interface JMSServerManager extends HornetQComponent
 
    void setContext(final Context context);
 
-   HornetQServer getHornetQServer();
+   ActiveMQServer getActiveMQServer();
 
    void addAddressSettings(String address, AddressSettings addressSettings);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
index fcda258..fcc7a04 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
@@ -17,7 +17,7 @@ import java.util.List;
 
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.utils.BufferHelper;
@@ -50,65 +50,65 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
 
    private String clientID = null;
 
-   private boolean ha = HornetQClient.DEFAULT_HA;
+   private boolean ha = ActiveMQClient.DEFAULT_HA;
 
-   private long clientFailureCheckPeriod = HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
+   private long clientFailureCheckPeriod = ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 
-   private long connectionTTL = HornetQClient.DEFAULT_CONNECTION_TTL;
+   private long connectionTTL = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 
-   private long callTimeout = HornetQClient.DEFAULT_CALL_TIMEOUT;
+   private long callTimeout = ActiveMQClient.DEFAULT_CALL_TIMEOUT;
 
-   private long callFailoverTimeout = HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT;
+   private long callFailoverTimeout = ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT;
 
-   private boolean cacheLargeMessagesClient = HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
+   private boolean cacheLargeMessagesClient = ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
 
-   private int minLargeMessageSize = HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
+   private int minLargeMessageSize = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
 
-   private boolean compressLargeMessage = HornetQClient.DEFAULT_COMPRESS_LARGE_MESSAGES;
+   private boolean compressLargeMessage = ActiveMQClient.DEFAULT_COMPRESS_LARGE_MESSAGES;
 
-   private int consumerWindowSize = HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE;
+   private int consumerWindowSize = ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE;
 
-   private int consumerMaxRate = HornetQClient.DEFAULT_CONSUMER_MAX_RATE;
+   private int consumerMaxRate = ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE;
 
-   private int confirmationWindowSize = HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
+   private int confirmationWindowSize = ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
 
-   private int producerWindowSize = HornetQClient.DEFAULT_PRODUCER_WINDOW_SIZE;
+   private int producerWindowSize = ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE;
 
-   private int producerMaxRate = HornetQClient.DEFAULT_PRODUCER_MAX_RATE;
+   private int producerMaxRate = ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE;
 
-   private boolean blockOnAcknowledge = HornetQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
+   private boolean blockOnAcknowledge = ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
 
-   private boolean blockOnDurableSend = HornetQClient.DEFAULT_BLOCK_ON_DURABLE_SEND;
+   private boolean blockOnDurableSend = ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND;
 
-   private boolean blockOnNonDurableSend = HornetQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND;
+   private boolean blockOnNonDurableSend = ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND;
 
-   private boolean autoGroup = HornetQClient.DEFAULT_AUTO_GROUP;
+   private boolean autoGroup = ActiveMQClient.DEFAULT_AUTO_GROUP;
 
-   private boolean preAcknowledge = HornetQClient.DEFAULT_PRE_ACKNOWLEDGE;
+   private boolean preAcknowledge = ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE;
 
-   private String loadBalancingPolicyClassName = HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
+   private String loadBalancingPolicyClassName = ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
 
-   private int transactionBatchSize = HornetQClient.DEFAULT_ACK_BATCH_SIZE;
+   private int transactionBatchSize = ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
 
-   private int dupsOKBatchSize = HornetQClient.DEFAULT_ACK_BATCH_SIZE;
+   private int dupsOKBatchSize = ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
 
-   private long initialWaitTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
+   private long initialWaitTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
 
-   private boolean useGlobalPools = HornetQClient.DEFAULT_USE_GLOBAL_POOLS;
+   private boolean useGlobalPools = ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS;
 
-   private int scheduledThreadPoolMaxSize = HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
+   private int scheduledThreadPoolMaxSize = ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
 
-   private int threadPoolMaxSize = HornetQClient.DEFAULT_THREAD_POOL_MAX_SIZE;
+   private int threadPoolMaxSize = ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE;
 
-   private long retryInterval = HornetQClient.DEFAULT_RETRY_INTERVAL;
+   private long retryInterval = ActiveMQClient.DEFAULT_RETRY_INTERVAL;
 
-   private double retryIntervalMultiplier = HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
+   private double retryIntervalMultiplier = ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
 
-   private long maxRetryInterval = HornetQClient.DEFAULT_MAX_RETRY_INTERVAL;
+   private long maxRetryInterval = ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL;
 
-   private int reconnectAttempts = HornetQClient.DEFAULT_RECONNECT_ATTEMPTS;
+   private int reconnectAttempts = ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS;
 
-   private boolean failoverOnInitialConnection = HornetQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
+   private boolean failoverOnInitialConnection = ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
 
    private String groupID = null;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/embedded/EmbeddedJMS.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/embedded/EmbeddedJMS.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/embedded/EmbeddedJMS.java
index 159241b..047d457 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/embedded/EmbeddedJMS.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/embedded/EmbeddedJMS.java
@@ -16,14 +16,14 @@ import javax.naming.Context;
 
 import org.apache.activemq.core.registry.JndiBindingRegistry;
 import org.apache.activemq.core.registry.MapBindingRegistry;
-import org.apache.activemq.core.server.embedded.EmbeddedHornetQ;
+import org.apache.activemq.core.server.embedded.EmbeddedActiveMQ;
 import org.apache.activemq.jms.server.config.JMSConfiguration;
 import org.apache.activemq.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.spi.core.naming.BindingRegistry;
 
 /**
- * Simple bootstrap class that parses hornetq config files (server and jms and security) and starts
- * a HornetQServer instance and populates it with configured JMS endpoints.
+ * Simple bootstrap class that parses activemq config files (server and jms and security) and starts
+ * a ActiveMQServer instance and populates it with configured JMS endpoints.
  * <p>
  * JMS Endpoints are registered with a simple MapBindingRegistry.  If you want to use a different registry
  * you must set the registry property of this class or call the setRegistry() method if you want to use JNDI
@@ -31,7 +31,7 @@ import org.apache.activemq.spi.core.naming.BindingRegistry;
  * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
  * @version $Revision: 1 $
  */
-public class EmbeddedJMS extends EmbeddedHornetQ
+public class EmbeddedJMS extends EmbeddedActiveMQ
 {
    protected JMSServerManagerImpl serverManager;
    protected BindingRegistry registry;
@@ -40,7 +40,7 @@ public class EmbeddedJMS extends EmbeddedHornetQ
    protected Context context;
 
    /**
-    * Classpath resource where JMS config file is.  Defaults to 'hornetq-jms.xml'
+    * Classpath resource where JMS config file is.  Defaults to 'activemq-jms.xml'
     *
     * @param jmsConfigResourcePath
     */
@@ -101,10 +101,10 @@ public class EmbeddedJMS extends EmbeddedHornetQ
       super.initStart();
       if (jmsConfiguration != null)
       {
-         serverManager = new JMSServerManagerImpl(hornetQServer, jmsConfiguration);
+         serverManager = new JMSServerManagerImpl(activeMQServer, jmsConfiguration);
       }
-      else if (jmsConfigResourcePath == null) serverManager = new JMSServerManagerImpl(hornetQServer);
-      else serverManager = new JMSServerManagerImpl(hornetQServer, jmsConfigResourcePath);
+      else if (jmsConfigResourcePath == null) serverManager = new JMSServerManagerImpl(activeMQServer);
+      else serverManager = new JMSServerManagerImpl(activeMQServer, jmsConfigResourcePath);
 
       if (registry == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerConfigParserImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerConfigParserImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerConfigParserImpl.java
index 0ecb5de..d959fab 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerConfigParserImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerConfigParserImpl.java
@@ -20,11 +20,11 @@ import java.util.List;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.config.impl.Validators;
-import org.apache.activemq.jms.server.HornetQJMSServerBundle;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
+import org.apache.activemq.jms.server.ActiveMQJMSServerBundle;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
 import org.apache.activemq.jms.server.JMSServerConfigParser;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.jms.server.config.JMSConfiguration;
@@ -92,7 +92,7 @@ public final class JMSServerConfigParserImpl implements JMSServerConfigParser
             Node keyNode = node.getAttributes().getNamedItem(JMSServerConfigParserImpl.NAME_ATTR);
             if (keyNode == null)
             {
-               HornetQJMSServerLogger.LOGGER.jmsConfigMissingKey(node);
+               ActiveMQJMSServerLogger.LOGGER.jmsConfigMissingKey(node);
                continue;
             }
 
@@ -197,7 +197,7 @@ public final class JMSServerConfigParserImpl implements JMSServerConfigParser
       if (!node.getNodeName().equals(JMSServerDeployer.CONNECTION_FACTORY_NODE_NAME))
       {
          // sanity check, this shouldn't ever happen
-         throw HornetQJMSServerBundle.BUNDLE.invalidNodeParsingCF(node.getNodeName());
+         throw ActiveMQJMSServerBundle.BUNDLE.invalidNodeParsingCF(node.getNodeName());
       }
       Element e = (Element) node;
 
@@ -206,116 +206,116 @@ public final class JMSServerConfigParserImpl implements JMSServerConfigParser
       String fact = e.getAttribute("signature");
       boolean isXA = XMLConfigurationUtil.getBoolean(e,
                                                      "xa",
-                                                     HornetQClient.DEFAULT_XA);
+                                                     ActiveMQClient.DEFAULT_XA);
 
       JMSFactoryType factType = resolveFactoryType(fact, isXA);
 
       long clientFailureCheckPeriod = XMLConfigurationUtil.getLong(e,
                                                                    "client-failure-check-period",
-                                                                   HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
+                                                                   ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                                                                    Validators.MINUS_ONE_OR_GT_ZERO);
       long connectionTTL = XMLConfigurationUtil.getLong(e,
                                                         "connection-ttl",
-                                                        HornetQClient.DEFAULT_CONNECTION_TTL,
+                                                        ActiveMQClient.DEFAULT_CONNECTION_TTL,
                                                         Validators.MINUS_ONE_OR_GE_ZERO);
       long callTimeout = XMLConfigurationUtil.getLong(e,
                                                       "call-timeout",
-                                                      HornetQClient.DEFAULT_CALL_TIMEOUT,
+                                                      ActiveMQClient.DEFAULT_CALL_TIMEOUT,
                                                       Validators.GE_ZERO);
       long callFailoverTimeout = XMLConfigurationUtil.getLong(e,
                                                               "call-failover-timeout",
-                                                              HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
+                                                              ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
                                                               Validators.MINUS_ONE_OR_GT_ZERO);
       String clientID = XMLConfigurationUtil.getString(e, "client-id", null, Validators.NO_CHECK);
       int dupsOKBatchSize = XMLConfigurationUtil.getInteger(e,
                                                             "dups-ok-batch-size",
-                                                            HornetQClient.DEFAULT_ACK_BATCH_SIZE,
+                                                            ActiveMQClient.DEFAULT_ACK_BATCH_SIZE,
                                                             Validators.GT_ZERO);
       int transactionBatchSize = XMLConfigurationUtil.getInteger(e,
                                                                  "transaction-batch-size",
-                                                                 HornetQClient.DEFAULT_ACK_BATCH_SIZE,
+                                                                 ActiveMQClient.DEFAULT_ACK_BATCH_SIZE,
                                                                  Validators.GT_ZERO);
       int consumerWindowSize = XMLConfigurationUtil.getInteger(e,
                                                                "consumer-window-size",
-                                                               HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
+                                                               ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
                                                                Validators.MINUS_ONE_OR_GE_ZERO);
       int producerWindowSize = XMLConfigurationUtil.getInteger(e,
                                                                "producer-window-size",
-                                                               HornetQClient.DEFAULT_PRODUCER_WINDOW_SIZE,
+                                                               ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE,
                                                                Validators.MINUS_ONE_OR_GT_ZERO);
       int consumerMaxRate = XMLConfigurationUtil.getInteger(e,
                                                             "consumer-max-rate",
-                                                            HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
+                                                            ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE,
                                                             Validators.MINUS_ONE_OR_GT_ZERO);
       int confirmationWindowSize = XMLConfigurationUtil.getInteger(e,
                                                                    "confirmation-window-size",
-                                                                   HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE,
+                                                                   ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE,
                                                                    Validators.MINUS_ONE_OR_GT_ZERO);
       int producerMaxRate = XMLConfigurationUtil.getInteger(e,
                                                             "producer-max-rate",
-                                                            HornetQClient.DEFAULT_PRODUCER_MAX_RATE,
+                                                            ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE,
                                                             Validators.MINUS_ONE_OR_GT_ZERO);
       boolean cacheLargeMessagesClient = XMLConfigurationUtil.getBoolean(e,
                                                                          "cache-large-message-client",
-                                                                         HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT);
+                                                                         ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT);
       int minLargeMessageSize = XMLConfigurationUtil.getInteger(e,
                                                                 "min-large-message-size",
-                                                                HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+                                                                ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                                                                 Validators.GT_ZERO);
 
       boolean compressLargeMessages = XMLConfigurationUtil.getBoolean(e,
                                                                       "compress-large-messages",
-                                                                      HornetQClient.DEFAULT_COMPRESS_LARGE_MESSAGES);
+                                                                      ActiveMQClient.DEFAULT_COMPRESS_LARGE_MESSAGES);
 
       boolean blockOnAcknowledge = XMLConfigurationUtil.getBoolean(e,
                                                                    "block-on-acknowledge",
-                                                                   HornetQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+                                                                   ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
       boolean blockOnNonDurableSend = XMLConfigurationUtil.getBoolean(e,
                                                                       "block-on-non-durable-send",
-                                                                      HornetQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND);
+                                                                      ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND);
       boolean blockOnDurableSend = XMLConfigurationUtil.getBoolean(e,
                                                                    "block-on-durable-send",
-                                                                   HornetQClient.DEFAULT_BLOCK_ON_DURABLE_SEND);
-      boolean autoGroup = XMLConfigurationUtil.getBoolean(e, "auto-group", HornetQClient.DEFAULT_AUTO_GROUP);
+                                                                   ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND);
+      boolean autoGroup = XMLConfigurationUtil.getBoolean(e, "auto-group", ActiveMQClient.DEFAULT_AUTO_GROUP);
       boolean preAcknowledge = XMLConfigurationUtil.getBoolean(e,
                                                                "pre-acknowledge",
-                                                               HornetQClient.DEFAULT_PRE_ACKNOWLEDGE);
+                                                               ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE);
       long retryInterval = XMLConfigurationUtil.getLong(e,
                                                         "retry-interval",
-                                                        HornetQClient.DEFAULT_RETRY_INTERVAL,
+                                                        ActiveMQClient.DEFAULT_RETRY_INTERVAL,
                                                         Validators.GT_ZERO);
       double retryIntervalMultiplier = XMLConfigurationUtil.getDouble(e,
                                                                       "retry-interval-multiplier",
-                                                                      HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
+                                                                      ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
                                                                       Validators.GT_ZERO);
       long maxRetryInterval = XMLConfigurationUtil.getLong(e,
                                                            "max-retry-interval",
-                                                           HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
+                                                           ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL,
                                                            Validators.GT_ZERO);
       int reconnectAttempts = XMLConfigurationUtil.getInteger(e,
                                                               "reconnect-attempts",
-                                                              HornetQClient.DEFAULT_RECONNECT_ATTEMPTS,
+                                                              ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS,
                                                               Validators.MINUS_ONE_OR_GE_ZERO);
       boolean failoverOnInitialConnection = XMLConfigurationUtil.getBoolean(e,
                                                                             "failover-on-initial-connection",
-                                                                            HornetQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION);
+                                                                            ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION);
 
       boolean useGlobalPools = XMLConfigurationUtil.getBoolean(e,
                                                                "use-global-pools",
-                                                               HornetQClient.DEFAULT_USE_GLOBAL_POOLS);
+                                                               ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS);
       int scheduledThreadPoolMaxSize = XMLConfigurationUtil.getInteger(e,
                                                                        "scheduled-thread-pool-max-size",
-                                                                       HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
+                                                                       ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
                                                                        Validators.MINUS_ONE_OR_GT_ZERO);
       int threadPoolMaxSize = XMLConfigurationUtil.getInteger(e,
                                                               "thread-pool-max-size",
-                                                              HornetQClient.DEFAULT_THREAD_POOL_MAX_SIZE,
+                                                              ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE,
                                                               Validators.MINUS_ONE_OR_GT_ZERO);
       String connectionLoadBalancingPolicyClassName = XMLConfigurationUtil.getString(e,
                                                                                      "connection-load-balancing-policy-class-name",
-                                                                                     HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
+                                                                                     ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
                                                                                      Validators.NOT_NULL_OR_EMPTY);
-      boolean ha = XMLConfigurationUtil.getBoolean(e, "ha", HornetQClient.DEFAULT_HA);
+      boolean ha = XMLConfigurationUtil.getBoolean(e, "ha", ActiveMQClient.DEFAULT_HA);
 
       String groupid = XMLConfigurationUtil.getString(e, "group-id", null, Validators.NO_CHECK);
       List<String> jndiBindings = new ArrayList<String>();
@@ -458,7 +458,7 @@ public final class JMSServerConfigParserImpl implements JMSServerConfigParser
             return JMSFactoryType.TOPIC_CF;
          }
       }
-      throw HornetQJMSServerBundle.BUNDLE.invalidSignatureParsingCF(fact);
+      throw ActiveMQJMSServerBundle.BUNDLE.invalidSignatureParsingCF(fact);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerDeployer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerDeployer.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerDeployer.java
index ae5730a..2bab2bd 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerDeployer.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/JMSServerDeployer.java
@@ -96,8 +96,8 @@ public class JMSServerDeployer extends XmlDeployer
    }
 
    /**
-    * Creates the object to bind, this will either be a JBossConnectionFActory, HornetQQueue or
-    * HornetQTopic.
+    * Creates the object to bind, this will either be a JBossConnectionFActory, ActiveMQQueue or
+    * ActiveMQTopic.
     *
     * @param node the config
     * @throws Exception
@@ -147,7 +147,7 @@ public class JMSServerDeployer extends XmlDeployer
    @Override
    public String[] getDefaultConfigFileNames()
    {
-      return new String[]{"hornetq-jms.xml"};
+      return new String[]{"activemq-jms.xml"};
    }
 
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/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 b8b2d5f..943d9f4 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
@@ -37,7 +37,7 @@ import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.management.AddressControl;
 import org.apache.activemq.api.core.management.ResourceNames;
-import org.apache.activemq.api.jms.HornetQJMSClient;
+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.deployers.DeploymentManager;
@@ -50,18 +50,18 @@ 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;
 import org.apache.activemq.core.server.ActivateCallback;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.Queue;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.settings.impl.AddressSettings;
 import org.apache.activemq.core.transaction.ResourceManager;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionDetail;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQQueue;
-import org.apache.activemq.jms.client.HornetQTopic;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQQueue;
+import org.apache.activemq.jms.client.ActiveMQTopic;
 import org.apache.activemq.jms.client.SelectorTranslator;
 import org.apache.activemq.jms.persistence.JMSStorageManager;
 import org.apache.activemq.jms.persistence.config.PersistedConnectionFactory;
@@ -70,8 +70,8 @@ import org.apache.activemq.jms.persistence.config.PersistedJNDI;
 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;
-import org.apache.activemq.jms.server.HornetQJMSServerBundle;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
+import org.apache.activemq.jms.server.ActiveMQJMSServerBundle;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.jms.server.config.JMSConfiguration;
@@ -106,15 +106,15 @@ import org.apache.activemq.utils.json.JSONObject;
  */
 public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 {
-   private static final String REJECT_FILTER = HornetQServerImpl.GENERIC_IGNORED_FILTER;
+   private static final String REJECT_FILTER = ActiveMQServerImpl.GENERIC_IGNORED_FILTER;
 
    private BindingRegistry registry;
 
-   private final Map<String, HornetQQueue> queues = new HashMap<String, HornetQQueue>();
+   private final Map<String, ActiveMQQueue> queues = new HashMap<String, ActiveMQQueue>();
 
-   private final Map<String, HornetQTopic> topics = new HashMap<String, HornetQTopic>();
+   private final Map<String, ActiveMQTopic> topics = new HashMap<String, ActiveMQTopic>();
 
-   private final Map<String, HornetQConnectionFactory> connectionFactories = new HashMap<String, HornetQConnectionFactory>();
+   private final Map<String, ActiveMQConnectionFactory> connectionFactories = new HashMap<String, ActiveMQConnectionFactory>();
 
    private final Map<String, List<String>> queueJNDI = new HashMap<String, List<String>>();
 
@@ -125,7 +125,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    // We keep things cached if objects are created while the JMS is not active
    private final List<Runnable> cachedCommands = new ArrayList<Runnable>();
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private JMSManagementService jmsManagementService;
 
@@ -149,7 +149,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    private final Map<String, List<String>> unRecoveredJndi = new HashMap<String, List<String>>();
 
-   public JMSServerManagerImpl(final HornetQServer server) throws Exception
+   public JMSServerManagerImpl(final ActiveMQServer server) throws Exception
    {
       this.server = server;
 
@@ -165,7 +165,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
     * @param registry
     * @throws Exception
     */
-   public JMSServerManagerImpl(final HornetQServer server, final BindingRegistry registry) throws Exception
+   public JMSServerManagerImpl(final ActiveMQServer server, final BindingRegistry registry) throws Exception
    {
       this.server = server;
 
@@ -176,7 +176,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       this.registry = registry;
    }
 
-   public JMSServerManagerImpl(final HornetQServer server, final String configFileName) throws Exception
+   public JMSServerManagerImpl(final ActiveMQServer server, final String configFileName) throws Exception
    {
       this.server = server;
 
@@ -185,7 +185,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       this.configFileName = configFileName;
    }
 
-   public JMSServerManagerImpl(final HornetQServer server, final JMSConfiguration configuration) throws Exception
+   public JMSServerManagerImpl(final ActiveMQServer server, final JMSConfiguration configuration) throws Exception
    {
       this.server = server;
 
@@ -200,7 +200,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
     * Unused
     */
    @Deprecated
-   public JMSServerManagerImpl(HornetQServer server, String configFilename, JMSStorageManager storageManager)
+   public JMSServerManagerImpl(ActiveMQServer server, String configFilename, JMSStorageManager storageManager)
    {
       this.server = server;
 
@@ -259,7 +259,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          for (Runnable run : cachedCommands)
          {
-            HornetQJMSServerLogger.LOGGER.serverRunningCachedCommand(run);
+            ActiveMQJMSServerLogger.LOGGER.serverRunningCachedCommand(run);
             run.run();
          }
 
@@ -270,7 +270,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       catch (Exception e)
       {
          active = false;
-         HornetQJMSServerLogger.LOGGER.jmsDeployerStartError(e);
+         ActiveMQJMSServerLogger.LOGGER.jmsDeployerStartError(e);
       }
    }
 
@@ -450,7 +450,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
    }
 
-   // HornetQComponent implementation -----------------------------------
+   // ActiveMQComponent implementation -----------------------------------
 
    /**
     * Notice that this component has a {@link #startCalled} boolean to control its internal
@@ -460,8 +460,8 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
     * This method and {@code server.start()} are interdependent in the following way:
     * <ol>
     * <li>{@link JMSServerManagerImpl#start()} is called, it sets {@code start_called=true}, and
-    * calls {@link HornetQServerImpl#start()}
-    * <li>{@link HornetQServerImpl#start()} will call {@link JMSServerManagerImpl#activated()}
+    * calls {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#start()}
+    * <li>{@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#start()} will call {@link JMSServerManagerImpl#activated()}
     * <li>{@link JMSServerManagerImpl#activated()} checks the value of {@link #startCalled}, which
     * must already be true.
     * </ol>
@@ -535,7 +535,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       this.registry = registry;
    }
 
-   public HornetQServer getHornetQServer()
+   public ActiveMQServer getActiveMQServer()
    {
       return server;
    }
@@ -606,7 +606,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             if (internalCreateQueue(queueName, selectorString, durable))
             {
 
-               HornetQDestination destination = queues.get(queueName);
+               ActiveMQDestination destination = queues.get(queueName);
                if (destination == null)
                {
                   // sanity check. internalCreateQueue should already have done this check
@@ -664,7 +664,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
             if (internalCreateTopic(topicName))
             {
-               HornetQDestination destination = topics.get(topicName);
+               ActiveMQDestination destination = topics.get(topicName);
 
                if (destination == null)
                {
@@ -705,7 +705,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
       checkJNDI(jndiBinding);
 
-      HornetQTopic destination = topics.get(topicName);
+      ActiveMQTopic destination = topics.get(topicName);
       if (destination == null)
       {
          throw new IllegalArgumentException("Topic does not exist");
@@ -745,7 +745,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
       checkJNDI(jndiBinding);
 
-      HornetQQueue destination = queues.get(queueName);
+      ActiveMQQueue destination = queues.get(queueName);
       if (destination == null)
       {
          throw new IllegalArgumentException("Queue does not exist");
@@ -769,14 +769,14 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
       checkJNDI(jndiBinding);
 
-      HornetQConnectionFactory factory = connectionFactories.get(name);
+      ActiveMQConnectionFactory factory = connectionFactories.get(name);
       if (factory == null)
       {
          throw new IllegalArgumentException("Factory does not exist");
       }
       if (registry.lookup(jndiBinding) != null)
       {
-         throw HornetQJMSServerBundle.BUNDLE.cfJndiExists(name);
+         throw ActiveMQJMSServerBundle.BUNDLE.cfJndiExists(name);
       }
       boolean added = bindToJndi(jndiBinding, factory);
       if (added)
@@ -913,11 +913,11 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    {
       checkInitialised();
 
-      server.destroyQueue(HornetQDestination.createQueueAddressFromName(name), null, !removeConsumers, removeConsumers);
+      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
-      if (this.server.getPostOffice().getBinding(HornetQDestination.createQueueAddressFromName(name)) == null)
+      if (this.server.getPostOffice().getBinding(ActiveMQDestination.createQueueAddressFromName(name)) == null)
       {
          removeFromJNDI(queues, queueJNDI, name);
 
@@ -946,7 +946,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    {
       checkInitialised();
       AddressControl addressControl = (AddressControl) server.getManagementService()
-         .getResource(ResourceNames.CORE_ADDRESS + HornetQDestination.createTopicAddressFromName(name));
+         .getResource(ResourceNames.CORE_ADDRESS + ActiveMQDestination.createTopicAddressFromName(name));
       if (addressControl != null)
       {
          for (String queueName : addressControl.getQueueNames())
@@ -954,7 +954,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             Binding binding = server.getPostOffice().getBinding(new SimpleString(queueName));
             if (binding == null)
             {
-               HornetQJMSServerLogger.LOGGER.noQueueOnTopic(queueName, name);
+               ActiveMQJMSServerLogger.LOGGER.noQueueOnTopic(queueName, name);
                continue;
             }
 
@@ -997,7 +997,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     String... jndiBindings) throws Exception
    {
       checkInitialised();
-      HornetQConnectionFactory cf = connectionFactories.get(name);
+      ActiveMQConnectionFactory cf = connectionFactories.get(name);
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
@@ -1047,7 +1047,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     String... jndiBindings) throws Exception
    {
       checkInitialised();
-      HornetQConnectionFactory cf = connectionFactories.get(name);
+      ActiveMQConnectionFactory cf = connectionFactories.get(name);
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
@@ -1126,7 +1126,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final String... jndiBindings) throws Exception
    {
       checkInitialised();
-      HornetQConnectionFactory cf = connectionFactories.get(name);
+      ActiveMQConnectionFactory cf = connectionFactories.get(name);
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
@@ -1175,7 +1175,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                                                     final String... jndiBindings) throws Exception
    {
       checkInitialised();
-      HornetQConnectionFactory cf = connectionFactories.get(name);
+      ActiveMQConnectionFactory cf = connectionFactories.get(name);
       if (cf == null)
       {
          ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl()
@@ -1187,18 +1187,18 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
    }
 
-   public synchronized HornetQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception
+   public synchronized ActiveMQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception
    {
       List<String> jndi = connectionFactoryJNDI.get(name);
 
       if (jndi == null)
       {
-         throw HornetQJMSServerBundle.BUNDLE.cfDoesntExist(name);
+         throw ActiveMQJMSServerBundle.BUNDLE.cfDoesntExist(name);
       }
 
       String[] usedJNDI = jndi.toArray(new String[jndi.size()]);
 
-      HornetQConnectionFactory realCF = internalCreateCFPOJO(cf);
+      ActiveMQConnectionFactory realCF = internalCreateCFPOJO(cf);
 
       if (cf.isPersisted())
       {
@@ -1232,7 +1232,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          {
             checkJNDI(jndi);
 
-            HornetQConnectionFactory cf = internalCreateCF(storeConfig, cfConfig);
+            ActiveMQConnectionFactory cf = internalCreateCF(storeConfig, cfConfig);
 
             ArrayList<String> bindings = new ArrayList<String>();
 
@@ -1270,7 +1270,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
       catch (Exception e)
       {
-         HornetQJMSServerLogger.LOGGER.warn("Failed to send notification : " + notif);
+         ActiveMQJMSServerLogger.LOGGER.warn("Failed to send notification : " + notif);
       }
    }
 
@@ -1308,27 +1308,27 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
       else
       {
-         HornetQQueue hqQueue = HornetQDestination.createQueue(queueName);
+         ActiveMQQueue activeMQQueue = ActiveMQDestination.createQueue(queueName);
 
          // Convert from JMS selector to core filter
          String coreFilterString = null;
 
          if (selectorString != null)
          {
-            coreFilterString = SelectorTranslator.convertToHornetQFilterString(selectorString);
+            coreFilterString = SelectorTranslator.convertToActiveMQFilterString(selectorString);
          }
 
-         Queue queue = server.deployQueue(SimpleString.toSimpleString(hqQueue.getAddress()),
-                                          SimpleString.toSimpleString(hqQueue.getAddress()),
+         Queue queue = server.deployQueue(SimpleString.toSimpleString(activeMQQueue.getAddress()),
+                                          SimpleString.toSimpleString(activeMQQueue.getAddress()),
                                           SimpleString.toSimpleString(coreFilterString),
                                           durable,
                                           false);
 
-         queues.put(queueName, hqQueue);
+         queues.put(queueName, activeMQQueue);
 
          this.recoverJndiBindings(queueName, PersistedType.Queue);
 
-         jmsManagementService.registerQueue(hqQueue, queue);
+         jmsManagementService.registerQueue(activeMQQueue, queue);
 
          return true;
       }
@@ -1351,22 +1351,22 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
       else
       {
-         HornetQTopic hqTopic = HornetQDestination.createTopic(topicName);
+         ActiveMQTopic activeMQTopic = ActiveMQDestination.createTopic(topicName);
          // We create a dummy subscription on the topic, that never receives messages - this is so we can perform JMS
          // checks when routing messages to a topic that
          // does not exist - otherwise we would not be able to distinguish from a non existent topic and one with no
          // subscriptions - core has no notion of a topic
-         server.deployQueue(SimpleString.toSimpleString(hqTopic.getAddress()),
-                            SimpleString.toSimpleString(hqTopic.getAddress()),
+         server.deployQueue(SimpleString.toSimpleString(activeMQTopic.getAddress()),
+                            SimpleString.toSimpleString(activeMQTopic.getAddress()),
                             SimpleString.toSimpleString(JMSServerManagerImpl.REJECT_FILTER),
                             true,
                             false);
 
-         topics.put(topicName, hqTopic);
+         topics.put(topicName, activeMQTopic);
 
          this.recoverJndiBindings(topicName, PersistedType.Topic);
 
-         jmsManagementService.registerTopic(hqTopic);
+         jmsManagementService.registerTopic(activeMQTopic);
 
          return true;
       }
@@ -1376,12 +1376,12 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
     * @param cfConfig
     * @throws Exception
     */
-   private HornetQConnectionFactory internalCreateCF(final boolean persisted,
+   private ActiveMQConnectionFactory internalCreateCF(final boolean persisted,
                                                      final ConnectionFactoryConfiguration cfConfig) throws Exception
    {
       checkInitialised();
 
-      HornetQConnectionFactory cf = connectionFactories.get(cfConfig.getName());
+      ActiveMQConnectionFactory cf = connectionFactories.get(cfConfig.getName());
 
       if (cf == null)
       {
@@ -1400,9 +1400,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
     * @return
     * @throws org.apache.activemq.api.core.ActiveMQException
     */
-   protected HornetQConnectionFactory internalCreateCFPOJO(final ConnectionFactoryConfiguration cfConfig) throws ActiveMQException
+   protected ActiveMQConnectionFactory internalCreateCFPOJO(final ConnectionFactoryConfiguration cfConfig) throws ActiveMQException
    {
-      HornetQConnectionFactory cf;
+      ActiveMQConnectionFactory cf;
       if (cfConfig.getDiscoveryGroupName() != null)
       {
          DiscoveryGroupConfiguration groupConfig = server.getConfiguration()
@@ -1411,23 +1411,23 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          if (groupConfig == null)
          {
-            throw HornetQJMSServerBundle.BUNDLE.discoveryGroupDoesntExist(cfConfig.getDiscoveryGroupName());
+            throw ActiveMQJMSServerBundle.BUNDLE.discoveryGroupDoesntExist(cfConfig.getDiscoveryGroupName());
          }
 
          if (cfConfig.isHA())
          {
-            cf = HornetQJMSClient.createConnectionFactoryWithHA(groupConfig, cfConfig.getFactoryType());
+            cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfig, cfConfig.getFactoryType());
          }
          else
          {
-            cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfig, cfConfig.getFactoryType());
+            cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(groupConfig, cfConfig.getFactoryType());
          }
       }
       else
       {
          if (cfConfig.getConnectorNames() == null || cfConfig.getConnectorNames().size() == 0)
          {
-            throw HornetQJMSServerBundle.BUNDLE.noConnectorNameOnCF();
+            throw ActiveMQJMSServerBundle.BUNDLE.noConnectorNameOnCF();
          }
 
          TransportConfiguration[] configs = new TransportConfiguration[cfConfig.getConnectorNames().size()];
@@ -1438,7 +1438,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
             TransportConfiguration connector = server.getConfiguration().getConnectorConfigurations().get(name);
             if (connector == null)
             {
-               throw HornetQJMSServerBundle.BUNDLE.noConnectorNameConfiguredOnCF(name);
+               throw ActiveMQJMSServerBundle.BUNDLE.noConnectorNameConfiguredOnCF(name);
             }
             correctInvalidNettyConnectorHost(connector);
             configs[count++] = connector;
@@ -1446,11 +1446,11 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 
          if (cfConfig.isHA())
          {
-            cf = HornetQJMSClient.createConnectionFactoryWithHA(cfConfig.getFactoryType(), configs);
+            cf = ActiveMQJMSClient.createConnectionFactoryWithHA(cfConfig.getFactoryType(), configs);
          }
          else
          {
-            cf = HornetQJMSClient.createConnectionFactoryWithoutHA(cfConfig.getFactoryType(), configs);
+            cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(cfConfig.getFactoryType(), configs);
          }
       }
 
@@ -1547,42 +1547,42 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
    public String[] listRemoteAddresses() throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().listRemoteAddresses();
+      return server.getActiveMQServerControl().listRemoteAddresses();
    }
 
    public String[] listRemoteAddresses(final String ipAddress) throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().listRemoteAddresses(ipAddress);
+      return server.getActiveMQServerControl().listRemoteAddresses(ipAddress);
    }
 
    public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().closeConnectionsForAddress(ipAddress);
+      return server.getActiveMQServerControl().closeConnectionsForAddress(ipAddress);
    }
 
    public boolean closeConsumerConnectionsForAddress(final String address) throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().closeConsumerConnectionsForAddress(address);
+      return server.getActiveMQServerControl().closeConsumerConnectionsForAddress(address);
    }
 
    public boolean closeConnectionsForUser(final String userName) throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().closeConnectionsForUser(userName);
+      return server.getActiveMQServerControl().closeConnectionsForUser(userName);
    }
 
    public String[] listConnectionIDs() throws Exception
    {
-      return server.getHornetQServerControl().listConnectionIDs();
+      return server.getActiveMQServerControl().listConnectionIDs();
    }
 
    public String[] listSessions(final String connectionID) throws Exception
    {
       checkInitialised();
-      return server.getHornetQServerControl().listSessions(connectionID);
+      return server.getActiveMQServerControl().listSessions(connectionID);
    }
 
    public String listPreparedTransactionDetailsAsJSON() throws Exception
@@ -1797,7 +1797,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
                }
                catch (Exception e)
                {
-                  HornetQJMSServerLogger.LOGGER.jndiUnbindError(e, key);
+                  ActiveMQJMSServerLogger.LOGGER.jndiUnbindError(e, key);
                }
             }
          }
@@ -1924,7 +1924,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       }
       else
       {
-         HornetQJMSServerLogger.LOGGER.serverCachingCommand(runnable);
+         ActiveMQJMSServerLogger.LOGGER.serverCachingCommand(runnable);
          cachedCommands.add(runnable);
          return false;
       }
@@ -1940,7 +1940,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          }
          catch (Exception e)
          {
-            HornetQJMSServerLogger.LOGGER.jmsServerError(e);
+            ActiveMQJMSServerLogger.LOGGER.jmsServerError(e);
          }
       }
 
@@ -1958,12 +1958,12 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          try
          {
             String newHost = InetAddress.getLocalHost().getHostName();
-            HornetQJMSServerLogger.LOGGER.invalidHostForConnector(transportConfiguration.getName(), newHost);
+            ActiveMQJMSServerLogger.LOGGER.invalidHostForConnector(transportConfiguration.getName(), newHost);
             params.put(TransportConstants.HOST_PROP_NAME, newHost);
          }
          catch (UnknownHostException e)
          {
-            HornetQJMSServerLogger.LOGGER.failedToCorrectHost(e, transportConfiguration.getName());
+            ActiveMQJMSServerLogger.LOGGER.failedToCorrectHost(e, transportConfiguration.getName());
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/StandaloneNamingServer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/StandaloneNamingServer.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/StandaloneNamingServer.java
index 2652990..c060b93 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/StandaloneNamingServer.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/impl/StandaloneNamingServer.java
@@ -17,9 +17,9 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 import org.apache.activemq.core.server.ActivateCallback;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.jnp.server.Main;
 import org.jnp.server.NamingBeanImpl;
 
@@ -30,11 +30,11 @@ import org.jnp.server.NamingBeanImpl;
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  *         11/8/12
  */
-public class StandaloneNamingServer implements HornetQComponent
+public class StandaloneNamingServer implements ActiveMQComponent
 {
    private Main jndiServer;
 
-   private HornetQServer server;
+   private ActiveMQServer server;
 
    private NamingBeanImpl namingBean;
 
@@ -48,7 +48,7 @@ public class StandaloneNamingServer implements HornetQComponent
 
    private ExecutorService executor;
 
-   public StandaloneNamingServer(HornetQServer server)
+   public StandaloneNamingServer(ActiveMQServer server)
    {
       this.server = server;
    }
@@ -117,7 +117,7 @@ public class StandaloneNamingServer implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.unableToStartNamingServer(e);
+            ActiveMQServerLogger.LOGGER.unableToStartNamingServer(e);
          }
 
          activated = true;
@@ -144,7 +144,7 @@ public class StandaloneNamingServer implements HornetQComponent
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.unableToStopNamingServer(e);
+               ActiveMQServerLogger.LOGGER.unableToStopNamingServer(e);
             }
          }
          if (namingBean != null)


[02/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionBridge.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionBridge.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionBridge.java
index 9d43f58..e86a22f 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionBridge.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionBridge.java
@@ -35,12 +35,12 @@ import org.apache.activemq.core.filter.Filter;
 import org.apache.activemq.core.message.impl.MessageImpl;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.BindingType;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.cluster.ClusterConnection;
 import org.apache.activemq.core.server.cluster.ClusterManager;
-import org.apache.activemq.core.server.cluster.HornetQServerSideProtocolManagerFactory;
+import org.apache.activemq.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.core.server.cluster.MessageFlowRecord;
 import org.apache.activemq.core.server.cluster.Transformer;
 import org.apache.activemq.utils.UUID;
@@ -139,9 +139,9 @@ public class ClusterConnectionBridge extends BridgeImpl
       // we need to disable DLQ check on the clustered bridges
       queue.setInternalQueue(true);
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("Setting up bridge between " + clusterConnection.getConnector() + " and " + targetLocator,
+         ActiveMQServerLogger.LOGGER.trace("Setting up bridge between " + clusterConnection.getConnector() + " and " + targetLocator,
                                           new Exception("trace"));
       }
    }
@@ -149,13 +149,13 @@ public class ClusterConnectionBridge extends BridgeImpl
    @Override
    protected ClientSessionFactoryInternal createSessionFactory() throws Exception
    {
-      serverLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+      serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
       ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) serverLocator.createSessionFactory(targetNodeID);
       setSessionFactory(factory);
 
       if (factory == null)
       {
-         HornetQServerLogger.LOGGER.nodeNotAvailable(targetNodeID);
+         ActiveMQServerLogger.LOGGER.nodeNotAvailable(targetNodeID);
          return null;
       }
       factory.setReconnectAttempts(0);
@@ -173,9 +173,9 @@ public class ClusterConnectionBridge extends BridgeImpl
       // Note we must copy since same message may get routed to other nodes which require different headers
       ServerMessage messageCopy = message.copy();
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("Clustered bridge  copied message " + message + " as " + messageCopy + " before delivery");
+         ActiveMQServerLogger.LOGGER.trace("Clustered bridge  copied message " + message + " as " + messageCopy + " before delivery");
       }
 
       // TODO - we can optimise this
@@ -187,7 +187,7 @@ public class ClusterConnectionBridge extends BridgeImpl
       if (queueIds == null)
       {
          // Sanity check only
-         HornetQServerLogger.LOGGER.noQueueIdDefined(message, messageCopy, idsHeaderName);
+         ActiveMQServerLogger.LOGGER.noQueueIdDefined(message, messageCopy, idsHeaderName);
          throw new IllegalStateException("no queueIDs defined");
       }
 
@@ -208,9 +208,9 @@ public class ClusterConnectionBridge extends BridgeImpl
 
    private void setupNotificationConsumer() throws Exception
    {
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Setting up notificationConsumer between " + this.clusterConnection.getConnector() +
+         ActiveMQServerLogger.LOGGER.debug("Setting up notificationConsumer between " + this.clusterConnection.getConnector() +
                                              " and " +
                                              flowRecord.getBridge().getForwardingConnection() +
                                              " clusterConnection = " +
@@ -226,7 +226,7 @@ public class ClusterConnectionBridge extends BridgeImpl
          {
             try
             {
-               HornetQServerLogger.LOGGER.debug("Closing notification Consumer for reopening " + notifConsumer +
+               ActiveMQServerLogger.LOGGER.debug("Closing notification Consumer for reopening " + notifConsumer +
                                                    " on bridge " +
                                                    this.getName());
                notifConsumer.close();
@@ -235,7 +235,7 @@ public class ClusterConnectionBridge extends BridgeImpl
             }
             catch (ActiveMQException e)
             {
-               HornetQServerLogger.LOGGER.errorClosingConsumer(e);
+               ActiveMQServerLogger.LOGGER.errorClosingConsumer(e);
             }
          }
 
@@ -282,9 +282,9 @@ public class ClusterConnectionBridge extends BridgeImpl
          session.start();
 
          ClientMessage message = session.createMessage(false);
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace("Requesting sendQueueInfoToQueue through " + this, new Exception("trace"));
+            ActiveMQServerLogger.LOGGER.trace("Requesting sendQueueInfoToQueue through " + this, new Exception("trace"));
          }
          ManagementHelper.putOperationInvocation(message,
                                                  ResourceNames.CORE_SERVER,
@@ -294,9 +294,9 @@ public class ClusterConnectionBridge extends BridgeImpl
 
          ClientProducer prod = session.createProducer(managementAddress);
 
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug("Cluster connetion bridge on " + clusterConnection + " requesting information on queues");
+            ActiveMQServerLogger.LOGGER.debug("Cluster connetion bridge on " + clusterConnection + " requesting information on queues");
          }
 
          prod.send(message);
@@ -392,12 +392,12 @@ public class ClusterConnectionBridge extends BridgeImpl
    @Override
    protected void fail(final boolean permanently)
    {
-      HornetQServerLogger.LOGGER.debug("Cluster Bridge " + this.getName() + " failed, permanently=" + permanently);
+      ActiveMQServerLogger.LOGGER.debug("Cluster Bridge " + this.getName() + " failed, permanently=" + permanently);
       super.fail(permanently);
 
       if (permanently)
       {
-         HornetQServerLogger.LOGGER.debug("cluster node for bridge " + this.getName() + " is permanently down");
+         ActiveMQServerLogger.LOGGER.debug("cluster node for bridge " + this.getName() + " is permanently down");
          clusterConnection.removeRecord(targetNodeID);
       }
       else

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionImpl.java
index eb13e7e..0755f52 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -45,9 +45,9 @@ import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.Bindings;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.postoffice.impl.PostOfficeImpl;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.NodeManager;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.cluster.Bridge;
@@ -55,7 +55,7 @@ import org.apache.activemq.core.server.cluster.ClusterConnection;
 import org.apache.activemq.core.server.cluster.ClusterControl;
 import org.apache.activemq.core.server.cluster.ClusterManager;
 import org.apache.activemq.core.server.cluster.ClusterManager.IncomingInterceptorLookingForExceptionMessage;
-import org.apache.activemq.core.server.cluster.HornetQServerSideProtocolManagerFactory;
+import org.apache.activemq.core.server.cluster.ActiveMQServerSideProtocolManagerFactory;
 import org.apache.activemq.core.server.cluster.MessageFlowRecord;
 import org.apache.activemq.core.server.cluster.RemoteQueueBinding;
 import org.apache.activemq.core.server.group.impl.Proposal;
@@ -75,13 +75,13 @@ import org.apache.activemq.utils.TypedProperties;
  */
 public final class ClusterConnectionImpl implements ClusterConnection, AfterConnectInternalListener
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final ExecutorFactory executorFactory;
 
    private final Executor executor;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final PostOffice postOffice;
 
@@ -182,7 +182,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
                                 final boolean routeWhenNoConsumers,
                                 final int confirmationWindowSize,
                                 final ExecutorFactory executorFactory,
-                                final HornetQServer server,
+                                final ActiveMQServer server,
                                 final PostOffice postOffice,
                                 final ManagementService managementService,
                                 final ScheduledExecutorService scheduledExecutor,
@@ -289,7 +289,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
                                 final boolean routeWhenNoConsumers,
                                 final int confirmationWindowSize,
                                 final ExecutorFactory executorFactory,
-                                final HornetQServer server,
+                                final ActiveMQServer server,
                                 final PostOffice postOffice,
                                 final ManagementService managementService,
                                 final ScheduledExecutorService scheduledExecutor,
@@ -399,9 +399,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          return;
       }
       stopping = true;
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug(this + "::stopping ClusterConnection");
+         ActiveMQServerLogger.LOGGER.debug(this + "::stopping ClusterConnection");
       }
 
       if (serverLocator != null)
@@ -409,7 +409,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          serverLocator.removeClusterTopologyListener(this);
       }
 
-      HornetQServerLogger.LOGGER.debug("Cluster connection being stopped for node" + nodeManager.getNodeId() +
+      ActiveMQServerLogger.LOGGER.debug("Cluster connection being stopped for node" + nodeManager.getNodeId() +
                                           ", server = " +
                                           this.server +
                                           " serverLocator = " +
@@ -490,9 +490,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
                              final Pair<TransportConfiguration, TransportConfiguration> connectorPair,
                              final boolean backup)
    {
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug(this + "::NodeAnnounced, backup=" + backup + nodeID + connectorPair);
+         ActiveMQServerLogger.LOGGER.debug(this + "::NodeAnnounced, backup=" + backup + nodeID + connectorPair);
       }
 
       TransportConfiguration live = connectorPair.getA();
@@ -528,12 +528,12 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          }
          catch (ActiveMQException e)
          {
-            HornetQServerLogger.LOGGER.clusterControlAuthfailure();
+            ActiveMQServerLogger.LOGGER.clusterControlAuthfailure();
          }
       }
       else
       {
-         HornetQServerLogger.LOGGER.noLocalMemborOnClusterConnection(this);
+         ActiveMQServerLogger.LOGGER.noLocalMemborOnClusterConnection(this);
       }
 
       // TODO: shouldn't we send the current time here? and change the current topology?
@@ -559,7 +559,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
       return nodeManager.getNodeId().toString();
    }
 
-   public HornetQServer getServer()
+   public ActiveMQServer getServer()
    {
       return server;
    }
@@ -598,9 +598,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          return;
       }
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Activating cluster connection nodeID=" + nodeManager.getNodeId() + " for server=" + this.server);
+         ActiveMQServerLogger.LOGGER.debug("Activating cluster connection nodeID=" + nodeManager.getNodeId() + " for server=" + this.server);
       }
 
       liveNotifier = new LiveNotifier();
@@ -614,7 +614,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
          if (!useDuplicateDetection)
          {
-            HornetQServerLogger.LOGGER.debug("DuplicateDetection is disabled, sending clustered messages blocked");
+            ActiveMQServerLogger.LOGGER.debug("DuplicateDetection is disabled, sending clustered messages blocked");
          }
 
          final TopologyMember currentMember = topology.getMember(manager.getNodeId());
@@ -649,7 +649,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
          serverLocator.setAfterConnectionInternalListener(this);
 
-         serverLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+         serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
 
          serverLocator.start(server.getExecutorFactory().getExecutor());
       }
@@ -661,7 +661,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          Notification notification = new Notification(nodeManager.getNodeId().toString(),
                                                       CoreNotificationType.CLUSTER_CONNECTION_STARTED,
                                                       props);
-         HornetQServerLogger.LOGGER.debug("sending notification: " + notification);
+         ActiveMQServerLogger.LOGGER.debug("sending notification: " + notification);
          managementService.sendNotification(notification);
       }
       //we add as a listener after we have sent the cluster start notif as the listener may start sending notifs before
@@ -691,18 +691,18 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          return;
       }
       final String nodeID = topologyMember.getNodeId();
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
          String ClusterTestBase = "receiving nodeUP for nodeID=";
-         HornetQServerLogger.LOGGER.debug(this + ClusterTestBase + nodeID + " connectionPair=" + topologyMember);
+         ActiveMQServerLogger.LOGGER.debug(this + ClusterTestBase + nodeID + " connectionPair=" + topologyMember);
       }
       // discard notifications about ourselves unless its from our backup
 
       if (nodeID.equals(nodeManager.getNodeId().toString()))
       {
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace(this + "::informing about backup to itself, nodeUUID=" +
+            ActiveMQServerLogger.LOGGER.trace(this + "::informing about backup to itself, nodeUUID=" +
                                                 nodeManager.getNodeId() + ", connectorPair=" + topologyMember + ", this = " + this);
          }
          return;
@@ -725,7 +725,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
       {
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace(this + " ignoring call with nodeID=" + nodeID + ", topologyMember=" +
+            ActiveMQServerLogger.LOGGER.trace(this + " ignoring call with nodeID=" + nodeID + ", topologyMember=" +
                                                 topologyMember + ", last=" + last);
          }
          return;
@@ -739,9 +739,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
             if (record == null)
             {
-               if (HornetQServerLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                {
-                  HornetQServerLogger.LOGGER.debug(this + "::Creating record for nodeID=" + nodeID + ", topologyMember=" +
+                  ActiveMQServerLogger.LOGGER.debug(this + "::Creating record for nodeID=" + nodeID + ", topologyMember=" +
                                                       topologyMember);
                }
 
@@ -774,14 +774,14 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
             {
                if (isTrace)
                {
-                  HornetQServerLogger.LOGGER.trace(this + " ignored nodeUp record for " + topologyMember + " on nodeID=" +
+                  ActiveMQServerLogger.LOGGER.trace(this + " ignored nodeUp record for " + topologyMember + " on nodeID=" +
                                                       nodeID + " as the record already existed");
                }
             }
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorUpdatingTopology(e);
+            ActiveMQServerLogger.LOGGER.errorUpdatingTopology(e);
          }
       }
    }
@@ -842,7 +842,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       targetLocator.setAfterConnectionInternalListener(this);
 
-      serverLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+      serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
 
       targetLocator.setNodeID(nodeId);
 
@@ -893,9 +893,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       targetLocator.setIdentity("(Cluster-connection-bridge::" + bridge.toString() + "::" + this.toString() + ")");
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("creating record between " + this.connector + " and " + connector + bridge);
+         ActiveMQServerLogger.LOGGER.debug("creating record between " + this.connector + " and " + connector + bridge);
       }
 
       record.setBridge(bridge);
@@ -1032,7 +1032,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
       {
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Stopping bridge " + bridge);
+            ActiveMQServerLogger.LOGGER.trace("Stopping bridge " + bridge);
          }
 
          isClosed = true;
@@ -1063,7 +1063,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
                }
                catch (Exception ignored)
                {
-                  HornetQServerLogger.LOGGER.debug(ignored.getMessage(), ignored);
+                  ActiveMQServerLogger.LOGGER.debug(ignored.getMessage(), ignored);
                }
             }
          });
@@ -1091,9 +1091,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       public synchronized void onMessage(final ClientMessage message)
       {
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug("ClusterCommunication::Flow record on " + clusterConnector + " Receiving message " + message);
+            ActiveMQServerLogger.LOGGER.debug("ClusterCommunication::Flow record on " + clusterConnector + " Receiving message " + message);
          }
          try
          {
@@ -1112,7 +1112,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
             if (!reset)
             {
-               HornetQServerLogger.LOGGER.debug("Notification being ignored since first reset wasn't received yet: " + message);
+               ActiveMQServerLogger.LOGGER.debug("Notification being ignored since first reset wasn't received yet: " + message);
                return;
             }
 
@@ -1120,7 +1120,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorHandlingMessage(e);
+            ActiveMQServerLogger.LOGGER.errorHandlingMessage(e);
          }
       }
 
@@ -1176,7 +1176,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
             }
             default:
             {
-               throw HornetQMessageBundle.BUNDLE.invalidType(ntype);
+               throw ActiveMQMessageBundle.BUNDLE.invalidType(ntype);
             }
          }
       }
@@ -1263,7 +1263,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void clearBindings() throws Exception
       {
-         HornetQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " clearing bindings");
+         ActiveMQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " clearing bindings");
          for (RemoteQueueBinding binding : new HashSet<RemoteQueueBinding>(bindings.values()))
          {
             removeBinding(binding.getClusterName());
@@ -1272,7 +1272,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void resetBindings() throws Exception
       {
-         HornetQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " reset bindings");
+         ActiveMQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " reset bindings");
          for (RemoteQueueBinding binding : new HashSet<>(bindings.values()))
          {
             resetBinding(binding.getClusterName());
@@ -1281,7 +1281,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void clearDisconnectedBindings() throws Exception
       {
-         HornetQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " reset bindings");
+         ActiveMQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " reset bindings");
          for (RemoteQueueBinding binding : new HashSet<>(bindings.values()))
          {
             if (!binding.isConnected())
@@ -1294,7 +1294,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       public synchronized void disconnectBindings() throws Exception
       {
-         HornetQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " disconnect bindings");
+         ActiveMQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + " disconnect bindings");
          reset = false;
          for (RemoteQueueBinding binding : new HashSet<>(bindings.values()))
          {
@@ -1304,9 +1304,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void doBindingAdded(final ClientMessage message) throws Exception
       {
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Adding binding " + message);
+            ActiveMQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Adding binding " + message);
          }
          if (!message.containsProperty(ManagementHelper.HDR_DISTANCE))
          {
@@ -1358,7 +1358,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
             // hops is too high
             // or there are multiple cluster connections for the same address
 
-            HornetQServerLogger.LOGGER.remoteQueueAlreadyBoundOnClusterConnection(this, clusterName);
+            ActiveMQServerLogger.LOGGER.remoteQueueAlreadyBoundOnClusterConnection(this, clusterName);
 
             return;
          }
@@ -1375,7 +1375,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Adding binding " + clusterName + " into " + ClusterConnectionImpl.this);
+            ActiveMQServerLogger.LOGGER.trace("Adding binding " + clusterName + " into " + ClusterConnectionImpl.this);
          }
 
          bindings.put(clusterName, binding);
@@ -1396,9 +1396,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private void doBindingRemoved(final ClientMessage message) throws Exception
       {
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Removing binding " + message);
+            ActiveMQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Removing binding " + message);
          }
          if (!message.containsProperty(ManagementHelper.HDR_CLUSTER_NAME))
          {
@@ -1447,9 +1447,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void doConsumerCreated(final ClientMessage message) throws Exception
       {
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Consumer created " + message);
+            ActiveMQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Consumer created " + message);
          }
          if (!message.containsProperty(ManagementHelper.HDR_DISTANCE))
          {
@@ -1507,9 +1507,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       private synchronized void doConsumerClosed(final ClientMessage message) throws Exception
       {
-         if (HornetQServerLogger.LOGGER.isTraceEnabled())
+         if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
          {
-            HornetQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Consumer closed " + message);
+            ActiveMQServerLogger.LOGGER.trace(ClusterConnectionImpl.this + " Consumer closed " + message);
          }
          if (!message.containsProperty(ManagementHelper.HDR_DISTANCE))
          {
@@ -1621,9 +1621,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
       {
          if (tcConfigs != null && tcConfigs.length > 0)
          {
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + "Creating a serverLocator for " + Arrays.toString(tcConfigs));
+               ActiveMQServerLogger.LOGGER.debug(ClusterConnectionImpl.this + "Creating a serverLocator for " + Arrays.toString(tcConfigs));
             }
             ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, tcConfigs);
             locator.setClusterConnection(true);
@@ -1664,7 +1664,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
    @Override
    public void removeRecord(String targetNodeID)
    {
-      HornetQServerLogger.LOGGER.debug("Removing record for: " + targetNodeID);
+      ActiveMQServerLogger.LOGGER.debug("Removing record for: " + targetNodeID);
       MessageFlowRecord record = records.remove(targetNodeID);
       try
       {
@@ -1679,7 +1679,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
    @Override
    public void disconnectRecord(String targetNodeID)
    {
-      HornetQServerLogger.LOGGER.debug("Disconnecting record for: " + targetNodeID);
+      ActiveMQServerLogger.LOGGER.debug("Disconnecting record for: " + targetNodeID);
       MessageFlowRecord record = records.get(targetNodeID);
       try
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/Redistributor.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/Redistributor.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/Redistributor.java
index 1826cd7..e356162 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/Redistributor.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/Redistributor.java
@@ -24,7 +24,7 @@ import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.server.Consumer;
 import org.apache.activemq.core.server.HandleStatus;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.RoutingContext;
@@ -112,7 +112,7 @@ public class Redistributor implements Consumer
 
       if (!ok)
       {
-         HornetQServerLogger.LOGGER.errorStoppingRedistributor();
+         ActiveMQServerLogger.LOGGER.errorStoppingRedistributor();
       }
    }
 
@@ -137,7 +137,7 @@ public class Redistributor implements Consumer
       }
       catch (InterruptedException e)
       {
-         HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+         ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
          return false;
       }
    }
@@ -206,7 +206,7 @@ public class Redistributor implements Consumer
                      // Nothing much we can do now
 
                      // TODO log
-                     HornetQServerLogger.LOGGER.warn(e2.getMessage(), e2);
+                     ActiveMQServerLogger.LOGGER.warn(e2.getMessage(), e2);
                   }
                }
             }
@@ -255,7 +255,7 @@ public class Redistributor implements Consumer
 
          public void onError(final int errorCode, final String errorMessage)
          {
-            HornetQServerLogger.LOGGER.ioErrorRedistributing(errorCode, errorMessage);
+            ActiveMQServerLogger.LOGGER.ioErrorRedistributing(errorCode, errorMessage);
          }
 
          public void done()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/RemoteQueueBindingImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/RemoteQueueBindingImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/RemoteQueueBindingImpl.java
index 77032e0..d218e42 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/RemoteQueueBindingImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/RemoteQueueBindingImpl.java
@@ -25,7 +25,7 @@ import org.apache.activemq.core.filter.impl.FilterImpl;
 import org.apache.activemq.core.message.impl.MessageImpl;
 import org.apache.activemq.core.postoffice.BindingType;
 import org.apache.activemq.core.server.Bindable;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.RoutingContext;
 import org.apache.activemq.core.server.ServerMessage;
@@ -370,9 +370,9 @@ public class RemoteQueueBindingImpl implements RemoteQueueBinding
 
       message.putBytesProperty(idsHeaderName, ids);
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("Adding remoteQueue ID = " + remoteQueueID + " into message=" + message + " store-forward-queue=" + storeAndForwardQueue);
+         ActiveMQServerLogger.LOGGER.trace("Adding remoteQueue ID = " + remoteQueueID + " into message=" + message + " store-forward-queue=" + storeAndForwardQueue);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/QuorumManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/QuorumManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/QuorumManager.java
index 1ac2475..b52f8e8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/QuorumManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/QuorumManager.java
@@ -23,7 +23,7 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
 import org.apache.activemq.api.core.client.TopologyMember;
 import org.apache.activemq.core.client.impl.TopologyMemberImpl;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.cluster.ClusterControl;
 import org.apache.activemq.core.server.cluster.ClusterController;
 
@@ -32,7 +32,7 @@ import org.apache.activemq.core.server.cluster.ClusterController;
  * about changes to the cluster. A {@link org.apache.activemq.core.server.cluster.qourum.Quorum} can then issue a vote to the
  * remaining nodes in a cluster for a specific outcome
  */
-public final class QuorumManager implements ClusterTopologyListener, HornetQComponent
+public final class QuorumManager implements ClusterTopologyListener, ActiveMQComponent
 {
    private final ExecutorService executor;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/SharedNothingBackupQuorum.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/SharedNothingBackupQuorum.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/SharedNothingBackupQuorum.java
index 2285b5a..05dee26 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/SharedNothingBackupQuorum.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/qourum/SharedNothingBackupQuorum.java
@@ -25,7 +25,7 @@ import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationLiveIsStoppingMessage;
 import org.apache.activemq.core.remoting.FailureListener;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.NodeManager;
 
 /**
@@ -108,7 +108,7 @@ public class SharedNothingBackupQuorum implements Quorum, FailureListener
             catch (ActiveMQException e)
             {
                if (e.getType() != ActiveMQExceptionType.NOT_CONNECTED)
-                  HornetQServerLogger.LOGGER.errorReConnecting(e);
+                  ActiveMQServerLogger.LOGGER.errorReConnecting(e);
             }
          }
          // live is assumed to be down, backup fails-over

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedActiveMQ.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedActiveMQ.java b/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedActiveMQ.java
new file mode 100644
index 0000000..313ae71
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedActiveMQ.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.server.embedded;
+
+import javax.management.MBeanServer;
+
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.config.impl.FileConfiguration;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl;
+
+/**
+ * Helper class to simplify bootstrap of ActiveMQ server.  Bootstraps from classpath-based config files.
+ *
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class EmbeddedActiveMQ
+{
+   protected ActiveMQSecurityManager securityManager;
+   protected String configResourcePath = null;
+   protected Configuration configuration;
+   protected ActiveMQServer activeMQServer;
+   protected MBeanServer mbeanServer;
+
+   /**
+    * Classpath resource for activemq server config.  Defaults to 'activemq-configuration.xml'.
+    *
+    * @param filename
+    */
+   public void setConfigResourcePath(String filename)
+   {
+      configResourcePath = filename;
+   }
+
+   /**
+    * Set the activemq security manager.  This defaults to org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl
+    *
+    * @param securityManager
+    */
+   public void setSecurityManager(ActiveMQSecurityManager securityManager)
+   {
+      this.securityManager = securityManager;
+   }
+
+   /**
+    * Use this mbean server to register management beans.  If not set, no mbeans will be registered.
+    *
+    * @param mbeanServer
+    */
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+
+   /**
+    * Set this object if you are not using file-based configuration.  The default implementation will load
+    * configuration from a file.
+    *
+    * @param configuration
+    */
+   public void setConfiguration(Configuration configuration)
+   {
+      this.configuration = configuration;
+   }
+
+   public ActiveMQServer getActiveMQServer()
+   {
+      return activeMQServer;
+   }
+
+   public void start() throws Exception
+   {
+      initStart();
+      activeMQServer.start();
+
+   }
+
+   protected void initStart() throws Exception
+   {
+      if (configuration == null)
+      {
+         if (configResourcePath == null) configResourcePath = "activemq-configuration.xml";
+         FileConfiguration config = new FileConfiguration(configResourcePath);
+         config.start();
+         configuration = config;
+      }
+      if (securityManager == null)
+      {
+         securityManager = new ActiveMQSecurityManagerImpl();
+      }
+      if (mbeanServer == null)
+      {
+         activeMQServer = new ActiveMQServerImpl(configuration, securityManager);
+      }
+      else
+      {
+         activeMQServer = new ActiveMQServerImpl(configuration, mbeanServer, securityManager);
+      }
+   }
+
+   public void stop() throws Exception
+   {
+      activeMQServer.stop();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedHornetQ.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedHornetQ.java b/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedHornetQ.java
deleted file mode 100644
index bd9acde..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/embedded/EmbeddedHornetQ.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.server.embedded;
-
-import javax.management.MBeanServer;
-
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.config.impl.FileConfiguration;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
-import org.apache.activemq.spi.core.security.HornetQSecurityManagerImpl;
-
-/**
- * Helper class to simplify bootstrap of HornetQ server.  Bootstraps from classpath-based config files.
- *
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class EmbeddedHornetQ
-{
-   protected HornetQSecurityManager securityManager;
-   protected String configResourcePath = null;
-   protected Configuration configuration;
-   protected HornetQServer hornetQServer;
-   protected MBeanServer mbeanServer;
-
-   /**
-    * Classpath resource for hornetq server config.  Defaults to 'activemq-configuration.xml'.
-    *
-    * @param filename
-    */
-   public void setConfigResourcePath(String filename)
-   {
-      configResourcePath = filename;
-   }
-
-   /**
-    * Set the hornetq security manager.  This defaults to org.apache.activemq.spi.core.security.HornetQSecurityManagerImpl
-    *
-    * @param securityManager
-    */
-   public void setSecurityManager(HornetQSecurityManager securityManager)
-   {
-      this.securityManager = securityManager;
-   }
-
-   /**
-    * Use this mbean server to register management beans.  If not set, no mbeans will be registered.
-    *
-    * @param mbeanServer
-    */
-   public void setMbeanServer(MBeanServer mbeanServer)
-   {
-      this.mbeanServer = mbeanServer;
-   }
-
-   /**
-    * Set this object if you are not using file-based configuration.  The default implementation will load
-    * configuration from a file.
-    *
-    * @param configuration
-    */
-   public void setConfiguration(Configuration configuration)
-   {
-      this.configuration = configuration;
-   }
-
-   public HornetQServer getHornetQServer()
-   {
-      return hornetQServer;
-   }
-
-   public void start() throws Exception
-   {
-      initStart();
-      hornetQServer.start();
-
-   }
-
-   protected void initStart() throws Exception
-   {
-      if (configuration == null)
-      {
-         if (configResourcePath == null) configResourcePath = "activemq-configuration.xml";
-         FileConfiguration config = new FileConfiguration(configResourcePath);
-         config.start();
-         configuration = config;
-      }
-      if (securityManager == null)
-      {
-         securityManager = new HornetQSecurityManagerImpl();
-      }
-      if (mbeanServer == null)
-      {
-         hornetQServer = new HornetQServerImpl(configuration, securityManager);
-      }
-      else
-      {
-         hornetQServer = new HornetQServerImpl(configuration, mbeanServer, securityManager);
-      }
-   }
-
-   public void stop() throws Exception
-   {
-      hornetQServer.stop();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/group/GroupingHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/group/GroupingHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/server/group/GroupingHandler.java
index d840f72..418e6a6 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/group/GroupingHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/group/GroupingHandler.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.server.group;
 
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.group.impl.GroupBinding;
 import org.apache.activemq.core.server.group.impl.Proposal;
 import org.apache.activemq.core.server.group.impl.Response;
@@ -22,7 +22,7 @@ import org.apache.activemq.core.server.management.NotificationListener;
 /**
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  */
-public interface GroupingHandler extends NotificationListener, HornetQComponent
+public interface GroupingHandler extends NotificationListener, ActiveMQComponent
 {
    // this method should maintain a WeakHash list, no need to remove the elements
    void addListener(UnproposalListener listener);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/GroupHandlingAbstract.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/GroupHandlingAbstract.java b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/GroupHandlingAbstract.java
index 8dd9be9..a92190f 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/GroupHandlingAbstract.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/GroupHandlingAbstract.java
@@ -22,7 +22,7 @@ import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.management.CoreNotificationType;
 import org.apache.activemq.api.core.management.ManagementHelper;
 import org.apache.activemq.core.postoffice.BindingType;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.group.GroupingHandler;
 import org.apache.activemq.core.server.group.UnproposalListener;
 import org.apache.activemq.core.server.management.ManagementService;
@@ -117,7 +117,7 @@ public abstract class GroupHandlingAbstract implements GroupingHandler
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.errorHandlingMessage(e);
+         ActiveMQServerLogger.LOGGER.errorHandlingMessage(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/LocalGroupingHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/LocalGroupingHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/LocalGroupingHandler.java
index 1e62b03..d8763dc 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/LocalGroupingHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/LocalGroupingHandler.java
@@ -31,7 +31,7 @@ import org.apache.activemq.api.core.management.ManagementHelper;
 import org.apache.activemq.core.persistence.OperationContext;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.BindingType;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.management.ManagementService;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.utils.ExecutorFactory;
@@ -200,7 +200,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
 
    public Response receive(final Proposal proposal, final int distance) throws Exception
    {
-      HornetQServerLogger.LOGGER.trace("received proposal " + proposal);
+      ActiveMQServerLogger.LOGGER.trace("received proposal " + proposal);
       return propose(proposal);
    }
 
@@ -251,7 +251,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
          catch (Exception e)
          {
             // nothing we can do being log
-            HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
          }
       }
    }
@@ -287,12 +287,12 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
 
             if (expectedBindings.size() > 0)
             {
-               HornetQServerLogger.LOGGER.debug("Waiting remote group bindings to arrive before starting the server. timeout=" + timeout + " milliseconds");
+               ActiveMQServerLogger.LOGGER.debug("Waiting remote group bindings to arrive before starting the server. timeout=" + timeout + " milliseconds");
                //now we wait here for the rest to be received in onNotification, it will signal once all have been received.
                //if we arent signaled then bindingsAdded still has some groupids we need to remove.
                if (!awaitCondition.await(timeout, TimeUnit.MILLISECONDS))
                {
-                  HornetQServerLogger.LOGGER.remoteGroupCoordinatorsNotStarted();
+                  ActiveMQServerLogger.LOGGER.remoteGroupCoordinatorsNotStarted();
                }
 
             }
@@ -330,24 +330,24 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
                {
                   if (expectedBindings.remove(clusterName))
                   {
-                     HornetQServerLogger.LOGGER.debug("OnNotification for waitForbindings::Removed clusterName=" + clusterName + " from lis succesffully");
+                     ActiveMQServerLogger.LOGGER.debug("OnNotification for waitForbindings::Removed clusterName=" + clusterName + " from lis succesffully");
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.debug("OnNotification for waitForbindings::Couldn't remove clusterName=" + clusterName + " as it wasn't on the original list");
+                     ActiveMQServerLogger.LOGGER.debug("OnNotification for waitForbindings::Couldn't remove clusterName=" + clusterName + " as it wasn't on the original list");
                   }
                }
                else
                {
                   expectedBindings.add(clusterName);
-                  HornetQServerLogger.LOGGER.debug("Notification for waitForbindings::Adding previously known item clusterName=" + clusterName);
+                  ActiveMQServerLogger.LOGGER.debug("Notification for waitForbindings::Adding previously known item clusterName=" + clusterName);
                }
 
-               if (HornetQServerLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                {
                   for (SimpleString stillWaiting : expectedBindings)
                   {
-                     HornetQServerLogger.LOGGER.debug("Notification for waitForbindings::Still waiting for clusterName=" + stillWaiting);
+                     ActiveMQServerLogger.LOGGER.debug("Notification for waitForbindings::Still waiting for clusterName=" + stillWaiting);
                   }
                }
 
@@ -435,7 +435,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
                      }
                      catch (Exception e)
                      {
-                        HornetQServerLogger.LOGGER.unableToDeleteGroupBindings(e, val.getGroupId());
+                        ActiveMQServerLogger.LOGGER.unableToDeleteGroupBindings(e, val.getGroupId());
                      }
                   }
                }
@@ -449,7 +449,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
                   }
                   catch (Exception e)
                   {
-                     HornetQServerLogger.LOGGER.unableToDeleteGroupBindings(e, SimpleString.toSimpleString("TX:" + txID));
+                     ActiveMQServerLogger.LOGGER.unableToDeleteGroupBindings(e, SimpleString.toSimpleString("TX:" + txID));
                   }
                }
             }
@@ -512,7 +512,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
                   }
                   catch (Exception e)
                   {
-                     HornetQServerLogger.LOGGER.unableToDeleteGroupBindings(e, groupBinding.getGroupId());
+                     ActiveMQServerLogger.LOGGER.unableToDeleteGroupBindings(e, groupBinding.getGroupId());
                   }
                }
             }
@@ -525,7 +525,7 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.unableToDeleteGroupBindings(e, SimpleString.toSimpleString("TX:" + txID));
+                  ActiveMQServerLogger.LOGGER.unableToDeleteGroupBindings(e, SimpleString.toSimpleString("TX:" + txID));
                }
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/RemoteGroupingHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/RemoteGroupingHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/RemoteGroupingHandler.java
index bcd76a4..02ca7a2 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/RemoteGroupingHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/group/impl/RemoteGroupingHandler.java
@@ -26,8 +26,8 @@ import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.management.CoreNotificationType;
 import org.apache.activemq.api.core.management.ManagementHelper;
 import org.apache.activemq.core.postoffice.BindingType;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.management.ManagementService;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.utils.ConcurrentHashSet;
@@ -141,7 +141,7 @@ public final class RemoteGroupingHandler extends GroupHandlingAbstract
 
       if (!started)
       {
-         throw HornetQMessageBundle.BUNDLE.groupWhileStopping();
+         throw ActiveMQMessageBundle.BUNDLE.groupWhileStopping();
       }
 
       Notification notification = null;
@@ -183,7 +183,7 @@ public final class RemoteGroupingHandler extends GroupHandlingAbstract
       }
       if (response == null)
       {
-         HornetQServerLogger.LOGGER.groupHandlerSendTimeout();
+         ActiveMQServerLogger.LOGGER.groupHandlerSendTimeout();
       }
       return response;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/impl/AIOFileLockNodeManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/AIOFileLockNodeManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/AIOFileLockNodeManager.java
index 1dfebae..0c614ce 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/AIOFileLockNodeManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/AIOFileLockNodeManager.java
@@ -19,7 +19,7 @@ import java.nio.channels.FileLock;
 import org.apache.activemq.core.asyncio.impl.AsynchronousFileImpl;
 
 /**
- * This is using the HornetQ Libaio Native to perform calls to flock on a Linux system. At the
+ * This is using the ActiveMQ Libaio Native to perform calls to flock on a Linux system. At the
  * current version of RHEL there's a bug on GFS2 and because of that fctl is not functional what
  * will cause issues on Failover over Shared Storage.
  * <p/>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/impl/Activation.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/Activation.java b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/Activation.java
index 4d1e874..bc9347d 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/Activation.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/Activation.java
@@ -21,7 +21,7 @@ import org.apache.activemq.core.protocol.core.Channel;
 import org.apache.activemq.core.protocol.core.ChannelHandler;
 import org.apache.activemq.core.remoting.server.RemotingService;
 import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.NodeManager;
 import org.apache.activemq.core.server.QueueFactory;
 import org.apache.activemq.core.server.cluster.ha.HAManager;
@@ -96,7 +96,7 @@ public abstract class Activation implements Runnable
    /*
    * create the Journal loader needed for this Activation.
    * */
-   public JournalLoader createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, HornetQServer parentServer) throws ActiveMQException
+   public JournalLoader createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, ActiveMQServer parentServer) throws ActiveMQException
    {
       return new PostOfficeJournalLoader(postOffice,
             pagingManager,


[24/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASession.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASession.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASession.java
new file mode 100644
index 0000000..d1cad59
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASession.java
@@ -0,0 +1,1903 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.BytesMessage;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.jms.TransactionInProgressException;
+import javax.jms.XAQueueSession;
+import javax.jms.XATopicSession;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ManagedConnection;
+import javax.transaction.xa.XAResource;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
+import org.apache.activemq.jms.client.ActiveMQSession;
+
+
+/**
+ * A joint interface for JMS sessions
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ */
+public final class ActiveMQRASession implements QueueSession, TopicSession, XAQueueSession, XATopicSession
+{
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The managed connection
+    */
+   private ActiveMQRAManagedConnection mc;
+
+   /**
+    * The connection request info
+    */
+   private final ActiveMQRAConnectionRequestInfo cri;
+
+   /**
+    * The session factory
+    */
+   private ActiveMQRASessionFactory sf;
+
+   /**
+    * The message consumers
+    */
+   private final Set<MessageConsumer> consumers;
+
+   /**
+    * The message producers
+    */
+   private final Set<MessageProducer> producers;
+
+   /**
+    * Constructor
+    *
+    * @param mc  The managed connection
+    * @param cri The connection request info
+    */
+   public ActiveMQRASession(final ActiveMQRAManagedConnection mc, final ActiveMQRAConnectionRequestInfo cri)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mc + ", " + cri + ")");
+      }
+
+      this.mc = mc;
+      this.cri = cri;
+      sf = null;
+      consumers = new HashSet<MessageConsumer>();
+      producers = new HashSet<MessageProducer>();
+   }
+
+   /**
+    * Set the session factory
+    *
+    * @param sf The session factory
+    */
+   public void setActiveMQSessionFactory(final ActiveMQRASessionFactory sf)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setActiveMQSessionFactory(" + sf + ")");
+      }
+
+      this.sf = sf;
+   }
+
+   /**
+    * Lock
+    *
+    * @throws JMSException          Thrown if an error occurs
+    * @throws IllegalStateException The session is closed
+    */
+   protected void lock() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("lock()");
+      }
+
+      final ActiveMQRAManagedConnection mcLocal = this.mc;
+      if (mcLocal != null)
+      {
+         mcLocal.tryLock();
+      }
+      else
+      {
+         throw new IllegalStateException("Connection is not associated with a managed connection. " + this);
+      }
+   }
+
+   /**
+    * Unlock
+    */
+   protected void unlock()
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("unlock()");
+      }
+
+      final ActiveMQRAManagedConnection mcLocal = this.mc;
+      if (mcLocal != null)
+      {
+         mcLocal.unlock();
+      }
+
+      // We recreate the lock when returned to the pool
+      // so missing the unlock after disassociation is not important
+   }
+
+   /**
+    * Create a bytes message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public BytesMessage createBytesMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createBytesMessage" + session);
+      }
+
+      return session.createBytesMessage();
+   }
+
+   /**
+    * Create a map message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MapMessage createMapMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createMapMessage(), " + session);
+      }
+
+      return session.createMapMessage();
+   }
+
+   /**
+    * Create a message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Message createMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createMessage" + session);
+      }
+
+      return session.createMessage();
+   }
+
+   /**
+    * Create an object message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public ObjectMessage createObjectMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createObjectMessage" + session);
+      }
+
+      return session.createObjectMessage();
+   }
+
+   /**
+    * Create an object message
+    *
+    * @param object The object
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public ObjectMessage createObjectMessage(final Serializable object) throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createObjectMessage(" + object + ")" + session);
+      }
+
+      return session.createObjectMessage(object);
+   }
+
+   /**
+    * Create a stream message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public StreamMessage createStreamMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createStreamMessage" + session);
+      }
+
+      return session.createStreamMessage();
+   }
+
+   /**
+    * Create a text message
+    *
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TextMessage createTextMessage() throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTextMessage" + session);
+      }
+
+      return session.createTextMessage();
+   }
+
+   /**
+    * Create a text message
+    *
+    * @param string The text
+    * @return The message
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TextMessage createTextMessage(final String string) throws JMSException
+   {
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTextMessage(" + string + ")" + session);
+      }
+
+      return session.createTextMessage(string);
+   }
+
+   /**
+    * Get transacted
+    *
+    * @return True if transacted; otherwise false
+    * @throws JMSException Thrown if an error occurs
+    */
+   public boolean getTransacted() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTransacted()");
+      }
+
+      getSessionInternal();
+      return cri.isTransacted();
+   }
+
+   /**
+    * Get the message listener -- throws IllegalStateException
+    *
+    * @return The message listener
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MessageListener getMessageListener() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageListener()");
+      }
+
+      throw new IllegalStateException("Method not allowed");
+   }
+
+   /**
+    * Set the message listener -- Throws IllegalStateException
+    *
+    * @param listener The message listener
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setMessageListener(final MessageListener listener) throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setMessageListener(" + listener + ")");
+      }
+
+      throw new IllegalStateException("Method not allowed");
+   }
+
+   /**
+    * Always throws an Error.
+    *
+    * @throws Error Method not allowed.
+    */
+   public void run()
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("run()");
+      }
+
+      throw new Error("Method not allowed");
+   }
+
+   /**
+    * Closes the session. Sends a ConnectionEvent.CONNECTION_CLOSED to the
+    * managed connection.
+    *
+    * @throws JMSException Failed to close session.
+    */
+   public void close() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("close()");
+      }
+
+      sf.closeSession(this);
+      closeSession();
+   }
+
+   /**
+    * Commit
+    *
+    * @throws JMSException Failed to close session.
+    */
+   public void commit() throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new TransactionInProgressException("XA connection");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (cri.isTransacted() == false)
+         {
+            throw new IllegalStateException("Session is not transacted");
+         }
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("Commit session " + this);
+         }
+
+         session.commit();
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Rollback
+    *
+    * @throws JMSException Failed to close session.
+    */
+   public void rollback() throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new TransactionInProgressException("XA connection");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (cri.isTransacted() == false)
+         {
+            throw new IllegalStateException("Session is not transacted");
+         }
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("Rollback session " + this);
+         }
+
+         session.rollback();
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Recover
+    *
+    * @throws JMSException Failed to close session.
+    */
+   public void recover() throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (cri.isTransacted())
+         {
+            throw new IllegalStateException("Session is transacted");
+         }
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("Recover session " + this);
+         }
+
+         session.recover();
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a topic
+    *
+    * @param topicName The topic name
+    * @return The topic
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Topic createTopic(final String topicName) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create topic for javax.jms.QueueSession");
+      }
+
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTopic " + session + " topicName=" + topicName);
+      }
+
+      Topic result = session.createTopic(topicName);
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createdTopic " + session + " topic=" + result);
+      }
+
+      return result;
+   }
+
+   /**
+    * Create a topic subscriber
+    *
+    * @param topic The topic
+    * @return The subscriber
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
+   {
+      lock();
+      try
+      {
+         TopicSession session = getTopicSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSubscriber " + session + " topic=" + topic);
+         }
+
+         TopicSubscriber result = session.createSubscriber(topic);
+         result = new ActiveMQRATopicSubscriber(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdSubscriber " + session + " ActiveMQTopicSubscriber=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a topic subscriber
+    *
+    * @param topic           The topic
+    * @param messageSelector The message selector
+    * @param noLocal         If true inhibits the delivery of messages published by its own connection
+    * @return The subscriber
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSubscriber createSubscriber(final Topic topic, final String messageSelector, final boolean noLocal) throws JMSException
+   {
+      lock();
+      try
+      {
+         TopicSession session = getTopicSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSubscriber " + session +
+                                            " topic=" +
+                                            topic +
+                                            " selector=" +
+                                            messageSelector +
+                                            " noLocal=" +
+                                            noLocal);
+         }
+
+         TopicSubscriber result = session.createSubscriber(topic, messageSelector, noLocal);
+         result = new ActiveMQRATopicSubscriber(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdSubscriber " + session + " ActiveMQTopicSubscriber=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a durable topic subscriber
+    *
+    * @param topic The topic
+    * @param name  The name
+    * @return The subscriber
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create durable subscriber from javax.jms.QueueSession");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createDurableSubscriber " + session + " topic=" + topic + " name=" + name);
+         }
+
+         TopicSubscriber result = session.createDurableSubscriber(topic, name);
+         result = new ActiveMQRATopicSubscriber(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdDurableSubscriber " + session + " ActiveMQTopicSubscriber=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a topic subscriber
+    *
+    * @param topic           The topic
+    * @param name            The name
+    * @param messageSelector The message selector
+    * @param noLocal         If true inhibits the delivery of messages published by its own connection
+    * @return The subscriber
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSubscriber createDurableSubscriber(final Topic topic,
+                                                  final String name,
+                                                  final String messageSelector,
+                                                  final boolean noLocal) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createDurableSubscriber " + session +
+                                            " topic=" +
+                                            topic +
+                                            " name=" +
+                                            name +
+                                            " selector=" +
+                                            messageSelector +
+                                            " noLocal=" +
+                                            noLocal);
+         }
+
+         TopicSubscriber result = session.createDurableSubscriber(topic, name, messageSelector, noLocal);
+         result = new ActiveMQRATopicSubscriber(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdDurableSubscriber " + session + " ActiveMQTopicSubscriber=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a topic publisher
+    *
+    * @param topic The topic
+    * @return The publisher
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicPublisher createPublisher(final Topic topic) throws JMSException
+   {
+      lock();
+      try
+      {
+         TopicSession session = getTopicSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createPublisher " + session + " topic=" + topic);
+         }
+
+         TopicPublisher result = session.createPublisher(topic);
+         result = new ActiveMQRATopicPublisher(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdPublisher " + session + " publisher=" + result);
+         }
+
+         addProducer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a temporary topic
+    *
+    * @return The temporary topic
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TemporaryTopic createTemporaryTopic() throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create temporary topic for javax.jms.QueueSession");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createTemporaryTopic " + session);
+         }
+
+         TemporaryTopic temp = session.createTemporaryTopic();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdTemporaryTopic " + session + " temp=" + temp);
+         }
+
+         sf.addTemporaryTopic(temp);
+
+         return temp;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Unsubscribe
+    *
+    * @param name The name
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void unsubscribe(final String name) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot unsubscribe for javax.jms.QueueSession");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("unsubscribe " + session + " name=" + name);
+         }
+
+         session.unsubscribe(name);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a browser
+    *
+    * @param queue The queue
+    * @return The browser
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueBrowser createBrowser(final Queue queue) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create browser for javax.jms.TopicSession");
+      }
+
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createBrowser " + session + " queue=" + queue);
+      }
+
+      QueueBrowser result = session.createBrowser(queue);
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createdBrowser " + session + " browser=" + result);
+      }
+
+      return result;
+   }
+
+   /**
+    * Create a browser
+    *
+    * @param queue           The queue
+    * @param messageSelector The message selector
+    * @return The browser
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueBrowser createBrowser(final Queue queue, final String messageSelector) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create browser for javax.jms.TopicSession");
+      }
+
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createBrowser " + session + " queue=" + queue + " selector=" + messageSelector);
+      }
+
+      QueueBrowser result = session.createBrowser(queue, messageSelector);
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createdBrowser " + session + " browser=" + result);
+      }
+
+      return result;
+   }
+
+   /**
+    * Create a queue
+    *
+    * @param queueName The queue name
+    * @return The queue
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Queue createQueue(final String queueName) throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create browser or javax.jms.TopicSession");
+      }
+
+      Session session = getSessionInternal();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createQueue " + session + " queueName=" + queueName);
+      }
+
+      Queue result = session.createQueue(queueName);
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createdQueue " + session + " queue=" + result);
+      }
+
+      return result;
+   }
+
+   /**
+    * Create a queue receiver
+    *
+    * @param queue The queue
+    * @return The queue receiver
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueReceiver createReceiver(final Queue queue) throws JMSException
+   {
+      lock();
+      try
+      {
+         QueueSession session = getQueueSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createReceiver " + session + " queue=" + queue);
+         }
+
+         QueueReceiver result = session.createReceiver(queue);
+         result = new ActiveMQRAQueueReceiver(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdReceiver " + session + " receiver=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a queue receiver
+    *
+    * @param queue           The queue
+    * @param messageSelector
+    * @return The queue receiver
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException
+   {
+      lock();
+      try
+      {
+         QueueSession session = getQueueSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createReceiver " + session + " queue=" + queue + " selector=" + messageSelector);
+         }
+
+         QueueReceiver result = session.createReceiver(queue, messageSelector);
+         result = new ActiveMQRAQueueReceiver(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdReceiver " + session + " receiver=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a queue sender
+    *
+    * @param queue The queue
+    * @return The queue sender
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueSender createSender(final Queue queue) throws JMSException
+   {
+      lock();
+      try
+      {
+         QueueSession session = getQueueSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSender " + session + " queue=" + queue);
+         }
+
+         QueueSender result = session.createSender(queue);
+         result = new ActiveMQRAQueueSender(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdSender " + session + " sender=" + result);
+         }
+
+         addProducer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a temporary queue
+    *
+    * @return The temporary queue
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TemporaryQueue createTemporaryQueue() throws JMSException
+   {
+      if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Cannot create temporary queue for javax.jms.TopicSession");
+      }
+
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createTemporaryQueue " + session);
+         }
+
+         TemporaryQueue temp = session.createTemporaryQueue();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdTemporaryQueue " + session + " temp=" + temp);
+         }
+
+         sf.addTemporaryQueue(temp);
+
+         return temp;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a message consumer
+    *
+    * @param destination The destination
+    * @return The message consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MessageConsumer createConsumer(final Destination destination) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createConsumer " + session + " dest=" + destination);
+         }
+
+         MessageConsumer result = session.createConsumer(destination);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a message consumer
+    *
+    * @param destination     The destination
+    * @param messageSelector The message selector
+    * @return The message consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MessageConsumer createConsumer(final Destination destination, final String messageSelector) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createConsumer " + session +
+                                            " dest=" +
+                                            destination +
+                                            " messageSelector=" +
+                                            messageSelector);
+         }
+
+         MessageConsumer result = session.createConsumer(destination, messageSelector);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a message consumer
+    *
+    * @param destination     The destination
+    * @param messageSelector The message selector
+    * @param noLocal         If true inhibits the delivery of messages published by its own connection
+    * @return The message consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MessageConsumer createConsumer(final Destination destination,
+                                         final String messageSelector,
+                                         final boolean noLocal) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createConsumer " + session +
+                                            " dest=" +
+                                            destination +
+                                            " messageSelector=" +
+                                            messageSelector +
+                                            " noLocal=" +
+                                            noLocal);
+         }
+
+         MessageConsumer result = session.createConsumer(destination, messageSelector, noLocal);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Create a message producer
+    *
+    * @param destination The destination
+    * @return The message producer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public MessageProducer createProducer(final Destination destination) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createProducer " + session + " dest=" + destination);
+         }
+
+         MessageProducer result = session.createProducer(destination);
+         result = new ActiveMQRAMessageProducer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdProducer " + session + " producer=" + result);
+         }
+
+         addProducer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Get the acknowledge mode
+    *
+    * @return The mode
+    * @throws JMSException Thrown if an error occurs
+    */
+   public int getAcknowledgeMode() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()");
+      }
+
+      getSessionInternal();
+      return cri.getAcknowledgeMode();
+   }
+
+   /**
+    * Get the XA resource
+    *
+    * @return The XA resource
+    * @throws IllegalStateException If non XA connection
+    */
+   public XAResource getXAResource()
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getXAResource()");
+      }
+
+      if (cri.getType() == ActiveMQRAConnectionFactory.CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION)
+      {
+         return null;
+      }
+
+      try
+      {
+         lock();
+
+         return getXAResourceInternal();
+      }
+      catch (Throwable t)
+      {
+         return null;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Returns the ID of the Node that this session is associated with.
+    *
+    * @return Node ID
+    */
+   public String getNodeId() throws JMSException
+   {
+      ActiveMQSession session = (ActiveMQSession) getSessionInternal();
+      ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) session.getCoreSession().getSessionFactory();
+      return factory.getLiveNodeId();
+   }
+
+   /**
+    * Get the session
+    *
+    * @return The session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Session getSession() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getNonXAsession()");
+      }
+
+      if (cri.getType() == ActiveMQRAConnectionFactory.CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Non XA connection");
+      }
+
+      lock();
+      try
+      {
+         return this;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Get the queue session
+    *
+    * @return The queue session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueSession getQueueSession() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getQueueSession()");
+      }
+
+      if (cri.getType() == ActiveMQRAConnectionFactory.CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Non XA connection");
+      }
+
+      lock();
+      try
+      {
+         return this;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Get the topic session
+    *
+    * @return The topic session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSession getTopicSession() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTopicSession()");
+      }
+
+      if (cri.getType() == ActiveMQRAConnectionFactory.CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION ||
+         cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Non XA connection");
+      }
+
+      lock();
+      try
+      {
+         return this;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createSharedConsumer(final Topic topic, final String sharedSubscriptionName) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic + ", sharedSubscriptionName=" + sharedSubscriptionName);
+         }
+
+         MessageConsumer result = session.createSharedConsumer(topic, sharedSubscriptionName);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createSharedConsumer(final Topic topic, final String sharedSubscriptionName,
+                                               final String messageSelector) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic +
+                                            ", sharedSubscriptionName=" + sharedSubscriptionName + ", messageSelector=" + messageSelector);
+         }
+
+         MessageConsumer result = session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createDurableConsumer(final Topic topic, final String name) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSharedConsumer " + session + " topic=" + topic + ", name=" + name);
+         }
+
+         MessageConsumer result = session.createDurableConsumer(topic, name);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createDurableConsumer " + session + " topic=" + topic + ", name=" + name +
+                                            ", messageSelector=" + messageSelector + ", noLocal=" + noLocal);
+         }
+
+         MessageConsumer result = session.createDurableConsumer(topic, name, messageSelector, noLocal);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSharedDurableConsumer " + session + " topic=" + topic + ", name=" +
+                                            name);
+         }
+
+         MessageConsumer result = session.createSharedDurableConsumer(topic, name);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException
+   {
+      lock();
+      try
+      {
+         Session session = getSessionInternal();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createSharedDurableConsumer " + session + " topic=" + topic + ", name=" +
+                                            name + ", messageSelector=" + messageSelector);
+         }
+
+         MessageConsumer result = session.createSharedDurableConsumer(topic, name, messageSelector);
+         result = new ActiveMQRAMessageConsumer(result, this);
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("createdConsumer " + session + " consumer=" + result);
+         }
+
+         addConsumer(result);
+
+         return result;
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * Set the managed connection
+    *
+    * @param managedConnection The managed connection
+    */
+   void setManagedConnection(final ActiveMQRAManagedConnection managedConnection)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setManagedConnection(" + managedConnection + ")");
+      }
+
+      if (mc != null)
+      {
+         mc.removeHandle(this);
+      }
+
+      mc = managedConnection;
+   }
+
+   /**
+    * for tests only
+    */
+   public ManagedConnection getManagedConnection()
+   {
+      return mc;
+   }
+
+   /**
+    * Destroy
+    */
+   void destroy()
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("destroy()");
+      }
+
+      mc = null;
+   }
+
+   /**
+    * Start
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   void start() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start()");
+      }
+
+      if (mc != null)
+      {
+         mc.start();
+      }
+   }
+
+   /**
+    * Stop
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   void stop() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("stop()");
+      }
+
+      if (mc != null)
+      {
+         mc.stop();
+      }
+   }
+
+   /**
+    * Check strict
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   void checkStrict() throws JMSException
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("checkStrict()");
+      }
+
+      if (mc != null)
+      {
+         throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+      }
+   }
+
+   /**
+    * Close session
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   void closeSession() throws JMSException
+   {
+      if (mc != null)
+      {
+         ActiveMQRALogger.LOGGER.trace("Closing session");
+
+         try
+         {
+            mc.stop();
+         }
+         catch (Throwable t)
+         {
+            ActiveMQRALogger.LOGGER.trace("Error stopping managed connection", t);
+         }
+
+         synchronized (consumers)
+         {
+            for (Iterator<MessageConsumer> i = consumers.iterator(); i.hasNext(); )
+            {
+               ActiveMQRAMessageConsumer consumer = (ActiveMQRAMessageConsumer) i.next();
+               try
+               {
+                  consumer.closeConsumer();
+               }
+               catch (Throwable t)
+               {
+                  ActiveMQRALogger.LOGGER.trace("Error closing consumer", t);
+               }
+               i.remove();
+            }
+         }
+
+         synchronized (producers)
+         {
+            for (Iterator<MessageProducer> i = producers.iterator(); i.hasNext(); )
+            {
+               ActiveMQRAMessageProducer producer = (ActiveMQRAMessageProducer) i.next();
+               try
+               {
+                  producer.closeProducer();
+               }
+               catch (Throwable t)
+               {
+                  ActiveMQRALogger.LOGGER.trace("Error closing producer", t);
+               }
+               i.remove();
+            }
+         }
+
+         mc.removeHandle(this);
+         ConnectionEvent ev = new ConnectionEvent(mc, ConnectionEvent.CONNECTION_CLOSED);
+         ev.setConnectionHandle(this);
+         mc.sendEvent(ev);
+         mc = null;
+      }
+   }
+
+   /**
+    * Add consumer
+    *
+    * @param consumer The consumer
+    */
+   void addConsumer(final MessageConsumer consumer)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("addConsumer(" + consumer + ")");
+      }
+
+      synchronized (consumers)
+      {
+         consumers.add(consumer);
+      }
+   }
+
+   /**
+    * Remove consumer
+    *
+    * @param consumer The consumer
+    */
+   void removeConsumer(final MessageConsumer consumer)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("removeConsumer(" + consumer + ")");
+      }
+
+      synchronized (consumers)
+      {
+         consumers.remove(consumer);
+      }
+   }
+
+   /**
+    * Add producer
+    *
+    * @param producer The producer
+    */
+   void addProducer(final MessageProducer producer)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("addProducer(" + producer + ")");
+      }
+
+      synchronized (producers)
+      {
+         producers.add(producer);
+      }
+   }
+
+   /**
+    * Remove producer
+    *
+    * @param producer The producer
+    */
+   void removeProducer(final MessageProducer producer)
+   {
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("removeProducer(" + producer + ")");
+      }
+
+      synchronized (producers)
+      {
+         producers.remove(producer);
+      }
+   }
+
+   /**
+    * Get the session and ensure that it is open
+    *
+    * @return The session
+    * @throws JMSException          Thrown if an error occurs
+    * @throws IllegalStateException The session is closed
+    */
+   Session getSessionInternal() throws JMSException
+   {
+      if (mc == null)
+      {
+         throw new IllegalStateException("The session is closed");
+      }
+
+      Session session = mc.getSession();
+
+      if (ActiveMQRASession.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSessionInternal " + session + " for " + this);
+      }
+
+      return session;
+   }
+
+   /**
+    * Get the XA resource and ensure that it is open
+    *
+    * @return The XA Resource
+    * @throws JMSException          Thrown if an error occurs
+    * @throws IllegalStateException The session is closed
+    */
+   XAResource getXAResourceInternal() throws JMSException
+   {
+      if (mc == null)
+      {
+         throw new IllegalStateException("The session is closed");
+      }
+
+      try
+      {
+         XAResource xares = mc.getXAResource();
+
+         if (ActiveMQRASession.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("getXAResourceInternal " + xares + " for " + this);
+         }
+
+         return xares;
+      }
+      catch (ResourceException e)
+      {
+         JMSException jmse = new JMSException("Unable to get XA Resource");
+         jmse.initCause(e);
+         throw jmse;
+      }
+   }
+
+   /**
+    * Get the queue session
+    *
+    * @return The queue session
+    * @throws JMSException          Thrown if an error occurs
+    * @throws IllegalStateException The session is closed
+    */
+   QueueSession getQueueSessionInternal() throws JMSException
+   {
+      Session s = getSessionInternal();
+      if (!(s instanceof QueueSession))
+      {
+         throw new InvalidDestinationException("Attempting to use QueueSession methods on: " + this);
+      }
+      return (QueueSession) s;
+   }
+
+   /**
+    * Get the topic session
+    *
+    * @return The topic session
+    * @throws JMSException          Thrown if an error occurs
+    * @throws IllegalStateException The session is closed
+    */
+   TopicSession getTopicSessionInternal() throws JMSException
+   {
+      Session s = getSessionInternal();
+      if (!(s instanceof TopicSession))
+      {
+         throw new InvalidDestinationException("Attempting to use TopicSession methods on: " + this);
+      }
+      return (TopicSession) s;
+   }
+
+   /**
+    * @throws SystemException
+    * @throws RollbackException
+    */
+   public void checkState() throws JMSException
+   {
+      if (mc != null)
+      {
+         mc.checkTransactionActive();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactory.java
new file mode 100644
index 0000000..eba16f5
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactory.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.XAQueueConnection;
+import javax.jms.XATopicConnection;
+
+/**
+ * A joint interface for all connection types
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 71554 $
+ */
+public interface ActiveMQRASessionFactory extends XATopicConnection, XAQueueConnection
+{
+   /** Error message for strict behaviour */
+   String ISE = "This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6";
+
+   /**
+    * Add a temporary queue
+    * @param temp The temporary queue
+    */
+   void addTemporaryQueue(TemporaryQueue temp);
+
+   /**
+    * Add a temporary topic
+    * @param temp The temporary topic
+    */
+   void addTemporaryTopic(TemporaryTopic temp);
+
+   /**
+    * Notification that a session is closed
+    * @param session The session
+    * @throws JMSException for any error
+    */
+   void closeSession(ActiveMQRASession session) throws JMSException;
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactoryImpl.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactoryImpl.java
new file mode 100644
index 0000000..ef743ac
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRASessionFactoryImpl.java
@@ -0,0 +1,1046 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.ConnectionConsumer;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateException;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.jms.ServerSessionPool;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.Topic;
+import javax.jms.TopicSession;
+import javax.jms.XAJMSContext;
+import javax.jms.XAQueueSession;
+import javax.jms.XASession;
+import javax.jms.XATopicSession;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+import javax.resource.spi.ConnectionManager;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.jms.client.ActiveMQConnectionForContext;
+import org.apache.activemq.jms.client.ActiveMQConnectionForContextImpl;
+
+/**
+ * Implements the JMS Connection API and produces {@link ActiveMQRASession} objects.
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public final class ActiveMQRASessionFactoryImpl extends ActiveMQConnectionForContextImpl implements
+   ActiveMQRASessionFactory, ActiveMQConnectionForContext, Referenceable
+{
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Are we closed?
+    */
+   private boolean closed = false;
+
+   /**
+    * The naming reference
+    */
+   private Reference reference;
+
+   /**
+    * The user name
+    */
+   private String userName;
+
+   /**
+    * The password
+    */
+   private String password;
+
+   /**
+    * The client ID
+    */
+   private String clientID;
+
+   /**
+    * The connection type
+    */
+   private final int type;
+
+   /**
+    * Whether we are started
+    */
+   private boolean started = false;
+
+   /**
+    * The managed connection factory
+    */
+   private final ActiveMQRAManagedConnectionFactory mcf;
+   private TransactionManager tm;
+
+   /**
+    * The connection manager
+    */
+   private ConnectionManager cm;
+
+   /**
+    * The sessions
+    */
+   private final Set<ActiveMQRASession> sessions = new HashSet<ActiveMQRASession>();
+
+   /**
+    * The temporary queues
+    */
+   private final Set<TemporaryQueue> tempQueues = new HashSet<TemporaryQueue>();
+
+   /**
+    * The temporary topics
+    */
+   private final Set<TemporaryTopic> tempTopics = new HashSet<TemporaryTopic>();
+
+   /**
+    * Constructor
+    *
+    * @param mcf  The managed connection factory
+    * @param cm   The connection manager
+    * @param type The connection type
+    */
+   public ActiveMQRASessionFactoryImpl(final ActiveMQRAManagedConnectionFactory mcf,
+                                       final ConnectionManager cm,
+                                       final TransactionManager tm,
+                                       final int type)
+   {
+      this.mcf = mcf;
+
+      this.tm = tm;
+
+      if (cm == null)
+      {
+         this.cm = new ActiveMQRAConnectionManager();
+      }
+      else
+      {
+         this.cm = cm;
+      }
+
+      this.type = type;
+
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cm + ", " + type);
+      }
+   }
+
+   public JMSContext createContext(int sessionMode)
+   {
+      boolean inJtaTx = inJtaTransaction();
+      int sessionModeToUse;
+      switch (sessionMode)
+      {
+         case Session.AUTO_ACKNOWLEDGE:
+         case Session.DUPS_OK_ACKNOWLEDGE:
+         case ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
+         case ActiveMQJMSConstants.PRE_ACKNOWLEDGE:
+            sessionModeToUse = sessionMode;
+            break;
+         //these are prohibited in JEE unless not in a JTA tx where they should be ignored and auto_ack used
+         case Session.CLIENT_ACKNOWLEDGE:
+            if (!inJtaTx)
+            {
+               throw ActiveMQRABundle.BUNDLE.invalidSessionTransactedModeRuntime();
+            }
+            sessionModeToUse = Session.AUTO_ACKNOWLEDGE;
+            break;
+         case Session.SESSION_TRANSACTED:
+            if (!inJtaTx)
+            {
+               throw ActiveMQRABundle.BUNDLE.invalidClientAcknowledgeModeRuntime();
+            }
+            sessionModeToUse = Session.AUTO_ACKNOWLEDGE;
+            break;
+         default:
+            throw ActiveMQRABundle.BUNDLE.invalidAcknowledgeMode(sessionMode);
+      }
+      incrementRefCounter();
+
+      return new ActiveMQRAJMSContext(this, sessionModeToUse, threadAwareContext);
+   }
+
+   public XAJMSContext createXAContext()
+   {
+      incrementRefCounter();
+
+      return new ActiveMQRAXAJMSContext(this, threadAwareContext);
+   }
+
+   /**
+    * Set the naming reference
+    *
+    * @param reference The reference
+    */
+   public void setReference(final Reference reference)
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setReference(" + reference + ")");
+      }
+
+      this.reference = reference;
+   }
+
+   /**
+    * Get the naming reference
+    *
+    * @return The reference
+    */
+   public Reference getReference()
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getReference()");
+      }
+
+      return reference;
+   }
+
+   /**
+    * Set the user name
+    *
+    * @param name The user name
+    */
+   public void setUserName(final String name)
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUserName(" + name + ")");
+      }
+
+      userName = name;
+   }
+
+   /**
+    * Set the password
+    *
+    * @param password The password
+    */
+   public void setPassword(final String password)
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      this.password = password;
+   }
+
+   /**
+    * Get the client ID
+    *
+    * @return The client ID
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public String getClientID() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getClientID()");
+      }
+
+      checkClosed();
+
+      if (clientID == null)
+      {
+         return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID();
+      }
+
+      return clientID;
+   }
+
+   /**
+    * Set the client ID -- throws IllegalStateException
+    *
+    * @param cID The client ID
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public void setClientID(final String cID) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setClientID(" + cID + ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a queue session
+    *
+    * @param transacted      Use transactions
+    * @param acknowledgeMode The acknowledge mode
+    * @return The queue session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createQueueSession(" + transacted + ", " + acknowledgeMode + ")");
+      }
+
+      checkClosed();
+
+      if (type == ActiveMQRAConnectionFactory.TOPIC_CONNECTION || type == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Can not get a queue session from a topic connection");
+      }
+
+      return allocateConnection(transacted, acknowledgeMode, type);
+   }
+
+   /**
+    * Create a XA queue session
+    *
+    * @return The XA queue session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public XAQueueSession createXAQueueSession() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXAQueueSession()");
+      }
+
+      checkClosed();
+
+      if (type == ActiveMQRAConnectionFactory.CONNECTION || type == ActiveMQRAConnectionFactory.TOPIC_CONNECTION ||
+         type == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION)
+      {
+         throw new IllegalStateException("Can not get a topic session from a queue connection");
+      }
+
+      return allocateConnection(type);
+   }
+
+   /**
+    * Create a connection consumer -- throws IllegalStateException
+    *
+    * @param queue           The queue
+    * @param messageSelector The message selector
+    * @param sessionPool     The session pool
+    * @param maxMessages     The number of max messages
+    * @return The connection consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public ConnectionConsumer createConnectionConsumer(final Queue queue,
+                                                      final String messageSelector,
+                                                      final ServerSessionPool sessionPool,
+                                                      final int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionConsumer(" + queue +
+                                         ", " +
+                                         messageSelector +
+                                         ", " +
+                                         sessionPool +
+                                         ", " +
+                                         maxMessages +
+                                         ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a topic session
+    *
+    * @param transacted      Use transactions
+    * @param acknowledgeMode The acknowledge mode
+    * @return The topic session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTopicSession(" + transacted + ", " + acknowledgeMode + ")");
+      }
+
+      checkClosed();
+
+      if (type == ActiveMQRAConnectionFactory.QUEUE_CONNECTION || type == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Can not get a topic session from a queue connection");
+      }
+
+      return allocateConnection(transacted, acknowledgeMode, type);
+   }
+
+   /**
+    * Create a XA topic session
+    *
+    * @return The XA topic session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public XATopicSession createXATopicSession() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXATopicSession()");
+      }
+
+      checkClosed();
+
+      if (type == ActiveMQRAConnectionFactory.CONNECTION || type == ActiveMQRAConnectionFactory.QUEUE_CONNECTION ||
+         type == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION)
+      {
+         throw new IllegalStateException("Can not get a topic session from a queue connection");
+      }
+
+      return allocateConnection(type);
+   }
+
+   /**
+    * Create a connection consumer -- throws IllegalStateException
+    *
+    * @param topic           The topic
+    * @param messageSelector The message selector
+    * @param sessionPool     The session pool
+    * @param maxMessages     The number of max messages
+    * @return The connection consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public ConnectionConsumer createConnectionConsumer(final Topic topic,
+                                                      final String messageSelector,
+                                                      final ServerSessionPool sessionPool,
+                                                      final int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionConsumer(" + topic +
+                                         ", " +
+                                         messageSelector +
+                                         ", " +
+                                         sessionPool +
+                                         ", " +
+                                         maxMessages +
+                                         ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a durable connection consumer -- throws IllegalStateException
+    *
+    * @param topic            The topic
+    * @param subscriptionName The subscription name
+    * @param messageSelector  The message selector
+    * @param sessionPool      The session pool
+    * @param maxMessages      The number of max messages
+    * @return The connection consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public ConnectionConsumer createDurableConnectionConsumer(final Topic topic,
+                                                             final String subscriptionName,
+                                                             final String messageSelector,
+                                                             final ServerSessionPool sessionPool,
+                                                             final int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionConsumer(" + topic +
+                                         ", " +
+                                         subscriptionName +
+                                         ", " +
+                                         messageSelector +
+                                         ", " +
+                                         sessionPool +
+                                         ", " +
+                                         maxMessages +
+                                         ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a connection consumer -- throws IllegalStateException
+    *
+    * @param destination The destination
+    * @param pool        The session pool
+    * @param maxMessages The number of max messages
+    * @return The connection consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   public ConnectionConsumer createConnectionConsumer(final Destination destination,
+                                                      final ServerSessionPool pool,
+                                                      final int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionConsumer(" + destination +
+                                         ", " +
+                                         pool +
+                                         ", " +
+                                         maxMessages +
+                                         ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a connection consumer -- throws IllegalStateException
+    *
+    * @param destination The destination
+    * @param name        The name
+    * @param pool        The session pool
+    * @param maxMessages The number of max messages
+    * @return The connection consumer
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public ConnectionConsumer createConnectionConsumer(final Destination destination,
+                                                      final String name,
+                                                      final ServerSessionPool pool,
+                                                      final int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionConsumer(" + destination +
+                                         ", " +
+                                         name +
+                                         ", " +
+                                         pool +
+                                         ", " +
+                                         maxMessages +
+                                         ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Create a session
+    *
+    * @param transacted      Use transactions
+    * @param acknowledgeMode The acknowledge mode
+    * @return The session
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createSession(" + transacted + ", " + acknowledgeMode + ")");
+      }
+
+      checkClosed();
+      return allocateConnection(transacted, acknowledgeMode, type);
+   }
+
+   /**
+    * Create a XA session
+    *
+    * @return The XA session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public XASession createXASession() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXASession()");
+      }
+
+      checkClosed();
+      return allocateConnection(type);
+   }
+
+   /**
+    * Get the connection metadata
+    *
+    * @return The connection metadata
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public ConnectionMetaData getMetaData() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMetaData()");
+      }
+
+      checkClosed();
+      return mcf.getMetaData();
+   }
+
+   /**
+    * Get the exception listener -- throws IllegalStateException
+    *
+    * @return The exception listener
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public ExceptionListener getExceptionListener() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getExceptionListener()");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Set the exception listener -- throws IllegalStateException
+    *
+    * @param listener The exception listener
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public void setExceptionListener(final ExceptionListener listener) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setExceptionListener(" + listener + ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Start
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public void start() throws JMSException
+   {
+      checkClosed();
+
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start() " + this);
+      }
+
+      synchronized (sessions)
+      {
+         if (started)
+         {
+            return;
+         }
+         started = true;
+         for (ActiveMQRASession session : sessions)
+         {
+            session.start();
+         }
+      }
+   }
+
+   /**
+    * Stop
+    *
+    * @throws IllegalStateException
+    * @throws JMSException          Thrown if an error occurs
+    */
+   @Override
+   public void stop() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("stop() " + this);
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Close
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   @Override
+   public void close() throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("close() " + this);
+      }
+
+      if (closed)
+      {
+         return;
+      }
+
+      closed = true;
+
+      synchronized (sessions)
+      {
+         for (Iterator<ActiveMQRASession> i = sessions.iterator(); i.hasNext(); )
+         {
+            ActiveMQRASession session = i.next();
+            try
+            {
+               session.closeSession();
+            }
+            catch (Throwable t)
+            {
+               ActiveMQRALogger.LOGGER.trace("Error closing session", t);
+            }
+            i.remove();
+         }
+      }
+
+      synchronized (tempQueues)
+      {
+         for (Iterator<TemporaryQueue> i = tempQueues.iterator(); i.hasNext(); )
+         {
+            TemporaryQueue temp = i.next();
+            try
+            {
+               if (ActiveMQRASessionFactoryImpl.trace)
+               {
+                  ActiveMQRALogger.LOGGER.trace("Closing temporary queue " + temp + " for " + this);
+               }
+               temp.delete();
+            }
+            catch (Throwable t)
+            {
+               ActiveMQRALogger.LOGGER.trace("Error deleting temporary queue", t);
+            }
+            i.remove();
+         }
+      }
+
+      synchronized (tempTopics)
+      {
+         for (Iterator<TemporaryTopic> i = tempTopics.iterator(); i.hasNext(); )
+         {
+            TemporaryTopic temp = i.next();
+            try
+            {
+               if (ActiveMQRASessionFactoryImpl.trace)
+               {
+                  ActiveMQRALogger.LOGGER.trace("Closing temporary topic " + temp + " for " + this);
+               }
+               temp.delete();
+            }
+            catch (Throwable t)
+            {
+               ActiveMQRALogger.LOGGER.trace("Error deleting temporary queue", t);
+            }
+            i.remove();
+         }
+      }
+   }
+
+   /**
+    * Close session
+    *
+    * @param session The session
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void closeSession(final ActiveMQRASession session) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("closeSession(" + session + ")");
+      }
+
+      synchronized (sessions)
+      {
+         sessions.remove(session);
+      }
+   }
+
+   /**
+    * Add temporary queue
+    *
+    * @param temp The temporary queue
+    */
+   public void addTemporaryQueue(final TemporaryQueue temp)
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("addTemporaryQueue(" + temp + ")");
+      }
+
+      synchronized (tempQueues)
+      {
+         tempQueues.add(temp);
+      }
+   }
+
+   /**
+    * Add temporary topic
+    *
+    * @param temp The temporary topic
+    */
+   public void addTemporaryTopic(final TemporaryTopic temp)
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("addTemporaryTopic(" + temp + ")");
+      }
+
+      synchronized (tempTopics)
+      {
+         tempTopics.add(temp);
+      }
+   }
+
+   @Override
+   public Session createSession(int sessionMode) throws JMSException
+   {
+      return createSession(sessionMode == Session.SESSION_TRANSACTED, sessionMode);
+   }
+
+   @Override
+   public Session createSession() throws JMSException
+   {
+      return createSession(Session.AUTO_ACKNOWLEDGE);
+   }
+
+   @Override
+   public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createSharedConnectionConsumer(" + topic + ", " + subscriptionName + ", " +
+                                         messageSelector + ", " + sessionPool + ", " + maxMessages + ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   @Override
+   public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createSharedDurableConnectionConsumer(" + topic + ", " + subscriptionName +
+                                         ", " + messageSelector + ", " + sessionPool + ", " + maxMessages + ")");
+      }
+
+      throw new IllegalStateException(ActiveMQRASessionFactory.ISE);
+   }
+
+   /**
+    * Allocation a connection
+    *
+    * @param sessionType The session type
+    * @return The session
+    * @throws JMSException Thrown if an error occurs
+    */
+   protected ActiveMQRASession allocateConnection(final int sessionType) throws JMSException
+   {
+      return allocateConnection(false, Session.AUTO_ACKNOWLEDGE, sessionType);
+   }
+
+   /**
+    * Allocate a connection
+    *
+    * @param transacted      Use transactions
+    * @param acknowledgeMode The acknowledge mode
+    * @param sessionType     The session type
+    * @return The session
+    * @throws JMSException Thrown if an error occurs
+    */
+   protected ActiveMQRASession allocateConnection(boolean transacted, int acknowledgeMode, final int sessionType) throws JMSException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("allocateConnection(" + transacted +
+                                         ", " +
+                                         acknowledgeMode +
+                                         ", " +
+                                         sessionType +
+                                         ")");
+      }
+
+      try
+      {
+         synchronized (sessions)
+         {
+            if (sessions.isEmpty() == false)
+            {
+               throw new IllegalStateException("Only allowed one session per connection. See the J2EE spec, e.g. J2EE1.4 Section 6.6");
+            }
+            //from createSession
+            // In a Java EE web or EJB container, when there is an active JTA transaction in progress:
+            //Both arguments {@code transacted} and {@code acknowledgeMode} are ignored.
+            if (inJtaTransaction())
+            {
+               transacted = true;
+               //from getAcknowledgeMode
+               // If the session is not transacted, returns the
+               // current acknowledgement mode for the session.
+               // If the session
+               // is transacted, returns SESSION_TRANSACTED.
+               acknowledgeMode = Session.SESSION_TRANSACTED;
+            }
+            //In the Java EE web or EJB container, when there is no active JTA transaction in progress
+            // The argument {@code transacted} is ignored.
+            else
+            {
+               //The session will always be non-transacted,
+               transacted = false;
+               switch (acknowledgeMode)
+               {
+                  //using one of the two acknowledgement modes AUTO_ACKNOWLEDGE and DUPS_OK_ACKNOWLEDGE.
+                  case Session.AUTO_ACKNOWLEDGE:
+                  case Session.DUPS_OK_ACKNOWLEDGE:
+                     //plus our own
+                  case ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
+                  case ActiveMQJMSConstants.PRE_ACKNOWLEDGE:
+                     break;
+                  //The value {@code Session.CLIENT_ACKNOWLEDGE} may not be used.
+                  case Session.CLIENT_ACKNOWLEDGE:
+                     throw ActiveMQRABundle.BUNDLE.invalidClientAcknowledgeModeRuntime();
+                     //same with this although the spec doesn't explicitly say
+                  case Session.SESSION_TRANSACTED:
+                     throw ActiveMQRABundle.BUNDLE.invalidSessionTransactedModeRuntime();
+                  default:
+                     throw ActiveMQRABundle.BUNDLE.invalidAcknowledgeMode(acknowledgeMode);
+               }
+            }
+
+            ActiveMQRAConnectionRequestInfo info = new ActiveMQRAConnectionRequestInfo(transacted,
+                                                                                     acknowledgeMode,
+                                                                                     sessionType);
+            info.setUserName(userName);
+            info.setPassword(password);
+            info.setClientID(clientID);
+            info.setDefaults(((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties());
+
+            if (ActiveMQRASessionFactoryImpl.trace)
+            {
+               ActiveMQRALogger.LOGGER.trace("Allocating session for " + this + " with request info=" + info);
+            }
+
+            ActiveMQRASession session = (ActiveMQRASession) cm.allocateConnection(mcf, info);
+
+            try
+            {
+               if (ActiveMQRASessionFactoryImpl.trace)
+               {
+                  ActiveMQRALogger.LOGGER.trace("Allocated  " + this + " session=" + session);
+               }
+
+               session.setActiveMQSessionFactory(this);
+
+               if (started)
+               {
+                  session.start();
+               }
+
+               sessions.add(session);
+
+               return session;
+            }
+            catch (Throwable t)
+            {
+               try
+               {
+                  session.close();
+               }
+               catch (Throwable ignored)
+               {
+               }
+               if (t instanceof Exception)
+               {
+                  throw (Exception) t;
+               }
+               else
+               {
+                  throw new RuntimeException("Unexpected error: ", t);
+               }
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         Throwable current = e;
+         while (current != null && !(current instanceof JMSException))
+         {
+            current = current.getCause();
+         }
+
+         if (current != null && current instanceof JMSException)
+         {
+            throw (JMSException) current;
+         }
+         else
+         {
+            JMSException je = new JMSException("Could not create a session: " + e.getMessage());
+            je.setLinkedException(e);
+            je.initCause(e);
+            throw je;
+         }
+      }
+   }
+
+   /**
+    * Check if we are closed
+    *
+    * @throws IllegalStateException Thrown if closed
+    */
+   protected void checkClosed() throws IllegalStateException
+   {
+      if (ActiveMQRASessionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("checkClosed()" + this);
+      }
+
+      if (closed)
+      {
+         throw new IllegalStateException("The connection is closed");
+      }
+   }
+
+   private boolean inJtaTransaction()
+   {
+      boolean inJtaTx = false;
+      if (tm != null)
+      {
+         Transaction tx = null;
+         try
+         {
+            tx = tm.getTransaction();
+         }
+         catch (SystemException e)
+         {
+            //assume false
+         }
+         inJtaTx = tx != null;
+      }
+      return inJtaTx;
+   }
+}


[44/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQSessionContext.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQSessionContext.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQSessionContext.java
deleted file mode 100644
index 5589402..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/HornetQSessionContext.java
+++ /dev/null
@@ -1,940 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.core.impl;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
-import org.apache.activemq.core.client.impl.AddressQueryImpl;
-import org.apache.activemq.core.client.impl.ClientConsumerImpl;
-import org.apache.activemq.core.client.impl.ClientConsumerInternal;
-import org.apache.activemq.core.client.impl.ClientLargeMessageInternal;
-import org.apache.activemq.core.client.impl.ClientMessageInternal;
-import org.apache.activemq.core.client.impl.ClientProducerCreditsImpl;
-import org.apache.activemq.core.client.impl.ClientSessionImpl;
-import org.apache.activemq.core.message.impl.MessageInternal;
-import org.apache.activemq.core.protocol.core.Channel;
-import org.apache.activemq.core.protocol.core.ChannelHandler;
-import org.apache.activemq.core.protocol.core.CommandConfirmationHandler;
-import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
-import org.apache.activemq.core.protocol.core.Packet;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateQueueMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectConsumerMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.RollbackMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionAddMetaDataMessageV2;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionCloseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionDeleteQueueMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionExpireMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionForceConsumerDelivery;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionIndividualAcknowledgeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionProducerCreditsFailMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionQueueQueryMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendLargeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionSendMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionUniqueAddMetaDataMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAAfterFailedMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXACommitMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAEndMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAForgetMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAJoinMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAPrepareMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAResumeMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXARollbackMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXASetTimeoutMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.SessionXAStartMessage;
-import org.apache.activemq.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.spi.core.remoting.Connection;
-import org.apache.activemq.spi.core.remoting.SessionContext;
-import org.apache.activemq.utils.TokenBucketLimiterImpl;
-
-import static org.apache.activemq.core.protocol.core.impl.PacketImpl.DISCONNECT_CONSUMER;
-import static org.apache.activemq.core.protocol.core.impl.PacketImpl.EXCEPTION;
-import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_CONTINUATION;
-import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_LARGE_MSG;
-import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_MSG;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQSessionContext extends SessionContext
-{
-   private final Channel sessionChannel;
-   private final int serverVersion;
-   private int confirmationWindow;
-   private final String name;
-
-
-   public HornetQSessionContext(String name, RemotingConnection remotingConnection, Channel sessionChannel, int serverVersion, int confirmationWindow)
-   {
-      super(remotingConnection);
-
-      this.name = name;
-      this.sessionChannel = sessionChannel;
-      this.serverVersion = serverVersion;
-      this.confirmationWindow = confirmationWindow;
-
-      ChannelHandler handler = new ClientSessionPacketHandler();
-      sessionChannel.setHandler(handler);
-
-
-      if (confirmationWindow >= 0)
-      {
-         sessionChannel.setCommandConfirmationHandler(confirmationHandler);
-      }
-   }
-
-
-   private final CommandConfirmationHandler confirmationHandler = new CommandConfirmationHandler()
-   {
-      public void commandConfirmed(final Packet packet)
-      {
-         if (packet.getType() == PacketImpl.SESS_SEND)
-         {
-            SessionSendMessage ssm = (SessionSendMessage) packet;
-            callSendAck(ssm.getHandler(), ssm.getMessage());
-         }
-         else if (packet.getType() == PacketImpl.SESS_SEND_CONTINUATION)
-         {
-            SessionSendContinuationMessage scm = (SessionSendContinuationMessage) packet;
-            if (!scm.isContinues())
-            {
-               callSendAck(scm.getHandler(), scm.getMessage());
-            }
-         }
-      }
-
-      private void callSendAck(SendAcknowledgementHandler handler, final Message message)
-      {
-         if (handler != null)
-         {
-            handler.sendAcknowledged(message);
-         }
-         else if (sendAckHandler != null)
-         {
-            sendAckHandler.sendAcknowledged(message);
-         }
-      }
-
-   };
-
-
-   // Failover utility methods
-
-   @Override
-   public void returnBlocking(ActiveMQException cause)
-   {
-      sessionChannel.returnBlocking(cause);
-   }
-
-   @Override
-   public void lockCommunications()
-   {
-      sessionChannel.lock();
-   }
-
-   @Override
-   public void releaseCommunications()
-   {
-      sessionChannel.setTransferring(false);
-      sessionChannel.unlock();
-   }
-
-   public void cleanup()
-   {
-      sessionChannel.close();
-
-      // if the server is sending a disconnect
-      // any pending blocked operation could hang without this
-      sessionChannel.returnBlocking();
-   }
-
-   @Override
-   public void linkFlowControl(SimpleString address, ClientProducerCreditsImpl clientProducerCredits)
-   {
-      // nothing to be done here... Flow control here is done on the core side
-   }
-
-
-   public void setSendAcknowledgementHandler(final SendAcknowledgementHandler handler)
-   {
-      sessionChannel.setCommandConfirmationHandler(confirmationHandler);
-      this.sendAckHandler = handler;
-   }
-
-   public void createSharedQueue(SimpleString address,
-                                 SimpleString queueName,
-                                 SimpleString filterString,
-                                 boolean durable) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new CreateSharedQueueMessage(address, queueName, filterString, durable, true), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void deleteQueue(final SimpleString queueName) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new SessionDeleteQueueMessage(queueName), PacketImpl.NULL_RESPONSE);
-   }
-
-   public ClientSession.QueueQuery queueQuery(final SimpleString queueName) throws ActiveMQException
-   {
-      SessionQueueQueryMessage request = new SessionQueueQueryMessage(queueName);
-      SessionQueueQueryResponseMessage response = (SessionQueueQueryResponseMessage) sessionChannel.sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
-
-      return response.toQueueQuery();
-
-   }
-
-
-   public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString,
-                                                int windowSize, int maxRate, int ackBatchSize, boolean browseOnly,
-                                                Executor executor, Executor flowControlExecutor) throws ActiveMQException
-   {
-      long consumerID = idGenerator.generateID();
-
-      HornetQConsumerContext consumerContext = new HornetQConsumerContext(consumerID);
-
-      SessionCreateConsumerMessage request = new SessionCreateConsumerMessage(consumerID,
-                                                                              queueName,
-                                                                              filterString,
-                                                                              browseOnly,
-                                                                              true);
-
-      SessionQueueQueryResponseMessage queueInfo = (SessionQueueQueryResponseMessage) sessionChannel.sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
-
-      // The actual windows size that gets used is determined by the user since
-      // could be overridden on the queue settings
-      // The value we send is just a hint
-
-      return new ClientConsumerImpl(session,
-                                    consumerContext,
-                                    queueName,
-                                    filterString,
-                                    browseOnly,
-                                    calcWindowSize(windowSize),
-                                    ackBatchSize,
-                                    maxRate > 0 ? new TokenBucketLimiterImpl(maxRate,
-                                                                             false)
-                                       : null,
-                                    executor,
-                                    flowControlExecutor,
-                                    this,
-                                    queueInfo.toQueueQuery(),
-                                    lookupTCCL());
-   }
-
-
-   public int getServerVersion()
-   {
-      return serverVersion;
-   }
-
-   public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException
-   {
-      SessionBindingQueryResponseMessage response =
-         (SessionBindingQueryResponseMessage) sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
-
-      return new AddressQueryImpl(response.isExists(), response.getQueueNames());
-   }
-
-
-   @Override
-   public void closeConsumer(final ClientConsumer consumer) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new SessionConsumerCloseMessage(getConsumerID(consumer)), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void sendConsumerCredits(final ClientConsumer consumer, final int credits)
-   {
-      sessionChannel.send(new SessionConsumerFlowCreditMessage(getConsumerID(consumer), credits));
-   }
-
-   public void forceDelivery(final ClientConsumer consumer, final long sequence) throws ActiveMQException
-   {
-      SessionForceConsumerDelivery request = new SessionForceConsumerDelivery(getConsumerID(consumer), sequence);
-      sessionChannel.send(request);
-   }
-
-   public void simpleCommit() throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_COMMIT), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new RollbackMessage(lastMessageAsDelivered), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void sessionStart() throws ActiveMQException
-   {
-      sessionChannel.send(new PacketImpl(PacketImpl.SESS_START));
-   }
-
-   public void sessionStop() throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_STOP), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void addSessionMetadata(String key, String data) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new SessionAddMetaDataMessageV2(key, data), PacketImpl.NULL_RESPONSE);
-   }
-
-
-   public void addUniqueMetaData(String key, String data) throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new SessionUniqueAddMetaDataMessage(key, data), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
-   {
-      SessionXACommitMessage packet = new SessionXACommitMessage(xid, onePhase);
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         throw new XAException(response.getResponseCode());
-      }
-
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
-      {
-         HornetQClientLogger.LOGGER.trace("finished commit on " + ClientSessionImpl.convert(xid) + " with response = " + response);
-      }
-   }
-
-   public void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
-   {
-      Packet packet;
-      if (flags == XAResource.TMSUSPEND)
-      {
-         packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
-      }
-      else if (flags == XAResource.TMSUCCESS)
-      {
-         packet = new SessionXAEndMessage(xid, false);
-      }
-      else if (flags == XAResource.TMFAIL)
-      {
-         packet = new SessionXAEndMessage(xid, true);
-      }
-      else
-      {
-         throw new XAException(XAException.XAER_INVAL);
-      }
-
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         throw new XAException(response.getResponseCode());
-      }
-   }
-
-
-   public void sendProducerCreditsMessage(final int credits, final SimpleString address)
-   {
-      sessionChannel.send(new SessionRequestProducerCreditsMessage(credits, address));
-   }
-
-   /**
-    * HornetQ does support large messages
-    *
-    * @return
-    */
-   public boolean supportsLargeMessage()
-   {
-      return true;
-   }
-
-   @Override
-   public int getCreditsOnSendingFull(MessageInternal msgI)
-   {
-      return msgI.getEncodeSize();
-   }
-
-   public void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
-   {
-      SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking, handler);
-
-      if (sendBlocking)
-      {
-         sessionChannel.sendBlocking(packet, PacketImpl.NULL_RESPONSE);
-      }
-      else
-      {
-         sessionChannel.sendBatched(packet);
-      }
-   }
-
-   @Override
-   public int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws ActiveMQException
-   {
-      SessionSendLargeMessage initialChunk = new SessionSendLargeMessage(msgI);
-
-      sessionChannel.send(initialChunk);
-
-      return msgI.getHeadersAndPropertiesEncodeSize();
-   }
-
-   @Override
-   public int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
-   {
-      final boolean requiresResponse = lastChunk && sendBlocking;
-      final SessionSendContinuationMessage chunkPacket =
-         new SessionSendContinuationMessage(msgI, chunk, !lastChunk,
-                                            requiresResponse, messageBodySize, messageHandler);
-
-      if (requiresResponse)
-      {
-         // When sending it blocking, only the last chunk will be blocking.
-         sessionChannel.sendBlocking(chunkPacket, PacketImpl.NULL_RESPONSE);
-      }
-      else
-      {
-         sessionChannel.send(chunkPacket);
-      }
-
-      return chunkPacket.getPacketSize();
-   }
-
-   public void sendACK(boolean individual, boolean block, final ClientConsumer consumer, final Message message) throws ActiveMQException
-   {
-      PacketImpl messagePacket;
-      if (individual)
-      {
-         messagePacket = new SessionIndividualAcknowledgeMessage(getConsumerID(consumer), message.getMessageID(), block);
-      }
-      else
-      {
-         messagePacket = new SessionAcknowledgeMessage(getConsumerID(consumer), message.getMessageID(), block);
-      }
-
-      if (block)
-      {
-         sessionChannel.sendBlocking(messagePacket, PacketImpl.NULL_RESPONSE);
-      }
-      else
-      {
-         sessionChannel.sendBatched(messagePacket);
-      }
-   }
-
-   public void expireMessage(final ClientConsumer consumer, Message message) throws ActiveMQException
-   {
-      SessionExpireMessage messagePacket = new SessionExpireMessage(getConsumerID(consumer), message.getMessageID());
-
-      sessionChannel.send(messagePacket);
-   }
-
-
-   public void sessionClose() throws ActiveMQException
-   {
-      sessionChannel.sendBlocking(new SessionCloseMessage(), PacketImpl.NULL_RESPONSE);
-   }
-
-   public void xaForget(Xid xid) throws XAException, ActiveMQException
-   {
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(new SessionXAForgetMessage(xid), PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         throw new XAException(response.getResponseCode());
-      }
-   }
-
-   public int xaPrepare(Xid xid) throws XAException, ActiveMQException
-   {
-      SessionXAPrepareMessage packet = new SessionXAPrepareMessage(xid);
-
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         throw new XAException(response.getResponseCode());
-      }
-      else
-      {
-         return response.getResponseCode();
-      }
-   }
-
-   public Xid[] xaScan() throws ActiveMQException
-   {
-      SessionXAGetInDoubtXidsResponseMessage response = (SessionXAGetInDoubtXidsResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS), PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
-
-      List<Xid> xids = response.getXids();
-
-      Xid[] xidArray = xids.toArray(new Xid[xids.size()]);
-
-      return xidArray;
-   }
-
-   public void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
-   {
-      SessionXARollbackMessage packet = new SessionXARollbackMessage(xid);
-
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         throw new XAException(response.getResponseCode());
-      }
-   }
-
-   public void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
-   {
-      Packet packet;
-      if (flags == XAResource.TMJOIN)
-      {
-         packet = new SessionXAJoinMessage(xid);
-      }
-      else if (flags == XAResource.TMRESUME)
-      {
-         packet = new SessionXAResumeMessage(xid);
-      }
-      else if (flags == XAResource.TMNOFLAGS)
-      {
-         // Don't need to flush since the previous end will have done this
-         packet = new SessionXAStartMessage(xid);
-      }
-      else
-      {
-         throw new XAException(XAException.XAER_INVAL);
-      }
-
-      SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
-
-      if (response.isError())
-      {
-         HornetQClientLogger.LOGGER.errorCallingStart(response.getMessage(), response.getResponseCode());
-         throw new XAException(response.getResponseCode());
-      }
-   }
-
-   public boolean configureTransactionTimeout(int seconds) throws ActiveMQException
-   {
-      SessionXASetTimeoutResponseMessage response = (SessionXASetTimeoutResponseMessage) sessionChannel.sendBlocking(new SessionXASetTimeoutMessage(seconds), PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
-
-      return response.isOK();
-   }
-
-   public int recoverSessionTimeout() throws ActiveMQException
-   {
-      SessionXAGetTimeoutResponseMessage response = (SessionXAGetTimeoutResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT), PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
-
-      return response.getTimeoutSeconds();
-   }
-
-   public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws ActiveMQException
-   {
-      CreateQueueMessage request = new CreateQueueMessage(address, queueName, filterString, durable, temp, true);
-      sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
-   }
-
-   @Override
-   public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
-   {
-
-      this.remotingConnection = newConnection;
-
-      sessionChannel.transferConnection((CoreRemotingConnection) newConnection);
-
-      Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID());
-
-      Channel channel1 = getCoreConnection().getChannel(1, -1);
-
-      ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP);
-
-      if (response.isReattached())
-      {
-         if (HornetQClientLogger.LOGGER.isDebugEnabled())
-         {
-            HornetQClientLogger.LOGGER.debug("ClientSession reattached fine, replaying commands");
-         }
-         // The session was found on the server - we reattached transparently ok
-
-         sessionChannel.replayCommands(response.getLastConfirmedCommandID());
-
-         return true;
-      }
-      else
-      {
-
-         sessionChannel.clearCommands();
-
-         return false;
-      }
-
-   }
-
-   public void recreateSession(final String username,
-                               final String password,
-                               final int minLargeMessageSize,
-                               final boolean xa,
-                               final boolean autoCommitSends,
-                               final boolean autoCommitAcks,
-                               final boolean preAcknowledge,
-                               final SimpleString defaultAddress) throws ActiveMQException
-   {
-      Packet createRequest = new CreateSessionMessage(name,
-                                                      sessionChannel.getID(),
-                                                      getServerVersion(),
-                                                      username,
-                                                      password,
-                                                      minLargeMessageSize,
-                                                      xa,
-                                                      autoCommitSends,
-                                                      autoCommitAcks,
-                                                      preAcknowledge,
-                                                      confirmationWindow,
-                                                      defaultAddress == null ? null
-                                                         : defaultAddress.toString());
-      boolean retry;
-      do
-      {
-         try
-         {
-            getCreateChannel().sendBlocking(createRequest, PacketImpl.CREATESESSION_RESP);
-            retry = false;
-         }
-         catch (ActiveMQException e)
-         {
-            // the session was created while its server was starting, retry it:
-            if (e.getType() == ActiveMQExceptionType.SESSION_CREATION_REJECTED)
-            {
-               HornetQClientLogger.LOGGER.retryCreateSessionSeverStarting(name);
-               retry = true;
-               // sleep a little bit to avoid spinning too much
-               try
-               {
-                  Thread.sleep(10);
-               }
-               catch (InterruptedException ie)
-               {
-                  Thread.currentThread().interrupt();
-                  throw e;
-               }
-            }
-            else
-            {
-               throw e;
-            }
-         }
-      }
-      while (retry && !session.isClosing());
-   }
-
-   @Override
-   public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws ActiveMQException
-   {
-      ClientSession.QueueQuery queueInfo = consumerInternal.getQueueInfo();
-
-      // We try and recreate any non durable queues, since they probably won't be there unless
-      // they are defined in hornetq-configuration.xml
-      // This allows e.g. JMS non durable subs and temporary queues to continue to be used after failover
-      if (!queueInfo.isDurable())
-      {
-         CreateQueueMessage createQueueRequest = new CreateQueueMessage(queueInfo.getAddress(),
-                                                                        queueInfo.getName(),
-                                                                        queueInfo.getFilterString(),
-                                                                        false,
-                                                                        queueInfo.isTemporary(),
-                                                                        false);
-
-         sendPacketWithoutLock(sessionChannel, createQueueRequest);
-      }
-
-      SessionCreateConsumerMessage createConsumerRequest = new SessionCreateConsumerMessage(getConsumerID(consumerInternal),
-                                                                                            consumerInternal.getQueueName(),
-                                                                                            consumerInternal.getFilterString(),
-                                                                                            consumerInternal.isBrowseOnly(),
-                                                                                            false);
-
-      sendPacketWithoutLock(sessionChannel, createConsumerRequest);
-
-      int clientWindowSize = consumerInternal.getClientWindowSize();
-
-      if (clientWindowSize != 0)
-      {
-         SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal),
-                                                                                        clientWindowSize);
-
-         sendPacketWithoutLock(sessionChannel, packet);
-      }
-      else
-      {
-         // https://jira.jboss.org/browse/HORNETQ-522
-         SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal),
-                                                                                        1);
-         sendPacketWithoutLock(sessionChannel, packet);
-      }
-   }
-
-   public void xaFailed(Xid xid) throws ActiveMQException
-   {
-      sendPacketWithoutLock(sessionChannel, new SessionXAAfterFailedMessage(xid));
-   }
-
-   public void restartSession() throws ActiveMQException
-   {
-      sendPacketWithoutLock(sessionChannel, new PacketImpl(PacketImpl.SESS_START));
-   }
-
-   @Override
-   public void resetMetadata(HashMap<String, String> metaDataToSend)
-   {
-      // Resetting the metadata after failover
-      for (Map.Entry<String, String> entries : metaDataToSend.entrySet())
-      {
-         sendPacketWithoutLock(sessionChannel, new SessionAddMetaDataMessageV2(entries.getKey(), entries.getValue(), false));
-      }
-   }
-
-
-   private Channel getCreateChannel()
-   {
-      return getCoreConnection().getChannel(1, -1);
-   }
-
-   private CoreRemotingConnection getCoreConnection()
-   {
-      return (CoreRemotingConnection) remotingConnection;
-   }
-
-
-   /**
-    * This doesn't apply to other protocols probably, so it will be a hornetq exclusive feature
-    *
-    * @throws org.apache.activemq.api.core.ActiveMQException
-    */
-   private void handleConsumerDisconnected(DisconnectConsumerMessage packet) throws ActiveMQException
-   {
-      DisconnectConsumerMessage message = packet;
-
-      session.handleConsumerDisconnect(new HornetQConsumerContext(message.getConsumerId()));
-   }
-
-   private void handleReceivedMessagePacket(SessionReceiveMessage messagePacket) throws Exception
-   {
-      ClientMessageInternal msgi = (ClientMessageInternal) messagePacket.getMessage();
-
-      msgi.setDeliveryCount(messagePacket.getDeliveryCount());
-
-      msgi.setFlowControlSize(messagePacket.getPacketSize());
-
-      handleReceiveMessage(new HornetQConsumerContext(messagePacket.getConsumerID()), msgi);
-   }
-
-   private void handleReceiveLargeMessage(SessionReceiveLargeMessage serverPacket) throws Exception
-   {
-      ClientLargeMessageInternal clientLargeMessage = (ClientLargeMessageInternal) serverPacket.getLargeMessage();
-
-      clientLargeMessage.setFlowControlSize(serverPacket.getPacketSize());
-
-      clientLargeMessage.setDeliveryCount(serverPacket.getDeliveryCount());
-
-      handleReceiveLargeMessage(new HornetQConsumerContext(serverPacket.getConsumerID()), clientLargeMessage, serverPacket.getLargeMessageSize());
-   }
-
-
-   private void handleReceiveContinuation(SessionReceiveContinuationMessage continuationPacket) throws Exception
-   {
-      handleReceiveContinuation(new HornetQConsumerContext(continuationPacket.getConsumerID()), continuationPacket.getBody(), continuationPacket.getPacketSize(),
-                                continuationPacket.isContinues());
-   }
-
-
-   protected void handleReceiveProducerCredits(SessionProducerCreditsMessage message)
-   {
-      handleReceiveProducerCredits(message.getAddress(), message.getCredits());
-   }
-
-
-   protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message)
-   {
-      handleReceiveProducerFailCredits(message.getAddress(), message.getCredits());
-   }
-
-   class ClientSessionPacketHandler implements ChannelHandler
-   {
-
-      public void handlePacket(final Packet packet)
-      {
-         byte type = packet.getType();
-
-         try
-         {
-            switch (type)
-            {
-               case DISCONNECT_CONSUMER:
-               {
-                  handleConsumerDisconnected((DisconnectConsumerMessage) packet);
-                  break;
-               }
-               case SESS_RECEIVE_CONTINUATION:
-               {
-                  handleReceiveContinuation((SessionReceiveContinuationMessage) packet);
-
-                  break;
-               }
-               case SESS_RECEIVE_MSG:
-               {
-                  handleReceivedMessagePacket((SessionReceiveMessage) packet);
-
-                  break;
-               }
-               case SESS_RECEIVE_LARGE_MSG:
-               {
-                  handleReceiveLargeMessage((SessionReceiveLargeMessage) packet);
-
-                  break;
-               }
-               case PacketImpl.SESS_PRODUCER_CREDITS:
-               {
-                  handleReceiveProducerCredits((SessionProducerCreditsMessage) packet);
-
-                  break;
-               }
-               case PacketImpl.SESS_PRODUCER_FAIL_CREDITS:
-               {
-                  handleReceiveProducerFailCredits((SessionProducerCreditsFailMessage) packet);
-
-                  break;
-               }
-               case EXCEPTION:
-               {
-                  // We can only log these exceptions
-                  // maybe we should cache it on SessionContext and throw an exception on any next calls
-                  HornetQExceptionMessage mem = (HornetQExceptionMessage) packet;
-
-                  HornetQClientLogger.LOGGER.receivedExceptionAsynchronously(mem.getException());
-
-                  break;
-               }
-               default:
-               {
-                  throw new IllegalStateException("Invalid packet: " + type);
-               }
-            }
-         }
-         catch (Exception e)
-         {
-            HornetQClientLogger.LOGGER.failedToHandlePacket(e);
-         }
-
-         sessionChannel.confirm(packet);
-      }
-   }
-
-   private long getConsumerID(ClientConsumer consumer)
-   {
-      return ((HornetQConsumerContext)consumer.getConsumerContext()).getId();
-   }
-
-   private ClassLoader lookupTCCL()
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
-      {
-         public ClassLoader run()
-         {
-            return Thread.currentThread().getContextClassLoader();
-         }
-      });
-
-   }
-
-   private int calcWindowSize(final int windowSize)
-   {
-      int clientWindowSize;
-      if (windowSize == -1)
-      {
-         // No flow control - buffer can increase without bound! Only use with
-         // caution for very fast consumers
-         clientWindowSize = -1;
-      }
-      else if (windowSize == 0)
-      {
-         // Slow consumer - no buffering
-         clientWindowSize = 0;
-      }
-      else if (windowSize == 1)
-      {
-         // Slow consumer = buffer 1
-         clientWindowSize = 1;
-      }
-      else if (windowSize > 1)
-      {
-         // Client window size is half server window size
-         clientWindowSize = windowSize >> 1;
-      }
-      else
-      {
-         throw HornetQClientMessageBundle.BUNDLE.invalidWindowSize(windowSize);
-      }
-
-      return clientWindowSize;
-   }
-
-
-   private void sendPacketWithoutLock(final Channel parameterChannel, final Packet packet)
-   {
-      packet.setChannelID(parameterChannel.getID());
-
-      Connection conn = parameterChannel.getConnection().getTransportConnection();
-
-      ActiveMQBuffer buffer = packet.encode(this.getCoreConnection());
-
-      conn.write(buffer, false, false);
-   }
-
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/PacketDecoder.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/PacketDecoder.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/PacketDecoder.java
index 764f8ec..7aeace4 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/PacketDecoder.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/PacketDecoder.java
@@ -77,7 +77,7 @@ import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SUBSCRIBE_T
 import java.io.Serializable;
 
 import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverReplyMessage;
@@ -91,7 +91,7 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSharedQueueM
 import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectConsumerMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage_V2;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.NullResponseMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.Ping;
@@ -174,7 +174,7 @@ public abstract class PacketDecoder implements Serializable
          }
          case EXCEPTION:
          {
-            packet = new HornetQExceptionMessage();
+            packet = new ActiveMQExceptionMessage();
             break;
          }
          case PACKETS_CONFIRMED:
@@ -464,7 +464,7 @@ public abstract class PacketDecoder implements Serializable
          }
          default:
          {
-            throw HornetQClientMessageBundle.BUNDLE.invalidType(packetType);
+            throw ActiveMQClientMessageBundle.BUNDLE.invalidType(packetType);
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/RemotingConnectionImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/RemotingConnectionImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/RemotingConnectionImpl.java
index 7e5b4f0..9104d48 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/RemotingConnectionImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/RemotingConnectionImpl.java
@@ -23,14 +23,14 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.apache.activemq.core.protocol.core.Channel;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.ChannelImpl.CHANNEL_ID;
 import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage_V2;
-import org.apache.activemq.core.security.HornetQPrincipal;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
 import org.apache.activemq.spi.core.protocol.AbstractRemotingConnection;
 import org.apache.activemq.spi.core.remoting.Connection;
 import org.apache.activemq.utils.SimpleIDGenerator;
@@ -44,7 +44,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
    // Constants
    // ------------------------------------------------------------------------------------
 
-   private static final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
    // Static
    // ---------------------------------------------------------------------------------------
@@ -210,7 +210,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
          destroyed = true;
       }
 
-      HornetQClientLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
+      ActiveMQClientLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
 
 
       try
@@ -219,7 +219,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
       }
       catch (Throwable e)
       {
-         HornetQClientLogger.LOGGER.warn(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
       }
 
       // Then call the listeners
@@ -359,9 +359,9 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
       }
    }
 
-   public HornetQPrincipal getDefaultHornetQPrincipal()
+   public ActiveMQPrincipal getDefaultActiveMQPrincipal()
    {
-      return getTransportConnection().getDefaultHornetQPrincipal();
+      return getTransportConnection().getDefaultActiveMQPrincipal();
    }
 
    // Buffer Handler implementation
@@ -374,7 +374,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
 
          if (isTrace)
          {
-            HornetQClientLogger.LOGGER.trace("handling packet " + packet);
+            ActiveMQClientLogger.LOGGER.trace("handling packet " + packet);
          }
 
          if (packet.isAsyncExec() && executor != null)
@@ -391,7 +391,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
                   }
                   catch (Throwable t)
                   {
-                     HornetQClientLogger.LOGGER.errorHandlingPacket(t, packet);
+                     ActiveMQClientLogger.LOGGER.errorHandlingPacket(t, packet);
                   }
 
                   executing = false;
@@ -415,7 +415,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
       }
       catch (Exception e)
       {
-         HornetQClientLogger.LOGGER.errorDecodingPacket(e);
+         ActiveMQClientLogger.LOGGER.errorDecodingPacket(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java
new file mode 100644
index 0000000..14877f4
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.protocol.core.impl.wireformat;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public class ActiveMQExceptionMessage extends PacketImpl
+{
+
+   private ActiveMQException exception;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQExceptionMessage(final ActiveMQException exception)
+   {
+      super(EXCEPTION);
+
+      this.exception = exception;
+   }
+
+   public ActiveMQExceptionMessage()
+   {
+      super(EXCEPTION);
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public boolean isResponse()
+   {
+      return true;
+   }
+
+   public ActiveMQException getException()
+   {
+      return exception;
+   }
+
+   @Override
+   public void encodeRest(final ActiveMQBuffer buffer)
+   {
+      buffer.writeInt(exception.getType().getCode());
+      buffer.writeNullableString(exception.getMessage());
+   }
+
+   @Override
+   public void decodeRest(final ActiveMQBuffer buffer)
+   {
+      int code = buffer.readInt();
+      String msg = buffer.readNullableString();
+
+      exception = ActiveMQExceptionType.createException(code, msg);
+   }
+
+   @Override
+   public String toString()
+   {
+      return getParentString() + ", exception= " + exception + "]";
+   }
+
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = super.hashCode();
+      result = prime * result + ((exception == null) ? 0 : exception.hashCode());
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+      {
+         return true;
+      }
+      if (!super.equals(obj))
+      {
+         return false;
+      }
+      if (!(obj instanceof ActiveMQExceptionMessage))
+      {
+         return false;
+      }
+      ActiveMQExceptionMessage other = (ActiveMQExceptionMessage)obj;
+      if (exception == null)
+      {
+         if (other.exception != null)
+         {
+            return false;
+         }
+      }
+      else if (!exception.equals(other.exception))
+      {
+         return false;
+      }
+      return true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
deleted file mode 100644
index f8bfe5a..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.protocol.core.impl.wireformat;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class HornetQExceptionMessage extends PacketImpl
-{
-
-   private ActiveMQException exception;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQExceptionMessage(final ActiveMQException exception)
-   {
-      super(EXCEPTION);
-
-      this.exception = exception;
-   }
-
-   public HornetQExceptionMessage()
-   {
-      super(EXCEPTION);
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public boolean isResponse()
-   {
-      return true;
-   }
-
-   public ActiveMQException getException()
-   {
-      return exception;
-   }
-
-   @Override
-   public void encodeRest(final ActiveMQBuffer buffer)
-   {
-      buffer.writeInt(exception.getType().getCode());
-      buffer.writeNullableString(exception.getMessage());
-   }
-
-   @Override
-   public void decodeRest(final ActiveMQBuffer buffer)
-   {
-      int code = buffer.readInt();
-      String msg = buffer.readNullableString();
-
-      exception = ActiveMQExceptionType.createException(code, msg);
-   }
-
-   @Override
-   public String toString()
-   {
-      return getParentString() + ", exception= " + exception + "]";
-   }
-
-   @Override
-   public int hashCode()
-   {
-      final int prime = 31;
-      int result = super.hashCode();
-      result = prime * result + ((exception == null) ? 0 : exception.hashCode());
-      return result;
-   }
-
-   @Override
-   public boolean equals(Object obj)
-   {
-      if (this == obj)
-      {
-         return true;
-      }
-      if (!super.equals(obj))
-      {
-         return false;
-      }
-      if (!(obj instanceof HornetQExceptionMessage))
-      {
-         return false;
-      }
-      HornetQExceptionMessage other = (HornetQExceptionMessage)obj;
-      if (exception == null)
-      {
-         if (other.exception != null)
-         {
-            return false;
-         }
-      }
-      else if (!exception.equals(other.exception))
-      {
-         return false;
-      }
-      return true;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQAMQPFrameDecoder.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQAMQPFrameDecoder.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQAMQPFrameDecoder.java
new file mode 100644
index 0000000..dc6e658
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQAMQPFrameDecoder.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.remoting.impl.netty;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
+
+/**
+ * A Netty decoder specially optimised to to decode messages on the core protocol only
+ *
+ * @author <a href="tlee@redhat.com">Trustin Lee</a>
+ * @author <a href="nmaurer@redhat.com">Norman Maurer</a>
+ * @version $Revision: 7839 $, $Date: 2009-08-21 02:26:39 +0900 (2009-08-21, 금) $
+ */
+public class ActiveMQAMQPFrameDecoder extends LengthFieldBasedFrameDecoder
+{
+   public ActiveMQAMQPFrameDecoder()
+   {
+      // The interface itself is part of the buffer (hence the -4)
+      super(Integer.MAX_VALUE, 0, 4, -4 , 0);
+   }
+
+
+   @Override
+   protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length)
+   {
+      return super.extractFrame(ctx, buffer, index, length);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQChannelHandler.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQChannelHandler.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQChannelHandler.java
new file mode 100644
index 0000000..d075a98
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQChannelHandler.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.remoting.impl.netty;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelDuplexHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.group.ChannelGroup;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
+import org.apache.activemq.spi.core.remoting.BufferHandler;
+import org.apache.activemq.spi.core.remoting.ConnectionLifeCycleListener;
+
+
+/**
+ * Common handler implementation for client and server side handler.
+ *
+ * @author <a href="mailto:tlee@redhat.com">Trustin Lee</a>
+ * @author <a href="mailto:nmaurer@redhat.com">Norman Maurer</a>
+ * @version $Rev$, $Date$
+ */
+public class ActiveMQChannelHandler extends ChannelDuplexHandler
+{
+   private final ChannelGroup group;
+
+   private final BufferHandler handler;
+
+   private final ConnectionLifeCycleListener listener;
+
+   volatile boolean active;
+
+   protected ActiveMQChannelHandler(final ChannelGroup group,
+                                    final BufferHandler handler,
+                                    final ConnectionLifeCycleListener listener)
+   {
+      this.group = group;
+      this.handler = handler;
+      this.listener = listener;
+   }
+
+   @Override
+   public void channelActive(final ChannelHandlerContext ctx) throws Exception
+   {
+      group.add(ctx.channel());
+      ctx.fireChannelActive();
+   }
+
+   @Override
+   public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception
+   {
+      // TODO: Think about the id thingy
+      listener.connectionReadyForWrites(channelId(ctx.channel()), ctx.channel().isWritable());
+   }
+
+   @Override
+   public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception
+   {
+      ByteBuf buffer = (ByteBuf) msg;
+
+      handler.bufferReceived(channelId(ctx.channel()), new ChannelBufferWrapper(buffer));
+   }
+
+   @Override
+   public void channelInactive(final ChannelHandlerContext ctx) throws Exception
+   {
+      synchronized (this)
+      {
+         if (active)
+         {
+            listener.connectionDestroyed(channelId(ctx.channel()));
+
+            active = false;
+         }
+      }
+   }
+
+   @Override
+   public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception
+   {
+      if (!active)
+      {
+         return;
+      }
+      // We don't want to log this - since it is normal for this to happen during failover/reconnect
+      // and we don't want to spew out stack traces in that event
+      // The user has access to this exeception anyway via the ActiveMQException initial cause
+
+      ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.nettyError();
+      me.initCause(cause);
+
+      synchronized (listener)
+      {
+         try
+         {
+            listener.connectionException(channelId(ctx.channel()), me);
+            active = false;
+         }
+         catch (Exception ex)
+         {
+            ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex);
+         }
+      }
+   }
+
+   protected static int channelId(Channel channel)
+   {
+      return channel.hashCode();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQFrameDecoder2.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQFrameDecoder2.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQFrameDecoder2.java
new file mode 100644
index 0000000..4c74b1b
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/ActiveMQFrameDecoder2.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.remoting.impl.netty;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
+import org.apache.activemq.utils.DataConstants;
+
+/**
+ * A Netty decoder specially optimised to to decode messages on the core protocol only
+ *
+ * @author <a href="tlee@redhat.com">Trustin Lee</a>
+ * @author <a href="nmaurer@redhat.com">Norman Maurer</a>
+ * @version $Revision: 7839 $, $Date: 2009-08-21 02:26:39 +0900 (2009-08-21, 금) $
+ */
+public class ActiveMQFrameDecoder2 extends LengthFieldBasedFrameDecoder
+{
+   public ActiveMQFrameDecoder2()
+   {
+      super(Integer.MAX_VALUE, 0, DataConstants.SIZE_INT);
+   }
+
+   @Override
+   protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length)
+   {
+      return super.extractFrame(ctx, buffer, index, length).skipBytes(DataConstants.SIZE_INT);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQAMQPFrameDecoder.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQAMQPFrameDecoder.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQAMQPFrameDecoder.java
deleted file mode 100644
index ed6bf75..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQAMQPFrameDecoder.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.remoting.impl.netty;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
-
-/**
- * A Netty decoder specially optimised to to decode messages on the core protocol only
- *
- * @author <a href="tlee@redhat.com">Trustin Lee</a>
- * @author <a href="nmaurer@redhat.com">Norman Maurer</a>
- * @version $Revision: 7839 $, $Date: 2009-08-21 02:26:39 +0900 (2009-08-21, 금) $
- */
-public class HornetQAMQPFrameDecoder extends LengthFieldBasedFrameDecoder
-{
-   public HornetQAMQPFrameDecoder()
-   {
-      // The interface itself is part of the buffer (hence the -4)
-      super(Integer.MAX_VALUE, 0, 4, -4 , 0);
-   }
-
-
-   @Override
-   protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length)
-   {
-      return super.extractFrame(ctx, buffer, index, length);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQChannelHandler.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQChannelHandler.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQChannelHandler.java
deleted file mode 100644
index c7e3fd6..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQChannelHandler.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.remoting.impl.netty;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelDuplexHandler;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.group.ChannelGroup;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
-import org.apache.activemq.spi.core.remoting.BufferHandler;
-import org.apache.activemq.spi.core.remoting.ConnectionLifeCycleListener;
-
-
-/**
- * Common handler implementation for client and server side handler.
- *
- * @author <a href="mailto:tlee@redhat.com">Trustin Lee</a>
- * @author <a href="mailto:nmaurer@redhat.com">Norman Maurer</a>
- * @version $Rev$, $Date$
- */
-public class HornetQChannelHandler extends ChannelDuplexHandler
-{
-   private final ChannelGroup group;
-
-   private final BufferHandler handler;
-
-   private final ConnectionLifeCycleListener listener;
-
-   volatile boolean active;
-
-   protected HornetQChannelHandler(final ChannelGroup group,
-                                   final BufferHandler handler,
-                                   final ConnectionLifeCycleListener listener)
-   {
-      this.group = group;
-      this.handler = handler;
-      this.listener = listener;
-   }
-
-   @Override
-   public void channelActive(final ChannelHandlerContext ctx) throws Exception
-   {
-      group.add(ctx.channel());
-      ctx.fireChannelActive();
-   }
-
-   @Override
-   public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception
-   {
-      // TODO: Think about the id thingy
-      listener.connectionReadyForWrites(channelId(ctx.channel()), ctx.channel().isWritable());
-   }
-
-   @Override
-   public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception
-   {
-      ByteBuf buffer = (ByteBuf) msg;
-
-      handler.bufferReceived(channelId(ctx.channel()), new ChannelBufferWrapper(buffer));
-   }
-
-   @Override
-   public void channelInactive(final ChannelHandlerContext ctx) throws Exception
-   {
-      synchronized (this)
-      {
-         if (active)
-         {
-            listener.connectionDestroyed(channelId(ctx.channel()));
-
-            active = false;
-         }
-      }
-   }
-
-   @Override
-   public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception
-   {
-      if (!active)
-      {
-         return;
-      }
-      // We don't want to log this - since it is normal for this to happen during failover/reconnect
-      // and we don't want to spew out stack traces in that event
-      // The user has access to this exeception anyway via the ActiveMQException initial cause
-
-      ActiveMQException me = HornetQClientMessageBundle.BUNDLE.nettyError();
-      me.initCause(cause);
-
-      synchronized (listener)
-      {
-         try
-         {
-            listener.connectionException(channelId(ctx.channel()), me);
-            active = false;
-         }
-         catch (Exception ex)
-         {
-            HornetQClientLogger.LOGGER.errorCallingLifeCycleListener(ex);
-         }
-      }
-   }
-
-   protected static int channelId(Channel channel)
-   {
-      return channel.hashCode();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQFrameDecoder2.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQFrameDecoder2.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQFrameDecoder2.java
deleted file mode 100644
index 17b5fc7..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/HornetQFrameDecoder2.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.remoting.impl.netty;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
-import org.apache.activemq.utils.DataConstants;
-
-/**
- * A Netty decoder specially optimised to to decode messages on the core protocol only
- *
- * @author <a href="tlee@redhat.com">Trustin Lee</a>
- * @author <a href="nmaurer@redhat.com">Norman Maurer</a>
- * @version $Revision: 7839 $, $Date: 2009-08-21 02:26:39 +0900 (2009-08-21, 금) $
- */
-public class HornetQFrameDecoder2 extends LengthFieldBasedFrameDecoder
-{
-   public HornetQFrameDecoder2()
-   {
-      super(Integer.MAX_VALUE, 0, DataConstants.SIZE_INT);
-   }
-
-   @Override
-   protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length)
-   {
-      return super.extractFrame(ctx, buffer, index, length).skipBytes(DataConstants.SIZE_INT);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnection.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnection.java b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnection.java
index 6dbf38a..b068b79 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnection.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/remoting/impl/netty/NettyConnection.java
@@ -29,8 +29,8 @@ import org.apache.activemq.api.core.ActiveMQBuffers;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.security.HornetQPrincipal;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.Connection;
 import org.apache.activemq.spi.core.remoting.ConnectionLifeCycleListener;
@@ -110,7 +110,7 @@ public class NettyConnection implements Connection
          }
          catch (Throwable e)
          {
-            HornetQClientLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
          }
       }
    }
@@ -320,7 +320,7 @@ public class NettyConnection implements Connection
 
                      if (!ok)
                      {
-                        HornetQClientLogger.LOGGER.timeoutFlushingPacket();
+                        ActiveMQClientLogger.LOGGER.timeoutFlushingPacket();
                      }
 
                      break;
@@ -369,7 +369,7 @@ public class NettyConnection implements Connection
    }
 
    //never allow this
-   public HornetQPrincipal getDefaultHornetQPrincipal()
+   public ActiveMQPrincipal getDefaultActiveMQPrincipal()
    {
       return null;
    }
@@ -428,7 +428,7 @@ public class NettyConnection implements Connection
 
             if (!sslCloseFuture.awaitUninterruptibly(10000))
             {
-               HornetQClientLogger.LOGGER.timeoutClosingSSL();
+               ActiveMQClientLogger.LOGGER.timeoutClosingSSL();
             }
          }
          catch (Throwable t)
@@ -440,7 +440,7 @@ public class NettyConnection implements Connection
       ChannelFuture closeFuture = channel.close();
       if (!closeFuture.awaitUninterruptibly(10000))
       {
-         HornetQClientLogger.LOGGER.timeoutClosingNettyChannel();
+         ActiveMQClientLogger.LOGGER.timeoutClosingNettyChannel();
       }
    }
    // Inner classes -------------------------------------------------


[34/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSMessageListenerWrapper.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSMessageListenerWrapper.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSMessageListenerWrapper.java
index 1bbffc5..d56fddd 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSMessageListenerWrapper.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSMessageListenerWrapper.java
@@ -19,7 +19,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.client.ClientConsumer;
 import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.MessageHandler;
-import org.apache.activemq.api.jms.HornetQJMSConstants;
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
 
 /**
  *
@@ -30,9 +30,9 @@ import org.apache.activemq.api.jms.HornetQJMSConstants;
  */
 public class JMSMessageListenerWrapper implements MessageHandler
 {
-   private final HornetQConnection connection;
+   private final ActiveMQConnection connection;
 
-   private final HornetQSession session;
+   private final ActiveMQSession session;
 
    private final MessageListener listener;
 
@@ -42,8 +42,8 @@ public class JMSMessageListenerWrapper implements MessageHandler
 
    private final boolean individualACK;
 
-   protected JMSMessageListenerWrapper(final HornetQConnection connection,
-                                       final HornetQSession session,
+   protected JMSMessageListenerWrapper(final ActiveMQConnection connection,
+                                       final ActiveMQSession session,
                                        final ClientConsumer consumer,
                                        final MessageListener listener,
                                        final int ackMode)
@@ -58,7 +58,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
 
       transactedOrClientAck = (ackMode == Session.SESSION_TRANSACTED || ackMode == Session.CLIENT_ACKNOWLEDGE) || session.isXA();
 
-      individualACK = (ackMode == HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE);
+      individualACK = (ackMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE);
    }
 
    /**
@@ -67,7 +67,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
     */
    public void onMessage(final ClientMessage message)
    {
-      HornetQMessage msg = HornetQMessage.createMessage(message, session.getCoreSession());
+      ActiveMQMessage msg = ActiveMQMessage.createMessage(message, session.getCoreSession());
 
       if (individualACK)
       {
@@ -80,7 +80,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
       }
       catch (Exception e)
       {
-         HornetQJMSClientLogger.LOGGER.errorPreparingMessageForReceipt(e);
+         ActiveMQJMSClientLogger.LOGGER.errorPreparingMessageForReceipt(e);
 
          return;
       }
@@ -93,7 +93,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
          }
          catch (ActiveMQException e)
          {
-            HornetQJMSClientLogger.LOGGER.errorProcessingMessage(e);
+            ActiveMQJMSClientLogger.LOGGER.errorProcessingMessage(e);
          }
       }
 
@@ -106,7 +106,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
       {
          // See JMS 1.1 spec, section 4.5.2
 
-         HornetQJMSClientLogger.LOGGER.onMessageError(e);
+         ActiveMQJMSClientLogger.LOGGER.onMessageError(e);
 
          if (!transactedOrClientAck)
          {
@@ -123,7 +123,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
             }
             catch (Exception e2)
             {
-               HornetQJMSClientLogger.LOGGER.errorRecoveringSession(e2);
+               ActiveMQJMSClientLogger.LOGGER.errorRecoveringSession(e2);
             }
          }
       }
@@ -143,7 +143,7 @@ public class JMSMessageListenerWrapper implements MessageHandler
          }
          catch (ActiveMQException e)
          {
-            HornetQJMSClientLogger.LOGGER.errorProcessingMessage(e);
+            ActiveMQJMSClientLogger.LOGGER.errorProcessingMessage(e);
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/SelectorTranslator.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/SelectorTranslator.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/SelectorTranslator.java
index 0c9b5cf..3ff6ea4 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/SelectorTranslator.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/SelectorTranslator.java
@@ -17,12 +17,12 @@ import java.util.List;
 
 /**
  *
- * This class converts a JMS selector expression into a HornetQ core filter expression.
+ * This class converts a JMS selector expression into a ActiveMQ core filter expression.
  *
- * JMS selector and HornetQ filters use the same syntax but have different identifiers.
+ * JMS selector and ActiveMQ filters use the same syntax but have different identifiers.
  *
  * We basically just need to replace the JMS header and property Identifier names
- * with the corresponding HornetQ field and header Identifier names.
+ * with the corresponding ActiveMQ field and header Identifier names.
  *
  * We must be careful not to substitute any literals, or identifiers whose name contains the name
  * of one we want to substitute.
@@ -34,7 +34,7 @@ import java.util.List;
  */
 public class SelectorTranslator
 {
-   public static String convertToHornetQFilterString(final String selectorString)
+   public static String convertToActiveMQFilterString(final String selectorString)
    {
       if (selectorString == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ThreadAwareContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ThreadAwareContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ThreadAwareContext.java
index ec34209..84937d2 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ThreadAwareContext.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ThreadAwareContext.java
@@ -90,7 +90,7 @@ public class ThreadAwareContext
    {
       if (completionListenerThread == Thread.currentThread())
       {
-         throw HornetQJMSClientBundle.BUNDLE.callingMethodFromCompletionListenerRuntime();
+         throw ActiveMQJMSClientBundle.BUNDLE.callingMethodFromCompletionListenerRuntime();
       }
    }
 
@@ -109,7 +109,7 @@ public class ThreadAwareContext
    {
       if (completionListenerThread == Thread.currentThread())
       {
-         throw HornetQJMSClientBundle.BUNDLE.callingMethodFromCompletionListener();
+         throw ActiveMQJMSClientBundle.BUNDLE.callingMethodFromCompletionListener();
       }
    }
 
@@ -126,7 +126,7 @@ public class ThreadAwareContext
    {
       if (messageListenerThreads.contains(Thread.currentThread().getId()))
       {
-         throw HornetQJMSClientBundle.BUNDLE.callingMethodFromListenerRuntime();
+         throw ActiveMQJMSClientBundle.BUNDLE.callingMethodFromListenerRuntime();
       }
    }
 
@@ -145,7 +145,7 @@ public class ThreadAwareContext
    {
       if (messageListenerThreads.contains(Thread.currentThread().getId()))
       {
-         throw HornetQJMSClientBundle.BUNDLE.callingMethodFromListener();
+         throw ActiveMQJMSClientBundle.BUNDLE.callingMethodFromListener();
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/package-info.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/package-info.java
index acce764..74fbb39 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/package-info.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/package-info.java
@@ -14,7 +14,7 @@
  * Implementation of the JMS API.
  * <br>
  * Classes in this package are not meant to be used directly
- * except {@link org.apache.activemq.jms.client.HornetQConnectionFactory} which can be instantiated directly
+ * except {@link org.apache.activemq.jms.client.ActiveMQConnectionFactory} which can be instantiated directly
  * if JMS resources are not looked up in JNDI.
  *
  */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/ConnectionFactoryObjectFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/ConnectionFactoryObjectFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/ConnectionFactoryObjectFactory.java
index 5b11b24..f717e1f 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/ConnectionFactoryObjectFactory.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/ConnectionFactoryObjectFactory.java
@@ -23,7 +23,7 @@ import javax.naming.spi.ObjectFactory;
  *
  * A ConnectionFactoryObjectFactory.
  *
- * Given a reference - reconstructs a HornetQRAConnectionFactory
+ * Given a reference - reconstructs a ActiveMQRAConnectionFactory
  *
  * @author <a href="tim.fox@jboss.com">Tim Fox</a>
  * @version $Revision$
@@ -35,7 +35,7 @@ public class ConnectionFactoryObjectFactory implements ObjectFactory
    {
       Reference r = (Reference)ref;
 
-      byte[] bytes = (byte[])r.get("HornetQ-CF").getContent();
+      byte[] bytes = (byte[])r.get("ActiveMQ-CF").getContent();
 
       // Deserialize
       return SerializableObjectRefAddr.deserialize(bytes);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/DestinationObjectFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/DestinationObjectFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/DestinationObjectFactory.java
index af18fb9..5be2a40 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/DestinationObjectFactory.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/referenceable/DestinationObjectFactory.java
@@ -23,7 +23,7 @@ import javax.naming.spi.ObjectFactory;
  *
  * A DestinationObjectFactory.
  *
- * Given a Reference - reconstructs a HornetQDestination
+ * Given a Reference - reconstructs a ActiveMQDestination
  *
  * @author <a href="tim.fox@jboss.com">Tim Fox</a>
  * @version $Revision$
@@ -35,7 +35,7 @@ public class DestinationObjectFactory implements ObjectFactory
    {
       Reference r = (Reference)ref;
 
-      byte[] bytes = (byte[])r.get("HornetQ-DEST").getContent();
+      byte[] bytes = (byte[])r.get("ActiveMQ-DEST").getContent();
 
       // Deserialize
       return SerializableObjectRefAddr.deserialize(bytes);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/ActiveMQJMSBridgeLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/ActiveMQJMSBridgeLogger.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/ActiveMQJMSBridgeLogger.java
new file mode 100644
index 0000000..8084f78
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/ActiveMQJMSBridgeLogger.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.jms.bridge;
+
+import javax.management.ObjectName;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ *
+ * Logger Code 34
+ *
+ * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 341000 to 341999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQJMSBridgeLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQJMSBridgeLogger LOGGER = Logger.getMessageLogger(ActiveMQJMSBridgeLogger.class, ActiveMQJMSBridgeLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 341000, value = "Failed to set up JMS bridge connections. Most probably the source or target servers are unavailable." +
+         " Will retry after a pause of {0} ms", format = Message.Format.MESSAGE_FORMAT)
+   void failedToSetUpBridge(long failureRetryInterval);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 341001, value = "JMS Bridge Succeeded in reconnecting to servers" , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeReconnected();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 341002, value = "Succeeded in connecting to servers" , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeConnected();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342000, value = "Attempt to start JMS Bridge, but is already started" , format = Message.Format.MESSAGE_FORMAT)
+   void errorBridgeAlreadyStarted();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342001, value = "Failed to start JMS Bridge" , format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingBridge();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342002, value = "Failed to unregisted JMS Bridge {0}" , format = Message.Format.MESSAGE_FORMAT)
+   void errorUnregisteringBridge(ObjectName objectName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342003, value = "JMS Bridge unable to set up connections, bridge will be stopped" , format = Message.Format.MESSAGE_FORMAT)
+   void errorConnectingBridge();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342004, value = "JMS Bridge Will retry after a pause of {0} ms" , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeRetry(long failureRetryInterval);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342005, value = "JMS Bridge unable to set up connections, bridge will not be started" , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNotStarted();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342006, value = "Detected failure on bridge connection" , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeFailure(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342009, value = "JMS Bridge failed to send + acknowledge batch, closing JMS objects"  , format = Message.Format.MESSAGE_FORMAT)
+   void bridgeAckError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 342010, value = "Failed to connect JMS Bridge", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeConnectError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 344001, value = "Failed to start source connection" , format = Message.Format.MESSAGE_FORMAT)
+   void jmsBridgeSrcConnectError(@Cause Exception e);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/HornetQJMSBridgeLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/HornetQJMSBridgeLogger.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/HornetQJMSBridgeLogger.java
deleted file mode 100644
index 5b89fce..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/HornetQJMSBridgeLogger.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.jms.bridge;
-
-import javax.management.ObjectName;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- *
- * Logger Code 34
- *
- * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 341000 to 341999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQJMSBridgeLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQJMSBridgeLogger LOGGER = Logger.getMessageLogger(HornetQJMSBridgeLogger.class, HornetQJMSBridgeLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 341000, value = "Failed to set up JMS bridge connections. Most probably the source or target servers are unavailable." +
-         " Will retry after a pause of {0} ms", format = Message.Format.MESSAGE_FORMAT)
-   void failedToSetUpBridge(long failureRetryInterval);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 341001, value = "JMS Bridge Succeeded in reconnecting to servers" , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeReconnected();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 341002, value = "Succeeded in connecting to servers" , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeConnected();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342000, value = "Attempt to start JMS Bridge, but is already started" , format = Message.Format.MESSAGE_FORMAT)
-   void errorBridgeAlreadyStarted();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342001, value = "Failed to start JMS Bridge" , format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingBridge();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342002, value = "Failed to unregisted JMS Bridge {0}" , format = Message.Format.MESSAGE_FORMAT)
-   void errorUnregisteringBridge(ObjectName objectName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342003, value = "JMS Bridge unable to set up connections, bridge will be stopped" , format = Message.Format.MESSAGE_FORMAT)
-   void errorConnectingBridge();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342004, value = "JMS Bridge Will retry after a pause of {0} ms" , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeRetry(long failureRetryInterval);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342005, value = "JMS Bridge unable to set up connections, bridge will not be started" , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNotStarted();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342006, value = "Detected failure on bridge connection" , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeFailure(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342009, value = "JMS Bridge failed to send + acknowledge batch, closing JMS objects"  , format = Message.Format.MESSAGE_FORMAT)
-   void bridgeAckError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 342010, value = "Failed to connect JMS Bridge", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeConnectError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 344001, value = "Failed to start source connection" , format = Message.Format.MESSAGE_FORMAT)
-   void jmsBridgeSrcConnectError(@Cause Exception e);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridge.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridge.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridge.java
index 936e61e..13e7c10 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridge.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridge.java
@@ -14,13 +14,13 @@ package org.apache.activemq.jms.bridge;
 
 import javax.transaction.TransactionManager;
 
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 
 /**
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  */
-public interface JMSBridge extends HornetQComponent
+public interface JMSBridge extends ActiveMQComponent
 {
    void pause() throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridgeControl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridgeControl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridgeControl.java
index 3ed1d61..b116b4f 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridgeControl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/JMSBridgeControl.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.jms.bridge;
 
-import org.apache.activemq.api.core.management.HornetQComponentControl;
+import org.apache.activemq.api.core.management.ActiveMQComponentControl;
 
 /**
  * A JMSBridgeControl
@@ -20,7 +20,7 @@ import org.apache.activemq.api.core.management.HornetQComponentControl;
  * @author <a href="jose@voxeo.com">Jose de Castro</a>
  *
  */
-public interface JMSBridgeControl extends HornetQComponentControl
+public interface JMSBridgeControl extends ActiveMQComponentControl
 {
    void pause() throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/QualityOfServiceMode.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/QualityOfServiceMode.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/QualityOfServiceMode.java
index 188aa05..d07dd78 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/QualityOfServiceMode.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/QualityOfServiceMode.java
@@ -38,7 +38,7 @@ package org.apache.activemq.jms.bridge;
  *
  * This QoS mode ensures messages will reach the destination from the source
  * once and only once. (Sometimes this mode is known as "exactly once"). If both
- * the source and the destination are on the same HornetQ server
+ * the source and the destination are on the same ActiveMQ server
  * instance then this can be achieved by sending and acknowledging the messages
  * in the same local transaction. If the source and destination are on different
  * servers this is achieved by enlisting the sending and consuming sessions in a

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java
index f04d59b..e30e795 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java
@@ -49,18 +49,18 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.api.core.client.FailoverEventListener;
 import org.apache.activemq.api.core.client.FailoverEventType;
-import org.apache.activemq.api.jms.HornetQJMSConstants;
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.jms.bridge.ConnectionFactoryFactory;
 import org.apache.activemq.jms.bridge.DestinationFactory;
-import org.apache.activemq.jms.bridge.HornetQJMSBridgeLogger;
+import org.apache.activemq.jms.bridge.ActiveMQJMSBridgeLogger;
 import org.apache.activemq.jms.bridge.JMSBridge;
 import org.apache.activemq.jms.bridge.JMSBridgeControl;
 import org.apache.activemq.jms.bridge.QualityOfServiceMode;
-import org.apache.activemq.jms.client.HornetQConnection;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQMessage;
-import org.apache.activemq.jms.server.HornetQJMSServerBundle;
-import org.apache.activemq.jms.server.recovery.HornetQRegistryBase;
+import org.apache.activemq.jms.client.ActiveMQConnection;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQMessage;
+import org.apache.activemq.jms.server.ActiveMQJMSServerBundle;
+import org.apache.activemq.jms.server.recovery.ActiveMQRegistryBase;
 import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
 import org.apache.activemq.utils.ClassloadingUtil;
 import org.apache.activemq.utils.DefaultSensitiveStringCodec;
@@ -78,7 +78,7 @@ public final class JMSBridgeImpl implements JMSBridge
 {
    private static final String[] RESOURCE_RECOVERY_CLASS_NAMES = new String[]{"org.jboss.as.messaging.jms.AS7RecoveryRegistry"};
 
-   private static boolean trace = HornetQJMSBridgeLogger.LOGGER.isTraceEnabled();
+   private static boolean trace = ActiveMQJMSBridgeLogger.LOGGER.isTraceEnabled();
 
    private static final int TEN_YEARS = 60 * 60 * 24 * 365 * 10; // in ms
 
@@ -183,7 +183,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
    private static final int FORWARD_MODE_NONTX = 2;
 
-   private HornetQRegistryBase registry;
+   private ActiveMQRegistryBase registry;
 
    /*
     * Constructor for MBean
@@ -349,7 +349,7 @@ public final class JMSBridgeImpl implements JMSBridge
                this.objectName = ObjectName.getInstance(objectName);
                StandardMBean mbean = new StandardMBean(controlBean, JMSBridgeControl.class);
                mbeanServer.registerMBean(mbean, this.objectName);
-               HornetQJMSBridgeLogger.LOGGER.debug("Registered JMSBridge instance as: " + this.objectName.getCanonicalName());
+               ActiveMQJMSBridgeLogger.LOGGER.debug("Registered JMSBridge instance as: " + this.objectName.getCanonicalName());
             }
             catch (Exception e)
             {
@@ -364,11 +364,11 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Created " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Created " + this);
       }
    }
 
-   // HornetQComponent overrides --------------------------------------------------
+   // ActiveMQComponent overrides --------------------------------------------------
 
    public synchronized void start() throws Exception
    {
@@ -381,13 +381,13 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (started)
       {
-         HornetQJMSBridgeLogger.LOGGER.errorBridgeAlreadyStarted();
+         ActiveMQJMSBridgeLogger.LOGGER.errorBridgeAlreadyStarted();
          return;
       }
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Starting " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Starting " + this);
       }
 
       // bridge has been stopped and is restarted
@@ -429,7 +429,7 @@ public final class JMSBridgeImpl implements JMSBridge
       }
       else
       {
-         HornetQJMSBridgeLogger.LOGGER.errorStartingBridge();
+         ActiveMQJMSBridgeLogger.LOGGER.errorStartingBridge();
          handleFailureOnStartup();
       }
 
@@ -447,7 +447,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Starting time checker thread");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Starting time checker thread");
          }
 
          timeChecker = new BatchTimeChecker();
@@ -457,7 +457,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Started time checker thread");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Started time checker thread");
          }
       }
 
@@ -465,7 +465,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Started " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Started " + this);
       }
    }
 
@@ -494,7 +494,7 @@ public final class JMSBridgeImpl implements JMSBridge
          }
          catch (Exception e)
          {
-            throw HornetQJMSServerBundle.BUNDLE.errorDecodingPassword(e);
+            throw ActiveMQJMSServerBundle.BUNDLE.errorDecodingPassword(e);
          }
 
       }
@@ -512,7 +512,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Stopping " + this);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Stopping " + this);
          }
          if (!connectedSource && sourceConn != null)
          {
@@ -541,7 +541,7 @@ public final class JMSBridgeImpl implements JMSBridge
             // Terminate any transaction
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Rolling back remaining tx");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Rolling back remaining tx");
             }
 
             try
@@ -552,13 +552,13 @@ public final class JMSBridgeImpl implements JMSBridge
             {
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Failed to rollback", ignore);
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to rollback", ignore);
                }
             }
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Rolled back remaining tx");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Rolled back remaining tx");
             }
          }
 
@@ -570,7 +570,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Failed to close source conn", ignore);
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to close source conn", ignore);
             }
          }
 
@@ -584,14 +584,14 @@ public final class JMSBridgeImpl implements JMSBridge
             {
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Failed to close target conn", ignore);
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to close target conn", ignore);
                }
             }
          }
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Stopped " + this);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Stopped " + this);
          }
       }
    }
@@ -611,7 +611,7 @@ public final class JMSBridgeImpl implements JMSBridge
          }
          catch (Exception e)
          {
-            HornetQJMSBridgeLogger.LOGGER.errorUnregisteringBridge(objectName);
+            ActiveMQJMSBridgeLogger.LOGGER.errorUnregisteringBridge(objectName);
          }
       }
    }
@@ -622,7 +622,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Pausing " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Pausing " + this);
       }
 
       synchronized (lock)
@@ -634,7 +634,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Paused " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Paused " + this);
       }
    }
 
@@ -642,7 +642,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Resuming " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Resuming " + this);
       }
 
       synchronized (lock)
@@ -654,7 +654,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Resumed " + this);
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Resumed " + this);
       }
    }
 
@@ -969,7 +969,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Enlisting resources in tx");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Enlisting resources in tx");
       }
 
       XAResource resSource = ((XASession) sourceSession).getXAResource();
@@ -982,7 +982,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Enlisted resources in tx");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Enlisted resources in tx");
       }
    }
 
@@ -990,7 +990,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Delisting resources from tx");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Delisting resources from tx");
       }
 
       XAResource resSource = ((XASession) sourceSession).getXAResource();
@@ -1003,7 +1003,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failed to delist source resource", e);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to delist source resource", e);
          }
       }
 
@@ -1017,13 +1017,13 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failed to delist target resource", e);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to delist target resource", e);
          }
       }
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Delisted resources from tx");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Delisted resources from tx");
       }
    }
 
@@ -1031,7 +1031,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction");
       }
 
       TransactionManager tm = getTm();
@@ -1051,7 +1051,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Started JTA transaction");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Started JTA transaction");
       }
 
       return tx;
@@ -1094,9 +1094,9 @@ public final class JMSBridgeImpl implements JMSBridge
 
       Object cf = cff.createConnectionFactory();
 
-      if (cf instanceof HornetQConnectionFactory && registry != null)
+      if (cf instanceof ActiveMQConnectionFactory && registry != null)
       {
-         registry.register(XARecoveryConfig.newConfig((HornetQConnectionFactory) cf, username, password));
+         registry.register(XARecoveryConfig.newConfig((ActiveMQConnectionFactory) cf, username, password));
       }
 
       if (qualityOfServiceMode == QualityOfServiceMode.ONCE_AND_ONLY_ONCE && !(cf instanceof XAConnectionFactory))
@@ -1110,7 +1110,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Creating an XA connection");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Creating an XA connection");
             }
             conn = ((XAConnectionFactory) cf).createXAConnection();
          }
@@ -1118,7 +1118,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Creating a non XA connection");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Creating a non XA connection");
             }
             conn = ((ConnectionFactory) cf).createConnection();
          }
@@ -1129,7 +1129,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Creating an XA connection");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Creating an XA connection");
             }
             conn = ((XAConnectionFactory) cf).createXAConnection(username, password);
          }
@@ -1137,7 +1137,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Creating a non XA connection");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Creating a non XA connection");
             }
             conn = ((ConnectionFactory) cf).createConnection(username, password);
          }
@@ -1151,16 +1151,16 @@ public final class JMSBridgeImpl implements JMSBridge
       boolean ha = false;
       BridgeFailoverListener failoverListener = null;
 
-      if (conn instanceof HornetQConnection)
+      if (conn instanceof ActiveMQConnection)
       {
-         HornetQConnectionFactory hornetQCF = (HornetQConnectionFactory) cf;
-         ha = hornetQCF.isHA();
+         ActiveMQConnectionFactory activeMQCF = (ActiveMQConnectionFactory) cf;
+         ha = activeMQCF.isHA();
 
          if (ha)
          {
-            HornetQConnection hornetQConn = (HornetQConnection) conn;
+            ActiveMQConnection activeMQConn = (ActiveMQConnection) conn;
             failoverListener = new BridgeFailoverListener(isSource);
-            hornetQConn.setFailoverListener(failoverListener);
+            activeMQConn.setFailoverListener(failoverListener);
          }
       }
 
@@ -1249,7 +1249,7 @@ public final class JMSBridgeImpl implements JMSBridge
                // Create an XASession for consuming from the source
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Creating XA source session");
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Creating XA source session");
                }
 
                sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, true, true);
@@ -1259,7 +1259,7 @@ public final class JMSBridgeImpl implements JMSBridge
             {
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Creating non XA source session");
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA source session");
                }
 
                sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, false, true);
@@ -1313,7 +1313,7 @@ public final class JMSBridgeImpl implements JMSBridge
             {
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Creating XA dest session");
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Creating XA dest session");
                }
 
                // Create an XA session for sending to the destination
@@ -1326,7 +1326,7 @@ public final class JMSBridgeImpl implements JMSBridge
             {
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Creating non XA dest session");
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA dest session");
                }
 
                // Create a standard session for sending to the target
@@ -1346,7 +1346,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction");
             }
 
             tx = startTx();
@@ -1365,7 +1365,7 @@ public final class JMSBridgeImpl implements JMSBridge
          // If this fails we should attempt to cleanup or we might end up in some weird state
 
          // Adding a log.warn, so the use may see the cause of the failure and take actions
-         HornetQJMSBridgeLogger.LOGGER.bridgeConnectError(e);
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeConnectError(e);
 
          cleanup();
 
@@ -1384,7 +1384,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failed to stop source connection", ignore);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to stop source connection", ignore);
          }
       }
 
@@ -1398,7 +1398,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Failed to delist resources", ignore);
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to delist resources", ignore);
             }
          }
          try
@@ -1410,7 +1410,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Failed to rollback", ignore);
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to rollback", ignore);
             }
          }
       }
@@ -1424,7 +1424,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failed to close source connection", ignore);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to close source connection", ignore);
          }
       }
       try
@@ -1438,7 +1438,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failed to close target connection", ignore);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failed to close target connection", ignore);
          }
       }
    }
@@ -1462,7 +1462,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Setting up connections");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Setting up connections");
       }
 
       int count = 0;
@@ -1483,7 +1483,7 @@ public final class JMSBridgeImpl implements JMSBridge
             break;
          }
 
-         HornetQJMSBridgeLogger.LOGGER.failedToSetUpBridge(failureRetryInterval);
+         ActiveMQJMSBridgeLogger.LOGGER.failedToSetUpBridge(failureRetryInterval);
 
          pause(failureRetryInterval);
       }
@@ -1496,7 +1496,7 @@ public final class JMSBridgeImpl implements JMSBridge
    {
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Sending batch of " + messages.size() + " messages");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Sending batch of " + messages.size() + " messages");
       }
 
       if (paused)
@@ -1504,7 +1504,7 @@ public final class JMSBridgeImpl implements JMSBridge
          // Don't send now
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Paused, so not sending now");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Paused, so not sending now");
          }
 
          return;
@@ -1535,14 +1535,14 @@ public final class JMSBridgeImpl implements JMSBridge
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Client acking source session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Client acking source session");
             }
 
             messages.getLast().acknowledge();
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Client acked source session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Client acked source session");
             }
          }
 
@@ -1557,7 +1557,7 @@ public final class JMSBridgeImpl implements JMSBridge
             }
             catch (TransactionRolledbackException e)
             {
-               HornetQJMSBridgeLogger.LOGGER.warn(e.getMessage() + ", retrying TX", e);
+               ActiveMQJMSBridgeLogger.LOGGER.warn(e.getMessage() + ", retrying TX", e);
                exHappened = true;
             }
          }
@@ -1569,14 +1569,14 @@ public final class JMSBridgeImpl implements JMSBridge
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Committing target session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Committing target session");
             }
 
             targetSession.commit();
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Committed target session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Committed target session");
             }
          }
 
@@ -1589,14 +1589,14 @@ public final class JMSBridgeImpl implements JMSBridge
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Client acking source session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Client acking source session");
             }
 
             messages.getLast().acknowledge();
 
             if (JMSBridgeImpl.trace)
             {
-               HornetQJMSBridgeLogger.LOGGER.trace("Client acked source session");
+               ActiveMQJMSBridgeLogger.LOGGER.trace("Client acked source session");
             }
          }
       }
@@ -1604,10 +1604,10 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (!stopping)
          {
-            HornetQJMSBridgeLogger.LOGGER.bridgeAckError(e);
+            ActiveMQJMSBridgeLogger.LOGGER.bridgeAckError(e);
          }
 
-         // We don't call failure otherwise failover would be broken with HornetQ
+         // We don't call failure otherwise failover would be broken with ActiveMQ
          // We let the ExceptionListener to deal with failures
 
          if (connectedSource)
@@ -1641,14 +1641,14 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Committing JTA transaction");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Committing JTA transaction");
          }
 
          tx.commit();
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Committed JTA transaction");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Committed JTA transaction");
          }
       }
       catch (Exception e)
@@ -1662,7 +1662,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
          }
 
-         HornetQJMSBridgeLogger.LOGGER.bridgeAckError(e);
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeAckError(e);
 
          //we don't do handle failure here because the tx
          //may be rolledback due to failover. All failure handling
@@ -1683,7 +1683,7 @@ public final class JMSBridgeImpl implements JMSBridge
          }
          catch (Exception e)
          {
-            HornetQJMSBridgeLogger.LOGGER.bridgeAckError(e);
+            ActiveMQJMSBridgeLogger.LOGGER.bridgeAckError(e);
 
             handleFailureOnSend();
          }
@@ -1698,20 +1698,20 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Committing source session");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Committing source session");
          }
 
          sourceSession.commit();
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Committed source session");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Committed source session");
          }
 
       }
       catch (Exception e)
       {
-         HornetQJMSBridgeLogger.LOGGER.bridgeAckError(e);
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeAckError(e);
 
          try
          {
@@ -1753,7 +1753,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Sending message " + msg);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Sending message " + msg);
          }
 
          // Make sure the correct time to live gets propagated
@@ -1774,7 +1774,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Sent message " + msg);
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Sent message " + msg);
          }
       }
    }
@@ -1810,14 +1810,14 @@ public final class JMSBridgeImpl implements JMSBridge
       // distributed request/response
       if (JMSBridgeImpl.trace)
       {
-         HornetQJMSBridgeLogger.LOGGER.trace("Adding old message id in Message header");
+         ActiveMQJMSBridgeLogger.LOGGER.trace("Adding old message id in Message header");
       }
 
       JMSBridgeImpl.copyProperties(msg);
 
       String val = null;
 
-      val = msg.getStringProperty(HornetQJMSConstants.JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST);
+      val = msg.getStringProperty(ActiveMQJMSConstants.JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST);
 
       if (val == null)
       {
@@ -1832,7 +1832,7 @@ public final class JMSBridgeImpl implements JMSBridge
          val = sb.toString();
       }
 
-      msg.setStringProperty(HornetQJMSConstants.JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST, val);
+      msg.setStringProperty(ActiveMQJMSConstants.JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST, val);
    }
 
    /*
@@ -1875,12 +1875,12 @@ public final class JMSBridgeImpl implements JMSBridge
 
             if (val instanceof byte[] == false)
             {
-               //Can't set byte[] array props through the JMS API - if we're bridging a HornetQ message it might have such props
+               //Can't set byte[] array props through the JMS API - if we're bridging a ActiveMQ message it might have such props
                msg.setObjectProperty(propName, entry.getValue());
             }
-            else if (msg instanceof HornetQMessage)
+            else if (msg instanceof ActiveMQMessage)
             {
-               ((HornetQMessage) msg).getCoreMessage().putBytesProperty(propName, (byte[]) val);
+               ((ActiveMQMessage) msg).getCoreMessage().putBytesProperty(propName, (byte[]) val);
             }
          }
       }
@@ -1942,18 +1942,18 @@ public final class JMSBridgeImpl implements JMSBridge
                {
                   msg = sourceConsumer.receive(1000);
 
-                  if (msg instanceof HornetQMessage)
+                  if (msg instanceof ActiveMQMessage)
                   {
                      // We need to check the buffer mainly in the case of LargeMessages
                      // As we need to reconstruct the buffer before resending the message
-                     ((HornetQMessage) msg).checkBuffer();
+                     ((ActiveMQMessage) msg).checkBuffer();
                   }
                }
                catch (JMSException jmse)
                {
                   if (JMSBridgeImpl.trace)
                   {
-                     HornetQJMSBridgeLogger.LOGGER.trace(this + " exception while receiving a message", jmse);
+                     ActiveMQJMSBridgeLogger.LOGGER.trace(this + " exception while receiving a message", jmse);
                   }
                }
 
@@ -1967,7 +1967,7 @@ public final class JMSBridgeImpl implements JMSBridge
                   {
                      if (JMSBridgeImpl.trace)
                      {
-                        HornetQJMSBridgeLogger.LOGGER.trace(this + " thread was interrupted");
+                        ActiveMQJMSBridgeLogger.LOGGER.trace(this + " thread was interrupted");
                      }
                      if (stopping)
                      {
@@ -1980,7 +1980,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace(this + " received message " + msg);
+                  ActiveMQJMSBridgeLogger.LOGGER.trace(this + " received message " + msg);
                }
 
                messages.add(msg);
@@ -1989,21 +1989,21 @@ public final class JMSBridgeImpl implements JMSBridge
 
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace(this + " rescheduled batchExpiryTime to " + batchExpiryTime);
+                  ActiveMQJMSBridgeLogger.LOGGER.trace(this + " rescheduled batchExpiryTime to " + batchExpiryTime);
                }
 
                if (maxBatchSize != -1 && messages.size() >= maxBatchSize)
                {
                   if (JMSBridgeImpl.trace)
                   {
-                     HornetQJMSBridgeLogger.LOGGER.trace(this + " maxBatchSize has been reached so sending batch");
+                     ActiveMQJMSBridgeLogger.LOGGER.trace(this + " maxBatchSize has been reached so sending batch");
                   }
 
                   sendBatch();
 
                   if (JMSBridgeImpl.trace)
                   {
-                     HornetQJMSBridgeLogger.LOGGER.trace(this + " sent batch");
+                     ActiveMQJMSBridgeLogger.LOGGER.trace(this + " sent batch");
                   }
                }
             }
@@ -2025,13 +2025,13 @@ public final class JMSBridgeImpl implements JMSBridge
          }
          catch (JMSException e)
          {
-            HornetQJMSBridgeLogger.LOGGER.jmsBridgeSrcConnectError(e);
+            ActiveMQJMSBridgeLogger.LOGGER.jmsBridgeSrcConnectError(e);
          }
       }
 
       protected void succeeded()
       {
-         HornetQJMSBridgeLogger.LOGGER.bridgeReconnected();
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeReconnected();
          connectedSource = true;
          connectedTarget = true;
          synchronized (lock)
@@ -2045,7 +2045,7 @@ public final class JMSBridgeImpl implements JMSBridge
       protected void failed()
       {
          // We haven't managed to recreate connections or maxRetries = 0
-         HornetQJMSBridgeLogger.LOGGER.errorConnectingBridge();
+         ActiveMQJMSBridgeLogger.LOGGER.errorConnectingBridge();
 
          try
          {
@@ -2060,7 +2060,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace("Failure handler running");
+            ActiveMQJMSBridgeLogger.LOGGER.trace("Failure handler running");
          }
 
          // Clear the messages
@@ -2072,7 +2072,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (maxRetries > 0 || maxRetries == -1)
          {
-            HornetQJMSBridgeLogger.LOGGER.bridgeRetry(failureRetryInterval);
+            ActiveMQJMSBridgeLogger.LOGGER.bridgeRetry(failureRetryInterval);
 
             pause(failureRetryInterval);
 
@@ -2097,14 +2097,14 @@ public final class JMSBridgeImpl implements JMSBridge
       protected void failed()
       {
          // Don't call super
-         HornetQJMSBridgeLogger.LOGGER.bridgeNotStarted();
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeNotStarted();
       }
 
       @Override
       protected void succeeded()
       {
          // Don't call super - a bit ugly in this case but better than taking the lock twice.
-         HornetQJMSBridgeLogger.LOGGER.bridgeConnected();
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeConnected();
 
          synchronized (lock)
          {
@@ -2123,7 +2123,7 @@ public final class JMSBridgeImpl implements JMSBridge
             }
             catch (JMSException e)
             {
-               HornetQJMSBridgeLogger.LOGGER.jmsBridgeSrcConnectError(e);
+               ActiveMQJMSBridgeLogger.LOGGER.jmsBridgeSrcConnectError(e);
             }
          }
       }
@@ -2135,7 +2135,7 @@ public final class JMSBridgeImpl implements JMSBridge
       {
          if (JMSBridgeImpl.trace)
          {
-            HornetQJMSBridgeLogger.LOGGER.trace(this + " running");
+            ActiveMQJMSBridgeLogger.LOGGER.trace(this + " running");
          }
 
          synchronized (lock)
@@ -2148,7 +2148,7 @@ public final class JMSBridgeImpl implements JMSBridge
                {
                   if (JMSBridgeImpl.trace)
                   {
-                     HornetQJMSBridgeLogger.LOGGER.trace(this + " waited enough");
+                     ActiveMQJMSBridgeLogger.LOGGER.trace(this + " waited enough");
                   }
 
                   synchronized (lock)
@@ -2157,14 +2157,14 @@ public final class JMSBridgeImpl implements JMSBridge
                      {
                         if (JMSBridgeImpl.trace)
                         {
-                           HornetQJMSBridgeLogger.LOGGER.trace(this + " got some messages so sending batch");
+                           ActiveMQJMSBridgeLogger.LOGGER.trace(this + " got some messages so sending batch");
                         }
 
                         sendBatch();
 
                         if (JMSBridgeImpl.trace)
                         {
-                           HornetQJMSBridgeLogger.LOGGER.trace(this + " sent batch");
+                           ActiveMQJMSBridgeLogger.LOGGER.trace(this + " sent batch");
                         }
                      }
                   }
@@ -2177,21 +2177,21 @@ public final class JMSBridgeImpl implements JMSBridge
                   {
                      if (JMSBridgeImpl.trace)
                      {
-                        HornetQJMSBridgeLogger.LOGGER.trace(this + " waiting for " + toWait);
+                        ActiveMQJMSBridgeLogger.LOGGER.trace(this + " waiting for " + toWait);
                      }
 
                      lock.wait(toWait);
 
                      if (JMSBridgeImpl.trace)
                      {
-                        HornetQJMSBridgeLogger.LOGGER.trace(this + " woke up");
+                        ActiveMQJMSBridgeLogger.LOGGER.trace(this + " woke up");
                      }
                   }
                   catch (InterruptedException e)
                   {
                      if (JMSBridgeImpl.trace)
                      {
-                        HornetQJMSBridgeLogger.LOGGER.trace(this + " thread was interrupted");
+                        ActiveMQJMSBridgeLogger.LOGGER.trace(this + " thread was interrupted");
                      }
                      if (stopping)
                      {
@@ -2225,7 +2225,7 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             return;
          }
-         HornetQJMSBridgeLogger.LOGGER.bridgeFailure(e);
+         ActiveMQJMSBridgeLogger.LOGGER.bridgeFailure(e);
          if (isSource)
          {
             connectedSource = false;
@@ -2246,7 +2246,7 @@ public final class JMSBridgeImpl implements JMSBridge
                // The failure has already been detected and is being handled
                if (JMSBridgeImpl.trace)
                {
-                  HornetQJMSBridgeLogger.LOGGER.trace("Failure recovery already in progress");
+                  ActiveMQJMSBridgeLogger.LOGGER.trace("Failure recovery already in progress");
                }
             }
             else
@@ -2276,11 +2276,11 @@ public final class JMSBridgeImpl implements JMSBridge
          {
             try
             {
-               registry = (HornetQRegistryBase) safeInitNewInstance(locatorClasse);
+               registry = (ActiveMQRegistryBase) safeInitNewInstance(locatorClasse);
             }
             catch (Throwable e)
             {
-               HornetQJMSBridgeLogger.LOGGER.debug("unable to load  recovery registry " + locatorClasse, e);
+               ActiveMQJMSBridgeLogger.LOGGER.debug("unable to load  recovery registry " + locatorClasse, e);
             }
             if (registry != null)
             {
@@ -2290,7 +2290,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
          if (registry != null)
          {
-            HornetQJMSBridgeLogger.LOGGER.debug("Recovery Registry located = " + registry);
+            ActiveMQJMSBridgeLogger.LOGGER.debug("Recovery Registry located = " + registry);
          }
       }
    }
@@ -2400,7 +2400,7 @@ public final class JMSBridgeImpl implements JMSBridge
          if (timedOut)
          {
             //timeout, presumably failover failed.
-            HornetQJMSBridgeLogger.LOGGER.debug("Timed out waiting for failover completion " + this);
+            ActiveMQJMSBridgeLogger.LOGGER.debug("Timed out waiting for failover completion " + this);
             return false;
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSConnectionFactoryControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSConnectionFactoryControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSConnectionFactoryControlImpl.java
index 2a38b7e..1d9b13f 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSConnectionFactoryControlImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSConnectionFactoryControlImpl.java
@@ -21,7 +21,7 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.management.Parameter;
 import org.apache.activemq.api.jms.management.ConnectionFactoryControl;
 import org.apache.activemq.core.management.impl.MBeanInfoHelper;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 
@@ -36,7 +36,7 @@ public class JMSConnectionFactoryControlImpl extends StandardMBean implements Co
 
    private final ConnectionFactoryConfiguration cfConfig;
 
-   private HornetQConnectionFactory cf;
+   private ActiveMQConnectionFactory cf;
 
    private final String name;
 
@@ -47,7 +47,7 @@ public class JMSConnectionFactoryControlImpl extends StandardMBean implements Co
    // Constructors --------------------------------------------------
 
    public JMSConnectionFactoryControlImpl(final ConnectionFactoryConfiguration cfConfig,
-                                          final HornetQConnectionFactory cf,
+                                          final ActiveMQConnectionFactory cf,
                                           final JMSServerManager jmsManager,
                                           final String name) throws NotCompliantMBeanException
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java
index 36394ed..1dc4d6d 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSQueueControlImpl.java
@@ -25,8 +25,8 @@ import org.apache.activemq.api.jms.management.JMSQueueControl;
 import org.apache.activemq.core.management.impl.MBeanInfoHelper;
 import org.apache.activemq.core.messagecounter.MessageCounter;
 import org.apache.activemq.core.messagecounter.impl.MessageCounterHelper;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQMessage;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQMessage;
 import org.apache.activemq.jms.client.SelectorTranslator;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.utils.json.JSONArray;
@@ -37,7 +37,7 @@ import org.apache.activemq.utils.json.JSONObject;
  */
 public class JMSQueueControlImpl extends StandardMBean implements JMSQueueControl
 {
-   private final HornetQDestination managedQueue;
+   private final ActiveMQDestination managedQueue;
 
    private final JMSServerManager jmsServerManager;
 
@@ -53,12 +53,12 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
    public static String createFilterFromJMSSelector(final String selectorStr) throws ActiveMQException
    {
       return selectorStr == null || selectorStr.trim().length() == 0 ? null
-         : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+         : SelectorTranslator.convertToActiveMQFilterString(selectorStr);
    }
 
    private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
    {
-      return FilterConstants.HORNETQ_USERID + " = '" + jmsMessageID + "'";
+      return FilterConstants.ACTIVEMQ_USERID + " = '" + jmsMessageID + "'";
    }
 
    static String toJSON(final Map<String, Object>[] messages)
@@ -73,7 +73,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
 
    // Constructors --------------------------------------------------
 
-   public JMSQueueControlImpl(final HornetQDestination managedQueue,
+   public JMSQueueControlImpl(final ActiveMQDestination managedQueue,
                               final QueueControl coreQueueControl,
                               final JMSServerManager jmsServerManager,
                               final MessageCounter counter) throws Exception
@@ -200,7 +200,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
 
          for (Map<String, Object> coreMessage : coreMessages)
          {
-            Map<String, Object> jmsMessage = HornetQMessage.coreMaptoJMSMap(coreMessage);
+            Map<String, Object> jmsMessage = ActiveMQMessage.coreMaptoJMSMap(coreMessage);
             jmsMessages[i++] = jmsMessage;
          }
          return jmsMessages;
@@ -281,7 +281,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
    public boolean moveMessage(final String messageID, final String otherQueueName, final boolean rejectDuplicates) throws Exception
    {
       String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
-      HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName);
+      ActiveMQDestination otherQueue = ActiveMQDestination.createQueue(otherQueueName);
       int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates);
       if (moved != 1)
       {
@@ -294,7 +294,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
    public int moveMessages(final String filterStr, final String otherQueueName, final boolean rejectDuplicates) throws Exception
    {
       String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName);
+      ActiveMQDestination otherQueue = ActiveMQDestination.createQueue(otherQueueName);
       return coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSServerControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSServerControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSServerControlImpl.java
index f7f0ef8..6f745d6 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSServerControlImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/management/impl/JMSServerControlImpl.java
@@ -41,8 +41,8 @@ import org.apache.activemq.core.management.impl.AbstractControl;
 import org.apache.activemq.core.management.impl.MBeanInfoHelper;
 import org.apache.activemq.core.server.ServerConsumer;
 import org.apache.activemq.core.server.ServerSession;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
@@ -101,29 +101,29 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
    private static String[] determineJMSDestination(String coreAddress)
    {
       String[] result = new String[2]; // destination name & type
-      if (coreAddress.startsWith(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX))
+      if (coreAddress.startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX))
       {
-         result[0] = coreAddress.substring(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX.length());
+         result[0] = coreAddress.substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length());
          result[1] = "queue";
       }
-      else if (coreAddress.startsWith(HornetQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX))
+      else if (coreAddress.startsWith(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX))
       {
-         result[0] = coreAddress.substring(HornetQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
+         result[0] = coreAddress.substring(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
          result[1] = "tempqueue";
       }
-      else if (coreAddress.startsWith(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX))
+      else if (coreAddress.startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX))
       {
-         result[0] = coreAddress.substring(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX.length());
+         result[0] = coreAddress.substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length());
          result[1] = "topic";
       }
-      else if (coreAddress.startsWith(HornetQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX))
+      else if (coreAddress.startsWith(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX))
       {
-         result[0] = coreAddress.substring(HornetQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
+         result[0] = coreAddress.substring(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
          result[1] = "temptopic";
       }
       else
       {
-         HornetQJMSServerLogger.LOGGER.debug("JMSServerControlImpl.determineJMSDestination()" + coreAddress);
+         ActiveMQJMSServerLogger.LOGGER.debug("JMSServerControlImpl.determineJMSDestination()" + coreAddress);
          // not related to JMS
          return null;
       }
@@ -147,10 +147,10 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
    public JMSServerControlImpl(final JMSServerManager server) throws Exception
    {
-      super(JMSServerControl.class, server.getHornetQServer().getStorageManager());
+      super(JMSServerControl.class, server.getActiveMQServer().getStorageManager());
       this.server = server;
       broadcaster = new NotificationBroadcasterSupport();
-      server.getHornetQServer().getManagementService().addNotificationListener(this);
+      server.getActiveMQServer().getManagementService().addNotificationListener(this);
    }
 
    // Public --------------------------------------------------------
@@ -536,7 +536,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
       try
       {
-         Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
+         Object[] queueControls = server.getActiveMQServer().getManagementService().getResources(JMSQueueControl.class);
          String[] names = new String[queueControls.length];
          for (int i = 0; i < queueControls.length; i++)
          {
@@ -559,7 +559,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
       try
       {
-         Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
+         Object[] topicControls = server.getActiveMQServer().getManagementService().getResources(TopicControl.class);
          String[] names = new String[topicControls.length];
          for (int i = 0; i < topicControls.length; i++)
          {
@@ -582,7 +582,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
       try
       {
-         Object[] cfControls = server.getHornetQServer()
+         Object[] cfControls = server.getActiveMQServer()
             .getManagementService()
             .getResources(ConnectionFactoryControl.class);
          String[] names = new String[cfControls.length];
@@ -731,9 +731,9 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
       {
          JSONArray array = new JSONArray();
 
-         Set<RemotingConnection> connections = server.getHornetQServer().getRemotingService().getConnections();
+         Set<RemotingConnection> connections = server.getActiveMQServer().getRemotingService().getConnections();
 
-         Set<ServerSession> sessions = server.getHornetQServer().getSessions();
+         Set<ServerSession> sessions = server.getActiveMQServer().getSessions();
 
          Map<Object, ServerSession> jmsSessions = new HashMap<Object, ServerSession>();
 
@@ -777,12 +777,12 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
       {
          JSONArray array = new JSONArray();
 
-         Set<RemotingConnection> connections = server.getHornetQServer().getRemotingService().getConnections();
+         Set<RemotingConnection> connections = server.getActiveMQServer().getRemotingService().getConnections();
          for (RemotingConnection connection : connections)
          {
             if (connectionID.equals(connection.getID().toString()))
             {
-               List<ServerSession> sessions = server.getHornetQServer().getSessions(connectionID);
+               List<ServerSession> sessions = server.getActiveMQServer().getSessions(connectionID);
                for (ServerSession session : sessions)
                {
                   Set<ServerConsumer> consumers = session.getServerConsumers();
@@ -815,7 +815,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
       {
          JSONArray array = new JSONArray();
 
-         Set<ServerSession> sessions = server.getHornetQServer().getSessions();
+         Set<ServerSession> sessions = server.getActiveMQServer().getSessions();
          for (ServerSession session : sessions)
          {
             Set<ServerConsumer> consumers = session.getServerConsumers();
@@ -902,7 +902,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
    {
       if (!server.isStarted())
       {
-         throw new IllegalStateException("HornetQ JMS Server is not started. it can not be managed yet");
+         throw new IllegalStateException("ActiveMQ JMS Server is not started. it can not be managed yet");
       }
    }
 
@@ -910,17 +910,17 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
    public String[] listTargetDestinations(String sessionID) throws Exception
    {
-      String[] addresses = server.getHornetQServer().getHornetQServerControl().listTargetAddresses(sessionID);
+      String[] addresses = server.getActiveMQServer().getActiveMQServerControl().listTargetAddresses(sessionID);
       Map<String, DestinationControl> allDests = new HashMap<String, DestinationControl>();
 
-      Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
+      Object[] queueControls = server.getActiveMQServer().getManagementService().getResources(JMSQueueControl.class);
       for (Object queueControl2 : queueControls)
       {
          JMSQueueControl queueControl = (JMSQueueControl) queueControl2;
          allDests.put(queueControl.getAddress(), queueControl);
       }
 
-      Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
+      Object[] topicControls = server.getActiveMQServer().getManagementService().getResources(TopicControl.class);
       for (Object topicControl2 : topicControls)
       {
          TopicControl topicControl = (TopicControl) topicControl2;
@@ -941,7 +941,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
    public String getLastSentMessageID(String sessionID, String address) throws Exception
    {
-      ServerSession session = server.getHornetQServer().getSessionByID(sessionID);
+      ServerSession session = server.getActiveMQServer().getSessionByID(sessionID);
       if (session != null)
       {
          return session.getLastSentMessageID(address);
@@ -951,7 +951,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
    public String getSessionCreationTime(String sessionID) throws Exception
    {
-      ServerSession session = server.getHornetQServer().getSessionByID(sessionID);
+      ServerSession session = server.getActiveMQServer().getSessionByID(sessionID);
       if (session != null)
       {
          return String.valueOf(session.getCreationTime());
@@ -968,7 +968,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
       JSONArray array = new JSONArray();
       try
       {
-         List<ServerSession> sessions = server.getHornetQServer().getSessions(connectionID);
+         List<ServerSession> sessions = server.getActiveMQServer().getSessions(connectionID);
          for (ServerSession sess : sessions)
          {
             JSONObject obj = new JSONObject();
@@ -986,7 +986,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
 
    public String closeConnectionWithClientID(final String clientID) throws Exception
    {
-      return server.getHornetQServer().destroyConnectionWithSessionMetadata("jms-client-id", clientID);
+      return server.getActiveMQServer().destroyConnectionWithSessionMetadata("jms-client-id", clientID);
    }
 
    private JSONObject toJSONObject(ServerConsumer consumer) throws Exception
@@ -1015,7 +1015,9 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
       {
          try
          {
-            HornetQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue().getName().toString());
+            ActiveMQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue()
+                                                                            .getName()
+                                                                            .toString());
             obj.put("durable", true);
          }
          catch (IllegalArgumentException e)


[04/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServerLogger.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServerLogger.java b/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServerLogger.java
deleted file mode 100644
index 1647d03..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServerLogger.java
+++ /dev/null
@@ -1,1366 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.server;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/8/12
- *
- * Logger Code 22
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 101000 to 101999
- */
-
-import javax.transaction.xa.Xid;
-import java.io.File;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-
-import io.netty.channel.Channel;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.Pair;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.impl.ServerLocatorInternal;
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.journal.IOAsyncTask;
-import org.apache.activemq.core.journal.SequentialFile;
-import org.apache.activemq.core.journal.impl.JournalFile;
-import org.apache.activemq.core.paging.cursor.PagePosition;
-import org.apache.activemq.core.paging.cursor.PageSubscription;
-import org.apache.activemq.core.persistence.OperationContext;
-import org.apache.activemq.core.protocol.core.Packet;
-import org.apache.activemq.core.protocol.core.impl.wireformat.BackupReplicationStartFailedMessage;
-import org.apache.activemq.core.server.cluster.Bridge;
-import org.apache.activemq.core.server.cluster.impl.BridgeImpl;
-import org.apache.activemq.core.server.cluster.impl.ClusterConnectionImpl;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
-import org.apache.activemq.core.server.impl.ServerSessionImpl;
-import org.apache.activemq.core.server.management.Notification;
-import org.apache.activemq.utils.FutureLatch;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-import org.w3c.dom.Node;
-
-@MessageLogger(projectCode = "HQ")
-public interface HornetQServerLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQServerLogger LOGGER = Logger.getMessageLogger(HornetQServerLogger.class, HornetQServerLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221000, value = "{0} server is starting with configuration {1}", format = Message.Format.MESSAGE_FORMAT)
-   void serverStarting(String type, Configuration configuration);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221001, value = "HornetQ Server version {0} [{1}] {2}", format = Message.Format.MESSAGE_FORMAT)
-   void serverStarted(String fullVersion, SimpleString nodeId, String identity);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221002, value = "HornetQ Server version {0} [{1}] stopped", format = Message.Format.MESSAGE_FORMAT)
-   void serverStopped(String version, SimpleString nodeId);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221003, value = "trying to deploy queue {0}", format = Message.Format.MESSAGE_FORMAT)
-   void deployQueue(SimpleString queueName);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221004, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
-   void dumpServerInfo(String serverInfo);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221005, value = "Deleting pending large message as it was not completed: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void deletingPendingMessage(Pair<Long, Long> msgToDelete);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221006, value = "Waiting to obtain live lock", format = Message.Format.MESSAGE_FORMAT)
-   void awaitingLiveLock();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221007, value = "Server is now live", format = Message.Format.MESSAGE_FORMAT)
-   void serverIsLive();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221008, value = "live server wants to restart, restarting server in backup", format = Message.Format.MESSAGE_FORMAT)
-   void awaitFailBack();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221109, value = "HornetQ Backup Server version {0} [{1}] started, waiting live to fail before it gets active",
-            format = Message.Format.MESSAGE_FORMAT)
-   void backupServerStarted(String version, SimpleString nodeID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221010, value = "Backup Server is now live", format = Message.Format.MESSAGE_FORMAT)
-   void backupServerIsLive();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221011, value = "Server {0} is now live", format = Message.Format.MESSAGE_FORMAT)
-   void serverIsLive(String identity);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221012, value = "Using AIO Journal", format = Message.Format.MESSAGE_FORMAT)
-   void journalUseAIO();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221013, value = "Using NIO Journal", format = Message.Format.MESSAGE_FORMAT)
-   void journalUseNIO();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221014, value = "{0}% loaded", format = Message.Format.MESSAGE_FORMAT)
-   void percentLoaded(Long percent);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221015, value = "Can not find queue {0} while reloading ACKNOWLEDGE_CURSOR, deleting record now",
-            format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueReloading(Long queueID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221016,
-            value = "Can not find queue {0} while reloading PAGE_CURSOR_COUNTER_VALUE, deleting record now",
-            format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueReloadingPage(Long queueID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221017, value = "Can not find queue {0} while reloading PAGE_CURSOR_COUNTER_INC, deleting record now",
-            format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueReloadingPageCursor(Long queueID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221018, value = "Large message: {0} did not have any associated reference, file will be deleted",
-            format = Message.Format.MESSAGE_FORMAT)
-   void largeMessageWithNoRef(Long messageID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221019, value = "Deleting unreferenced message id={0} from the journal", format = Message.Format.MESSAGE_FORMAT)
-   void journalUnreferencedMessage(Long messageID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221020, value = "Started Netty Acceptor version {0} {1}:{2,number,#}", format = Message.Format.MESSAGE_FORMAT)
-   void startedNettyAcceptor(String id, String host, Integer port);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221021, value = "failed to remove connection", format = Message.Format.MESSAGE_FORMAT)
-   void errorRemovingConnection();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221022, value = "unable to start connector service: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingConnectorService(@Cause Throwable e, String name);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221023, value = "unable to stop connector service: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingConnectorService(@Cause Throwable e, String name);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221024, value = "Backup server {0} is synchronized with live-server.", format = Message.Format.MESSAGE_FORMAT)
-   void backupServerSynched(HornetQServerImpl server);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221025, value = "Replication: sending {0} (size={1}) to backup. {2}", format = Message.Format.MESSAGE_FORMAT)
-   void journalSynch(JournalFile jf, Long size, SequentialFile file);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(
-      id = 221026,
-      value = "Bridge {0} connected to fowardingAddress={1}. {2} does not have any bindings what means messages will be ignored until a binding is created.",
-      format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoBindings(SimpleString name, SimpleString forwardingAddress, SimpleString address);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221027, value = "Bridge {0} is connected", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeConnected(BridgeImpl name);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221028, value = "Bridge is stopping, will not retry", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeStopping();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221029, value = "stopped bridge {0}", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeStopped(SimpleString name);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221030, value = "paused bridge {0}", format = Message.Format.MESSAGE_FORMAT)
-   void bridgePaused(SimpleString name);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221031, value = "backup announced", format = Message.Format.MESSAGE_FORMAT)
-   void backupAnnounced();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221032, value = "Waiting to become backup node", format = Message.Format.MESSAGE_FORMAT)
-   void waitingToBecomeBackup();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221033, value = "** got backup lock", format = Message.Format.MESSAGE_FORMAT)
-   void gotBackupLock();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221034, value = "Waiting {0} to obtain live lock", format = Message.Format.MESSAGE_FORMAT)
-   void waitingToObtainLiveLock(String timeoutMessage);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221035, value = "Live Server Obtained live lock", format = Message.Format.MESSAGE_FORMAT)
-   void obtainedLiveLock();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221036, value = "Message with duplicate ID {0} was already set at {1}. Move from {2} being ignored and message removed from {3}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void messageWithDuplicateID(Object duplicateProperty, SimpleString toAddress, SimpleString address, SimpleString simpleString);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221037, value = "{0} to become ''live''", format = Message.Format.MESSAGE_FORMAT)
-   void becomingLive(HornetQServer server);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221038, value = "Configuration option ''{0}'' is deprecated. Consult the manual for details.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void deprecatedConfigurationOption(String deprecatedOption);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221039, value = "Restarting as Replicating backup server after live restart",
-            format = Message.Format.MESSAGE_FORMAT)
-   void restartingReplicatedBackupAfterFailback();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221040, value =  "Remote group coordinators did not start yet", format = Message.Format.MESSAGE_FORMAT)
-   void remoteGroupCoordinatorsNotStarted();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221041, value = "Cannot find queue {0} while reloading PAGE_CURSOR_COMPLETE, deleting record now",
-            format = Message.Format.MESSAGE_FORMAT)
-   void cantFindQueueOnPageComplete(long queueID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221042,
-            value = "Bridge {0} timed out waiting for the completion of {1} messages, we will just shutdown the bridge after 10 seconds wait",
-            format = Message.Format.MESSAGE_FORMAT)
-   void timedOutWaitingCompletions(String bridgeName, long numberOfMessages);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221043, value = "Adding protocol support {0}", format = Message.Format.MESSAGE_FORMAT)
-   void addingProtocolSupport(String protocolKey);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221045, value = "libaio is not available, switching the configuration into NIO", format = Message.Format.MESSAGE_FORMAT)
-   void switchingNIO();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221046, value = "Unblocking message production on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
-   void unblockingMessageProduction(SimpleString addressName, long currentSize, long maxSize);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221047, value = "Backup Server has scaled down to live server", format = Message.Format.MESSAGE_FORMAT)
-   void backupServerScaledDown();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221048, value = "Consumer {0}:{1} attached to queue ''{2}'' from {3} identified as ''slow.'' Expected consumption rate: {4} msgs/second; actual consumption rate: {5} msgs/second.", format = Message.Format.MESSAGE_FORMAT)
-   void slowConsumerDetected(String sessionID, long consumerID, String queueName, String remoteAddress, float slowConsumerThreshold, float consumerRate);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221049, value = "Activating Replica for node: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void activatingReplica(SimpleString nodeID);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 221050, value = "Activating Shared Store Slave", format = Message.Format.MESSAGE_FORMAT)
-   void activatingSharedStoreSlave();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222000, value = "HornetQServer is being finalized and has not been stopped. Please remember to stop the server before letting it go out of scope",
-            format = Message.Format.MESSAGE_FORMAT)
-   void serverFinalisedWIthoutBeingSTopped();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222001, value = "Error closing sessions while stopping server", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingSessionsWhileStoppingServer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222002, value = "Timed out waiting for pool to terminate {0}. Interrupting all its threads!", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutStoppingThreadpool(ExecutorService service);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222003, value = "Must specify a name for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void divertWithNoName();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222004, value = "Must specify an address for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void divertWithNoAddress();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222005, value = "Must specify a forwarding address for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void divertWithNoForwardingAddress();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222006, value = "Binding already exists with name {0}, divert will not be deployed", format = Message.Format.MESSAGE_FORMAT)
-   void divertBindingNotExists(SimpleString bindingName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222007, value = "Security risk! HornetQ is running with the default cluster admin user and default password. Please see the HornetQ user guide, cluster chapter, for instructions on how to change this.", format = Message.Format.MESSAGE_FORMAT)
-   void clusterSecurityRisk();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222008, value = "unable to restart server, please kill and restart manually", format = Message.Format.MESSAGE_FORMAT)
-   void serverRestartWarning();
-
-   @LogMessage(level = Logger.Level.WARN)
-   void serverRestartWarning(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222009, value = "Unable to announce backup for replication. Trying to stop the server.", format = Message.Format.MESSAGE_FORMAT)
-   void replicationStartProblem(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222010, value = "Critical IO Error, shutting down the server. file={1}, message={0}", format = Message.Format.MESSAGE_FORMAT)
-   void ioCriticalIOError(String message, String file, @Cause Throwable code);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222011, value = "Error stopping server", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingServer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222012, value = "Timed out waiting for backup activation to exit", format = Message.Format.MESSAGE_FORMAT)
-   void backupActivationProblem();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222013, value = "Error when trying to start replication", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingReplication(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222014, value = "Error when trying to stop replication", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingReplication(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222015, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
-   void warn(String message);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222016, value = "Cannot deploy a connector with no name specified.", format = Message.Format.MESSAGE_FORMAT)
-   void connectorWithNoName();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222017, value = "There is already a connector with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void connectorAlreadyDeployed(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(
-      id = 222018,
-      value = "AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal",
-      format = Message.Format.MESSAGE_FORMAT)
-   void AIONotFound();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222019, value = "There is already a discovery group with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void discoveryGroupAlreadyDeployed(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222020, value = "error scanning for URL''s", format = Message.Format.MESSAGE_FORMAT)
-   void errorScanningURLs(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222021, value = "problem undeploying {0}", format = Message.Format.MESSAGE_FORMAT)
-   void problemUndeployingNode(@Cause Exception e, Node node);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222022, value = "Timed out waiting for paging cursor to stop {0} {1}", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutStoppingPagingCursor(FutureLatch future, Executor executor);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222023, value = "problem cleaning page address {0}", format = Message.Format.MESSAGE_FORMAT)
-   void problemCleaningPageAddress(@Cause Exception e, SimpleString address);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222024, value = "Could not complete operations on IO context {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void problemCompletingOperations(OperationContext e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222025, value = "Problem cleaning page subscription counter", format = Message.Format.MESSAGE_FORMAT)
-   void problemCleaningPagesubscriptionCounter(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222026, value = "Error on cleaning up cursor pages", format = Message.Format.MESSAGE_FORMAT)
-   void problemCleaningCursorPages(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222027, value = "Timed out flushing executors for paging cursor to stop {0}", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutFlushingExecutorsPagingCursor(PageSubscription pageSubscription);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222028, value = "Could not find page cache for page {0} removing it from the journal",
-            format = Message.Format.MESSAGE_FORMAT)
-   void pageNotFound(PagePosition pos);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222029,
-            value = "Could not locate page transaction {0}, ignoring message on position {1} on address={2} queue={3}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void pageSubscriptionCouldntLoad(long transactionID, PagePosition position, SimpleString address, SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222030, value = "File {0} being renamed to {1}.invalidPage as it was loaded partially. Please verify your data.", format = Message.Format.MESSAGE_FORMAT)
-   void pageInvalid(String fileName, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222031, value = "Error while deleting page file", format = Message.Format.MESSAGE_FORMAT)
-   void pageDeleteError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222032, value = "page finalise error", format = Message.Format.MESSAGE_FORMAT)
-   void pageFinaliseError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222033, value = "Page file {0} had incomplete records at position {1} at record number {2}", format = Message.Format.MESSAGE_FORMAT)
-   void pageSuspectFile(String fileName, int position, int msgNumber);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222034, value = "Can not delete page transaction id={0}", format = Message.Format.MESSAGE_FORMAT)
-   void pageTxDeleteError(@Cause Exception e, long recordID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222035, value = "Directory {0} did not have an identification file {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void pageStoreFactoryNoIdFile(String s, String addressFile);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222036, value = "Timed out on waiting PagingStore {0} to shutdown", format = Message.Format.MESSAGE_FORMAT)
-   void pageStoreTimeout(SimpleString address);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222037, value = "IO Error, impossible to start paging", format = Message.Format.MESSAGE_FORMAT)
-   void pageStoreStartIOError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222038, value = "Starting paging on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
-   void pageStoreStart(SimpleString storeName, long addressSize, long maxSize);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222039, value = "Messages sent to address ''{0}'' are being dropped; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
-   void pageStoreDropMessages(SimpleString storeName, long addressSize, long maxSize);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222040, value = "Server is stopped", format = Message.Format.MESSAGE_FORMAT)
-   void serverIsStopped();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222041, value = "Cannot find queue {0} to update delivery count", format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueDelCount(Long queueID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222042, value = "Cannot find message {0} to update delivery count", format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindMessageDelCount(Long msg);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222043, value = "Message for queue {0} which does not exist. This message will be ignored.", format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueForMessage(Long queueID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222044, value = "It was not possible to delete message {0}", format = Message.Format.MESSAGE_FORMAT)
-   void journalErrorDeletingMessage(@Cause Exception e, Long messageID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222045, value = "Message in prepared tx for queue {0} which does not exist. This message will be ignored.", format = Message.Format.MESSAGE_FORMAT)
-   void journalMessageInPreparedTX(Long queueID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222046, value = "Failed to remove reference for {0}", format = Message.Format.MESSAGE_FORMAT)
-   void journalErrorRemovingRef(Long messageID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222047, value = "Can not find queue {0} while reloading ACKNOWLEDGE_CURSOR",
-            format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueReloadingACK(Long queueID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222048, value = "PAGE_CURSOR_COUNTER_VALUE record used on a prepared statement, invalid state", format = Message.Format.MESSAGE_FORMAT)
-   void journalPAGEOnPrepared();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(
-      id = 222049,
-      value = "InternalError: Record type {0} not recognized. Maybe you are using journal files created on a different version",
-      format = Message.Format.MESSAGE_FORMAT)
-   void journalInvalidRecordType(Byte recordType);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222050, value = "Can not locate recordType={0} on loadPreparedTransaction//deleteRecords",
-            format = Message.Format.MESSAGE_FORMAT)
-   void journalInvalidRecordTypeOnPreparedTX(Byte recordType);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222051, value = "Journal Error", format = Message.Format.MESSAGE_FORMAT)
-   void journalError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222052, value = "error incrementing delay detection", format = Message.Format.MESSAGE_FORMAT)
-   void errorIncrementDelayDeletionCount(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222053, value = "Error on copying large message {0} for DLA or Expiry", format = Message.Format.MESSAGE_FORMAT)
-   void lareMessageErrorCopying(@Cause Exception e, LargeServerMessage largeServerMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222054, value = "Error on executing IOAsyncTask", format = Message.Format.MESSAGE_FORMAT)
-   void errorExecutingIOAsyncTask(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222055, value = "Error on deleting duplicate cache", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingDuplicateCache(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222056, value = "Did not route to any bindings for address {0} and sendToDLAOnNoRoute is true but there is no DLA configured for the address, the message will be ignored.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void noDLA(SimpleString address);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222057, value = "It was not possible to add references due to an IO error code {0} message = {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void ioErrorAddingReferences(Integer errorCode, String errorMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222058, value = "Duplicate message detected through the bridge - message will not be routed. Message information:\n{0}", format = Message.Format.MESSAGE_FORMAT)
-   void duplicateMessageDetectedThruBridge(ServerMessage message);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222059, value = "Duplicate message detected - message will not be routed. Message information:\n{0}", format = Message.Format.MESSAGE_FORMAT)
-   void duplicateMessageDetected(ServerMessage message);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222060, value = "Error while confirming large message completion on rollback for recordID={0}", format = Message.Format.MESSAGE_FORMAT)
-   void journalErrorConfirmingLargeMessage(@Cause Throwable e, Long messageID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222061, value = "Client connection failed, clearing up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
-   void clientConnectionFailed(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222062, value = "Cleared up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
-   void clearingUpSession(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222063, value = "Error processing IOCallback code = {0} message = {1}", format = Message.Format.MESSAGE_FORMAT)
-   void errorProcessingIOCallback(Integer errorCode, String errorMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222065, value = "Client is not being consistent on the request versioning. It just sent a version id={0} while it informed {1} previously", format = Message.Format.MESSAGE_FORMAT)
-   void incompatibleVersionAfterConnect(int version, int clientVersion);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222066, value = "Reattach request from {0} failed as there is no confirmationWindowSize configured, which may be ok for your system", format = Message.Format.MESSAGE_FORMAT)
-   void reattachRequestFailed(String remoteAddress);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222067, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT)
-   void connectionFailureDetected(String message, ActiveMQExceptionType type);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222069, value = "error cleaning up stomp connection", format = Message.Format.MESSAGE_FORMAT)
-   void errorCleaningStompConn(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222070, value = "Stomp Transactional acknowledgement is not supported", format = Message.Format.MESSAGE_FORMAT)
-   void stompTXAckNorSupported();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222071, value = "Interrupted while waiting for stomp heart beate to die", format = Message.Format.MESSAGE_FORMAT)
-   void errorOnStompHeartBeat(@Cause InterruptedException e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222072, value = "Timed out flushing channel on InVMConnection", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutFlushingInvmChannel();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212074, value = "channel group did not completely close", format = Message.Format.MESSAGE_FORMAT)
-   void nettyChannelGroupError();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222075, value = "{0} is still connected to {1}", format = Message.Format.MESSAGE_FORMAT)
-   void nettyChannelStillOpen(Channel channel, SocketAddress remoteAddress);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222076, value = "channel group did not completely unbind", format = Message.Format.MESSAGE_FORMAT)
-   void nettyChannelGroupBindError();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222077, value = "{0} is still bound to {1}", format = Message.Format.MESSAGE_FORMAT)
-   void nettyChannelStillBound(Channel channel, SocketAddress remoteAddress);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222078, value = "Error instantiating remoting interceptor {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorCreatingRemotingInterceptor(@Cause Exception e, String interceptorClass);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222079, value = "The following keys are invalid for configuring the acceptor: {0} the acceptor will not be started.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void invalidAcceptorKeys(String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222080, value = "Error instantiating remoting acceptor {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorCreatingAcceptor(@Cause Exception e, String factoryClassName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222081, value = "Timed out waiting for remoting thread pool to terminate", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutRemotingThreadPool();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222082, value = "error on connection failure check", format = Message.Format.MESSAGE_FORMAT)
-   void errorOnFailureCheck(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222083, value = "The following keys are invalid for configuring the connector service: {0} the connector will not be started.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void connectorKeysInvalid(String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222084, value = "The following keys are required for configuring the connector service: {0} the connector will not be started.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void connectorKeysMissing(String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222085, value = "Packet {0} can not be processed by the ReplicationEndpoint",
-            format = Message.Format.MESSAGE_FORMAT)
-   void invalidPacketForReplication(Packet packet);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222086, value = "error handling packet {0} for replication", format = Message.Format.MESSAGE_FORMAT)
-   void errorHandlingReplicationPacket(@Cause Exception e, Packet packet);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222087, value = "Replication Error while closing the page on backup", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingPageOnReplication(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222088, value = "Journal comparison mismatch:\n{0}", format = Message.Format.MESSAGE_FORMAT)
-   void journalcomparisonMismatch(String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222089, value = "Replication Error deleting large message ID = {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingLargeMessage(@Cause Exception e, long messageId);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222090, value = "Replication Large MessageID {0}  is not available on backup server. Ignoring replication message", format = Message.Format.MESSAGE_FORMAT)
-   void largeMessageNotAvailable(long messageId);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222091, value = "The backup node has been shut-down, replication will now stop", format = Message.Format.MESSAGE_FORMAT)
-   void replicationStopOnBackupShutdown();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222092, value = "Connection to the backup node failed, removing replication now", format = Message.Format.MESSAGE_FORMAT)
-   void replicationStopOnBackupFail(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222093, value = "Timed out waiting to stop Bridge", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutWaitingToStopBridge();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222094, value = "Bridge unable to send message {0}, will try again once bridge reconnects", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeUnableToSendMessage(@Cause Exception e, MessageReference ref);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222095, value = "Connection failed with failedOver={0}", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeConnectionFailed(@Cause Exception e, Boolean failedOver);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222096, value = "Error on querying binding on bridge {0}. Retrying in 100 milliseconds", format = Message.Format.MESSAGE_FORMAT)
-   void errorQueryingBridge(@Cause Throwable t, SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222097, value = "Address {0} does not have any bindings yet, retry #({1})",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorQueryingBridge(SimpleString address, Integer retryCount);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222098, value = "Server is starting, retry to create the session for bridge {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingBridge(SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222099, value = "Bridge {0} is unable to connect to destination. It will be disabled.", format = Message.Format.MESSAGE_FORMAT)
-   void errorConnectingBridge(@Cause Exception e, Bridge bridge);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222100, value = "ServerLocator was shutdown, can not retry on opening connection for bridge",
-            format = Message.Format.MESSAGE_FORMAT)
-   void bridgeLocatorShutdown();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222101, value = "Bridge {0} achieved {1} maxattempts={2} it will stop retrying to reconnect", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeAbortStart(SimpleString name, Integer retryCount, Integer reconnectAttempts);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222102, value = "Unexpected exception while trying to reconnect", format = Message.Format.MESSAGE_FORMAT)
-   void errorReConnecting(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222103, value = "transaction with xid {0} timed out", format = Message.Format.MESSAGE_FORMAT)
-   void unexpectedXid(Xid xid);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222104, value = "IO Error completing the transaction, code = {0}, message = {1}", format = Message.Format.MESSAGE_FORMAT)
-   void ioErrorOnTX(Integer errorCode, String errorMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222105, value = "Could not finish context execution in 10 seconds",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorCompletingContext(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222106, value = "Replacing incomplete LargeMessage with ID={0}", format = Message.Format.MESSAGE_FORMAT)
-   void replacingIncompleteLargeMessage(Long messageID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222107, value = "Cleared up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
-   void clientConnectionFailedClearingSession(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222108, value = "unable to send notification when broadcast group is stopped",
-            format = Message.Format.MESSAGE_FORMAT)
-   void broadcastGroupClosed(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222109, value = "NodeID={0} is not available on the topology. Retrying the connection to that node now", format = Message.Format.MESSAGE_FORMAT)
-   void nodeNotAvailable(String targetNodeID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222110, value = "no queue IDs defined!,  originalMessage  = {0}, copiedMessage = {1}, props={2}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void noQueueIdDefined(ServerMessage message, ServerMessage messageCopy, SimpleString idsHeaderName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222111, value = "exception while invoking {0} on {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void managementOperationError(@Cause Exception e, String op, String resourceName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222112, value = "exception while retrieving attribute {0} on {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void managementAttributeError(@Cause Exception e, String att, String resourceName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222113, value = "On ManagementService stop, there are {0} unexpected registered MBeans: {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void managementStopError(Integer size, List<String> unexpectedResourceNames);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222114, value = "Unable to delete group binding info {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void unableToDeleteGroupBindings(@Cause Exception e, SimpleString groupId);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222115, value = "Error closing serverLocator={0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingServerLocator(@Cause Exception e, ServerLocatorInternal clusterLocator);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222116, value = "unable to start broadcast group {0}", format = Message.Format.MESSAGE_FORMAT)
-   void unableToStartBroadcastGroup(@Cause Exception e, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222117, value = "unable to start cluster connection {0}", format = Message.Format.MESSAGE_FORMAT)
-   void unableToStartClusterConnection(@Cause Exception e, SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222118, value = "unable to start Bridge {0}", format = Message.Format.MESSAGE_FORMAT)
-   void unableToStartBridge(@Cause Exception e, SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222119, value = "No connector with name {0}. backup cannot be announced.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void announceBackupNoConnector(String connectorName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222120, value = "no cluster connections defined, unable to announce backup", format = Message.Format.MESSAGE_FORMAT)
-   void announceBackupNoClusterConnections();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222121, value = "Must specify a unique name for each bridge. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNotUnique();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222122, value = "Must specify a queue name for each bridge. This one {0} will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoQueue(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222123, value = "Forward address is not specified on bridge {0}. Will use original message address instead", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoForwardAddress(String bridgeName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222124, value = "There is already a bridge with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeAlreadyDeployed(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222125, value = "No queue found with name {0} bridge {1} will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeQueueNotFound(String queueName, String bridgeName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222126, value = "No discovery group found with name {0} bridge will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoDiscoveryGroup(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222127, value = "Must specify a unique name for each cluster connection. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void clusterConnectionNotUnique();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222128, value = "Must specify an address for each cluster connection. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void clusterConnectionNoForwardAddress();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222129, value = "No connector with name {0}. The cluster connection will not be deployed.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void clusterConnectionNoConnector(String connectorName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222130,
-            value = "Cluster Configuration  {0} already exists. The cluster connection will not be deployed.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void clusterConnectionAlreadyExists(String connectorName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222131, value = "No discovery group with name {0}. The cluster connection will not be deployed.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void clusterConnectionNoDiscoveryGroup(String discoveryGroupName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222132, value = "There is already a broadcast-group with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
-   void broadcastGroupAlreadyExists(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(
-      id = 222133,
-      value = "There is no connector deployed with name {0}. The broadcast group with name {1} will not be deployed.",
-      format = Message.Format.MESSAGE_FORMAT)
-   void broadcastGroupNoConnector(String connectorName, String bgName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222134, value = "No connector defined with name {0}. The bridge will not be deployed.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoConnector(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222135, value = "Stopping Redistributor, Timed out waiting for tasks to complete", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingRedistributor();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222136, value = "IO Error during redistribution, errorCode = {0} message = {1}", format = Message.Format.MESSAGE_FORMAT)
-   void ioErrorRedistributing(Integer errorCode, String errorMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222137, value = "Unable to announce backup, retrying", format = Message.Format.MESSAGE_FORMAT)
-   void errorAnnouncingBackup();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222138, value = "Local Member is not set at on ClusterConnection {0}", format = Message.Format.MESSAGE_FORMAT)
-   void noLocalMemborOnClusterConnection(ClusterConnectionImpl clusterConnection);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222139, value = "{0}::Remote queue binding {1} has already been bound in the post office. Most likely cause for this is you have a loop in your cluster due to cluster max-hops being too large or you have multiple cluster connections to the same nodes using overlapping addresses",
-            format = Message.Format.MESSAGE_FORMAT)
-   void remoteQueueAlreadyBoundOnClusterConnection(Object messageFlowRecord, SimpleString clusterName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222141, value = "Node Manager can not open file {0}", format = Message.Format.MESSAGE_FORMAT)
-   void nodeManagerCantOpenFile(@Cause Exception e, File file);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222142, value = "Error on resetting large message deliver - {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorResttingLargeMessage(@Cause Throwable e, Object deliverer);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222143, value = "Timed out waiting for executor to complete", format = Message.Format.MESSAGE_FORMAT)
-   void errorTransferringConsumer();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222144, value = "Queue could not finish waiting executors. Try increasing the thread pool size",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorFlushingExecutorsOnQueue();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222145, value = "Error expiring reference {0} 0n queue", format = Message.Format.MESSAGE_FORMAT)
-   void errorExpiringReferencesOnQueue(@Cause Exception e, MessageReference ref);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222146, value = "Message has expired. No bindings for Expiry Address {0} so dropping it", format = Message.Format.MESSAGE_FORMAT)
-   void errorExpiringReferencesNoBindings(SimpleString expiryAddress);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222147, value = "Message has expired. No expiry queue configured for queue {0} so dropping it", format = Message.Format.MESSAGE_FORMAT)
-   void errorExpiringReferencesNoQueue(SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222148, value = "Message {0} has exceeded max delivery attempts. No bindings for Dead Letter Address {1} so dropping it",
-            format = Message.Format.MESSAGE_FORMAT)
-   void messageExceededMaxDelivery(MessageReference ref, SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222149, value = "Message {0} has reached maximum delivery attempts, sending it to Dead Letter Address {1} from {2}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void messageExceededMaxDeliverySendtoDLA(MessageReference ref, SimpleString name, SimpleString simpleString);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222150, value = "Message has exceeded max delivery attempts. No Dead Letter Address configured for queue {0} so dropping it",
-            format = Message.Format.MESSAGE_FORMAT)
-   void messageExceededMaxDeliveryNoDLA(SimpleString name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222151, value = "removing consumer which did not handle a message, consumer={0}, message={1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void removingBadConsumer(@Cause Throwable e, Consumer consumer, MessageReference reference);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222152, value = "Unable to decrement reference counting on queue",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorDecrementingRefCount(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222153, value = "Unable to remove message id = {0} please remove manually",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorRemovingMessage(@Cause Throwable e, Long messageID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222154, value = "Error checking DLQ",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorCheckingDLQ(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222155, value = "Failed to register as backup. Stopping the server.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorRegisteringBackup();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222156, value = "Less than {0}%\n{1}\nYou are in danger of running out of RAM. Have you set paging parameters on your addresses? (See user manual \"Paging\" chapter)",
-            format = Message.Format.MESSAGE_FORMAT)
-   void memoryError(Integer memoryWarningThreshold, String info);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222157, value = "Error completing callback on replication manager",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorCompletingCallbackOnReplicationManager(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222158, value = "{0} backup activation thread did not finish.", format = Message.Format.MESSAGE_FORMAT)
-   void backupActivationDidntFinish(HornetQServer server);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222159, value = "unable to send notification when broadcast group is stopped", format = Message.Format.MESSAGE_FORMAT)
-   void broadcastBridgeStoppedError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222160, value = "unable to send notification when broadcast group is stopped", format = Message.Format.MESSAGE_FORMAT)
-   void notificationBridgeStoppedError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222161, value = "Group Handler timed-out waiting for sendCondition", format = Message.Format.MESSAGE_FORMAT)
-   void groupHandlerSendTimeout();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222162, value = "Moving data directory {0} to {1}", format = Message.Format.MESSAGE_FORMAT)
-   void backupMovingDataAway(String oldPath, String newPath);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222163, value = "Server is being completely stopped, since this was a replicated backup there may be journal files that need cleaning up. The HornetQ server will have to be manually restarted.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void stopReplicatedBackupAfterFailback();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222164, value = "Error when trying to start replication {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingReplication(BackupReplicationStartFailedMessage.BackupRegistrationProblem problem);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222165, value = "Error starting naming server", format = Message.Format.MESSAGE_FORMAT)
-   void unableToStartNamingServer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222166, value = "Error stopping naming server", format = Message.Format.MESSAGE_FORMAT)
-   void unableToStopNamingServer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222167, value = "Group Binding not available so deleting {0} groups from {1}, groups will be bound to another node",
-            format = Message.Format.MESSAGE_FORMAT)
-   void groupingQueueRemoved(int size, SimpleString clusterName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222168, value = "The ''protocol'' property is deprecated, if you want this Acceptor to support multiple protocols use the ''protocols'' property, i.e. ''CORE,AMQP,STOMP''",
-            format = Message.Format.MESSAGE_FORMAT)
-   void warnDeprecatedProtocol();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222169, value = "You have old legacy clients connected to the queue {0} and we can''t disconnect them, these clients may just hang",
-            format = Message.Format.MESSAGE_FORMAT)
-   void warnDisconnectOldClient(String queueName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222170, value = "Bridge {0} forwarding address {1} has confirmation-window-size ({2}) greater than address'' max-size-bytes'' ({3})",
-            format = Message.Format.MESSAGE_FORMAT)
-   void bridgeConfirmationWindowTooSmall(String bridgeName, String address, int windowConfirmation, long maxSizeBytes);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222171, value = "Bridge {0} forwarding address {1} could not be resolved on address-settings configuration",
-            format = Message.Format.MESSAGE_FORMAT)
-   void bridgeCantFindAddressConfig(String bridgeName, String forwardingAddress);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222172, value = "Queue {0} was busy for more than {1} milliseconds. There are possibly consumers hanging on a network operation",
-            format = Message.Format.MESSAGE_FORMAT)
-   void queueBusy(String name, long timeout);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222173, value = "Queue {0} is duplicated during reload. This queue will be renamed as {1}", format = Message.Format.MESSAGE_FORMAT)
-   void queueDuplicatedRenaming(String name, String newName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222174, value = "Queue {0}, on address={1}, is taking too long to flush deliveries. Watch out for frozen clients.", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutFlushInTransit(String queueName, String addressName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222175, value = "Bridge {0} could not find configured connectors", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeCantFindConnectors(String bridgeName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222176,
-            value = "A session that was already doing XA work on {0} is replacing the xid by {1} " +
-               ". This was most likely caused from a previous communication timeout",
-            format = Message.Format.MESSAGE_FORMAT)
-   void xidReplacedOnXStart(String xidOriginalToString, String xidReplacedToString);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222177, value = "Wrong configuration for role, {0} is not a valid permission",
-            format = Message.Format.MESSAGE_FORMAT)
-   void rolePermissionConfigurationError(String permission);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222178, value = "Error during recovery of page counters",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorRecoveringPageCounter(@Cause Throwable error);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222181, value = "Unable to scaleDown messages", format = Message.Format.MESSAGE_FORMAT)
-   void failedToScaleDown(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222182, value = "Missing cluster-configuration for scale-down-clustername {0}", format = Message.Format.MESSAGE_FORMAT)
-   void missingClusterConfigForScaleDown(String scaleDownCluster);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222183, value = "Blocking message production on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
-   void blockingMessageProduction(SimpleString addressName, long currentSize, long maxSize);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222184,
-         value = "Unable to recover group bindings in SCALE_DOWN mode, only FULL backup server can do this",
-         format = Message.Format.MESSAGE_FORMAT)
-   void groupBindingsOnRecovery();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222185,
-         value = "no cluster connection for specified replication cluster",
-         format = Message.Format.MESSAGE_FORMAT)
-   void noClusterConnectionForReplicationCluster();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222186,
-         value = "unable to authorise cluster control",
-         format = Message.Format.MESSAGE_FORMAT)
-   void clusterControlAuthfailure();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222187,
-          value = "Failed to activate replicata",
-          format = Message.Format.MESSAGE_FORMAT)
-   void activateReplicatedBackupFailed(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222188,
-          value = "Unable to find target queue for node {0}",
-          format = Message.Format.MESSAGE_FORMAT)
-   void unableToFindTargetQueue(String targetNodeID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222189,
-         value = "Failed to activate shared store slave",
-         format = Message.Format.MESSAGE_FORMAT)
-   void activateSharedStoreSlaveFailed(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222190,
-         value = "Disallowing use of vulnerable protocol: {0}. See http://www.oracle.com/technetwork/topics/security/poodlecve-2014-3566-2339408.html for more details.",
-         format = Message.Format.MESSAGE_FORMAT)
-   void disallowedProtocol(String protocol);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
-   void initializationError(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224001, value = "Error deploying URI {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeployingURI(@Cause Throwable e, URI uri);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224002, value = "Error deploying URI", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeployingURI(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224003, value = "Error undeploying URI {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorUnDeployingURI(@Cause Throwable e, URI a);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224005, value = "Unable to deploy node {0}", format = Message.Format.MESSAGE_FORMAT)
-   void unableToDeployNode(@Cause Exception e, Node node);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224006, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidFilter(@Cause Throwable t, SimpleString filter);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224007, value = "page subscription = {0} error={1}", format = Message.Format.MESSAGE_FORMAT)
-   void pageSubscriptionError(IOAsyncTask ioAsyncTask, String error);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224008, value = "Failed to store id", format = Message.Format.MESSAGE_FORMAT)
-   void batchingIdError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224009, value = "Cannot find message {0}", format = Message.Format.MESSAGE_FORMAT)
-   void cannotFindMessage(Long id);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224010, value = "Cannot find queue messages for queueID={0} on ack for messageID={1}", format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueue(Long queue, Long id);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224011, value = "Cannot find queue messages {0} for message {1} while processing scheduled messages", format = Message.Format.MESSAGE_FORMAT)
-   void journalCannotFindQueueScheduled(Long queue, Long id);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224012, value = "error releasing resources", format = Message.Format.MESSAGE_FORMAT)
-   void largeMessageErrorReleasingResources(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224013, value = "failed to expire messages for queue", format = Message.Format.MESSAGE_FORMAT)
-   void errorExpiringMessages(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224014, value = "Failed to close session", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingSession(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224015, value = "Caught XA exception", format = Message.Format.MESSAGE_FORMAT)
-   void caughtXaException(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224016, value = "Caught exception", format = Message.Format.MESSAGE_FORMAT)
-   void caughtException(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224017, value = "Invalid packet {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidPacket(Packet packet);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224018, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
-   void failedToCreateSession(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224019, value = "Failed to reattach session", format = Message.Format.MESSAGE_FORMAT)
-   void failedToReattachSession(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224020, value = "Failed to handle create queue", format = Message.Format.MESSAGE_FORMAT)
-   void failedToHandleCreateQueue(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224021, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT)
-   void errorDecodingPacket(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224022, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingFailureListener(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224024, value = "Stomp Error, tx already exist! {0}", format = Message.Format.MESSAGE_FORMAT)
-   void stompErrorTXExists(String txID);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224027, value = "Failed to write to handler on invm connector {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorWritingToInvmConnector(@Cause Exception e, Runnable runnable);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224028, value = "Failed to stop acceptor", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingAcceptor();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224029, value = "large message sync: largeMessage instance is incompatible with it, ignoring data", format = Message.Format.MESSAGE_FORMAT)
-   void largeMessageIncompatible();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224030, value = "Could not cancel reference {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorCancellingRefOnBridge(@Cause Exception e, MessageReference ref2);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224031, value = "-------------------------------Stomp begin tx: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void stompBeginTX(String txID);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224032, value = "Failed to pause bridge", format = Message.Format.MESSAGE_FORMAT)
-   void errorPausingBridge(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224033, value = "Failed to broadcast connector configs", format = Message.Format.MESSAGE_FORMAT)
-   void errorBroadcastingConnectorConfigs(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224034, value = "Failed to close consumer", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingConsumer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224035, value = "Failed to close cluster connection flow record", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingFlowRecord(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224036, value = "Failed to update cluster connection topology", format = Message.Format.MESSAGE_FORMAT)
-   void errorUpdatingTopology(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224037, value = "cluster connection Failed to handle message", format = Message.Format.MESSAGE_FORMAT)
-   void errorHandlingMessage(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224038, value = "Failed to ack old reference", format = Message.Format.MESSAGE_FORMAT)
-   void errorAckingOldReference(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224039, value = "Failed to expire message reference", format = Message.Format.MESSAGE_FORMAT)
-   void errorExpiringRef(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224040, value = "Failed to remove consumer", format = Message.Format.MESSAGE_FORMAT)
-   void errorRemovingConsumer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224041, value = "Failed to deliver", format = Message.Format.MESSAGE_FORMAT)
-   void errorDelivering(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224042, value = "Error while restarting the backup server: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorRestartingBackupServer(@Cause Exception e, HornetQServer backup);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224043, value = "Failed to send forced delivery message", format = Message.Format.MESSAGE_FORMAT)
-   void errorSendingForcedDelivery(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224044, value = "error acknowledging message", format = Message.Format.MESSAGE_FORMAT)
-   void errorAckingMessage(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224045, value = "Failed to run large message deliverer", format = Message.Format.MESSAGE_FORMAT)
-   void errorRunningLargeMessageDeliverer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224046, value = "Exception while browser handled from {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorBrowserHandlingMessage(@Cause Exception e, MessageReference current);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224047, value = "Failed to delete large message file", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingLargeMessageFile(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224048, value = "Failed to remove temporary queue {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorRemovingTempQueue(@Cause Exception e, SimpleString bindingName);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224049, value = "Cannot find consumer with id {0}", format = Message.Format.MESSAGE_FORMAT)
-   void cannotFindConsumer(long consumerID);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224050, value = "Failed to close connection {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingConnection(ServerSessionImpl serverSession);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224051, value = "Failed to call notification listener", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingNotifListener(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224052, value = "Unable to call Hierarchical Repository Change Listener", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingRepoListener(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224053, value = "failed to timeout transaction, xid:{0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorTimingOutTX(@Cause Exception e, Xid xid);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224054, value = "exception while stopping the replication manager", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingReplicationManager(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224055, value = "Bridge Failed to ack", format = Message.Format.MESSAGE_FORMAT)
-   void bridgeFailedToAck(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224056, value = "Live server will not fail-back automatically", format = Message.Format.MESSAGE_FORMAT)
-   void autoFailBackDenied();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224057, value = "Backup server that requested fail-back was not announced. Server will not stop for fail-back.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void failbackMissedBackupAnnouncement();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224058, value = "Stopping ClusterManager. As it failed to authenticate with the cluster: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void clusterManagerAuthenticationError(String msg);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224059, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidCipherSuite(String validSuites);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224060, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidProtocol(String validProtocols);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 224069, value = "Could not contact group handler coordinator after 10 retries, message being routed without grouping information",
-            format = Message.Format.MESSAGE_FORMAT)
-   void impossibleToRouteGrouped();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224061, value = "Setting both <{0}> and <ha-policy> is invalid. Please use <ha-policy> exclusively as <{0}> is deprecated. Ignoring <{0}> value.", format = Message.Format.MESSAGE_FORMAT)
-   void incompatibleWithHAPolicy(String parameter);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224062, value = "Failed to send SLOW_CONSUMER notification: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void failedToSendSlowConsumerNotification(Notification notification, @Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224063, value = "Failed to close consumer connections for address {0}", format = Message.Format.MESSAGE_FORMAT)
-   void failedToCloseConsumerConnectionsForAddress(String address, @Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224064, value = "Setting <{0}> is invalid with this HA Policy Configuration. Please use <ha-policy> exclusively or remove. Ignoring <{0}> value.", format = Message.Format.MESSAGE_FORMAT)
-   void incompatibleWithHAPolicyChosen(String parameter);
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServers.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServers.java b/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServers.java
deleted file mode 100644
index 54ddda9..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServers.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.server;
-
-import java.lang.management.ManagementFactory;
-
-import javax.management.MBeanServer;
-
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
-import org.apache.activemq.spi.core.security.HornetQSecurityManagerImpl;
-
-/**
- * HornetQServers is a factory class for instantiating HornetQServer instances.
- * <p>
- * This class should be used when you want to instantiate a HornetQServer instance for embedding in
- * your own application, as opposed to directly instantiating an implementing instance.
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public final class HornetQServers
-{
-
-   private HornetQServers()
-   {
-      // Utility class
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config, final boolean enablePersistence)
-   {
-      HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
-
-      HornetQServer server = HornetQServers.newHornetQServer(config,
-                                                      ManagementFactory.getPlatformMBeanServer(),
-                                                      securityManager,
-                                                      enablePersistence);
-
-      return server;
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config)
-   {
-      return HornetQServers.newHornetQServer(config, config.isPersistenceEnabled());
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config,
-                                                final MBeanServer mbeanServer,
-                                                final boolean enablePersistence)
-   {
-      HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
-
-      HornetQServer server = HornetQServers.newHornetQServer(config, mbeanServer, securityManager, enablePersistence);
-
-      return server;
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config, final MBeanServer mbeanServer)
-   {
-      return HornetQServers.newHornetQServer(config, mbeanServer, true);
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config,
-                                                final MBeanServer mbeanServer,
-                                                final HornetQSecurityManager securityManager)
-   {
-      HornetQServer server = HornetQServers.newHornetQServer(config, mbeanServer, securityManager, true);
-
-      return server;
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config,
-                                                final MBeanServer mbeanServer,
-                                                final HornetQSecurityManager securityManager,
-                                                final boolean enablePersistence)
-   {
-      config.setPersistenceEnabled(enablePersistence);
-
-      HornetQServer server = new HornetQServerImpl(config, mbeanServer, securityManager);
-
-      return server;
-   }
-
-   public static HornetQServer newHornetQServer(Configuration config,
-         String defUser, String defPass)
-   {
-      HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
-
-      securityManager.addUser(defUser, defPass);
-
-      HornetQServer server = HornetQServers.newHornetQServer(config,
-                                                      ManagementFactory.getPlatformMBeanServer(),
-                                                      securityManager,
-                                                      config.isPersistenceEnabled());
-
-      return server;
-   }
-
-   public static HornetQServer newHornetQServer(final Configuration config,
-                                                final MBeanServer mbeanServer,
-                                                final boolean enablePersistence,
-                                                String user,
-                                                String password)
-   {
-      HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
-
-      securityManager.addUser(user, password);
-
-      HornetQServer server = HornetQServers.newHornetQServer(config, mbeanServer, securityManager, enablePersistence);
-
-      return server;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/MemoryManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/MemoryManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/MemoryManager.java
index b8544e7..d0c2139 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/MemoryManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/MemoryManager.java
@@ -21,7 +21,7 @@ import org.apache.activemq.utils.SizeFormatterUtil;
  * memory.
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */
-public class MemoryManager implements HornetQComponent
+public class MemoryManager implements ActiveMQComponent
 {
    private final Runtime runtime;
 
@@ -56,7 +56,7 @@ public class MemoryManager implements HornetQComponent
 
    public synchronized void start()
    {
-      HornetQServerLogger.LOGGER.debug("Starting MemoryManager with MEASURE_INTERVAL: " + measureInterval +
+      ActiveMQServerLogger.LOGGER.debug("Starting MemoryManager with MEASURE_INTERVAL: " + measureInterval +
                                   " FREE_MEMORY_PERCENT: " +
                                   memoryWarningThreshold);
 
@@ -68,7 +68,7 @@ public class MemoryManager implements HornetQComponent
 
       started = true;
 
-      thread = new Thread(new MemoryRunnable(), "hornetq-memory-manager-thread");
+      thread = new Thread(new MemoryRunnable(), "activemq-memory-manager-thread");
 
       thread.setDaemon(true);
 
@@ -135,14 +135,14 @@ public class MemoryManager implements HornetQComponent
             info.append(String.format("total memory:     %s%n", SizeFormatterUtil.sizeof(totalMemory)));
             info.append(String.format("available memory: %.2f%%%n", availableMemoryPercent));
 
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug(info);
+               ActiveMQServerLogger.LOGGER.debug(info);
             }
 
             if (availableMemoryPercent <= memoryWarningThreshold)
             {
-               HornetQServerLogger.LOGGER.memoryError(memoryWarningThreshold, info.toString());
+               ActiveMQServerLogger.LOGGER.memoryError(memoryWarningThreshold, info.toString());
 
                low = true;
             }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/NodeManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/NodeManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/NodeManager.java
index 5828bdf..4bd1772 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/NodeManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/NodeManager.java
@@ -28,7 +28,7 @@ import org.apache.activemq.utils.UUIDGenerator;
  *         Date: Oct 13, 2010
  *         Time: 2:38:40 PM
  */
-public abstract class NodeManager implements HornetQComponent
+public abstract class NodeManager implements ActiveMQComponent
 {
    protected static final byte FIRST_TIME_START = '0';
    private static final String SERVER_LOCK_NAME = "server.lock";
@@ -175,7 +175,7 @@ public abstract class NodeManager implements HornetQComponent
          }
          catch (RuntimeException e)
          {
-            HornetQServerLogger.LOGGER.nodeManagerCantOpenFile(e, serverLockFile);
+            ActiveMQServerLogger.LOGGER.nodeManagerCantOpenFile(e, serverLockFile);
             throw e;
          }
          catch (IOException e)
@@ -195,7 +195,7 @@ public abstract class NodeManager implements HornetQComponent
                count++;
                continue;
             }
-            HornetQServerLogger.LOGGER.nodeManagerCantOpenFile(e, serverLockFile);
+            ActiveMQServerLogger.LOGGER.nodeManagerCantOpenFile(e, serverLockFile);
             throw e;
          }
          if (!fileCreated)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/Queue.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/Queue.java b/activemq-server/src/main/java/org/apache/activemq/core/server/Queue.java
index b85c3c5..136c021 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/Queue.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/Queue.java
@@ -58,7 +58,7 @@ public interface Queue extends Bindable
     * on shared subscriptions where the queue needs to be deleted when all the
     * consumers are closed.
     */
-   void setConsumersRefCount(HornetQServer server);
+   void setConsumersRefCount(ActiveMQServer server);
 
    ReferenceCounter getConsumersRefCount();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ServerSessionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ServerSessionFactory.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ServerSessionFactory.java
index cb4faa8..bea7067 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/ServerSessionFactory.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ServerSessionFactory.java
@@ -17,7 +17,7 @@ import org.apache.activemq.core.persistence.OperationContext;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.security.SecurityStore;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.ServerSessionImpl;
 import org.apache.activemq.core.server.management.ManagementService;
 import org.apache.activemq.core.transaction.ResourceManager;
@@ -34,7 +34,7 @@ public interface ServerSessionFactory
          RemotingConnection connection, StorageManager storageManager,
          PostOffice postOffice, ResourceManager resourceManager,
          SecurityStore securityStore, ManagementService managementService,
-         HornetQServerImpl hornetQServerImpl, SimpleString managementAddress,
+         ActiveMQServerImpl activeMQServerImpl, SimpleString managementAddress,
          SimpleString simpleString, SessionCallback callback,
          OperationContext context) throws Exception;
 


[28/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/SimpleServerThreadFactory.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/SimpleServerThreadFactory.java b/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/SimpleServerThreadFactory.java
index d33c235..2919a80 100644
--- a/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/SimpleServerThreadFactory.java
+++ b/activemq-protocols/activemq-proton-plug/src/test/java/org/proton/plug/test/minimalserver/SimpleServerThreadFactory.java
@@ -18,7 +18,7 @@ import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
- * A HornetQThreadFactory
+ * A ActiveMQThreadFactory
  *
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompException.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompException.java
new file mode 100644
index 0000000..f75356a
--- /dev/null
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompException.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.protocol.stomp;
+
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQStompException extends Exception
+{
+   public static final int NONE = 0;
+   public static final int INVALID_EOL_V10 = 1;
+   public static final int INVALID_COMMAND = 2;
+
+   private static final long serialVersionUID = -274452327574950068L;
+
+   private int code = NONE;
+   private final List<Header> headers = new ArrayList<Header>(10);
+   private String body;
+   private VersionedStompFrameHandler handler;
+   private boolean disconnect;
+
+   public ActiveMQStompException(StompConnection connection, String msg)
+   {
+      super(msg);
+      handler = connection.getFrameHandler();
+   }
+
+   public ActiveMQStompException(String msg)
+   {
+      super(msg);
+      handler = null;
+   }
+
+   public ActiveMQStompException(String msg, Throwable t)
+   {
+      super(msg, t);
+      this.body = t.getMessage();
+      handler = null;
+   }
+
+   //used for version control logic
+   public ActiveMQStompException(int code, String details)
+   {
+      super(details);
+      this.code = code;
+      this.body = details;
+      handler = null;
+   }
+
+   void addHeader(String header, String value)
+   {
+      headers.add(new Header(header, value));
+   }
+
+   public void setBody(String body)
+   {
+      this.body = body;
+   }
+
+   public StompFrame getFrame()
+   {
+      StompFrame frame = null;
+      if (handler == null)
+      {
+         frame = new StompFrame("ERROR");
+      }
+      else
+      {
+         frame = handler.createStompFrame("ERROR");
+      }
+      frame.addHeader("message", this.getMessage());
+      for (Header header : headers)
+      {
+         frame.addHeader(header.key, header.val);
+      }
+
+      if (body != null)
+      {
+         frame.setByteBody(body.getBytes(StandardCharsets.UTF_8));
+      }
+      else
+      {
+         frame.setByteBody(new byte[0]);
+      }
+      frame.setNeedsDisconnect(disconnect);
+      return frame;
+   }
+
+   private static final class Header
+   {
+      public final String key;
+      public final String val;
+
+      public Header(String key, String val)
+      {
+         this.key = key;
+         this.val = val;
+      }
+   }
+
+   public void setDisconnect(boolean b)
+   {
+      disconnect = b;
+   }
+
+   public int getCode()
+   {
+      return code;
+   }
+
+   public void setCode(int newCode)
+   {
+      code = newCode;
+   }
+
+   public void setHandler(VersionedStompFrameHandler frameHandler)
+   {
+      this.handler = frameHandler;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolLogger.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolLogger.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolLogger.java
new file mode 100644
index 0000000..e5f7406
--- /dev/null
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolLogger.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.protocol.stomp;
+
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/8/12
+ *
+ * Logger Code 22
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 101000 to 101999
+ */
+
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQStompProtocolLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQStompProtocolLogger LOGGER = Logger.getMessageLogger(ActiveMQStompProtocolLogger.class, ActiveMQStompProtocolLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222068, value = "connection closed {0}", format = Message.Format.MESSAGE_FORMAT)
+   void connectionClosed(StompConnection connection);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224023, value = "Unable to send frame {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorSendingFrame(@Cause Exception e, StompFrame frame);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
new file mode 100644
index 0000000..6eb5da0
--- /dev/null
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.stomp;
+
+import org.apache.activemq.core.server.impl.ServerMessageImpl;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * Logger Code 33
+ * <p>
+ * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
+ * is from 339000 to 339999.
+ * <p>
+ * Once released, methods should not be deleted as they may be referenced by knowledge base
+ * articles. Unused methods should be marked as deprecated.
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQStompProtocolMessageBundle
+{
+   ActiveMQStompProtocolMessageBundle BUNDLE = Messages.getBundle(ActiveMQStompProtocolMessageBundle.class);
+
+   @Message(id = 339000, value = "Stomp Connection TTL cannot be negative: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException negativeConnectionTTL(Long ttl);
+
+   @Message(id = 339001, value = "Destination does not exist: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException destinationNotExist(String destination);
+
+   @Message(id = 339002, value = "Stomp versions not supported: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException versionNotSupported(String acceptVersion);
+
+   @Message(id = 339003, value = "Header host is null", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException nullHostHeader();
+
+   @Message(id = 339004, value = "Cannot accept null as host", format = Message.Format.MESSAGE_FORMAT)
+   String hostCannotBeNull();
+
+   @Message(id = 339005, value = "Header host does not match server host", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException hostNotMatch();
+
+   @Message(id = 339006, value = "host {0} does not match server host name", format = Message.Format.MESSAGE_FORMAT)
+   String hostNotMatchDetails(String host);
+
+   @Message(id = 339007, value = "Connection was destroyed.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException connectionDestroyed();
+
+   @Message(id = 339008, value = "Connection has not been established.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException connectionNotEstablished();
+
+   @Message(id = 339009, value = "Exception getting session", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorGetSession(@Cause Exception e);
+
+   @Message(id = 339010, value = "Connection is not valid.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException invalidConnection();
+
+   @Message(id = 339011, value = "Error sending message {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorSendMessage(ServerMessageImpl message, @Cause Exception e);
+
+   @Message(id = 339012, value = "Error beginning a transaction {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorBeginTx(String txID, @Cause Exception e);
+
+   @Message(id = 339013, value = "Error committing {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorCommitTx(String txID, @Cause Exception e);
+
+   @Message(id = 339014, value = "Error aborting {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorAbortTx(String txID, @Cause Exception e);
+
+   @Message(id = 339015, value = "Client must set destination or id header to a SUBSCRIBE command", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException noDestination();
+
+   @Message(id = 339016, value = "Error creating subscription {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorCreatSubscription(String subscriptionID, @Cause Exception e);
+
+   @Message(id = 339017, value = "Error unsubscribing {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorUnsubscrib(String subscriptionID, @Cause Exception e);
+
+   @Message(id = 339018, value = "Error acknowledging message {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorAck(String messageID, @Cause Exception e);
+
+   @Message(id = 339019, value = "Invalid char sequence: two consecutive CRs.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException invalidTwoCRs();
+
+   @Message(id = 339020, value = "Invalid char sequence: There is a CR not followed by an LF", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException badCRs();
+
+   @Message(id = 339021, value = "Expect new line char but is {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException notValidNewLine(byte b);
+
+   @Message(id = 339022, value = "Expect new line char but is {0}", format = Message.Format.MESSAGE_FORMAT)
+   String unexpectedNewLine(byte b);
+
+   @Message(id = 339023, value = "Invalid STOMP frame: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException invalidCommand(String dumpByteArray);
+
+   @Message(id = 339024, value = "Invalid STOMP frame: {0}", format = Message.Format.MESSAGE_FORMAT)
+   String invalidFrame(String dumpByteArray);
+
+   @Message(id = 339025, value = "failed to ack because no message with id: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException failToAckMissingID(long id);
+
+   @Message(id = 339026, value = "subscription id {0} does not match {1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException subscriptionIDMismatch(String subscriptionID, String actualID);
+
+   @Message(id = 339027, value = "Cannot create a subscriber on the durable subscription if the client-id of the connection is not set", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException missingClientID();
+
+   @Message(id = 339028, value = "Message header too big, increase minLargeMessageSize please.", format = Message.Format.MESSAGE_FORMAT)
+   Exception headerTooBig();
+
+   @Message(id = 339029, value = "Unsupported command: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException unknownCommand(String command);
+
+   @Message(id = 339030, value = "transaction header is mandatory to COMMIT a transaction", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException needTxIDHeader();
+
+   @Message(id = 339031, value = "Error handling send", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException errorHandleSend(@Cause Exception e);
+
+   @Message(id = 339032, value = "Need a transaction id to begin", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException beginTxNoID();
+
+   @Message(id = 339033, value = "transaction header is mandatory to ABORT a transaction", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException abortTxNoID();
+
+   @Message(id = 339034, value = "This method should not be called", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException invalidCall();
+
+   @Message(id = 339035, value = "Must specify the subscription''s id or the destination you are unsubscribing from", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException needIDorDestination();
+
+   @Message(id = 339037, value = "Must specify the subscription''s id", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException needSubscriptionID();
+
+   @Message(id = 339039, value = "No id header in ACK/NACK frame.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException noIDInAck();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompException.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompException.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompException.java
deleted file mode 100644
index 82b775d..0000000
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompException.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.protocol.stomp;
-
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQStompException extends Exception
-{
-   public static final int NONE = 0;
-   public static final int INVALID_EOL_V10 = 1;
-   public static final int INVALID_COMMAND = 2;
-
-   private static final long serialVersionUID = -274452327574950068L;
-
-   private int code = NONE;
-   private final List<Header> headers = new ArrayList<Header>(10);
-   private String body;
-   private VersionedStompFrameHandler handler;
-   private boolean disconnect;
-
-   public HornetQStompException(StompConnection connection, String msg)
-   {
-      super(msg);
-      handler = connection.getFrameHandler();
-   }
-
-   public HornetQStompException(String msg)
-   {
-      super(msg);
-      handler = null;
-   }
-
-   public HornetQStompException(String msg, Throwable t)
-   {
-      super(msg, t);
-      this.body = t.getMessage();
-      handler = null;
-   }
-
-   //used for version control logic
-   public HornetQStompException(int code, String details)
-   {
-      super(details);
-      this.code = code;
-      this.body = details;
-      handler = null;
-   }
-
-   void addHeader(String header, String value)
-   {
-      headers.add(new Header(header, value));
-   }
-
-   public void setBody(String body)
-   {
-      this.body = body;
-   }
-
-   public StompFrame getFrame()
-   {
-      StompFrame frame = null;
-      if (handler == null)
-      {
-         frame = new StompFrame("ERROR");
-      }
-      else
-      {
-         frame = handler.createStompFrame("ERROR");
-      }
-      frame.addHeader("message", this.getMessage());
-      for (Header header : headers)
-      {
-         frame.addHeader(header.key, header.val);
-      }
-
-      if (body != null)
-      {
-         frame.setByteBody(body.getBytes(StandardCharsets.UTF_8));
-      }
-      else
-      {
-         frame.setByteBody(new byte[0]);
-      }
-      frame.setNeedsDisconnect(disconnect);
-      return frame;
-   }
-
-   private static final class Header
-   {
-      public final String key;
-      public final String val;
-
-      public Header(String key, String val)
-      {
-         this.key = key;
-         this.val = val;
-      }
-   }
-
-   public void setDisconnect(boolean b)
-   {
-      disconnect = b;
-   }
-
-   public int getCode()
-   {
-      return code;
-   }
-
-   public void setCode(int newCode)
-   {
-      code = newCode;
-   }
-
-   public void setHandler(VersionedStompFrameHandler frameHandler)
-   {
-      this.handler = frameHandler;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolLogger.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolLogger.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolLogger.java
deleted file mode 100644
index a30f403..0000000
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolLogger.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.protocol.stomp;
-
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/8/12
- *
- * Logger Code 22
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 101000 to 101999
- */
-
-@MessageLogger(projectCode = "HQ")
-public interface HornetQStompProtocolLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQStompProtocolLogger LOGGER = Logger.getMessageLogger(HornetQStompProtocolLogger.class, HornetQStompProtocolLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 222068, value = "connection closed {0}", format = Message.Format.MESSAGE_FORMAT)
-   void connectionClosed(StompConnection connection);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 224023, value = "Unable to send frame {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorSendingFrame(@Cause Exception e, StompFrame frame);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolMessageBundle.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolMessageBundle.java
deleted file mode 100644
index d895c47..0000000
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/HornetQStompProtocolMessageBundle.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.stomp;
-
-import org.apache.activemq.core.server.impl.ServerMessageImpl;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * Logger Code 33
- * <p>
- * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
- * is from 339000 to 339999.
- * <p>
- * Once released, methods should not be deleted as they may be referenced by knowledge base
- * articles. Unused methods should be marked as deprecated.
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-
-@MessageBundle(projectCode = "HQ")
-public interface HornetQStompProtocolMessageBundle
-{
-   HornetQStompProtocolMessageBundle BUNDLE = Messages.getBundle(HornetQStompProtocolMessageBundle.class);
-
-   @Message(id = 339000, value = "Stomp Connection TTL cannot be negative: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException negativeConnectionTTL(Long ttl);
-
-   @Message(id = 339001, value = "Destination does not exist: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException destinationNotExist(String destination);
-
-   @Message(id = 339002, value = "Stomp versions not supported: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException versionNotSupported(String acceptVersion);
-
-   @Message(id = 339003, value = "Header host is null", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException nullHostHeader();
-
-   @Message(id = 339004, value = "Cannot accept null as host", format = Message.Format.MESSAGE_FORMAT)
-   String hostCannotBeNull();
-
-   @Message(id = 339005, value = "Header host does not match server host", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException hostNotMatch();
-
-   @Message(id = 339006, value = "host {0} does not match server host name", format = Message.Format.MESSAGE_FORMAT)
-   String hostNotMatchDetails(String host);
-
-   @Message(id = 339007, value = "Connection was destroyed.", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException connectionDestroyed();
-
-   @Message(id = 339008, value = "Connection has not been established.", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException connectionNotEstablished();
-
-   @Message(id = 339009, value = "Exception getting session", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorGetSession(@Cause Exception e);
-
-   @Message(id = 339010, value = "Connection is not valid.", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException invalidConnection();
-
-   @Message(id = 339011, value = "Error sending message {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorSendMessage(ServerMessageImpl message, @Cause Exception e);
-
-   @Message(id = 339012, value = "Error beginning a transaction {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorBeginTx(String txID, @Cause Exception e);
-
-   @Message(id = 339013, value = "Error committing {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorCommitTx(String txID, @Cause Exception e);
-
-   @Message(id = 339014, value = "Error aborting {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorAbortTx(String txID, @Cause Exception e);
-
-   @Message(id = 339015, value = "Client must set destination or id header to a SUBSCRIBE command", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException noDestination();
-
-   @Message(id = 339016, value = "Error creating subscription {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorCreatSubscription(String subscriptionID, @Cause Exception e);
-
-   @Message(id = 339017, value = "Error unsubscribing {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorUnsubscrib(String subscriptionID, @Cause Exception e);
-
-   @Message(id = 339018, value = "Error acknowledging message {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorAck(String messageID, @Cause Exception e);
-
-   @Message(id = 339019, value = "Invalid char sequence: two consecutive CRs.", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException invalidTwoCRs();
-
-   @Message(id = 339020, value = "Invalid char sequence: There is a CR not followed by an LF", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException badCRs();
-
-   @Message(id = 339021, value = "Expect new line char but is {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException notValidNewLine(byte b);
-
-   @Message(id = 339022, value = "Expect new line char but is {0}", format = Message.Format.MESSAGE_FORMAT)
-   String unexpectedNewLine(byte b);
-
-   @Message(id = 339023, value = "Invalid STOMP frame: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException invalidCommand(String dumpByteArray);
-
-   @Message(id = 339024, value = "Invalid STOMP frame: {0}", format = Message.Format.MESSAGE_FORMAT)
-   String invalidFrame(String dumpByteArray);
-
-   @Message(id = 339025, value = "failed to ack because no message with id: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException failToAckMissingID(long id);
-
-   @Message(id = 339026, value = "subscription id {0} does not match {1}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException subscriptionIDMismatch(String subscriptionID, String actualID);
-
-   @Message(id = 339027, value = "Cannot create a subscriber on the durable subscription if the client-id of the connection is not set", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException missingClientID();
-
-   @Message(id = 339028, value = "Message header too big, increase minLargeMessageSize please.", format = Message.Format.MESSAGE_FORMAT)
-   Exception headerTooBig();
-
-   @Message(id = 339029, value = "Unsupported command: {0}", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException unknownCommand(String command);
-
-   @Message(id = 339030, value = "transaction header is mandatory to COMMIT a transaction", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException needTxIDHeader();
-
-   @Message(id = 339031, value = "Error handling send", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException errorHandleSend(@Cause Exception e);
-
-   @Message(id = 339032, value = "Need a transaction id to begin", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException beginTxNoID();
-
-   @Message(id = 339033, value = "transaction header is mandatory to ABORT a transaction", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException abortTxNoID();
-
-   @Message(id = 339034, value = "This method should not be called", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException invalidCall();
-
-   @Message(id = 339035, value = "Must specify the subscription''s id or the destination you are unsubscribing from", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException needIDorDestination();
-
-   @Message(id = 339037, value = "Must specify the subscription''s id", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException needSubscriptionID();
-
-   @Message(id = 339039, value = "No id header in ACK/NACK frame.", format = Message.Format.MESSAGE_FORMAT)
-   HornetQStompException noIDInAck();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompConnection.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompConnection.java
index 733faf6..40c13a3 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompConnection.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompConnection.java
@@ -23,13 +23,13 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQBuffers;
 import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.protocol.stomp.v10.StompFrameHandlerV10;
 import org.apache.activemq.core.protocol.stomp.v12.StompFrameHandlerV12;
 import org.apache.activemq.core.remoting.CloseListener;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.core.remoting.impl.netty.TransportConstants;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
@@ -38,7 +38,7 @@ import org.apache.activemq.spi.core.remoting.Connection;
 import org.apache.activemq.utils.ConfigurationHelper;
 import org.apache.activemq.utils.VersionLoader;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * A StompConnection
@@ -48,8 +48,8 @@ import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessag
 public final class StompConnection implements RemotingConnection
 {
    protected static final String CONNECTION_ID_PROP = "__HQ_CID";
-   private static final String SERVER_NAME = "HornetQ/" + VersionLoader.getVersion().getFullVersion() +
-      " HornetQ Messaging Engine";
+   private static final String SERVER_NAME = "ActiveMQ/" + VersionLoader.getVersion().getFullVersion() +
+      " ActiveMQ Messaging Engine";
 
    private final StompProtocolManager manager;
 
@@ -93,24 +93,24 @@ public final class StompConnection implements RemotingConnection
 
    private int minLargeMessageSize;
 
-   public StompFrame decode(ActiveMQBuffer buffer) throws HornetQStompException
+   public StompFrame decode(ActiveMQBuffer buffer) throws ActiveMQStompException
    {
       StompFrame frame = null;
       try
       {
          frame = frameHandler.decode(buffer);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          switch (e.getCode())
          {
-            case HornetQStompException.INVALID_EOL_V10:
+            case ActiveMQStompException.INVALID_EOL_V10:
                if (version != null) throw e;
                frameHandler = new StompFrameHandlerV12(this);
                buffer.resetReaderIndex();
                frame = decode(buffer);
                break;
-            case HornetQStompException.INVALID_COMMAND:
+            case ActiveMQStompException.INVALID_COMMAND:
                frameHandler.onError(e);
                break;
             default:
@@ -141,7 +141,7 @@ public final class StompConnection implements RemotingConnection
                                                                     false,
                                                                     acceptorUsed.getConfiguration());
       this.minLargeMessageSize = ConfigurationHelper.getIntProperty(TransportConstants.STOMP_MIN_LARGE_MESSAGE_SIZE,
-                                                                    HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+                                                                    ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                                                                     acceptorUsed.getConfiguration());
    }
 
@@ -239,7 +239,7 @@ public final class StompConnection implements RemotingConnection
       return res;
    }
 
-   public void checkDestination(String destination) throws HornetQStompException
+   public void checkDestination(String destination) throws ActiveMQStompException
    {
       if (!manager.destinationExists(destination))
       {
@@ -297,7 +297,7 @@ public final class StompConnection implements RemotingConnection
          destroyed = true;
       }
 
-      HornetQServerLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
+      ActiveMQServerLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
       // Then call the listeners
       callFailureListeners(me);
 
@@ -402,7 +402,7 @@ public final class StompConnection implements RemotingConnection
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQServerLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQServerLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -422,7 +422,7 @@ public final class StompConnection implements RemotingConnection
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQServerLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQServerLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -431,7 +431,7 @@ public final class StompConnection implements RemotingConnection
     * accept-version value takes form of "v1,v2,v3..."
     * we need to return the highest supported version
     */
-   public void negotiateVersion(StompFrame frame) throws HornetQStompException
+   public void negotiateVersion(StompFrame frame) throws ActiveMQStompException
    {
       String acceptVersion = frame.getHeader(Stomp.Headers.ACCEPT_VERSION);
 
@@ -463,7 +463,7 @@ public final class StompConnection implements RemotingConnection
          else
          {
             //not a supported version!
-            HornetQStompException error = BUNDLE.versionNotSupported(acceptVersion);
+            ActiveMQStompException error = BUNDLE.versionNotSupported(acceptVersion);
             error.addHeader("version", acceptVersion);
             error.addHeader("content-type", "text/plain");
             error.setBody("Supported protocol version are " + manager.getSupportedVersionsAsString());
@@ -483,11 +483,11 @@ public final class StompConnection implements RemotingConnection
    }
 
    //reject if the host doesn't match
-   public void setHost(String host) throws HornetQStompException
+   public void setHost(String host) throws ActiveMQStompException
    {
       if (host == null)
       {
-         HornetQStompException error = BUNDLE.nullHostHeader();
+         ActiveMQStompException error = BUNDLE.nullHostHeader();
          error.setBody(BUNDLE.hostCannotBeNull());
          throw error;
       }
@@ -495,7 +495,7 @@ public final class StompConnection implements RemotingConnection
       String localHost = manager.getVirtualHostName();
       if (!host.equals(localHost))
       {
-         HornetQStompException error = BUNDLE.hostNotMatch();
+         ActiveMQStompException error = BUNDLE.hostNotMatch();
          error.setBody(BUNDLE.hostNotMatchDetails(host));
          throw error;
       }
@@ -529,7 +529,7 @@ public final class StompConnection implements RemotingConnection
 
          reply = frameHandler.handleFrame(request);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          reply = e.getFrame();
       }
@@ -566,7 +566,7 @@ public final class StompConnection implements RemotingConnection
       return manager.createServerMessage();
    }
 
-   public StompSession getSession(String txID) throws HornetQStompException
+   public StompSession getSession(String txID) throws ActiveMQStompException
    {
       StompSession session = null;
       try
@@ -588,7 +588,7 @@ public final class StompConnection implements RemotingConnection
       return session;
    }
 
-   protected void validate() throws HornetQStompException
+   protected void validate() throws ActiveMQStompException
    {
       if (!this.valid)
       {
@@ -596,7 +596,7 @@ public final class StompConnection implements RemotingConnection
       }
    }
 
-   protected void sendServerMessage(ServerMessageImpl message, String txID) throws HornetQStompException
+   protected void sendServerMessage(ServerMessageImpl message, String txID) throws ActiveMQStompException
    {
       StompSession stompSession = getSession(txID);
 
@@ -638,13 +638,13 @@ public final class StompConnection implements RemotingConnection
       destroy();
    }
 
-   protected void beginTransaction(String txID) throws HornetQStompException
+   protected void beginTransaction(String txID) throws ActiveMQStompException
    {
       try
       {
          manager.beginTransaction(this, txID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          throw e;
       }
@@ -654,7 +654,7 @@ public final class StompConnection implements RemotingConnection
       }
    }
 
-   public void commitTransaction(String txID) throws HornetQStompException
+   public void commitTransaction(String txID) throws ActiveMQStompException
    {
       try
       {
@@ -666,13 +666,13 @@ public final class StompConnection implements RemotingConnection
       }
    }
 
-   public void abortTransaction(String txID) throws HornetQStompException
+   public void abortTransaction(String txID) throws ActiveMQStompException
    {
       try
       {
          manager.abortTransaction(this, txID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          throw e;
       }
@@ -683,7 +683,7 @@ public final class StompConnection implements RemotingConnection
    }
 
    void subscribe(String destination, String selector, String ack,
-                  String id, String durableSubscriptionName, boolean noLocal) throws HornetQStompException
+                  String id, String durableSubscriptionName, boolean noLocal) throws ActiveMQStompException
    {
       if (noLocal)
       {
@@ -721,7 +721,7 @@ public final class StompConnection implements RemotingConnection
       {
          manager.createSubscription(this, subscriptionID, durableSubscriptionName, destination, selector, ack, noLocal);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          throw e;
       }
@@ -731,13 +731,13 @@ public final class StompConnection implements RemotingConnection
       }
    }
 
-   public void unsubscribe(String subscriptionID, String durableSubscriberName) throws HornetQStompException
+   public void unsubscribe(String subscriptionID, String durableSubscriberName) throws ActiveMQStompException
    {
       try
       {
          manager.unsubscribe(this, subscriptionID, durableSubscriberName);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          throw e;
       }
@@ -747,13 +747,13 @@ public final class StompConnection implements RemotingConnection
       }
    }
 
-   public void acknowledge(String messageID, String subscriptionID) throws HornetQStompException
+   public void acknowledge(String messageID, String subscriptionID) throws ActiveMQStompException
    {
       try
       {
          manager.acknowledge(this, messageID, subscriptionID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          throw e;
       }
@@ -768,7 +768,7 @@ public final class StompConnection implements RemotingConnection
       return String.valueOf(version);
    }
 
-   public String getHornetQServerName()
+   public String getActiveMQServerName()
    {
       return SERVER_NAME;
    }
@@ -792,7 +792,7 @@ public final class StompConnection implements RemotingConnection
 
    public void physicalSend(StompFrame frame) throws Exception
    {
-      ActiveMQBuffer buffer = frame.toHornetQBuffer();
+      ActiveMQBuffer buffer = frame.toActiveMQBuffer();
       synchronized (sendLock)
       {
          getTransportConnection().write(buffer, false, false);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompDecoder.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompDecoder.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompDecoder.java
index e7d15c2..f122ccc 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompDecoder.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompDecoder.java
@@ -17,7 +17,7 @@ import java.util.Map;
 
 import org.apache.activemq.api.core.ActiveMQBuffer;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * A StompDecoder
@@ -188,7 +188,7 @@ public class StompDecoder
     * unsupported EOLs ("\r\n" valid for 1.2 only). The StompConnection will switch
     * to proper version decoders on catching such exceptions.
     */
-   public synchronized StompFrame decode(final ActiveMQBuffer buffer) throws HornetQStompException
+   public synchronized StompFrame decode(final ActiveMQBuffer buffer) throws ActiveMQStompException
    {
       int readable = buffer.readableBytes();
 
@@ -225,7 +225,7 @@ public class StompDecoder
       return ret;
    }
 
-   protected StompFrame parseBody() throws HornetQStompException
+   protected StompFrame parseBody() throws ActiveMQStompException
    {
       byte[] content = null;
 
@@ -293,7 +293,7 @@ public class StompDecoder
       }
    }
 
-   protected boolean parseHeaders() throws HornetQStompException
+   protected boolean parseHeaders() throws ActiveMQStompException
    {
       if (headerBytesCopyStart == -1)
       {
@@ -399,7 +399,7 @@ public class StompDecoder
       return true;
    }
 
-   protected boolean parseCommand() throws HornetQStompException
+   protected boolean parseCommand() throws ActiveMQStompException
    {
       int offset = 0;
       boolean nextChar = false;
@@ -621,8 +621,8 @@ public class StompDecoder
       if (workingBuffer[pos - 1] != NEW_LINE)
       {
          //give a signal to try other versions
-         HornetQStompException error = BUNDLE.notValidNewLine(workingBuffer[pos - 1]);
-         error.setCode(HornetQStompException.INVALID_EOL_V10);
+         ActiveMQStompException error = BUNDLE.notValidNewLine(workingBuffer[pos - 1]);
+         error.setCode(ActiveMQStompException.INVALID_EOL_V10);
          error.setBody(BUNDLE.unexpectedNewLine(workingBuffer[pos - 1]));
          throw error;
       }
@@ -630,10 +630,10 @@ public class StompDecoder
       return true;
    }
 
-   public void throwInvalid() throws HornetQStompException
+   public void throwInvalid() throws ActiveMQStompException
    {
-      HornetQStompException error = BUNDLE.invalidCommand(this.dumpByteArray(workingBuffer));
-      error.setCode(HornetQStompException.INVALID_COMMAND);
+      ActiveMQStompException error = BUNDLE.invalidCommand(this.dumpByteArray(workingBuffer));
+      error.setCode(ActiveMQStompException.INVALID_COMMAND);
       error.setBody(BUNDLE.invalidFrame(this.dumpByteArray(workingBuffer)));
       throw error;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompFrame.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompFrame.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompFrame.java
index 46aa639..525c514 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompFrame.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompFrame.java
@@ -75,7 +75,7 @@ public class StompFrame
    {
       if (buffer == null)
       {
-         buffer = toHornetQBuffer();
+         buffer = toActiveMQBuffer();
       }
       return size;
    }
@@ -97,7 +97,7 @@ public class StompFrame
       isPing = ping;
    }
 
-   public ActiveMQBuffer toHornetQBuffer() throws Exception
+   public ActiveMQBuffer toActiveMQBuffer() throws Exception
    {
       if (buffer == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManager.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManager.java
index 9e1a0b4..24ea296 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManager.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManager.java
@@ -27,15 +27,15 @@ import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.api.core.ActiveMQExceptionType;
 import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.management.CoreNotificationType;
 import org.apache.activemq.api.core.management.ManagementHelper;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.postoffice.BindingType;
 import org.apache.activemq.core.remoting.impl.netty.NettyServerConnection;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerSession;
 import org.apache.activemq.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.core.server.management.ManagementService;
@@ -47,12 +47,12 @@ import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.Acceptor;
 import org.apache.activemq.spi.core.remoting.Connection;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.utils.ConcurrentHashSet;
 import org.apache.activemq.utils.TypedProperties;
 import org.apache.activemq.utils.UUIDGenerator;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * StompProtocolManager
@@ -65,7 +65,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
 
    // Attributes ----------------------------------------------------
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final Executor executor;
 
@@ -80,7 +80,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
 
    // Constructors --------------------------------------------------
 
-   public StompProtocolManager(final HornetQServer server, final List<Interceptor> interceptors)
+   public StompProtocolManager(final ActiveMQServer server, final List<Interceptor> interceptors)
    {
       this.server = server;
       this.executor = server.getExecutorFactory().getExecutor();
@@ -152,7 +152,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorDecodingPacket(e);
+            ActiveMQServerLogger.LOGGER.errorDecodingPacket(e);
             return;
          }
 
@@ -194,15 +194,15 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
 
    public boolean send(final StompConnection connection, final StompFrame frame)
    {
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("sent " + frame);
+         ActiveMQServerLogger.LOGGER.trace("sent " + frame);
       }
       synchronized (connection)
       {
          if (connection.isDestroyed())
          {
-            HornetQStompProtocolLogger.LOGGER.connectionClosed(connection);
+            ActiveMQStompProtocolLogger.LOGGER.connectionClosed(connection);
             return false;
          }
 
@@ -212,7 +212,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
          }
          catch (Exception e)
          {
-            HornetQStompProtocolLogger.LOGGER.errorSendingFrame(e, frame);
+            ActiveMQStompProtocolLogger.LOGGER.errorSendingFrame(e, frame);
             return false;
          }
          return true;
@@ -236,7 +236,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
          ServerSession session = server.createSession(name,
                                                       connection.getLogin(),
                                                       connection.getPasscode(),
-                                                      HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+                                                      ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                                                       connection,
                                                       true,
                                                       false,
@@ -261,7 +261,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
          ServerSession session = server.createSession(name,
                                                       connection.getLogin(),
                                                       connection.getPasscode(),
-                                                      HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+                                                      ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                                                       connection,
                                                       false,
                                                       false,
@@ -296,7 +296,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.errorCleaningStompConn(e);
+                  ActiveMQServerLogger.LOGGER.errorCleaningStompConn(e);
                }
             }
 
@@ -315,7 +315,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
                   }
                   catch (Exception e)
                   {
-                     HornetQServerLogger.LOGGER.errorCleaningStompConn(e);
+                     ActiveMQServerLogger.LOGGER.errorCleaningStompConn(e);
                   }
                   iterator.remove();
                }
@@ -330,9 +330,9 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
       {
          public void onError(final int errorCode, final String errorMessage)
          {
-            HornetQServerLogger.LOGGER.errorProcessingIOCallback(errorCode, errorMessage);
+            ActiveMQServerLogger.LOGGER.errorProcessingIOCallback(errorCode, errorMessage);
 
-            HornetQStompException e = new HornetQStompException("Error sending reply",
+            ActiveMQStompException e = new ActiveMQStompException("Error sending reply",
                                                                 ActiveMQExceptionType.createException(errorCode, errorMessage));
 
             StompFrame error = e.getFrame();
@@ -353,14 +353,14 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
 
    public String getVirtualHostName()
    {
-      return "hornetq";
+      return "activemq";
    }
 
    public boolean validateUser(String login, String passcode)
    {
       boolean validated = true;
 
-      HornetQSecurityManager sm = server.getSecurityManager();
+      ActiveMQSecurityManager sm = server.getSecurityManager();
 
       if (sm != null && server.getConfiguration().isSecurityEnabled())
       {
@@ -380,7 +380,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
       StompSession session = getTransactedSession(connection, txID);
       if (session == null)
       {
-         throw new HornetQStompException("No transaction started: " + txID);
+         throw new ActiveMQStompException("No transaction started: " + txID);
       }
       transactedSessions.remove(txID);
       session.getSession().commit();
@@ -391,7 +391,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
       StompSession session = getTransactedSession(connection, txID);
       if (session == null)
       {
-         throw new HornetQStompException("No transaction started: " + txID);
+         throw new ActiveMQStompException("No transaction started: " + txID);
       }
       transactedSessions.remove(txID);
       session.getSession().rollback(false);
@@ -406,7 +406,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
       stompSession.setNoLocal(noLocal);
       if (stompSession.containsSubscription(subscriptionID))
       {
-         throw new HornetQStompException("There already is a subscription for: " + subscriptionID +
+         throw new ActiveMQStompException("There already is a subscription for: " + subscriptionID +
                                             ". Either use unique subscription IDs or do not create multiple subscriptions for the same destination");
       }
       long consumerID = server.getStorageManager().generateID();
@@ -427,7 +427,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
       boolean unsubscribed = stompSession.unsubscribe(subscriptionID, durableSubscriberName);
       if (!unsubscribed)
       {
-         throw new HornetQStompException("Cannot unsubscribe as no subscription exists for id: " + subscriptionID);
+         throw new ActiveMQStompException("Cannot unsubscribe as no subscription exists for id: " + subscriptionID);
       }
    }
 
@@ -439,11 +439,11 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
 
    public void beginTransaction(StompConnection connection, String txID) throws Exception
    {
-      HornetQServerLogger.LOGGER.stompBeginTX(txID);
+      ActiveMQServerLogger.LOGGER.stompBeginTX(txID);
       if (transactedSessions.containsKey(txID))
       {
-         HornetQServerLogger.LOGGER.stompErrorTXExists(txID);
-         throw new HornetQStompException(connection, "Transaction already started: " + txID);
+         ActiveMQServerLogger.LOGGER.stompErrorTXExists(txID);
+         throw new ActiveMQStompException(connection, "Transaction already started: " + txID);
       }
       // create the transacted session
       getTransactedSession(connection, txID);
@@ -469,7 +469,7 @@ class StompProtocolManager implements ProtocolManager, NotificationListener
          {
             if (!props.containsProperty(ManagementHelper.HDR_BINDING_TYPE))
             {
-               throw HornetQMessageBundle.BUNDLE.bindingTypeNotSpecified();
+               throw ActiveMQMessageBundle.BUNDLE.bindingTypeNotSpecified();
             }
 
             Integer bindingType = props.getIntProperty(ManagementHelper.HDR_BINDING_TYPE);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManagerFactory.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManagerFactory.java
index 60f5810..365a23c 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManagerFactory.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompProtocolManagerFactory.java
@@ -15,7 +15,7 @@ package org.apache.activemq.core.protocol.stomp;
 import java.util.List;
 
 import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
 
@@ -32,7 +32,7 @@ public class StompProtocolManagerFactory implements ProtocolManagerFactory
 
    private static String[] SUPPORTED_PROTOCOLS = {STOMP_PROTOCOL_NAME};
 
-   public ProtocolManager createProtocolManager(final HornetQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
+   public ProtocolManager createProtocolManager(final ActiveMQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
    {
       return new StompProtocolManager(server, incomingInterceptors);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompSession.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompSession.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompSession.java
index 30baf56..96fb75c 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompSession.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/StompSession.java
@@ -41,7 +41,7 @@ import org.apache.activemq.spi.core.remoting.ReadyListener;
 import org.apache.activemq.utils.ConfigurationHelper;
 import org.apache.activemq.utils.UUIDGenerator;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * A StompSession

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/VersionedStompFrameHandler.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/VersionedStompFrameHandler.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/VersionedStompFrameHandler.java
index 8057a18..1500ab5 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/VersionedStompFrameHandler.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/VersionedStompFrameHandler.java
@@ -26,7 +26,7 @@ import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.utils.DataConstants;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
@@ -58,7 +58,7 @@ public abstract class VersionedStompFrameHandler
       this.connection = connection;
    }
 
-   public StompFrame decode(ActiveMQBuffer buffer) throws HornetQStompException
+   public StompFrame decode(ActiveMQBuffer buffer) throws ActiveMQStompException
    {
       return decoder.decode(buffer);
    }
@@ -157,7 +157,7 @@ public abstract class VersionedStompFrameHandler
 
    public StompFrame onUnknown(String command)
    {
-      HornetQStompException error = BUNDLE.unknownCommand(command);
+      ActiveMQStompException error = BUNDLE.unknownCommand(command);
       StompFrame response = error.getFrame();
       return response;
    }
@@ -177,7 +177,7 @@ public abstract class VersionedStompFrameHandler
       String txID = request.getHeader(Stomp.Headers.TRANSACTION);
       if (txID == null)
       {
-         HornetQStompException error = BUNDLE.needTxIDHeader();
+         ActiveMQStompException error = BUNDLE.needTxIDHeader();
          response = error.getFrame();
          return response;
       }
@@ -186,7 +186,7 @@ public abstract class VersionedStompFrameHandler
       {
          connection.commitTransaction(txID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -223,20 +223,20 @@ public abstract class VersionedStompFrameHandler
 
          connection.sendServerMessage(message, txID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
       catch (Exception e)
       {
-         HornetQStompException error = BUNDLE.errorHandleSend(e);
+         ActiveMQStompException error = BUNDLE.errorHandleSend(e);
          response = error.getFrame();
       }
 
       return response;
    }
 
-   private void checkDestination(String destination) throws HornetQStompException
+   private void checkDestination(String destination) throws ActiveMQStompException
    {
       connection.checkDestination(destination);
    }
@@ -247,7 +247,7 @@ public abstract class VersionedStompFrameHandler
       String txID = frame.getHeader(Stomp.Headers.TRANSACTION);
       if (txID == null)
       {
-         HornetQStompException error = BUNDLE.beginTxNoID();
+         ActiveMQStompException error = BUNDLE.beginTxNoID();
          response = error.getFrame();
       }
       else
@@ -256,7 +256,7 @@ public abstract class VersionedStompFrameHandler
          {
             connection.beginTransaction(txID);
          }
-         catch (HornetQStompException e)
+         catch (ActiveMQStompException e)
          {
             response = e.getFrame();
          }
@@ -271,7 +271,7 @@ public abstract class VersionedStompFrameHandler
 
       if (txID == null)
       {
-         HornetQStompException error = BUNDLE.abortTxNoID();
+         ActiveMQStompException error = BUNDLE.abortTxNoID();
          response = error.getFrame();
          return response;
       }
@@ -280,7 +280,7 @@ public abstract class VersionedStompFrameHandler
       {
          connection.abortTransaction(txID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -308,7 +308,7 @@ public abstract class VersionedStompFrameHandler
       {
          connection.subscribe(destination, selector, ack, id, durableSubscriptionName, noLocal);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -400,7 +400,7 @@ public abstract class VersionedStompFrameHandler
    }
 
    //sends an ERROR frame back to client if possible then close the connection
-   public void onError(HornetQStompException e)
+   public void onError(ActiveMQStompException e)
    {
       this.connection.sendFrame(e.getFrame());
       connection.destroy();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v10/StompFrameHandlerV10.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v10/StompFrameHandlerV10.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v10/StompFrameHandlerV10.java
index 6b20126..94395f7 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v10/StompFrameHandlerV10.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v10/StompFrameHandlerV10.java
@@ -15,15 +15,15 @@ package org.apache.activemq.core.protocol.stomp.v10;
 import java.util.Map;
 
 import org.apache.activemq.core.protocol.stomp.FrameEventListener;
-import org.apache.activemq.core.protocol.stomp.HornetQStompException;
+import org.apache.activemq.core.protocol.stomp.ActiveMQStompException;
 import org.apache.activemq.core.protocol.stomp.Stomp;
 import org.apache.activemq.core.protocol.stomp.StompConnection;
 import org.apache.activemq.core.protocol.stomp.StompDecoder;
 import org.apache.activemq.core.protocol.stomp.StompFrame;
 import org.apache.activemq.core.protocol.stomp.VersionedStompFrameHandler;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
 *
@@ -101,7 +101,7 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
       {
          if (destination == null)
          {
-            HornetQStompException error = BUNDLE.needIDorDestination();
+            ActiveMQStompException error = BUNDLE.needIDorDestination();
             response = error.getFrame();
             return response;
          }
@@ -112,7 +112,7 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
       {
          connection.unsubscribe(subscriptionID, durableSubscriberName);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          return e.getFrame();
       }
@@ -129,14 +129,14 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
 
       if (txID != null)
       {
-         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
+         ActiveMQServerLogger.LOGGER.stompTXAckNorSupported();
       }
 
       try
       {
          connection.acknowledge(messageID, null);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameHandlerV11.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameHandlerV11.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameHandlerV11.java
index 9b6b108..bc77cb8 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameHandlerV11.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameHandlerV11.java
@@ -15,17 +15,17 @@ package org.apache.activemq.core.protocol.stomp.v11;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.activemq.core.protocol.stomp.ActiveMQStompException;
 import org.apache.activemq.core.protocol.stomp.FrameEventListener;
-import org.apache.activemq.core.protocol.stomp.HornetQStompException;
 import org.apache.activemq.core.protocol.stomp.SimpleBytes;
 import org.apache.activemq.core.protocol.stomp.Stomp;
 import org.apache.activemq.core.protocol.stomp.StompConnection;
 import org.apache.activemq.core.protocol.stomp.StompDecoder;
 import org.apache.activemq.core.protocol.stomp.StompFrame;
 import org.apache.activemq.core.protocol.stomp.VersionedStompFrameHandler;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
@@ -73,7 +73,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
 
             // server
             response.addHeader(Stomp.Headers.Connected.SERVER,
-                               connection.getHornetQServerName());
+                               connection.getActiveMQServerName());
 
             if (requestID != null)
             {
@@ -107,7 +107,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
             response.setBody("The login account is not valid.");
          }
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -117,12 +117,12 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
 
    //ping parameters, hard-code for now
    //the server can support min 20 milliseconds and receive ping at 100 milliseconds (20,100)
-   private void handleHeartBeat(String heartBeatHeader) throws HornetQStompException
+   private void handleHeartBeat(String heartBeatHeader) throws ActiveMQStompException
    {
       String[] params = heartBeatHeader.split(",");
       if (params.length != 2)
       {
-         throw new HornetQStompException("Incorrect heartbeat header " + heartBeatHeader);
+         throw new ActiveMQStompException("Incorrect heartbeat header " + heartBeatHeader);
       }
 
       //client ping
@@ -148,7 +148,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
          }
          catch (InterruptedException e)
          {
-            HornetQServerLogger.LOGGER.errorOnStompHeartBeat(e);
+            ActiveMQServerLogger.LOGGER.errorOnStompHeartBeat(e);
          }
       }
       return null;
@@ -177,7 +177,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
       {
          connection.unsubscribe(subscriptionID, durableSubscriberName);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -195,7 +195,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
 
       if (txID != null)
       {
-         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
+         ActiveMQServerLogger.LOGGER.stompTXAckNorSupported();
       }
 
       if (subscriptionID == null)
@@ -208,7 +208,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
       {
          connection.acknowledge(messageID, subscriptionID);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -444,7 +444,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
       }
 
       @Override
-      protected boolean parseCommand() throws HornetQStompException
+      protected boolean parseCommand() throws ActiveMQStompException
       {
          int offset = 0;
          boolean nextChar = false;
@@ -692,7 +692,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
          return true;
       }
 
-      protected void checkEol() throws HornetQStompException
+      protected void checkEol() throws ActiveMQStompException
       {
          if (workingBuffer[pos - 1] != NEW_LINE)
          {
@@ -701,7 +701,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
       }
 
       @Override
-      protected boolean parseHeaders() throws HornetQStompException
+      protected boolean parseHeaders() throws ActiveMQStompException
       {
 
 
@@ -822,7 +822,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
          return true;
       }
 
-      protected StompFrame parseBody() throws HornetQStompException
+      protected StompFrame parseBody() throws ActiveMQStompException
       {
          byte[] content = null;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameV11.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameV11.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameV11.java
index 2fef54e..f8d2654 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameV11.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v11/StompFrameV11.java
@@ -43,7 +43,7 @@ public class StompFrameV11 extends StompFrame
    }
 
    @Override
-   public ActiveMQBuffer toHornetQBuffer() throws Exception
+   public ActiveMQBuffer toActiveMQBuffer() throws Exception
    {
       if (buffer == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameHandlerV12.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameHandlerV12.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameHandlerV12.java
index 5047b3d..79f7620 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameHandlerV12.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameHandlerV12.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.protocol.stomp.v12;
 
 import org.apache.activemq.core.protocol.stomp.FrameEventListener;
-import org.apache.activemq.core.protocol.stomp.HornetQStompException;
+import org.apache.activemq.core.protocol.stomp.ActiveMQStompException;
 import org.apache.activemq.core.protocol.stomp.Stomp;
 import org.apache.activemq.core.protocol.stomp.StompConnection;
 import org.apache.activemq.core.protocol.stomp.StompDecoder;
@@ -21,10 +21,10 @@ import org.apache.activemq.core.protocol.stomp.StompFrame;
 import org.apache.activemq.core.protocol.stomp.StompSubscription;
 import org.apache.activemq.core.protocol.stomp.v11.StompFrameHandlerV11;
 import org.apache.activemq.core.protocol.stomp.v11.StompFrameV11;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerMessage;
 
-import static org.apache.activemq.core.protocol.stomp.HornetQStompProtocolMessageBundle.BUNDLE;
+import static org.apache.activemq.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE;
 
 /**
  * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
@@ -72,12 +72,12 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements FrameE
 
       if (txID != null)
       {
-         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
+         ActiveMQServerLogger.LOGGER.stompTXAckNorSupported();
       }
 
       if (messageID == null)
       {
-         HornetQStompException error = BUNDLE.noIDInAck();
+         ActiveMQStompException error = BUNDLE.noIDInAck();
          error.setHandler(connection.getFrameHandler());
          return error.getFrame();
       }
@@ -86,7 +86,7 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements FrameE
       {
          connection.acknowledge(messageID, null);
       }
-      catch (HornetQStompException e)
+      catch (ActiveMQStompException e)
       {
          response = e.getFrame();
       }
@@ -112,7 +112,7 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements FrameE
       }
 
       @Override
-      protected void checkEol() throws HornetQStompException
+      protected void checkEol() throws ActiveMQStompException
       {
          //either \n or \r\n
          if (workingBuffer[pos - 2] == NEW_LINE)
@@ -139,7 +139,7 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements FrameE
       }
 
       @Override
-      protected boolean parseHeaders() throws HornetQStompException
+      protected boolean parseHeaders() throws ActiveMQStompException
       {
       outer:
          while (true)
@@ -283,7 +283,7 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements FrameE
          return true;
       }
 
-      protected StompFrame parseBody() throws HornetQStompException
+      protected StompFrame parseBody() throws ActiveMQStompException
       {
          byte[] content = null;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameV12.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameV12.java b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameV12.java
index 6754232..617b2cf 100644
--- a/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameV12.java
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/java/org/apache/activemq/core/protocol/stomp/v12/StompFrameV12.java
@@ -43,7 +43,7 @@ public class StompFrameV12 extends StompFrame
    }
 
    @Override
-   public ActiveMQBuffer toHornetQBuffer() throws Exception
+   public ActiveMQBuffer toActiveMQBuffer() throws Exception
    {
       if (buffer == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
new file mode 100644
index 0000000..7983da8
--- /dev/null
+++ b/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
@@ -0,0 +1 @@
+org.apache.activemq.core.protocol.stomp.StompProtocolManagerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
deleted file mode 100644
index 7983da8..0000000
--- a/activemq-protocols/activemq-stomp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.activemq.core.protocol.stomp.StompProtocolManagerFactory
\ No newline at end of file


[38/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQBytesMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQBytesMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQBytesMessage.java
deleted file mode 100644
index 5213ffa..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQBytesMessage.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.core.message.impl.MessageImpl;
-
-import static org.apache.activemq.reader.BytesMessageUtil.bytesMessageReset;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadBoolean;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadByte;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadBytes;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadChar;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadDouble;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadFloat;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadInt;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadLong;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadShort;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUTF;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUnsignedByte;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUnsignedShort;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteBoolean;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteByte;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteBytes;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteChar;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteDouble;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteFloat;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteInt;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteLong;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteObject;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteShort;
-import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteUTF;
-
-/**
- * HornetQ implementation of a JMS {@link BytesMessage}.
- *
- * @author Norbert Lataille (Norbert.Lataille@m4x.org)
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- */
-public class HornetQBytesMessage extends HornetQMessage implements BytesMessage
-{
-   // Static -------------------------------------------------------
-   public static final byte TYPE = Message.BYTES_TYPE;
-
-   // Attributes ----------------------------------------------------
-
-   private int bodyLength;
-
-   // Constructor ---------------------------------------------------
-
-   /**
-    * This constructor is used to construct messages prior to sending
-    */
-   protected HornetQBytesMessage(final ClientSession session)
-   {
-      super(HornetQBytesMessage.TYPE, session);
-   }
-
-   /**
-    * Constructor on receipt at client side
-    */
-   protected HornetQBytesMessage(final ClientMessage message, final ClientSession session)
-   {
-      super(message, session);
-   }
-
-   /**
-    * Foreign message constructor
-    */
-   public HornetQBytesMessage(final BytesMessage foreign, final ClientSession session) throws JMSException
-   {
-      super(foreign, HornetQBytesMessage.TYPE, session);
-
-      foreign.reset();
-
-      byte[] buffer = new byte[1024];
-      int n = foreign.readBytes(buffer);
-      while (n != -1)
-      {
-         writeBytes(buffer, 0, n);
-         n = foreign.readBytes(buffer);
-      }
-   }
-
-   // BytesMessage implementation -----------------------------------
-
-   public boolean readBoolean() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadBoolean(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public byte readByte() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadByte(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public int readUnsignedByte() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadUnsignedByte(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public short readShort() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadShort(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public int readUnsignedShort() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadUnsignedShort(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public char readChar() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadChar(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public int readInt() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadInt(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public long readLong() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadLong(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public float readFloat() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadFloat(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public double readDouble() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadDouble(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public String readUTF() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return bytesReadUTF(message);
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-      catch (Exception e)
-      {
-         JMSException je = new JMSException("Failed to get UTF");
-         je.setLinkedException(e);
-         je.initCause(e);
-         throw je;
-      }
-   }
-
-   public int readBytes(final byte[] value) throws JMSException
-   {
-      checkRead();
-      return bytesReadBytes(message, value);
-   }
-
-   public int readBytes(final byte[] value, final int length) throws JMSException
-   {
-      checkRead();
-      return bytesReadBytes(message, value, length);
-
-   }
-
-   public void writeBoolean(final boolean value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteBoolean(message, value);
-   }
-
-   public void writeByte(final byte value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteByte(message, value);
-   }
-
-   public void writeShort(final short value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteShort(message, value);
-   }
-
-   public void writeChar(final char value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteChar(message, value);
-   }
-
-   public void writeInt(final int value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteInt(message, value);
-   }
-
-   public void writeLong(final long value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteLong(message, value);
-   }
-
-   public void writeFloat(final float value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteFloat(message, value);
-   }
-
-   public void writeDouble(final double value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteDouble(message, value);
-   }
-
-   public void writeUTF(final String value) throws JMSException
-   {
-      checkWrite();
-      try
-      {
-         bytesWriteUTF(message, value);
-      }
-      catch (Exception e)
-      {
-         JMSException je = new JMSException("Failed to write UTF");
-         je.setLinkedException(e);
-         je.initCause(e);
-         throw je;
-      }
-
-   }
-
-   public void writeBytes(final byte[] value) throws JMSException
-   {
-      checkWrite();
-      bytesWriteBytes(message, value);
-   }
-
-   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
-   {
-      checkWrite();
-      bytesWriteBytes(message, value, offset, length);
-   }
-
-   public void writeObject(final Object value) throws JMSException
-   {
-      checkWrite();
-      if (!bytesWriteObject(message, value))
-      {
-         throw new MessageFormatException("Invalid object for properties");
-      }
-   }
-
-   public void reset() throws JMSException
-   {
-      if (!readOnly)
-      {
-         readOnly = true;
-
-         bodyLength = message.getBodySize();
-      }
-
-      bytesMessageReset(message);
-   }
-
-   @Override
-   public void doBeforeReceive() throws ActiveMQException
-   {
-      bodyLength = message.getBodySize();
-   }
-
-   // HornetQRAMessage overrides ----------------------------------------
-
-   @Override
-   public void clearBody() throws JMSException
-   {
-      super.clearBody();
-
-      try
-      {
-         getBuffer().clear();
-      }
-      catch (RuntimeException e)
-      {
-         JMSException e2 = new JMSException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   public long getBodyLength() throws JMSException
-   {
-      checkRead();
-
-      return bodyLength;
-   }
-
-   @Override
-   public void doBeforeSend() throws Exception
-   {
-      reset();
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public byte getType()
-   {
-      return HornetQBytesMessage.TYPE;
-   }
-
-   private ActiveMQBuffer getBuffer()
-   {
-      return message.getBodyBuffer();
-   }
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
-                                     Class c)
-   {
-      return c.isAssignableFrom(byte[].class);
-   }
-
-   @Override
-   protected <T> T getBodyInternal(Class<T> c)
-   {
-      if (bodyLength == 0)
-         return null;
-      byte[] dst = new byte[bodyLength];
-      message.getBodyBuffer().getBytes(MessageImpl.BODY_OFFSET, dst);
-      return (T)dst;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnection.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnection.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnection.java
deleted file mode 100644
index 6980131..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnection.java
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.ConnectionConsumer;
-import javax.jms.ConnectionMetaData;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidClientIDException;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.ServerSessionPool;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicSession;
-import java.lang.ref.WeakReference;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.FailoverEventListener;
-import org.apache.activemq.api.core.client.FailoverEventType;
-import org.apache.activemq.api.core.client.SessionFailureListener;
-import org.apache.activemq.api.jms.HornetQJMSConstants;
-import org.apache.activemq.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.core.version.Version;
-import org.apache.activemq.reader.MessageUtil;
-import org.apache.activemq.utils.ConcurrentHashSet;
-import org.apache.activemq.utils.UUIDGenerator;
-import org.apache.activemq.utils.VersionLoader;
-
-/**
- * HornetQ implementation of a JMS Connection.
- * <p>
- * The flat implementation of {@link TopicConnection} and {@link QueueConnection} is per design,
- * following the common usage of these as one flat API in JMS 1.1.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- */
-public class HornetQConnection extends HornetQConnectionForContextImpl implements TopicConnection, QueueConnection
-{
-   // Constants ------------------------------------------------------------------------------------
-   public static final int TYPE_GENERIC_CONNECTION = 0;
-
-   public static final int TYPE_QUEUE_CONNECTION = 1;
-
-   public static final int TYPE_TOPIC_CONNECTION = 2;
-
-   public static final String EXCEPTION_FAILOVER = "FAILOVER";
-
-   public static final String EXCEPTION_DISCONNECT = "DISCONNECT";
-
-   public static final SimpleString CONNECTION_ID_PROPERTY_NAME = MessageUtil.CONNECTION_ID_PROPERTY_NAME;
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   private final int connectionType;
-
-   private final Set<HornetQSession> sessions = new org.apache.activemq.utils.ConcurrentHashSet<HornetQSession>();
-
-   private final Set<SimpleString> tempQueues = new org.apache.activemq.utils.ConcurrentHashSet<SimpleString>();
-
-   private final Set<SimpleString> knownDestinations = new ConcurrentHashSet<SimpleString>();
-
-   private volatile boolean hasNoLocal;
-
-   private volatile ExceptionListener exceptionListener;
-
-   private volatile FailoverEventListener failoverEventListener;
-
-   private volatile boolean justCreated = true;
-
-   private volatile ConnectionMetaData metaData;
-
-   private volatile boolean closed;
-
-   private volatile boolean started;
-
-   private String clientID;
-
-   private final ClientSessionFactory sessionFactory;
-
-   private final SimpleString uid;
-
-   private final String username;
-
-   private final String password;
-
-   private final SessionFailureListener listener = new JMSFailureListener(this);
-
-   private final FailoverEventListener failoverListener = new FailoverEventListenerImpl(this);
-
-   private final Version thisVersion;
-
-   private final int dupsOKBatchSize;
-
-   private final int transactionBatchSize;
-
-   private ClientSession initialSession;
-
-   private final Exception creationStack;
-
-   private HornetQConnectionFactory factoryReference;
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public HornetQConnection(final String username, final String password, final int connectionType,
-                            final String clientID, final int dupsOKBatchSize, final int transactionBatchSize,
-                            final ClientSessionFactory sessionFactory)
-   {
-      this.username = username;
-
-      this.password = password;
-
-      this.connectionType = connectionType;
-
-      this.clientID = clientID;
-
-      this.sessionFactory = sessionFactory;
-
-      uid = UUIDGenerator.getInstance().generateSimpleStringUUID();
-
-      thisVersion = VersionLoader.getVersion();
-
-      this.dupsOKBatchSize = dupsOKBatchSize;
-
-      this.transactionBatchSize = transactionBatchSize;
-
-      creationStack = new Exception();
-   }
-
-   /**
-    * This internal method serves basically the Resource Adapter.
-    * The resource adapter plays with an XASession and a non XASession.
-    * When there is no enlisted transaction, the EE specification mandates that the commit should
-    * be done as if it was a nonXA Session (i.e. SessionTransacted).
-    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
-    * mandates createSession to return a XASession.
-    */
-   public Session createNonXASession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-
-      return createSessionInternal(false, transacted, acknowledgeMode, HornetQConnection.TYPE_GENERIC_CONNECTION);
-   }
-
-   /**
-    * This internal method serves basically the Resource Adapter.
-    * The resource adapter plays with an XASession and a non XASession.
-    * When there is no enlisted transaction, the EE specification mandates that the commit should
-    * be done as if it was a nonXA Session (i.e. SessionTransacted).
-    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
-    * mandates createSession to return a XASession.
-    */
-   public Session createNonXATopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-
-      return createSessionInternal(false, transacted, acknowledgeMode, HornetQConnection.TYPE_TOPIC_CONNECTION);
-   }
-
-   /**
-    * This internal method serves basically the Resource Adapter.
-    * The resource adapter plays with an XASession and a non XASession.
-    * When there is no enlisted transaction, the EE specification mandates that the commit should
-    * be done as if it was a nonXA Session (i.e. SessionTransacted).
-    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
-    * mandates createSession to return a XASession.
-    */
-   public Session createNonXAQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-
-      return createSessionInternal(false, transacted, acknowledgeMode, HornetQConnection.TYPE_QUEUE_CONNECTION);
-   }
-
-
-   // Connection implementation --------------------------------------------------------------------
-
-   public synchronized Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-
-      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), HornetQConnection.TYPE_GENERIC_CONNECTION);
-   }
-
-   public String getClientID() throws JMSException
-   {
-      checkClosed();
-
-      return clientID;
-   }
-
-   public void setClientID(final String clientID) throws JMSException
-   {
-      checkClosed();
-
-      if (this.clientID != null)
-      {
-         throw new IllegalStateException("Client id has already been set");
-      }
-
-      if (!justCreated)
-      {
-         throw new IllegalStateException("setClientID can only be called directly after the connection is created");
-      }
-
-      try
-      {
-         initialSession.addUniqueMetaData("jms-client-id", clientID);
-      }
-      catch (ActiveMQException e)
-      {
-         if (e.getType() == ActiveMQExceptionType.DUPLICATE_METADATA)
-         {
-            throw new InvalidClientIDException("clientID=" + clientID + " was already set into another connection");
-         }
-      }
-
-      this.clientID = clientID;
-      try
-      {
-         this.addSessionMetaData(initialSession);
-      }
-      catch (ActiveMQException e)
-      {
-         JMSException ex = new JMSException("Internal error setting metadata jms-client-id");
-         ex.setLinkedException(e);
-         ex.initCause(e);
-         throw ex;
-      }
-
-      justCreated = false;
-   }
-
-   public ConnectionMetaData getMetaData() throws JMSException
-   {
-      checkClosed();
-
-      justCreated = false;
-
-      if (metaData == null)
-      {
-         metaData = new HornetQConnectionMetaData(thisVersion);
-      }
-
-      return metaData;
-   }
-
-   public ExceptionListener getExceptionListener() throws JMSException
-   {
-      checkClosed();
-
-      justCreated = false;
-
-      return exceptionListener;
-   }
-
-   public void setExceptionListener(final ExceptionListener listener) throws JMSException
-   {
-      checkClosed();
-
-      exceptionListener = listener;
-      justCreated = false;
-   }
-
-   public synchronized void start() throws JMSException
-   {
-      checkClosed();
-
-      for (HornetQSession session : sessions)
-      {
-         session.start();
-      }
-
-      justCreated = false;
-      started = true;
-   }
-
-   public synchronized void signalStopToAllSessions()
-   {
-      for (HornetQSession session : sessions)
-      {
-         ClientSession coreSession = session.getCoreSession();
-         if (coreSession instanceof ClientSessionInternal)
-         {
-            ClientSessionInternal internalSession = (ClientSessionInternal) coreSession;
-            internalSession.setStopSignal();
-         }
-      }
-
-   }
-
-   public synchronized void stop() throws JMSException
-   {
-      threadAwareContext.assertNotMessageListenerThread();
-
-      checkClosed();
-
-      for (HornetQSession session : sessions)
-      {
-         session.stop();
-      }
-
-      justCreated = false;
-      started = false;
-   }
-
-   public final synchronized void close() throws JMSException
-   {
-      threadAwareContext.assertNotCompletionListenerThread();
-      threadAwareContext.assertNotMessageListenerThread();
-
-      if (closed)
-      {
-         return;
-      }
-
-      sessionFactory.close();
-
-      try
-      {
-         for (HornetQSession session : new HashSet<HornetQSession>(sessions))
-         {
-            session.close();
-         }
-
-         try
-         {
-            if (!tempQueues.isEmpty())
-            {
-               // Remove any temporary queues
-
-               for (SimpleString queueName : tempQueues)
-               {
-                  if (!initialSession.isClosed())
-                  {
-                     try
-                     {
-                        initialSession.deleteQueue(queueName);
-                     }
-                     catch (ActiveMQException ignore)
-                     {
-                        // Exception on deleting queue shouldn't prevent close from completing
-                     }
-                  }
-               }
-            }
-         }
-         finally
-         {
-            if (initialSession != null)
-            {
-               initialSession.close();
-            }
-         }
-
-         closed = true;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public ConnectionConsumer
-   createConnectionConsumer(final Destination destination, final String messageSelector,
-                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
-   {
-      checkClosed();
-
-      checkTempQueues(destination);
-
-      // We offer a RA, so no need to implement this for MDBs
-      return null;
-   }
-
-   private void checkTempQueues(Destination destination) throws JMSException
-   {
-      HornetQDestination jbdest = (HornetQDestination) destination;
-
-      if (jbdest.isTemporary() && !containsTemporaryQueue(jbdest.getSimpleAddress()))
-      {
-         throw new JMSException("Can not create consumer for temporary destination " + destination +
-                                   " from another JMS connection");
-      }
-   }
-
-   public ConnectionConsumer
-   createDurableConnectionConsumer(final Topic topic, final String subscriptionName,
-                                   final String messageSelector, final ServerSessionPool sessionPool,
-                                   final int maxMessages) throws JMSException
-   {
-      checkClosed();
-      // As spec. section 4.11
-      if (connectionType == HornetQConnection.TYPE_QUEUE_CONNECTION)
-      {
-         String msg = "Cannot create a durable connection consumer on a QueueConnection";
-         throw new javax.jms.IllegalStateException(msg);
-      }
-      checkTempQueues(topic);
-      // We offer RA, so no need for this
-      return null;
-   }
-
-   @Override
-   public Session createSession(int sessionMode) throws JMSException
-   {
-      checkClosed();
-      return createSessionInternal(false, sessionMode == Session.SESSION_TRANSACTED, sessionMode, HornetQSession.TYPE_GENERIC_SESSION);
-
-   }
-
-   @Override
-   public Session createSession() throws JMSException
-   {
-      checkClosed();
-      return createSessionInternal(false, false, Session.AUTO_ACKNOWLEDGE, HornetQSession.TYPE_GENERIC_SESSION);
-   }
-
-   // QueueConnection implementation ---------------------------------------------------------------
-
-   public QueueSession createQueueSession(final boolean transacted, int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), HornetQSession.TYPE_QUEUE_SESSION);
-   }
-
-   /**
-    * I'm keeping this as static as the same check will be done within RA.
-    * This is to conform with TCK Tests where we must return ackMode exactly as they want if transacted=false
-    */
-   public static int checkAck(boolean transacted, int acknowledgeMode)
-   {
-      if (!transacted && acknowledgeMode == Session.SESSION_TRANSACTED)
-      {
-         return Session.AUTO_ACKNOWLEDGE;
-      }
-
-      return acknowledgeMode;
-   }
-
-   public ConnectionConsumer
-   createConnectionConsumer(final Queue queue, final String messageSelector,
-                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
-   {
-      checkClosed();
-      checkTempQueues(queue);
-      return null;
-   }
-
-   // TopicConnection implementation ---------------------------------------------------------------
-
-   public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
-   {
-      checkClosed();
-      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), HornetQSession.TYPE_TOPIC_SESSION);
-   }
-
-   public ConnectionConsumer
-   createConnectionConsumer(final Topic topic, final String messageSelector,
-                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
-   {
-      checkClosed();
-      checkTempQueues(topic);
-      return null;
-   }
-
-   @Override
-   public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
-   {
-      return null; // we offer RA
-   }
-
-   @Override
-   public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
-   {
-      return null; // we offer RA
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   /**
-    * Sets a FailureListener for the session which is notified if a failure occurs on the session.
-    *
-    * @param listener the listener to add
-    * @throws JMSException
-    */
-   public void setFailoverListener(final FailoverEventListener listener) throws JMSException
-   {
-      checkClosed();
-
-      justCreated = false;
-
-      this.failoverEventListener = listener;
-
-   }
-
-   /**
-    * @return {@link FailoverEventListener} the current failover event listener for this connection
-    * @throws JMSException
-    */
-   public FailoverEventListener getFailoverListener() throws JMSException
-   {
-      checkClosed();
-
-      justCreated = false;
-
-      return failoverEventListener;
-   }
-
-   public void addTemporaryQueue(final SimpleString queueAddress)
-   {
-      tempQueues.add(queueAddress);
-      knownDestinations.add(queueAddress);
-   }
-
-   public void removeTemporaryQueue(final SimpleString queueAddress)
-   {
-      tempQueues.remove(queueAddress);
-   }
-
-   public void addKnownDestination(final SimpleString address)
-   {
-      knownDestinations.add(address);
-   }
-
-   public boolean containsKnownDestination(final SimpleString address)
-   {
-      return knownDestinations.contains(address);
-   }
-
-   public boolean containsTemporaryQueue(final SimpleString queueAddress)
-   {
-      return tempQueues.contains(queueAddress);
-   }
-
-   public boolean hasNoLocal()
-   {
-      return hasNoLocal;
-   }
-
-   public void setHasNoLocal()
-   {
-      hasNoLocal = true;
-   }
-
-   public SimpleString getUID()
-   {
-      return uid;
-   }
-
-   public void removeSession(final HornetQSession session)
-   {
-      sessions.remove(session);
-   }
-
-   public ClientSession getInitialSession()
-   {
-      return initialSession;
-   }
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   // In case the user forgets to close the connection manually
-
-   @Override
-   protected final void finalize() throws Throwable
-   {
-      if (!closed)
-      {
-         HornetQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack);
-
-         close();
-      }
-   }
-
-   protected boolean isXA()
-   {
-      return false;
-   }
-
-   protected final HornetQSession
-   createSessionInternal(final boolean isXA, final boolean transacted, int acknowledgeMode, final int type) throws JMSException
-   {
-      if (transacted)
-      {
-         acknowledgeMode = Session.SESSION_TRANSACTED;
-      }
-
-      try
-      {
-         ClientSession session;
-
-         if (acknowledgeMode == Session.SESSION_TRANSACTED)
-         {
-            session =
-               sessionFactory.createSession(username, password, isXA, false, false,
-                                            sessionFactory.getServerLocator().isPreAcknowledge(),
-                                            transactionBatchSize);
-         }
-         else if (acknowledgeMode == Session.AUTO_ACKNOWLEDGE)
-         {
-            session =
-               sessionFactory.createSession(username, password, isXA, true, true,
-                                            sessionFactory.getServerLocator().isPreAcknowledge(), 0);
-         }
-         else if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE)
-         {
-            session =
-               sessionFactory.createSession(username, password, isXA, true, true,
-                                            sessionFactory.getServerLocator().isPreAcknowledge(), dupsOKBatchSize);
-         }
-         else if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
-         {
-            session =
-               sessionFactory.createSession(username, password, isXA, true, false,
-                                            sessionFactory.getServerLocator().isPreAcknowledge(),
-                                            transactionBatchSize);
-         }
-         else if (acknowledgeMode == HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE)
-         {
-            session =
-               sessionFactory.createSession(username, password, isXA, true, false, false, transactionBatchSize);
-         }
-         else if (acknowledgeMode == HornetQJMSConstants.PRE_ACKNOWLEDGE)
-         {
-            session = sessionFactory.createSession(username, password, isXA, true, false, true, transactionBatchSize);
-         }
-         else
-         {
-            throw new JMSRuntimeException("Invalid ackmode: " + acknowledgeMode);
-         }
-
-         justCreated = false;
-
-         // Setting multiple times on different sessions doesn't matter since RemotingConnection
-         // maintains
-         // a set (no duplicates)
-         session.addFailureListener(listener);
-         session.addFailoverListener(failoverListener);
-
-         HornetQSession jbs = createHQSession(isXA, transacted, acknowledgeMode, session, type);
-
-         sessions.add(jbs);
-
-         if (started)
-         {
-            session.start();
-         }
-
-         this.addSessionMetaData(session);
-
-         return jbs;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   // Private --------------------------------------------------------------------------------------
-
-   /**
-    * @param transacted
-    * @param acknowledgeMode
-    * @param session
-    * @param type
-    * @return
-    */
-   protected HornetQSession createHQSession(boolean isXA, boolean transacted, int acknowledgeMode, ClientSession session, int type)
-   {
-      if (isXA)
-      {
-         return new HornetQXASession(this, transacted, true, acknowledgeMode, session, type);
-      }
-      else
-      {
-         return new HornetQSession(this, transacted, false, acknowledgeMode, session, type);
-      }
-   }
-
-   protected final void checkClosed() throws JMSException
-   {
-      if (closed)
-      {
-         throw new IllegalStateException("Connection is closed");
-      }
-   }
-
-   public void authorize() throws JMSException
-   {
-      try
-      {
-         initialSession = sessionFactory.createSession(username, password, false, false, false, false, 0);
-
-         addSessionMetaData(initialSession);
-
-         initialSession.addFailureListener(listener);
-         initialSession.addFailoverListener(failoverListener);
-      }
-      catch (ActiveMQException me)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(me);
-      }
-   }
-
-   private void addSessionMetaData(ClientSession session) throws ActiveMQException
-   {
-      session.addMetaData("jms-session", "");
-      if (clientID != null)
-      {
-         session.addMetaData("jms-client-id", clientID);
-      }
-   }
-
-   public void setReference(HornetQConnectionFactory factory)
-   {
-      this.factoryReference = factory;
-   }
-
-   public boolean isStarted()
-   {
-      return started;
-   }
-
-
-   // Inner classes --------------------------------------------------------------------------------
-
-   private static class JMSFailureListener implements SessionFailureListener
-   {
-      private final WeakReference<HornetQConnection> connectionRef;
-
-      JMSFailureListener(final HornetQConnection connection)
-      {
-         connectionRef = new WeakReference<HornetQConnection>(connection);
-      }
-
-      @Override
-      public synchronized void connectionFailed(final ActiveMQException me, boolean failedOver)
-      {
-         if (me == null)
-         {
-            return;
-         }
-
-         HornetQConnection conn = connectionRef.get();
-
-         if (conn != null)
-         {
-            try
-            {
-               final ExceptionListener exceptionListener = conn.getExceptionListener();
-
-               if (exceptionListener != null)
-               {
-                  final JMSException je =
-                     new JMSException(me.toString(), failedOver ? EXCEPTION_FAILOVER : EXCEPTION_DISCONNECT);
-
-                  je.initCause(me);
-
-                  new Thread(new Runnable()
-                  {
-                     public void run()
-                     {
-                        exceptionListener.onException(je);
-                     }
-                  }).start();
-               }
-            }
-            catch (JMSException e)
-            {
-               if (!conn.closed)
-               {
-                  HornetQJMSClientLogger.LOGGER.errorCallingExcListener(e);
-               }
-            }
-         }
-      }
-
-      @Override
-      public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
-      {
-         connectionFailed(me, failedOver);
-      }
-
-      public void beforeReconnect(final ActiveMQException me)
-      {
-
-      }
-
-   }
-
-   private static class FailoverEventListenerImpl implements FailoverEventListener
-   {
-      private final WeakReference<HornetQConnection> connectionRef;
-
-      FailoverEventListenerImpl(final HornetQConnection connection)
-      {
-         connectionRef = new WeakReference<HornetQConnection>(connection);
-      }
-
-      @Override
-      public void failoverEvent(final FailoverEventType eventType)
-      {
-         HornetQConnection conn = connectionRef.get();
-
-         if (conn != null)
-         {
-            try
-            {
-               final FailoverEventListener failoverListener = conn.getFailoverListener();
-
-               if (failoverListener != null)
-               {
-
-                  new Thread(new Runnable()
-                  {
-                     public void run()
-                     {
-                        failoverListener.failoverEvent(eventType);
-                     }
-                  }).start();
-               }
-            }
-            catch (JMSException e)
-            {
-               if (!conn.closed)
-               {
-                  HornetQJMSClientLogger.LOGGER.errorCallingFailoverListener(e);
-               }
-            }
-         }
-
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionFactory.java
deleted file mode 100644
index 503a13a..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionFactory.java
+++ /dev/null
@@ -1,821 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSContext;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.JMSSecurityException;
-import javax.jms.JMSSecurityRuntimeException;
-import javax.jms.QueueConnection;
-import javax.jms.TopicConnection;
-import javax.jms.XAConnection;
-import javax.jms.XAConnectionFactory;
-import javax.jms.XAJMSContext;
-import javax.jms.XAQueueConnection;
-import javax.jms.XATopicConnection;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import java.io.Serializable;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.HornetQClient;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-import org.apache.activemq.jms.referenceable.ConnectionFactoryObjectFactory;
-import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
-
-/**
- * HornetQ implementation of a JMS ConnectionFactory.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class HornetQConnectionFactory implements Serializable, Referenceable, ConnectionFactory, XAConnectionFactory
-{
-   private static final long serialVersionUID = -2810634789345348326L;
-
-   private final ServerLocator serverLocator;
-
-   private String clientID;
-
-   private int dupsOKBatchSize = HornetQClient.DEFAULT_ACK_BATCH_SIZE;
-
-   private int transactionBatchSize = HornetQClient.DEFAULT_ACK_BATCH_SIZE;
-
-   private boolean readOnly;
-
-   public HornetQConnectionFactory()
-   {
-      serverLocator = null;
-   }
-
-   public HornetQConnectionFactory(final ServerLocator serverLocator)
-   {
-      this.serverLocator = serverLocator;
-
-      serverLocator.disableFinalizeCheck();
-   }
-
-   public HornetQConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      if (ha)
-      {
-         serverLocator = HornetQClient.createServerLocatorWithHA(groupConfiguration);
-      }
-      else
-      {
-         serverLocator = HornetQClient.createServerLocatorWithoutHA(groupConfiguration);
-      }
-
-      serverLocator.disableFinalizeCheck();
-   }
-
-   public HornetQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
-   {
-      if (ha)
-      {
-         serverLocator = HornetQClient.createServerLocatorWithHA(initialConnectors);
-      }
-      else
-      {
-         serverLocator = HornetQClient.createServerLocatorWithoutHA(initialConnectors);
-      }
-
-      serverLocator.disableFinalizeCheck();
-   }
-
-   // ConnectionFactory implementation -------------------------------------------------------------
-
-   public Connection createConnection() throws JMSException
-   {
-      return createConnection(null, null);
-   }
-
-   public Connection createConnection(final String username, final String password) throws JMSException
-   {
-      return createConnectionInternal(username, password, false, HornetQConnection.TYPE_GENERIC_CONNECTION);
-   }
-
-   @Override
-   public JMSContext createContext()
-   {
-      return createContext(null, null);
-   }
-
-   @Override
-   public JMSContext createContext(final int sessionMode)
-   {
-      return createContext(null, null, sessionMode);
-   }
-
-   @Override
-   public JMSContext createContext(final String userName, final String password)
-   {
-      return createContext(userName, password, JMSContext.AUTO_ACKNOWLEDGE);
-   }
-
-   @Override
-   public JMSContext createContext(String userName, String password, int sessionMode)
-   {
-      validateSessionMode(sessionMode);
-      try
-      {
-         HornetQConnection connection =
-            createConnectionInternal(userName, password, false, HornetQConnection.TYPE_GENERIC_CONNECTION);
-         return connection.createContext(sessionMode);
-      }
-      catch (JMSSecurityException e)
-      {
-         throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   /**
-    * @param mode
-    */
-   private static void validateSessionMode(int mode)
-   {
-      switch (mode)
-      {
-         case JMSContext.AUTO_ACKNOWLEDGE:
-         case JMSContext.CLIENT_ACKNOWLEDGE:
-         case JMSContext.DUPS_OK_ACKNOWLEDGE:
-         case JMSContext.SESSION_TRANSACTED:
-         {
-            return;
-         }
-         default:
-            throw new JMSRuntimeException("Invalid Session Mode: " + mode);
-      }
-   }
-
-   // QueueConnectionFactory implementation --------------------------------------------------------
-
-   public QueueConnection createQueueConnection() throws JMSException
-   {
-      return createQueueConnection(null, null);
-   }
-
-   public QueueConnection createQueueConnection(final String username, final String password) throws JMSException
-   {
-      return createConnectionInternal(username, password, false, HornetQConnection.TYPE_QUEUE_CONNECTION);
-   }
-
-   // TopicConnectionFactory implementation --------------------------------------------------------
-
-   public TopicConnection createTopicConnection() throws JMSException
-   {
-      return createTopicConnection(null, null);
-   }
-
-   public TopicConnection createTopicConnection(final String username, final String password) throws JMSException
-   {
-      return createConnectionInternal(username, password, false, HornetQConnection.TYPE_TOPIC_CONNECTION);
-   }
-
-   // XAConnectionFactory implementation -----------------------------------------------------------
-
-   public XAConnection createXAConnection() throws JMSException
-   {
-      return createXAConnection(null, null);
-   }
-
-   public XAConnection createXAConnection(final String username, final String password) throws JMSException
-   {
-      return (XAConnection) createConnectionInternal(username, password, true, HornetQConnection.TYPE_GENERIC_CONNECTION);
-   }
-
-   @Override
-   public XAJMSContext createXAContext()
-   {
-      return createXAContext(null, null);
-   }
-
-   @Override
-   public XAJMSContext createXAContext(String userName, String password)
-   {
-      try
-      {
-         HornetQConnection connection =
-            createConnectionInternal(userName, password, true, HornetQConnection.TYPE_GENERIC_CONNECTION);
-         return connection.createXAContext();
-      }
-      catch (JMSSecurityException e)
-      {
-         throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   // XAQueueConnectionFactory implementation ------------------------------------------------------
-
-   public XAQueueConnection createXAQueueConnection() throws JMSException
-   {
-      return createXAQueueConnection(null, null);
-   }
-
-   public XAQueueConnection createXAQueueConnection(final String username, final String password) throws JMSException
-   {
-      return (XAQueueConnection) createConnectionInternal(username, password, true, HornetQConnection.TYPE_QUEUE_CONNECTION);
-   }
-
-   // XATopicConnectionFactory implementation ------------------------------------------------------
-
-   public XATopicConnection createXATopicConnection() throws JMSException
-   {
-      return createXATopicConnection(null, null);
-   }
-
-   public XATopicConnection createXATopicConnection(final String username, final String password) throws JMSException
-   {
-      return (XATopicConnection) createConnectionInternal(username, password, true, HornetQConnection.TYPE_TOPIC_CONNECTION);
-   }
-
-   @Override
-   public Reference getReference() throws NamingException
-   {
-      return new Reference(this.getClass().getCanonicalName(),
-                           new SerializableObjectRefAddr("HornetQ-CF", this),
-                           ConnectionFactoryObjectFactory.class.getCanonicalName(),
-                           null);
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   public boolean isHA()
-   {
-      return serverLocator.isHA();
-   }
-
-   public synchronized String getConnectionLoadBalancingPolicyClassName()
-   {
-      return serverLocator.getConnectionLoadBalancingPolicyClassName();
-   }
-
-   public synchronized void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
-   {
-      checkWrite();
-      serverLocator.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
-   }
-
-   public synchronized TransportConfiguration[] getStaticConnectors()
-   {
-      return serverLocator.getStaticTransportConfigurations();
-   }
-
-   public synchronized DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()
-   {
-      return serverLocator.getDiscoveryGroupConfiguration();
-   }
-
-   public synchronized String getClientID()
-   {
-      return clientID;
-   }
-
-   public synchronized void setClientID(final String clientID)
-   {
-      checkWrite();
-      this.clientID = clientID;
-   }
-
-   public synchronized int getDupsOKBatchSize()
-   {
-      return dupsOKBatchSize;
-   }
-
-   public synchronized void setDupsOKBatchSize(final int dupsOKBatchSize)
-   {
-      checkWrite();
-      this.dupsOKBatchSize = dupsOKBatchSize;
-   }
-
-   public synchronized int getTransactionBatchSize()
-   {
-      return transactionBatchSize;
-   }
-
-   public synchronized void setTransactionBatchSize(final int transactionBatchSize)
-   {
-      checkWrite();
-      this.transactionBatchSize = transactionBatchSize;
-   }
-
-   public synchronized long getClientFailureCheckPeriod()
-   {
-      return serverLocator.getClientFailureCheckPeriod();
-   }
-
-   public synchronized void setClientFailureCheckPeriod(final long clientFailureCheckPeriod)
-   {
-      checkWrite();
-      serverLocator.setClientFailureCheckPeriod(clientFailureCheckPeriod);
-   }
-
-   public synchronized long getConnectionTTL()
-   {
-      return serverLocator.getConnectionTTL();
-   }
-
-   public synchronized void setConnectionTTL(final long connectionTTL)
-   {
-      checkWrite();
-      serverLocator.setConnectionTTL(connectionTTL);
-   }
-
-   public synchronized long getCallTimeout()
-   {
-      return serverLocator.getCallTimeout();
-   }
-
-   public synchronized void setCallTimeout(final long callTimeout)
-   {
-      checkWrite();
-      serverLocator.setCallTimeout(callTimeout);
-   }
-
-   public synchronized long getCallFailoverTimeout()
-   {
-      return serverLocator.getCallFailoverTimeout();
-   }
-
-   public synchronized void setCallFailoverTimeout(final long callTimeout)
-   {
-      checkWrite();
-      serverLocator.setCallFailoverTimeout(callTimeout);
-   }
-
-   public synchronized int getConsumerWindowSize()
-   {
-      return serverLocator.getConsumerWindowSize();
-   }
-
-   public synchronized void setConsumerWindowSize(final int consumerWindowSize)
-   {
-      checkWrite();
-      serverLocator.setConsumerWindowSize(consumerWindowSize);
-   }
-
-   public synchronized int getConsumerMaxRate()
-   {
-      return serverLocator.getConsumerMaxRate();
-   }
-
-   public synchronized void setConsumerMaxRate(final int consumerMaxRate)
-   {
-      checkWrite();
-      serverLocator.setConsumerMaxRate(consumerMaxRate);
-   }
-
-   public synchronized int getConfirmationWindowSize()
-   {
-      return serverLocator.getConfirmationWindowSize();
-   }
-
-   public synchronized void setConfirmationWindowSize(final int confirmationWindowSize)
-   {
-      checkWrite();
-      serverLocator.setConfirmationWindowSize(confirmationWindowSize);
-   }
-
-   public synchronized int getProducerMaxRate()
-   {
-      return serverLocator.getProducerMaxRate();
-   }
-
-   public synchronized void setProducerMaxRate(final int producerMaxRate)
-   {
-      checkWrite();
-      serverLocator.setProducerMaxRate(producerMaxRate);
-   }
-
-   public synchronized int getProducerWindowSize()
-   {
-      return serverLocator.getProducerWindowSize();
-   }
-
-   public synchronized void setProducerWindowSize(final int producerWindowSize)
-   {
-      checkWrite();
-      serverLocator.setProducerWindowSize(producerWindowSize);
-   }
-
-   /**
-    * @param cacheLargeMessagesClient
-    */
-   public synchronized void setCacheLargeMessagesClient(final boolean cacheLargeMessagesClient)
-   {
-      checkWrite();
-      serverLocator.setCacheLargeMessagesClient(cacheLargeMessagesClient);
-   }
-
-   public synchronized boolean isCacheLargeMessagesClient()
-   {
-      return serverLocator.isCacheLargeMessagesClient();
-   }
-
-   public synchronized int getMinLargeMessageSize()
-   {
-      return serverLocator.getMinLargeMessageSize();
-   }
-
-   public synchronized void setMinLargeMessageSize(final int minLargeMessageSize)
-   {
-      checkWrite();
-      serverLocator.setMinLargeMessageSize(minLargeMessageSize);
-   }
-
-   public synchronized boolean isBlockOnAcknowledge()
-   {
-      return serverLocator.isBlockOnAcknowledge();
-   }
-
-   public synchronized void setBlockOnAcknowledge(final boolean blockOnAcknowledge)
-   {
-      checkWrite();
-      serverLocator.setBlockOnAcknowledge(blockOnAcknowledge);
-   }
-
-   public synchronized boolean isBlockOnNonDurableSend()
-   {
-      return serverLocator.isBlockOnNonDurableSend();
-   }
-
-   public synchronized void setBlockOnNonDurableSend(final boolean blockOnNonDurableSend)
-   {
-      checkWrite();
-      serverLocator.setBlockOnNonDurableSend(blockOnNonDurableSend);
-   }
-
-   public synchronized boolean isBlockOnDurableSend()
-   {
-      return serverLocator.isBlockOnDurableSend();
-   }
-
-   public synchronized void setBlockOnDurableSend(final boolean blockOnDurableSend)
-   {
-      checkWrite();
-      serverLocator.setBlockOnDurableSend(blockOnDurableSend);
-   }
-
-   public synchronized boolean isAutoGroup()
-   {
-      return serverLocator.isAutoGroup();
-   }
-
-   public synchronized void setAutoGroup(final boolean autoGroup)
-   {
-      checkWrite();
-      serverLocator.setAutoGroup(autoGroup);
-   }
-
-   public synchronized boolean isPreAcknowledge()
-   {
-      return serverLocator.isPreAcknowledge();
-   }
-
-   public synchronized void setPreAcknowledge(final boolean preAcknowledge)
-   {
-      checkWrite();
-      serverLocator.setPreAcknowledge(preAcknowledge);
-   }
-
-   public synchronized long getRetryInterval()
-   {
-      return serverLocator.getRetryInterval();
-   }
-
-   public synchronized void setRetryInterval(final long retryInterval)
-   {
-      checkWrite();
-      serverLocator.setRetryInterval(retryInterval);
-   }
-
-   public synchronized long getMaxRetryInterval()
-   {
-      return serverLocator.getMaxRetryInterval();
-   }
-
-   public synchronized void setMaxRetryInterval(final long retryInterval)
-   {
-      checkWrite();
-      serverLocator.setMaxRetryInterval(retryInterval);
-   }
-
-   public synchronized double getRetryIntervalMultiplier()
-   {
-      return serverLocator.getRetryIntervalMultiplier();
-   }
-
-   public synchronized void setRetryIntervalMultiplier(final double retryIntervalMultiplier)
-   {
-      checkWrite();
-      serverLocator.setRetryIntervalMultiplier(retryIntervalMultiplier);
-   }
-
-   public synchronized int getReconnectAttempts()
-   {
-      return serverLocator.getReconnectAttempts();
-   }
-
-   public synchronized void setReconnectAttempts(final int reconnectAttempts)
-   {
-      checkWrite();
-      serverLocator.setReconnectAttempts(reconnectAttempts);
-   }
-
-   public synchronized void setInitialConnectAttempts(final int reconnectAttempts)
-   {
-      checkWrite();
-      serverLocator.setInitialConnectAttempts(reconnectAttempts);
-   }
-
-   public synchronized int getInitialConnectAttempts()
-   {
-      checkWrite();
-      return serverLocator.getInitialConnectAttempts();
-   }
-
-   public synchronized boolean isFailoverOnInitialConnection()
-   {
-      return serverLocator.isFailoverOnInitialConnection();
-   }
-
-   public synchronized void setFailoverOnInitialConnection(final boolean failover)
-   {
-      checkWrite();
-      serverLocator.setFailoverOnInitialConnection(failover);
-   }
-
-   public synchronized boolean isUseGlobalPools()
-   {
-      return serverLocator.isUseGlobalPools();
-   }
-
-   public synchronized void setUseGlobalPools(final boolean useGlobalPools)
-   {
-      checkWrite();
-      serverLocator.setUseGlobalPools(useGlobalPools);
-   }
-
-   public synchronized int getScheduledThreadPoolMaxSize()
-   {
-      return serverLocator.getScheduledThreadPoolMaxSize();
-   }
-
-   public synchronized void setScheduledThreadPoolMaxSize(final int scheduledThreadPoolMaxSize)
-   {
-      checkWrite();
-      serverLocator.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
-   }
-
-   public synchronized int getThreadPoolMaxSize()
-   {
-      return serverLocator.getThreadPoolMaxSize();
-   }
-
-   public synchronized void setThreadPoolMaxSize(final int threadPoolMaxSize)
-   {
-      checkWrite();
-      serverLocator.setThreadPoolMaxSize(threadPoolMaxSize);
-   }
-
-   public synchronized int getInitialMessagePacketSize()
-   {
-      return serverLocator.getInitialMessagePacketSize();
-   }
-
-   public synchronized void setInitialMessagePacketSize(final int size)
-   {
-      checkWrite();
-      serverLocator.setInitialMessagePacketSize(size);
-   }
-
-   public void setGroupID(final String groupID)
-   {
-      serverLocator.setGroupID(groupID);
-   }
-
-   public String getGroupID()
-   {
-      return serverLocator.getGroupID();
-   }
-
-   public boolean isCompressLargeMessage()
-   {
-      return serverLocator.isCompressLargeMessage();
-   }
-
-   public void setCompressLargeMessage(boolean avoidLargeMessages)
-   {
-      serverLocator.setCompressLargeMessage(avoidLargeMessages);
-   }
-
-   public void close()
-   {
-      ServerLocator locator0 = serverLocator;
-      if (locator0 != null)
-         locator0.close();
-   }
-
-   public ServerLocator getServerLocator()
-   {
-      return serverLocator;
-   }
-
-   public int getFactoryType()
-   {
-      return JMSFactoryType.CF.intValue();
-   }
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   protected synchronized HornetQConnection createConnectionInternal(final String username,
-                                                                     final String password,
-                                                                     final boolean isXA,
-                                                                     final int type) throws JMSException
-   {
-      readOnly = true;
-
-      ClientSessionFactory factory;
-
-      try
-      {
-         factory = serverLocator.createSessionFactory();
-      }
-      catch (Exception e)
-      {
-         JMSException jmse = new JMSException("Failed to create session factory");
-
-         jmse.initCause(e);
-         jmse.setLinkedException(e);
-
-         throw jmse;
-      }
-
-      HornetQConnection connection = null;
-
-      if (isXA)
-      {
-         if (type == HornetQConnection.TYPE_GENERIC_CONNECTION)
-         {
-            connection = new HornetQXAConnection(username,
-                                                 password,
-                                                 type,
-                                                 clientID,
-                                                 dupsOKBatchSize,
-                                                 transactionBatchSize,
-                                                 factory);
-         }
-         else if (type == HornetQConnection.TYPE_QUEUE_CONNECTION)
-         {
-            connection =
-               new HornetQXAConnection(username,
-                                       password,
-                                       type,
-                                       clientID,
-                                       dupsOKBatchSize,
-                                       transactionBatchSize,
-                                       factory);
-         }
-         else if (type == HornetQConnection.TYPE_TOPIC_CONNECTION)
-         {
-            connection =
-               new HornetQXAConnection(username,
-                                       password,
-                                       type,
-                                       clientID,
-                                       dupsOKBatchSize,
-                                       transactionBatchSize,
-                                       factory);
-         }
-      }
-      else
-      {
-         if (type == HornetQConnection.TYPE_GENERIC_CONNECTION)
-         {
-            connection = new HornetQConnection(username,
-                                               password,
-                                               type,
-                                               clientID,
-                                               dupsOKBatchSize,
-                                               transactionBatchSize,
-                                               factory);
-         }
-         else if (type == HornetQConnection.TYPE_QUEUE_CONNECTION)
-         {
-            connection =
-               new HornetQConnection(username,
-                                     password,
-                                     type,
-                                     clientID,
-                                     dupsOKBatchSize,
-                                     transactionBatchSize,
-                                     factory);
-         }
-         else if (type == HornetQConnection.TYPE_TOPIC_CONNECTION)
-         {
-            connection =
-               new HornetQConnection(username,
-                                     password,
-                                     type,
-                                     clientID,
-                                     dupsOKBatchSize,
-                                     transactionBatchSize,
-                                     factory);
-         }
-      }
-
-      if (connection == null)
-      {
-         throw new JMSException("Failed to create connection: invalid type " + type);
-      }
-      connection.setReference(this);
-
-      try
-      {
-         connection.authorize();
-      }
-      catch (JMSException e)
-      {
-         try
-         {
-            connection.close();
-         }
-         catch (JMSException me)
-         {
-         }
-         throw e;
-      }
-
-      return connection;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "HornetQConnectionFactory [serverLocator=" + serverLocator +
-         ", clientID=" +
-         clientID +
-         ", consumerWindowSize = " +
-         getConsumerWindowSize() +
-         ", dupsOKBatchSize=" +
-         dupsOKBatchSize +
-         ", transactionBatchSize=" +
-         transactionBatchSize +
-         ", readOnly=" +
-         readOnly +
-         "]";
-   }
-
-
-   // Private --------------------------------------------------------------------------------------
-
-   private void checkWrite()
-   {
-      if (readOnly)
-      {
-         throw new IllegalStateException("Cannot set attribute on HornetQConnectionFactory after it has been used");
-      }
-   }
-
-   @Override
-   protected void finalize() throws Throwable
-   {
-      try
-      {
-         serverLocator.close();
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         //not much we can do here
-      }
-      super.finalize();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContext.java
deleted file mode 100644
index 7e493a1..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContext.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-/**
- *
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSContext;
-import javax.jms.XAJMSContext;
-
-/**
- * Interface created to support reference counting all contexts using it.
- * <p>
- * Necessary to support {@code JMSContext.close()} conditions.
- * @see JMSContext
- */
-public interface HornetQConnectionForContext extends javax.jms.Connection
-{
-   JMSContext createContext(int sessionMode);
-
-   XAJMSContext createXAContext();
-
-   void closeFromContext();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContextImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContextImpl.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContextImpl.java
deleted file mode 100644
index 25e3b3a..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionForContextImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-/**
- *
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSContext;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.Session;
-import javax.jms.XAJMSContext;
-
-import org.apache.activemq.api.jms.HornetQJMSConstants;
-import org.apache.activemq.utils.ReferenceCounter;
-import org.apache.activemq.utils.ReferenceCounterUtil;
-
-public abstract class HornetQConnectionForContextImpl implements HornetQConnectionForContext
-{
-
-   final Runnable closeRunnable = new Runnable()
-   {
-      public void run()
-      {
-         try
-         {
-            close();
-         }
-         catch (JMSException e)
-         {
-            throw JmsExceptionUtils.convertToRuntimeException(e);
-         }
-      }
-   };
-
-   final ReferenceCounter refCounter = new ReferenceCounterUtil(closeRunnable);
-
-   protected final ThreadAwareContext threadAwareContext = new ThreadAwareContext();
-
-   public JMSContext createContext(int sessionMode)
-   {
-      switch (sessionMode)
-      {
-         case Session.AUTO_ACKNOWLEDGE:
-         case Session.CLIENT_ACKNOWLEDGE:
-         case Session.DUPS_OK_ACKNOWLEDGE:
-         case Session.SESSION_TRANSACTED:
-         case HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
-         case HornetQJMSConstants.PRE_ACKNOWLEDGE:
-            break;
-         default:
-            throw new JMSRuntimeException("Invalid ackmode: " + sessionMode);
-      }
-      refCounter.increment();
-
-      return new HornetQJMSContext(this, sessionMode, threadAwareContext);
-   }
-
-   public XAJMSContext createXAContext()
-   {
-      refCounter.increment();
-
-      return new HornetQXAJMSContext(this, threadAwareContext);
-   }
-
-   @Override
-   public void closeFromContext()
-   {
-      refCounter.decrement();
-   }
-
-   protected void incrementRefCounter()
-   {
-      refCounter.increment();
-   }
-
-   public ThreadAwareContext getThreadAwareContext()
-   {
-      return threadAwareContext;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionMetaData.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionMetaData.java
deleted file mode 100644
index 8109b6d..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQConnectionMetaData.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import javax.jms.ConnectionMetaData;
-import javax.jms.JMSException;
-
-import org.apache.activemq.core.version.Version;
-
-/**
- * HornetQ implementation of a JMS ConnectionMetaData.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- *
- */
-public class HornetQConnectionMetaData implements ConnectionMetaData
-{
-   // Constants -----------------------------------------------------
-
-   private static final String HORNETQ = "HornetQ";
-
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final Version serverVersion;
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Create a new HornetQConnectionMetaData object.
-    */
-   public HornetQConnectionMetaData(final Version serverVersion)
-   {
-      this.serverVersion = serverVersion;
-   }
-
-   // ConnectionMetaData implementation -----------------------------
-
-   public String getJMSVersion() throws JMSException
-   {
-      return "2.0";
-   }
-
-   public int getJMSMajorVersion() throws JMSException
-   {
-      return 2;
-   }
-
-   public int getJMSMinorVersion() throws JMSException
-   {
-      return 0;
-   }
-
-   public String getJMSProviderName() throws JMSException
-   {
-      return HornetQConnectionMetaData.HORNETQ;
-   }
-
-   public String getProviderVersion() throws JMSException
-   {
-      return serverVersion.getFullVersion();
-   }
-
-   public int getProviderMajorVersion() throws JMSException
-   {
-      return serverVersion.getMajorVersion();
-   }
-
-   public int getProviderMinorVersion() throws JMSException
-   {
-      return serverVersion.getMinorVersion();
-   }
-
-   public Enumeration getJMSXPropertyNames() throws JMSException
-   {
-      Vector<Object> v = new Vector<Object>();
-      v.add("JMSXGroupID");
-      v.add("JMSXGroupSeq");
-      v.add("JMSXDeliveryCount");
-      return v.elements();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQDestination.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQDestination.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQDestination.java
deleted file mode 100644
index c9766d0..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQDestination.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import java.io.Serializable;
-import java.util.UUID;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-
-import org.apache.activemq.api.core.Pair;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.jms.referenceable.DestinationObjectFactory;
-import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
-
-/**
- * HornetQ implementation of a JMS Destination.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class HornetQDestination implements Destination, Serializable, Referenceable
-{
-   // Constants -----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   /**
-    *
-    */
-   private static final long serialVersionUID = 5027962425462382883L;
-
-   public static final String JMS_QUEUE_ADDRESS_PREFIX = "jms.queue.";
-
-   public static final String JMS_TEMP_QUEUE_ADDRESS_PREFIX = "jms.tempqueue.";
-
-   public static final String JMS_TOPIC_ADDRESS_PREFIX = "jms.topic.";
-
-   public static final String JMS_TEMP_TOPIC_ADDRESS_PREFIX = "jms.temptopic.";
-
-   private static final char SEPARATOR = '.';
-
-   private static String escape(final String input)
-   {
-      if (input == null)
-      {
-         return "";
-      }
-      return input.replace("\\", "\\\\").replace(".", "\\.");
-   }
-
-   public static Destination fromAddress(final String address)
-   {
-      if (address.startsWith(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX))
-      {
-         String name = address.substring(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX.length());
-
-         return createQueue(name);
-      }
-      else if (address.startsWith(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX))
-      {
-         String name = address.substring(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX.length());
-
-         return createTopic(name);
-      }
-      else if (address.startsWith(HornetQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX))
-      {
-         String name = address.substring(HornetQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
-
-         return new HornetQTemporaryQueue(address, name, null);
-      }
-      else if (address.startsWith(HornetQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX))
-      {
-         String name = address.substring(HornetQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
-
-         return new HornetQTemporaryTopic(address, name, null);
-      }
-      else
-      {
-         throw new JMSRuntimeException("Invalid address " + address);
-      }
-   }
-
-   public static String createQueueNameForDurableSubscription(final boolean isDurable, final String clientID, final String subscriptionName)
-   {
-      if (clientID != null)
-      {
-         if (isDurable)
-         {
-            return HornetQDestination.escape(clientID) + SEPARATOR +
-               HornetQDestination.escape(subscriptionName);
-         }
-         else
-         {
-            return "nonDurable" + SEPARATOR +
-               HornetQDestination.escape(clientID) + SEPARATOR +
-               HornetQDestination.escape(subscriptionName);
-         }
-      }
-      else
-      {
-         if (isDurable)
-         {
-            return HornetQDestination.escape(subscriptionName);
-         }
-         else
-         {
-            return "nonDurable" + SEPARATOR +
-               HornetQDestination.escape(subscriptionName);
-         }
-      }
-   }
-
-   public static String createQueueNameForSharedSubscription(final boolean isDurable, final String clientID, final String subscriptionName)
-   {
-      if (clientID != null)
-      {
-         return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
-            HornetQDestination.escape(clientID) + SEPARATOR +
-            HornetQDestination.escape(subscriptionName);
-      }
-      else
-      {
-         return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
-            HornetQDestination.escape(subscriptionName);
-      }
-   }
-
-   public static Pair<String, String> decomposeQueueNameForDurableSubscription(final String queueName)
-   {
-      StringBuffer[] parts = new StringBuffer[2];
-      int currentPart = 0;
-
-      parts[0] = new StringBuffer();
-      parts[1] = new StringBuffer();
-
-      int pos = 0;
-      while (pos < queueName.length())
-      {
-         char ch = queueName.charAt(pos);
-         pos++;
-
-         if (ch == SEPARATOR)
-         {
-            currentPart++;
-            if (currentPart >= parts.length)
-            {
-               throw new JMSRuntimeException("Invalid message queue name: " + queueName);
-            }
-
-            continue;
-         }
-
-         if (ch == '\\')
-         {
-            if (pos >= queueName.length())
-            {
-               throw new JMSRuntimeException("Invalid message queue name: " + queueName);
-            }
-            ch = queueName.charAt(pos);
-            pos++;
-         }
-
-         parts[currentPart].append(ch);
-      }
-
-      if (currentPart != 1)
-      {
-         throw new JMSRuntimeException("Invalid message queue name: " + queueName);
-      }
-
-      Pair<String, String> pair = new Pair<String, String>(parts[0].toString(), parts[1].toString());
-
-      return pair;
-   }
-
-   public static SimpleString createQueueAddressFromName(final String name)
-   {
-      return new SimpleString(JMS_QUEUE_ADDRESS_PREFIX + name);
-   }
-
-   public static SimpleString createTopicAddressFromName(final String name)
-   {
-      return new SimpleString(JMS_TOPIC_ADDRESS_PREFIX + name);
-   }
-
-   public static HornetQQueue createQueue(final String name)
-   {
-      return new HornetQQueue(name);
-   }
-
-   public static HornetQTopic createTopic(final String name)
-   {
-      return new HornetQTopic(name);
-   }
-
-   public static HornetQTemporaryQueue createTemporaryQueue(final String name, final HornetQSession session)
-   {
-      return new HornetQTemporaryQueue(JMS_TEMP_QUEUE_ADDRESS_PREFIX.concat(name), name, session);
-   }
-
-   public static HornetQTemporaryQueue createTemporaryQueue(final String name)
-   {
-      return createTemporaryQueue(name, null);
-   }
-
-   public static HornetQTemporaryQueue createTemporaryQueue(final HornetQSession session)
-   {
-      String name = UUID.randomUUID().toString();
-
-      return createTemporaryQueue(name, session);
-   }
-
-   public static HornetQTemporaryTopic createTemporaryTopic(final HornetQSession session)
-   {
-      String name = UUID.randomUUID().toString();
-
-      return createTemporaryTopic(name, session);
-   }
-
-   public static HornetQTemporaryTopic createTemporaryTopic(String name, final HornetQSession session)
-   {
-      return new HornetQTemporaryTopic(JMS_TEMP_TOPIC_ADDRESS_PREFIX.concat(name), name, session);
-   }
-
-   public static HornetQTemporaryTopic createTemporaryTopic(String name)
-   {
-      return createTemporaryTopic(name, null);
-   }
-
-   // Attributes ----------------------------------------------------
-
-   /**
-    * The JMS name
-    */
-   protected final String name;
-
-   /**
-    * The core address
-    */
-   private final String address;
-
-   /**
-    * SimpleString version of address
-    */
-   private final SimpleString simpleAddress;
-
-   private final boolean temporary;
-
-   private final boolean queue;
-
-   private final transient HornetQSession session;
-
-   // Constructors --------------------------------------------------
-
-   protected HornetQDestination(final String address, final String name,
-                                final boolean temporary,
-                                final boolean queue,
-                                final HornetQSession session)
-   {
-      this.address = address;
-
-      this.name = name;
-
-      simpleAddress = new SimpleString(address);
-
-      this.temporary = temporary;
-
-      this.queue = queue;
-
-      this.session = session;
-   }
-
-   // Referenceable implementation ---------------------------------------
-
-   public Reference getReference() throws NamingException
-   {
-      return new Reference(this.getClass().getCanonicalName(),
-                           new SerializableObjectRefAddr("HornetQ-DEST", this),
-                           DestinationObjectFactory.class.getCanonicalName(),
-                           null);
-   }
-
-   public void delete() throws JMSException
-   {
-      if (session != null)
-      {
-         if (session.getCoreSession().isClosed())
-         {
-            // Temporary queues will be deleted when the connection is closed.. nothing to be done then!
-            return;
-         }
-         if (queue)
-         {
-            session.deleteTemporaryQueue(this);
-         }
-         else
-         {
-            session.deleteTemporaryTopic(this);
-         }
-      }
-   }
-
-   public boolean isQueue()
-   {
-      return queue;
-   }
-
-   // Public --------------------------------------------------------
-
-   public String getAddress()
-   {
-      return address;
-   }
-
-   public SimpleString getSimpleAddress()
-   {
-      return simpleAddress;
-   }
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public boolean isTemporary()
-   {
-      return temporary;
-   }
-
-   @Override
-   public boolean equals(final Object o)
-   {
-      if (this == o)
-      {
-         return true;
-      }
-
-      if (!(o instanceof HornetQDestination))
-      {
-         return false;
-      }
-
-      HornetQDestination that = (HornetQDestination)o;
-
-      return address.equals(that.address);
-   }
-
-   @Override
-   public int hashCode()
-   {
-      return address.hashCode();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}


[30/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalLogger.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalLogger.java b/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalLogger.java
deleted file mode 100644
index 1f6cf60..0000000
--- a/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalLogger.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.journal;
-
-import org.apache.activemq.core.journal.impl.JournalFile;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/15/12
- *
- * Logger Code 14
- *
- * each message id must be 6 digits long starting with 14, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 141000 to 141999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQJournalLogger extends BasicLogger
-{
-   /**
-    * The journal logger.
-    */
-   HornetQJournalLogger LOGGER = Logger.getMessageLogger(HornetQJournalLogger.class, HornetQJournalLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141000, value = "*** running direct journal blast: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void runningJournalBlast(Integer numIts);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141002, value = "starting thread for sync speed test", format = Message.Format.MESSAGE_FORMAT)
-   void startingThread();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141003, value = "Write rate = {0} bytes / sec or {1} MiB / sec", format = Message.Format.MESSAGE_FORMAT)
-   void writeRate(Double rate, Long l);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141004, value = "Flush rate = {0} flushes / sec", format = Message.Format.MESSAGE_FORMAT)
-   void flushRate(Double rate);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141005, value = "Check Data Files:", format = Message.Format.MESSAGE_FORMAT)
-   void checkFiles();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141006, value = "Sequence out of order on journal", format = Message.Format.MESSAGE_FORMAT)
-   void seqOutOfOrder();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141007, value = "Current File on the journal is <= the sequence file.getFileID={0} on the dataFiles" +
-                                 "\nCurrentfile.getFileId={1} while the file.getFileID()={2}" +
-                                 "\nIs same = ({3})",
-            format = Message.Format.MESSAGE_FORMAT)
-   void currentFile(Long fileID, Long id, Long fileFileID, Boolean b);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141008, value = "Free File ID out of order", format = Message.Format.MESSAGE_FORMAT)
-   void fileIdOutOfOrder();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 141009, value = "A Free File is less than the maximum data", format = Message.Format.MESSAGE_FORMAT)
-   void fileTooSmall();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142000, value = "You have a native library with a different version than expected", format = Message.Format.MESSAGE_FORMAT)
-   void incompatibleNativeLibrary();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142001, value = "Could not get lock after 60 seconds on closing Asynchronous File: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void couldNotGetLock(String fileName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142002, value = "Asynchronous File: {0} being finalized with opened state", format = Message.Format.MESSAGE_FORMAT)
-   void fileFinalizedWhileOpen(String fileName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142003, value = "AIO Callback Error: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void callbackError(String error);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142004, value = "Inconsistency during compacting: CommitRecord ID = {0} for an already committed transaction during compacting",
-         format = Message.Format.MESSAGE_FORMAT)
-   void inconsistencyDuringCompacting(Long transactionID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142005, value = "Inconsistency during compacting: Delete record being read on an existent record (id={0})",
-         format = Message.Format.MESSAGE_FORMAT)
-   void inconsistencyDuringCompactingDelete(Long recordID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142006, value = "Could not find add Record information for record {0} during compacting",
-         format = Message.Format.MESSAGE_FORMAT)
-   void compactingWithNoAddRecord(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142007, value = "Can not find record {0} during compact replay",
-         format = Message.Format.MESSAGE_FORMAT)
-   void noRecordDuringCompactReplay(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142008, value = "Could not remove file {0} from the list of data files",
-         format = Message.Format.MESSAGE_FORMAT)
-   void couldNotRemoveFile(JournalFile file);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142009, value = "Deleting {0} as it does not have the configured size",
-         format = Message.Format.MESSAGE_FORMAT)
-   void deletingFile(JournalFile file);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142010, value = "Failed to add file to opened files queue: {0}. This should NOT happen!",
-         format = Message.Format.MESSAGE_FORMAT)
-   void failedToAddFile(JournalFile nextOpenedFile);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142011, value = "Error on reading compacting for {0}",
-         format = Message.Format.MESSAGE_FORMAT)
-   void compactReadError(JournalFile file);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142012, value = "Couldn''t find tx={0} to merge after compacting",
-         format = Message.Format.MESSAGE_FORMAT)
-   void compactMergeError(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142013, value = "Prepared transaction {0} was not considered completed, it will be ignored",
-         format = Message.Format.MESSAGE_FORMAT)
-   void preparedTXIncomplete(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142014, value = "Transaction {0} is missing elements so the transaction is being ignored",
-         format = Message.Format.MESSAGE_FORMAT)
-   void txMissingElements(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142015, value = "Uncommitted transaction with id {0} found and discarded",
-         format = Message.Format.MESSAGE_FORMAT)
-   void uncomittedTxFound(Long id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142016, value = "Couldn''t stop compactor executor after 120 seconds",
-         format = Message.Format.MESSAGE_FORMAT)
-   void couldNotStopCompactor();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142017, value = "Couldn''t stop journal executor after 60 seconds",
-         format = Message.Format.MESSAGE_FORMAT)
-   void couldNotStopJournalExecutor();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142018, value = "Temporary files were left unnatended after a crash on journal directory, deleting invalid files now",
-         format = Message.Format.MESSAGE_FORMAT)
-   void tempFilesLeftOpen();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142019, value =  "Deleting orphaned file {0}", format = Message.Format.MESSAGE_FORMAT)
-   void deletingOrphanedFile(String fileToDelete);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142020, value =  "Couldn''t get lock after 60 seconds on closing Asynchronous File: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingFile(String fileToDelete);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142021, value =  "Error on IO callback, {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorOnIOCallback(String errorMessage);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142022, value =  "Timed out on AIO poller shutdown", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutOnPollerShutdown(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142023, value =  "Executor on file {0} couldn''t complete its tasks in 60 seconds.", format = Message.Format.MESSAGE_FORMAT)
-   void couldNotCompleteTask(@Cause Exception e, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142024, value =  "Error completing callback", format = Message.Format.MESSAGE_FORMAT)
-   void errorCompletingCallback(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142025, value =  "Error calling onError callback", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingErrorCallback(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142026, value =  "Timed out on AIO writer shutdown", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutOnWriterShutdown(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142027, value =  "Error on writing data! {0} code - {1}", format = Message.Format.MESSAGE_FORMAT)
-   void errorWritingData(@Cause Throwable e, String errorMessage, Integer errorCode);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142028, value =  "Error replaying pending commands after compacting", format = Message.Format.MESSAGE_FORMAT)
-   void errorReplayingCommands(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142029, value =  "Error closing file", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingFile(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142030, value = "Could not open a file in 60 Seconds", format = Message.Format.MESSAGE_FORMAT)
-   void errorOpeningFile(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142031, value =  "Error retrieving ID part of the file name {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorRetrievingID(@Cause Throwable e, String fileName);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142032, value =  "Error reading journal file", format = Message.Format.MESSAGE_FORMAT)
-   void errorReadingFile(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142033, value =  "Error reinitializing file {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorReinitializingFile(@Cause Throwable e, JournalFile file);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 142034, value = "Exception on submitting write", format = Message.Format.MESSAGE_FORMAT)
-   void errorSubmittingWrite(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingFile(Object e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144001, value = "Error starting poller", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingPoller(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144002, value = "Error pushing opened file", format = Message.Format.MESSAGE_FORMAT)
-   void errorPushingFile(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144003, value = "Error compacting", format = Message.Format.MESSAGE_FORMAT)
-   void errorCompacting(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144004, value = "Error scheduling compacting", format = Message.Format.MESSAGE_FORMAT)
-   void errorSchedulingCompacting(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144005, value = "Failed to performance blast", format = Message.Format.MESSAGE_FORMAT)
-   void failedToPerfBlast(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 144006, value = "IOError code {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
-   void ioError(final int errorCode, final String errorMessage);
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ActiveMQProtonRemotingConnection.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ActiveMQProtonRemotingConnection.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ActiveMQProtonRemotingConnection.java
new file mode 100644
index 0000000..6fbd6e4
--- /dev/null
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ActiveMQProtonRemotingConnection.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.proton;
+
+import java.util.concurrent.Executor;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.spi.core.protocol.AbstractRemotingConnection;
+import org.apache.activemq.spi.core.remoting.Connection;
+import org.proton.plug.AMQPConnectionContext;
+
+/**
+ *
+ * This is a Server's Connection representation used by ActiveMQ.
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQProtonRemotingConnection extends AbstractRemotingConnection
+{
+   private final AMQPConnectionContext amqpConnection;
+
+   private boolean destroyed = false;
+
+   private final ProtonProtocolManager manager;
+
+
+   public ActiveMQProtonRemotingConnection(ProtonProtocolManager manager, AMQPConnectionContext amqpConnection, Connection transportConnection, Executor executor)
+   {
+      super(transportConnection, executor);
+      this.manager = manager;
+      this.amqpConnection = amqpConnection;
+   }
+
+   public ProtonProtocolManager getManager()
+   {
+      return manager;
+   }
+
+   /*
+    * This can be called concurrently by more than one thread so needs to be locked
+    */
+   public void fail(final ActiveMQException me, String scaleDownTargetNodeID)
+   {
+      if (destroyed)
+      {
+         return;
+      }
+
+      destroyed = true;
+
+      ActiveMQClientLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
+
+      // Then call the listeners
+      callFailureListeners(me, scaleDownTargetNodeID);
+
+      callClosingListeners();
+
+      internalClose();
+   }
+
+
+   @Override
+   public void destroy()
+   {
+      synchronized (this)
+      {
+         if (destroyed)
+         {
+            return;
+         }
+
+         destroyed = true;
+      }
+
+
+      callClosingListeners();
+
+      internalClose();
+
+   }
+
+   @Override
+   public boolean isClient()
+   {
+      return false;
+   }
+
+   @Override
+   public boolean isDestroyed()
+   {
+      return destroyed;
+   }
+
+   @Override
+   public void disconnect(boolean criticalError)
+   {
+      getTransportConnection().close();
+   }
+
+   /**
+    * Disconnect the connection, closing all channels
+    */
+   @Override
+   public void disconnect(String scaleDownNodeID, boolean criticalError)
+   {
+      getTransportConnection().close();
+   }
+
+   @Override
+   public boolean checkDataReceived()
+   {
+      return amqpConnection.checkDataReceived();
+   }
+
+   @Override
+   public void flush()
+   {
+      amqpConnection.flush();
+   }
+
+   @Override
+   public void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
+   {
+      amqpConnection.inputBuffer(buffer.byteBuf());
+      super.bufferReceived(connectionID, buffer);
+   }
+
+   private void internalClose()
+   {
+      // We close the underlying transport connection
+      getTransportConnection().close();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/HornetQProtonRemotingConnection.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/HornetQProtonRemotingConnection.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/HornetQProtonRemotingConnection.java
deleted file mode 100644
index fec1eac..0000000
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/HornetQProtonRemotingConnection.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.proton;
-
-import java.util.concurrent.Executor;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.spi.core.protocol.AbstractRemotingConnection;
-import org.apache.activemq.spi.core.remoting.Connection;
-import org.proton.plug.AMQPConnectionContext;
-
-/**
- *
- * This is a Server's Connection representation used by HornetQ.
- * @author Clebert Suconic
- */
-
-public class HornetQProtonRemotingConnection extends AbstractRemotingConnection
-{
-   private final AMQPConnectionContext amqpConnection;
-
-   private boolean destroyed = false;
-
-   private final ProtonProtocolManager manager;
-
-
-   public HornetQProtonRemotingConnection(ProtonProtocolManager manager, AMQPConnectionContext amqpConnection, Connection transportConnection, Executor executor)
-   {
-      super(transportConnection, executor);
-      this.manager = manager;
-      this.amqpConnection = amqpConnection;
-   }
-
-   public ProtonProtocolManager getManager()
-   {
-      return manager;
-   }
-
-   /*
-    * This can be called concurrently by more than one thread so needs to be locked
-    */
-   public void fail(final ActiveMQException me, String scaleDownTargetNodeID)
-   {
-      if (destroyed)
-      {
-         return;
-      }
-
-      destroyed = true;
-
-      HornetQClientLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
-
-      // Then call the listeners
-      callFailureListeners(me, scaleDownTargetNodeID);
-
-      callClosingListeners();
-
-      internalClose();
-   }
-
-
-   @Override
-   public void destroy()
-   {
-      synchronized (this)
-      {
-         if (destroyed)
-         {
-            return;
-         }
-
-         destroyed = true;
-      }
-
-
-      callClosingListeners();
-
-      internalClose();
-
-   }
-
-   @Override
-   public boolean isClient()
-   {
-      return false;
-   }
-
-   @Override
-   public boolean isDestroyed()
-   {
-      return destroyed;
-   }
-
-   @Override
-   public void disconnect(boolean criticalError)
-   {
-      getTransportConnection().close();
-   }
-
-   /**
-    * Disconnect the connection, closing all channels
-    */
-   @Override
-   public void disconnect(String scaleDownNodeID, boolean criticalError)
-   {
-      getTransportConnection().close();
-   }
-
-   @Override
-   public boolean checkDataReceived()
-   {
-      return amqpConnection.checkDataReceived();
-   }
-
-   @Override
-   public void flush()
-   {
-      amqpConnection.flush();
-   }
-
-   @Override
-   public void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
-   {
-      amqpConnection.inputBuffer(buffer.byteBuf());
-      super.bufferReceived(connectionID, buffer);
-   }
-
-   private void internalClose()
-   {
-      // We close the underlying transport connection
-      getTransportConnection().close();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManager.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManager.java
index cf5bb9a..5e69aae 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManager.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManager.java
@@ -17,11 +17,11 @@ import java.util.concurrent.Executor;
 
 import io.netty.channel.ChannelPipeline;
 import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.protocol.proton.converter.ProtonMessageConverter;
-import org.apache.activemq.core.protocol.proton.plug.HornetQProtonConnectionCallback;
+import org.apache.activemq.core.protocol.proton.plug.ActiveMQProtonConnectionCallback;
 import org.apache.activemq.core.remoting.impl.netty.NettyServerConnection;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.server.management.NotificationListener;
 import org.apache.activemq.spi.core.protocol.ConnectionEntry;
@@ -34,23 +34,23 @@ import org.proton.plug.AMQPServerConnectionContext;
 import org.proton.plug.context.server.ProtonServerConnectionContextFactory;
 
 /**
- * A proton protocol manager, basically reads the Proton Input and maps proton resources to HornetQ resources
+ * A proton protocol manager, basically reads the Proton Input and maps proton resources to ActiveMQ resources
  *
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  */
 public class ProtonProtocolManager implements ProtocolManager, NotificationListener
 {
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private MessageConverter protonConverter;
 
-   public ProtonProtocolManager(HornetQServer server)
+   public ProtonProtocolManager(ActiveMQServer server)
    {
       this.server = server;
       this.protonConverter = new ProtonMessageConverter(server.getStorageManager());
    }
 
-   public HornetQServer getServer()
+   public ActiveMQServer getServer()
    {
       return server;
    }
@@ -71,18 +71,18 @@ public class ProtonProtocolManager implements ProtocolManager, NotificationListe
    @Override
    public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection remotingConnection)
    {
-      HornetQProtonConnectionCallback connectionCallback = new HornetQProtonConnectionCallback(this, remotingConnection);
+      ActiveMQProtonConnectionCallback connectionCallback = new ActiveMQProtonConnectionCallback(this, remotingConnection);
 
       AMQPServerConnectionContext amqpConnection = ProtonServerConnectionContextFactory.getFactory().createConnection(connectionCallback);
 
       Executor executor = server.getExecutorFactory().getExecutor();
 
-      HornetQProtonRemotingConnection delegate = new HornetQProtonRemotingConnection(this, amqpConnection, remotingConnection, executor);
+      ActiveMQProtonRemotingConnection delegate = new ActiveMQProtonRemotingConnection(this, amqpConnection, remotingConnection, executor);
 
       connectionCallback.setProtonConnectionDelegate(delegate);
 
       ConnectionEntry entry = new ConnectionEntry(delegate, executor,
-                                                  System.currentTimeMillis(), HornetQClient.DEFAULT_CONNECTION_TTL);
+                                                  System.currentTimeMillis(), ActiveMQClient.DEFAULT_CONNECTION_TTL);
 
       return entry;
    }
@@ -96,7 +96,7 @@ public class ProtonProtocolManager implements ProtocolManager, NotificationListe
    @Override
    public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer)
    {
-      HornetQProtonRemotingConnection protonConnection = (HornetQProtonRemotingConnection)connection;
+      ActiveMQProtonRemotingConnection protonConnection = (ActiveMQProtonRemotingConnection)connection;
 
       protonConnection.bufferReceived(protonConnection.getID(), buffer);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManagerFactory.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManagerFactory.java
index e82202c..07877d2 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManagerFactory.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/ProtonProtocolManagerFactory.java
@@ -14,7 +14,7 @@
 package org.apache.activemq.core.protocol.proton;
 
 import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
 
@@ -30,7 +30,7 @@ public class ProtonProtocolManagerFactory implements ProtocolManagerFactory
    private static String[] SUPPORTED_PROTOCOLS = {AMQP_PROTOCOL_NAME};
 
    @Override
-   public ProtocolManager createProtocolManager(HornetQServer server, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
+   public ProtocolManager createProtocolManager(ActiveMQServer server, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
    {
       return new ProtonProtocolManager(server);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ActiveMQJMSVendor.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ActiveMQJMSVendor.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ActiveMQJMSVendor.java
new file mode 100644
index 0000000..be8be9e
--- /dev/null
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ActiveMQJMSVendor.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.proton.converter;
+
+import javax.jms.BytesMessage;
+import javax.jms.Destination;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.StreamMessage;
+import javax.jms.TextMessage;
+
+import org.apache.qpid.proton.jms.JMSVendor;
+import org.apache.activemq.core.buffers.impl.ResetLimitWrappedActiveMQBuffer;
+import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSBytesMessage;
+import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSMapMessage;
+import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSMessage;
+import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSStreamMessage;
+import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSTextMessage;
+import org.apache.activemq.core.server.ServerMessage;
+import org.apache.activemq.core.server.impl.ServerMessageImpl;
+import org.apache.activemq.utils.IDGenerator;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQJMSVendor extends JMSVendor
+{
+
+   private final IDGenerator serverGenerator;
+
+   ActiveMQJMSVendor(IDGenerator idGenerator)
+   {
+      this.serverGenerator = idGenerator;
+   }
+
+   @Override
+   public BytesMessage createBytesMessage()
+   {
+      return new ServerJMSBytesMessage(newMessage(org.apache.activemq.api.core.Message.BYTES_TYPE), 0);
+   }
+
+   @Override
+   public StreamMessage createStreamMessage()
+   {
+      return new ServerJMSStreamMessage(newMessage(org.apache.activemq.api.core.Message.STREAM_TYPE), 0);
+   }
+
+   @Override
+   public Message createMessage()
+   {
+      return new ServerJMSMessage(newMessage(org.apache.activemq.api.core.Message.DEFAULT_TYPE), 0 );
+   }
+
+   @Override
+   public TextMessage createTextMessage()
+   {
+      return new ServerJMSTextMessage(newMessage(org.apache.activemq.api.core.Message.TEXT_TYPE), 0);
+   }
+
+   @Override
+   public ObjectMessage createObjectMessage()
+   {
+      return null;
+   }
+
+   @Override
+   public MapMessage createMapMessage()
+   {
+      return new ServerJMSMapMessage(newMessage(org.apache.activemq.api.core.Message.MAP_TYPE), 0);
+   }
+
+   @Override
+   public void setJMSXUserID(Message message, String s)
+   {
+   }
+
+   @Override
+   public Destination createDestination(String name)
+   {
+      return super.createDestination(name);
+   }
+
+   @Override
+   public <T extends Destination> T createDestination(String name, Class<T> kind)
+   {
+      return super.createDestination(name, kind);
+   }
+
+   @Override
+   public void setJMSXGroupID(Message message, String s)
+   {
+
+   }
+
+   @Override
+   public void setJMSXGroupSequence(Message message, int i)
+   {
+
+   }
+
+   @Override
+   public void setJMSXDeliveryCount(Message message, long l)
+   {
+
+   }
+
+
+   public ServerJMSMessage wrapMessage(int messageType, ServerMessage wrapped, int deliveryCount)
+   {
+      switch (messageType)
+      {
+         case org.apache.activemq.api.core.Message.STREAM_TYPE:
+            return new ServerJMSStreamMessage(wrapped, deliveryCount);
+         case org.apache.activemq.api.core.Message.BYTES_TYPE:
+            return new ServerJMSBytesMessage(wrapped, deliveryCount);
+         case org.apache.activemq.api.core.Message.MAP_TYPE:
+            return new ServerJMSMapMessage(wrapped, deliveryCount);
+         case org.apache.activemq.api.core.Message.TEXT_TYPE:
+            return new ServerJMSTextMessage(wrapped, deliveryCount);
+         default:
+            return new ServerJMSMessage(wrapped, deliveryCount);
+      }
+
+   }
+
+
+   @Override
+   public String toAddress(Destination destination)
+   {
+      return null;
+   }
+
+
+   private ServerMessageImpl newMessage(byte messageType)
+   {
+      ServerMessageImpl message = new ServerMessageImpl(serverGenerator.generateID(), 512);
+      message.setType(messageType);
+      ((ResetLimitWrappedActiveMQBuffer)message.getBodyBuffer()).setMessage(null);
+      return message;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/HornetQJMSVendor.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/HornetQJMSVendor.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/HornetQJMSVendor.java
deleted file mode 100644
index 4c09836..0000000
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/HornetQJMSVendor.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.proton.converter;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.proton.jms.JMSVendor;
-import org.apache.activemq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
-import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSBytesMessage;
-import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSMapMessage;
-import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSMessage;
-import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSStreamMessage;
-import org.apache.activemq.core.protocol.proton.converter.jms.ServerJMSTextMessage;
-import org.apache.activemq.core.server.ServerMessage;
-import org.apache.activemq.core.server.impl.ServerMessageImpl;
-import org.apache.activemq.utils.IDGenerator;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQJMSVendor extends JMSVendor
-{
-
-   private final IDGenerator serverGenerator;
-
-   HornetQJMSVendor(IDGenerator idGenerator)
-   {
-      this.serverGenerator = idGenerator;
-   }
-
-   @Override
-   public BytesMessage createBytesMessage()
-   {
-      return new ServerJMSBytesMessage(newMessage(org.apache.activemq.api.core.Message.BYTES_TYPE), 0);
-   }
-
-   @Override
-   public StreamMessage createStreamMessage()
-   {
-      return new ServerJMSStreamMessage(newMessage(org.apache.activemq.api.core.Message.STREAM_TYPE), 0);
-   }
-
-   @Override
-   public Message createMessage()
-   {
-      return new ServerJMSMessage(newMessage(org.apache.activemq.api.core.Message.DEFAULT_TYPE), 0 );
-   }
-
-   @Override
-   public TextMessage createTextMessage()
-   {
-      return new ServerJMSTextMessage(newMessage(org.apache.activemq.api.core.Message.TEXT_TYPE), 0);
-   }
-
-   @Override
-   public ObjectMessage createObjectMessage()
-   {
-      return null;
-   }
-
-   @Override
-   public MapMessage createMapMessage()
-   {
-      return new ServerJMSMapMessage(newMessage(org.apache.activemq.api.core.Message.MAP_TYPE), 0);
-   }
-
-   @Override
-   public void setJMSXUserID(Message message, String s)
-   {
-   }
-
-   @Override
-   public Destination createDestination(String name)
-   {
-      return super.createDestination(name);
-   }
-
-   @Override
-   public <T extends Destination> T createDestination(String name, Class<T> kind)
-   {
-      return super.createDestination(name, kind);
-   }
-
-   @Override
-   public void setJMSXGroupID(Message message, String s)
-   {
-
-   }
-
-   @Override
-   public void setJMSXGroupSequence(Message message, int i)
-   {
-
-   }
-
-   @Override
-   public void setJMSXDeliveryCount(Message message, long l)
-   {
-
-   }
-
-
-   public ServerJMSMessage wrapMessage(int messageType, ServerMessage wrapped, int deliveryCount)
-   {
-      switch (messageType)
-      {
-         case org.apache.activemq.api.core.Message.STREAM_TYPE:
-            return new ServerJMSStreamMessage(wrapped, deliveryCount);
-         case org.apache.activemq.api.core.Message.BYTES_TYPE:
-            return new ServerJMSBytesMessage(wrapped, deliveryCount);
-         case org.apache.activemq.api.core.Message.MAP_TYPE:
-            return new ServerJMSMapMessage(wrapped, deliveryCount);
-         case org.apache.activemq.api.core.Message.TEXT_TYPE:
-            return new ServerJMSTextMessage(wrapped, deliveryCount);
-         default:
-            return new ServerJMSMessage(wrapped, deliveryCount);
-      }
-
-   }
-
-
-   @Override
-   public String toAddress(Destination destination)
-   {
-      return null;
-   }
-
-
-   private ServerMessageImpl newMessage(byte messageType)
-   {
-      ServerMessageImpl message = new ServerMessageImpl(serverGenerator.generateID(), 512);
-      message.setType(messageType);
-      ((ResetLimitWrappedHornetQBuffer)message.getBodyBuffer()).setMessage(null);
-      return message;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ProtonMessageConverter.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ProtonMessageConverter.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ProtonMessageConverter.java
index faf45f4..18b7de1 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ProtonMessageConverter.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/ProtonMessageConverter.java
@@ -30,13 +30,13 @@ public class ProtonMessageConverter implements MessageConverter
 {
 
 
-   HornetQJMSVendor hornetQJMSVendor;
+   ActiveMQJMSVendor activeMQJMSVendor;
 
    public ProtonMessageConverter(IDGenerator idGenerator)
    {
-      hornetQJMSVendor = new HornetQJMSVendor(idGenerator);
-      inboundTransformer = new JMSMappingInboundTransformer(hornetQJMSVendor);
-      outboundTransformer = new JMSMappingOutboundTransformer(hornetQJMSVendor);
+      activeMQJMSVendor = new ActiveMQJMSVendor(idGenerator);
+      inboundTransformer = new JMSMappingInboundTransformer(activeMQJMSVendor);
+      outboundTransformer = new JMSMappingOutboundTransformer(activeMQJMSVendor);
    }
 
    private final InboundTransformer inboundTransformer;
@@ -70,7 +70,7 @@ public class ProtonMessageConverter implements MessageConverter
    @Override
    public Object outbound(ServerMessage messageOutbound, int deliveryCount) throws Exception
    {
-      ServerJMSMessage jmsMessage = hornetQJMSVendor.wrapMessage(messageOutbound.getType(), messageOutbound, deliveryCount);
+      ServerJMSMessage jmsMessage = activeMQJMSVendor.wrapMessage(messageOutbound.getType(), messageOutbound, deliveryCount);
       jmsMessage.decode();
 
       return outboundTransformer.convert(jmsMessage);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMapMessage.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMapMessage.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMapMessage.java
index 36b9c96..f2fd1b8 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMapMessage.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMapMessage.java
@@ -30,7 +30,7 @@ import static org.apache.activemq.reader.MapMessageUtil.readBodyMap;
 import static org.apache.activemq.reader.MapMessageUtil.writeBodyMap;
 
 /**
- * HornetQ implementation of a JMS MapMessage.
+ * ActiveMQ implementation of a JMS MapMessage.
  *
  * @author Norbert Lataille (Norbert.Lataille@m4x.org)
  * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMessage.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMessage.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMessage.java
index ab2d2b4..fdf14d9 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMessage.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSMessage.java
@@ -23,8 +23,8 @@ import java.util.Enumeration;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.message.impl.MessageInternal;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQQueue;
+import org.apache.activemq.jms.client.ActiveMQDestination;
+import org.apache.activemq.jms.client.ActiveMQQueue;
 import org.apache.activemq.reader.MessageUtil;
 
 /**
@@ -111,7 +111,7 @@ public class ServerJMSMessage implements Message
       SimpleString reply = MessageUtil.getJMSReplyTo(message);
       if (reply != null)
       {
-         return HornetQDestination.fromAddress(reply.toString());
+         return ActiveMQDestination.fromAddress(reply.toString());
       }
       else
       {
@@ -122,7 +122,7 @@ public class ServerJMSMessage implements Message
    @Override
    public final void setJMSReplyTo(Destination replyTo) throws JMSException
    {
-      MessageUtil.setJMSReplyTo(message, replyTo == null ? null : ((HornetQDestination) replyTo).getSimpleAddress());
+      MessageUtil.setJMSReplyTo(message, replyTo == null ? null : ((ActiveMQDestination) replyTo).getSimpleAddress());
 
    }
 
@@ -138,11 +138,11 @@ public class ServerJMSMessage implements Message
       {
          if (!sdest.toString().startsWith("jms."))
          {
-            return new HornetQQueue(sdest.toString(), sdest.toString());
+            return new ActiveMQQueue(sdest.toString(), sdest.toString());
          }
          else
          {
-            return HornetQDestination.fromAddress(sdest.toString());
+            return ActiveMQDestination.fromAddress(sdest.toString());
          }
       }
    }
@@ -156,7 +156,7 @@ public class ServerJMSMessage implements Message
       }
       else
       {
-         message.setAddress(((HornetQDestination) destination).getSimpleAddress());
+         message.setAddress(((ActiveMQDestination) destination).getSimpleAddress());
       }
 
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSStreamMessage.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSStreamMessage.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSStreamMessage.java
index 8c9ce31..927eb46 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSStreamMessage.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSStreamMessage.java
@@ -384,7 +384,7 @@ public final class ServerJMSStreamMessage extends ServerJMSMessage implements St
       getBuffer().resetReaderIndex();
    }
 
-   // HornetQRAMessage overrides ----------------------------------------
+   // ActiveMQRAMessage overrides ----------------------------------------
 
    @Override
    public void clearBody() throws JMSException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSTextMessage.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSTextMessage.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSTextMessage.java
index 8db24a2..ff113cf 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSTextMessage.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/ServerJMSTextMessage.java
@@ -24,7 +24,7 @@ import static org.apache.activemq.reader.TextMessageUtil.writeBodyText;
 
 
 /**
- * HornetQ implementation of a JMS TextMessage.
+ * ActiveMQ implementation of a JMS TextMessage.
  * <br>
  * This class was ported from SpyTextMessage in JBossMQ.
  *

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/package-info.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/package-info.java
index e45c8d7..6c7a919 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/package-info.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/converter/jms/package-info.java
@@ -13,7 +13,7 @@
 
 
 /**
- * This package contains incomplete JMS implementations just to be used with converting amqp to hornetq and
+ * This package contains incomplete JMS implementations just to be used with converting amqp to activemq and
  * vice versa
  * @author Clebert Suconic
  */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java
new file mode 100644
index 0000000..97c3174
--- /dev/null
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ActiveMQProtonConnectionCallback.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.proton.plug;
+
+import java.util.concurrent.TimeUnit;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelFutureListener;
+import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
+import org.apache.activemq.core.protocol.proton.ActiveMQProtonRemotingConnection;
+import org.apache.activemq.core.protocol.proton.ProtonProtocolManager;
+import org.apache.activemq.core.protocol.proton.sasl.ActiveMQPlainSASL;
+import org.apache.activemq.spi.core.remoting.Connection;
+import org.apache.activemq.utils.ReusableLatch;
+import org.proton.plug.AMQPConnectionCallback;
+import org.proton.plug.AMQPConnectionContext;
+import org.proton.plug.AMQPSessionCallback;
+import org.proton.plug.ServerSASL;
+import org.proton.plug.sasl.AnonymousServerSASL;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQProtonConnectionCallback implements AMQPConnectionCallback
+{
+   private final ProtonProtocolManager manager;
+
+   private final Connection connection;
+
+   protected ActiveMQProtonRemotingConnection protonConnectionDelegate;
+
+   protected AMQPConnectionContext amqpConnection;
+
+   private final ReusableLatch latch = new ReusableLatch(0);
+
+   public ActiveMQProtonConnectionCallback(ProtonProtocolManager manager, Connection connection)
+   {
+      this.manager = manager;
+      this.connection = connection;
+   }
+
+   @Override
+   public ServerSASL[] getSASLMechnisms()
+   {
+      return new ServerSASL[]{new AnonymousServerSASL(), new ActiveMQPlainSASL(manager.getServer().getSecurityStore(), manager.getServer().getSecurityManager())};
+   }
+
+   @Override
+   public void close()
+   {
+
+   }
+
+   @Override
+   public void setConnection(AMQPConnectionContext connection)
+   {
+      this.amqpConnection = connection;
+   }
+
+   @Override
+   public AMQPConnectionContext getConnection()
+   {
+      return amqpConnection;
+   }
+
+   public ActiveMQProtonRemotingConnection getProtonConnectionDelegate()
+   {
+      return protonConnectionDelegate;
+   }
+
+   public void setProtonConnectionDelegate(ActiveMQProtonRemotingConnection protonConnectionDelegate)
+   {
+      this.protonConnectionDelegate = protonConnectionDelegate;
+   }
+
+   public void onTransport(ByteBuf byteBuf, AMQPConnectionContext amqpConnection)
+   {
+      final int size = byteBuf.writerIndex();
+
+      latch.countUp();
+      connection.write(new ChannelBufferWrapper(byteBuf, true), false, false, new ChannelFutureListener()
+      {
+         @Override
+         public void operationComplete(ChannelFuture future) throws Exception
+         {
+            latch.countDown();
+         }
+      });
+
+      if (amqpConnection.isSyncOnFlush())
+      {
+         try
+         {
+            latch.await(5, TimeUnit.SECONDS);
+         }
+         catch (Exception e)
+         {
+            e.printStackTrace();
+         }
+      }
+
+      amqpConnection.outputDone(size);
+   }
+
+
+   @Override
+   public AMQPSessionCallback createSessionCallback(AMQPConnectionContext connection)
+   {
+      return new ProtonSessionIntegrationCallback(this, manager, connection);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/HornetQProtonConnectionCallback.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/HornetQProtonConnectionCallback.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/HornetQProtonConnectionCallback.java
deleted file mode 100644
index 185220f..0000000
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/HornetQProtonConnectionCallback.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.proton.plug;
-
-import java.util.concurrent.TimeUnit;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelFutureListener;
-import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
-import org.apache.activemq.core.protocol.proton.HornetQProtonRemotingConnection;
-import org.apache.activemq.core.protocol.proton.ProtonProtocolManager;
-import org.apache.activemq.core.protocol.proton.sasl.HornetQPlainSASL;
-import org.apache.activemq.spi.core.remoting.Connection;
-import org.apache.activemq.utils.ReusableLatch;
-import org.proton.plug.AMQPConnectionCallback;
-import org.proton.plug.AMQPConnectionContext;
-import org.proton.plug.AMQPSessionCallback;
-import org.proton.plug.ServerSASL;
-import org.proton.plug.sasl.AnonymousServerSASL;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQProtonConnectionCallback implements AMQPConnectionCallback
-{
-   private final ProtonProtocolManager manager;
-
-   private final Connection connection;
-
-   protected HornetQProtonRemotingConnection protonConnectionDelegate;
-
-   protected AMQPConnectionContext amqpConnection;
-
-   private final ReusableLatch latch = new ReusableLatch(0);
-
-   public HornetQProtonConnectionCallback(ProtonProtocolManager manager, Connection connection)
-   {
-      this.manager = manager;
-      this.connection = connection;
-   }
-
-   @Override
-   public ServerSASL[] getSASLMechnisms()
-   {
-      return new ServerSASL[]{new AnonymousServerSASL(), new HornetQPlainSASL(manager.getServer().getSecurityStore(), manager.getServer().getSecurityManager())};
-   }
-
-   @Override
-   public void close()
-   {
-
-   }
-
-   @Override
-   public void setConnection(AMQPConnectionContext connection)
-   {
-      this.amqpConnection = connection;
-   }
-
-   @Override
-   public AMQPConnectionContext getConnection()
-   {
-      return amqpConnection;
-   }
-
-   public HornetQProtonRemotingConnection getProtonConnectionDelegate()
-   {
-      return protonConnectionDelegate;
-   }
-
-   public void setProtonConnectionDelegate(HornetQProtonRemotingConnection protonConnectionDelegate)
-   {
-      this.protonConnectionDelegate = protonConnectionDelegate;
-   }
-
-   public void onTransport(ByteBuf byteBuf, AMQPConnectionContext amqpConnection)
-   {
-      final int size = byteBuf.writerIndex();
-
-      latch.countUp();
-      connection.write(new ChannelBufferWrapper(byteBuf, true), false, false, new ChannelFutureListener()
-      {
-         @Override
-         public void operationComplete(ChannelFuture future) throws Exception
-         {
-            latch.countDown();
-         }
-      });
-
-      if (amqpConnection.isSyncOnFlush())
-      {
-         try
-         {
-            latch.await(5, TimeUnit.SECONDS);
-         }
-         catch (Exception e)
-         {
-            e.printStackTrace();
-         }
-      }
-
-      amqpConnection.outputDone(size);
-   }
-
-
-   @Override
-   public AMQPSessionCallback createSessionCallback(AMQPConnectionContext connection)
-   {
-      return new ProtonSessionIntegrationCallback(this, manager, connection);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
index 38c105f..5be9a13 100644
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
@@ -24,7 +24,7 @@ import org.apache.qpid.proton.engine.Receiver;
 import org.apache.qpid.proton.jms.EncodedMessage;
 import org.apache.qpid.proton.message.ProtonJMessage;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.protocol.proton.ProtonProtocolManager;
 import org.apache.activemq.core.server.QueueQueryResult;
@@ -52,7 +52,7 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
 {
    protected final IDGenerator consumerIDGenerator = new SimpleIDGenerator(0);
 
-   private final HornetQProtonConnectionCallback protonSPI;
+   private final ActiveMQProtonConnectionCallback protonSPI;
 
    private final ProtonProtocolManager manager;
 
@@ -62,7 +62,7 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
 
    private AMQPSessionContext protonSession;
 
-   public ProtonSessionIntegrationCallback(HornetQProtonConnectionCallback protonSPI, ProtonProtocolManager manager, AMQPConnectionContext connection)
+   public ProtonSessionIntegrationCallback(ActiveMQProtonConnectionCallback protonSPI, ProtonProtocolManager manager, AMQPConnectionContext connection)
    {
       this.protonSPI = protonSPI;
       this.manager = manager;
@@ -72,7 +72,7 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
    @Override
    public void onFlowConsumer(Object consumer, int credits)
    {
-      // We have our own flow control on AMQP, so we set hornetq's flow control to 0
+      // We have our own flow control on AMQP, so we set activemq's flow control to 0
       ((ServerConsumer) consumer).receiveCredits(-1);
    }
 
@@ -98,7 +98,7 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
       serverSession = manager.getServer().createSession(name,
                                                         user,
                                                         passcode,
-                                                        HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+                                                        ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
                                                         protonSPI.getProtonConnectionDelegate(), // RemotingConnection remotingConnection,
                                                         false, // boolean autoCommitSends
                                                         false, // boolean autoCommitAcks,

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/ActiveMQPlainSASL.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/ActiveMQPlainSASL.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/ActiveMQPlainSASL.java
new file mode 100644
index 0000000..0fafb31
--- /dev/null
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/ActiveMQPlainSASL.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.proton.sasl;
+
+import org.apache.activemq.core.security.SecurityStore;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
+import org.proton.plug.sasl.ServerSASLPlain;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQPlainSASL extends ServerSASLPlain
+{
+
+   private final ActiveMQSecurityManager securityManager;
+
+   private final SecurityStore securityStore;
+
+
+   public ActiveMQPlainSASL(SecurityStore securityStore, ActiveMQSecurityManager securityManager)
+   {
+      this.securityManager = securityManager;
+      this.securityStore = securityStore;
+   }
+
+   @Override
+   protected boolean authenticate(String user, String password)
+   {
+      if (securityStore.isSecurityEnabled())
+      {
+         return securityManager.validateUser(user, password);
+      }
+      else
+      {
+         return true;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/HornetQPlainSASL.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/HornetQPlainSASL.java b/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/HornetQPlainSASL.java
deleted file mode 100644
index 389a474..0000000
--- a/activemq-protocols/activemq-amqp-protocol/src/main/java/org/apache/activemq/core/protocol/proton/sasl/HornetQPlainSASL.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.protocol.proton.sasl;
-
-import org.apache.activemq.core.security.SecurityStore;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
-import org.proton.plug.sasl.ServerSASLPlain;
-
-/**
- * @author Clebert Suconic
- */
-
-public class HornetQPlainSASL extends ServerSASLPlain
-{
-
-   private final HornetQSecurityManager securityManager;
-
-   private final SecurityStore securityStore;
-
-
-   public HornetQPlainSASL(SecurityStore securityStore, HornetQSecurityManager securityManager)
-   {
-      this.securityManager = securityManager;
-      this.securityStore = securityStore;
-   }
-
-   @Override
-   protected boolean authenticate(String user, String password)
-   {
-      if (securityStore.isSecurityEnabled())
-      {
-         return securityManager.validateUser(user, password);
-      }
-      else
-      {
-         return true;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
new file mode 100644
index 0000000..8f035c7
--- /dev/null
+++ b/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.spi.core.protocol.ProtocolManagerFactory
@@ -0,0 +1 @@
+org.apache.activemq.core.protocol.proton.ProtonProtocolManagerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory b/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
deleted file mode 100644
index 8f035c7..0000000
--- a/activemq-protocols/activemq-amqp-protocol/src/main/resources/META-INF/services/org.hornetq.spi.core.protocol.ProtocolManagerFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.activemq.core.protocol.proton.ProtonProtocolManagerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireConnection.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireConnection.java
index 6005b3d..86575b6 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireConnection.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireConnection.java
@@ -93,7 +93,7 @@ import org.apache.activemq.core.protocol.openwire.amq.AMQTransportConnectionStat
 import org.apache.activemq.core.protocol.openwire.amq.AMQTransportConnectionStateRegister;
 import org.apache.activemq.core.remoting.CloseListener;
 import org.apache.activemq.core.remoting.FailureListener;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.Acceptor;
 import org.apache.activemq.spi.core.remoting.Connection;
@@ -142,7 +142,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
 
    private Throwable stopError = null;
 
-   // should come from hornetq server
+   // should come from activemq server
    private final TaskRunnerFactory stopTaskRunnerFactory = null;
 
    private boolean starting;
@@ -204,7 +204,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
       }
       catch (Throwable t)
       {
-         HornetQServerLogger.LOGGER.error("decoding error", t);
+         ActiveMQServerLogger.LOGGER.error("decoding error", t);
          return;
       }
 
@@ -314,11 +314,11 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
          }
          catch (IOException e)
          {
-            HornetQServerLogger.LOGGER.error("error decoding", e);
+            ActiveMQServerLogger.LOGGER.error("error decoding", e);
          }
          catch (Throwable t)
          {
-            HornetQServerLogger.LOGGER.error("error decoding", t);
+            ActiveMQServerLogger.LOGGER.error("error decoding", t);
          }
       }
    }
@@ -444,7 +444,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
    @Override
    public void fail(ActiveMQException me)
    {
-      HornetQServerLogger.LOGGER.connectionFailureDetected(me.getMessage(),
+      ActiveMQServerLogger.LOGGER.connectionFailureDetected(me.getMessage(),
             me.getType());
       // Then call the listeners
       callFailureListeners(me);
@@ -543,7 +543,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQServerLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQServerLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -564,7 +564,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
             // Failure of one listener to execute shouldn't prevent others
             // from
             // executing
-            HornetQServerLogger.LOGGER.errorCallingFailureListener(t);
+            ActiveMQServerLogger.LOGGER.errorCallingFailureListener(t);
          }
       }
    }
@@ -586,7 +586,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
       try
       {
          ByteSequence bytes = wireFormat.marshal(command);
-         ActiveMQBuffer buffer = OpenWireUtil.toHornetQBuffer(bytes);
+         ActiveMQBuffer buffer = OpenWireUtil.toActiveMQBuffer(bytes);
          synchronized (sendLock)
          {
             getTransportConnection().write(buffer, false, false);
@@ -598,7 +598,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
       }
       catch (Throwable t)
       {
-         HornetQServerLogger.LOGGER.error("error sending", t);
+         ActiveMQServerLogger.LOGGER.error("error sending", t);
       }
 
    }
@@ -652,7 +652,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
       context.setConnection(this);
       context.setConnectionId(info.getConnectionId());
       // for now we pass the manager as the connector and see what happens
-      // it should be related to hornetq's Acceptor
+      // it should be related to activemq's Acceptor
       context.setConnector(this.acceptorUsed);
       context.setMessageAuthorizationPolicy(getMessageAuthorizationPolicy());
       context.setNetworkConnection(networkConnection);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManager.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManager.java
index 65a8d71..e878763 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManager.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManager.java
@@ -50,6 +50,7 @@ import org.apache.activemq.command.TransactionId;
 import org.apache.activemq.command.TransactionInfo;
 import org.apache.activemq.command.WireFormatInfo;
 import org.apache.activemq.command.XATransactionId;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.openwire.OpenWireFormat;
 import org.apache.activemq.openwire.OpenWireFormatFactory;
 import org.apache.activemq.state.ConnectionState;
@@ -68,16 +69,15 @@ import org.apache.activemq.core.protocol.openwire.amq.AMQSession;
 import org.apache.activemq.core.protocol.openwire.amq.AMQTransportConnectionState;
 import org.apache.activemq.core.remoting.impl.netty.NettyServerConnection;
 import org.apache.activemq.core.security.CheckType;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.spi.core.protocol.ConnectionEntry;
 import org.apache.activemq.spi.core.protocol.MessageConverter;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.spi.core.remoting.Acceptor;
 import org.apache.activemq.spi.core.remoting.Connection;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 
 public class OpenWireProtocolManager implements ProtocolManager
 {
@@ -85,7 +85,7 @@ public class OpenWireProtocolManager implements ProtocolManager
    private static final IdGenerator ID_GENERATOR = new IdGenerator();
 
    private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator();
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private OpenWireFormatFactory wireFactory;
 
@@ -114,7 +114,7 @@ public class OpenWireProtocolManager implements ProtocolManager
 
    private Map<TransactionId, AMQSession> transactions = new ConcurrentHashMap<TransactionId, AMQSession>();
 
-   public OpenWireProtocolManager(HornetQServer server)
+   public OpenWireProtocolManager(ActiveMQServer server)
    {
       this.server = server;
       this.wireFactory = new OpenWireFormatFactory();
@@ -223,7 +223,7 @@ public class OpenWireProtocolManager implements ProtocolManager
       {
          public void onError(final int errorCode, final String errorMessage)
          {
-            HornetQServerLogger.LOGGER.errorProcessingIOCallback(errorCode,
+            ActiveMQServerLogger.LOGGER.errorProcessingIOCallback(errorCode,
                   errorMessage);
          }
 
@@ -236,9 +236,9 @@ public class OpenWireProtocolManager implements ProtocolManager
 
    public boolean send(final OpenWireConnection connection, final Command command)
    {
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("sending " + command);
+         ActiveMQServerLogger.LOGGER.trace("sending " + command);
       }
       synchronized (connection)
       {
@@ -642,7 +642,7 @@ public class OpenWireProtocolManager implements ProtocolManager
 
             AMQServerSession fakeSession = new AMQServerSession(user, pass);
             CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE;
-            ((HornetQServerImpl)server).getSecurityStore().check(qName, checkType, fakeSession);
+            ((ActiveMQServerImpl)server).getSecurityStore().check(qName, checkType, fakeSession);
          }
          this.server.createQueue(qName, qName, null, false, true);
          if (dest.isTemporary())
@@ -729,7 +729,7 @@ public class OpenWireProtocolManager implements ProtocolManager
    {
       boolean validated = true;
 
-      HornetQSecurityManager sm = server.getSecurityManager();
+      ActiveMQSecurityManager sm = server.getSecurityManager();
 
       if (sm != null && server.getConfiguration().isSecurityEnabled())
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManagerFactory.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManagerFactory.java
index 25c5a46..2582b8d 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManagerFactory.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireProtocolManagerFactory.java
@@ -15,7 +15,7 @@ package org.apache.activemq.core.protocol.openwire;
 import java.util.List;
 
 import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
 
@@ -32,7 +32,7 @@ public class OpenWireProtocolManagerFactory implements ProtocolManagerFactory
 
    private static String[] SUPPORTED_PROTOCOLS = {OPENWIRE_PROTOCOL_NAME};
 
-   public ProtocolManager createProtocolManager(final HornetQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
+   public ProtocolManager createProtocolManager(final ActiveMQServer server, final List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
    {
       return new OpenWireProtocolManager(server);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireUtil.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireUtil.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireUtil.java
index 603c5c6..e55e7b1 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireUtil.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/OpenWireUtil.java
@@ -22,7 +22,7 @@ import org.apache.activemq.api.core.SimpleString;
 public class OpenWireUtil
 {
 
-   public static ActiveMQBuffer toHornetQBuffer(ByteSequence bytes)
+   public static ActiveMQBuffer toActiveMQBuffer(ByteSequence bytes)
    {
       ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(bytes.length);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQConsumer.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQConsumer.java
index 9e98de2..a7f3527 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQConsumer.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQConsumer.java
@@ -19,7 +19,6 @@ import java.util.UUID;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConsumerId;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.MessageAck;
@@ -32,12 +31,12 @@ import org.apache.activemq.core.protocol.openwire.OpenWireMessageConverter;
 import org.apache.activemq.core.protocol.openwire.OpenWireUtil;
 import org.apache.activemq.core.server.QueueQueryResult;
 import org.apache.activemq.core.server.ServerMessage;
-import org.apache.activemq.jms.client.HornetQDestination;
+import org.apache.activemq.jms.client.ActiveMQDestination;
 
 public class AMQConsumer implements BrowserListener
 {
    private AMQSession session;
-   private ActiveMQDestination actualDest;
+   private org.apache.activemq.command.ActiveMQDestination actualDest;
    private ConsumerInfo info;
    private long nativeId = -1;
    private SimpleString subQueueName = null;
@@ -46,7 +45,7 @@ public class AMQConsumer implements BrowserListener
    private AtomicInteger currentSize;
    private final java.util.Queue<MessageInfo> deliveringRefs = new ConcurrentLinkedQueue<MessageInfo>();
 
-   public AMQConsumer(AMQSession amqSession, ActiveMQDestination d, ConsumerInfo info)
+   public AMQConsumer(AMQSession amqSession, org.apache.activemq.command.ActiveMQDestination d, ConsumerInfo info)
    {
       this.session = amqSession;
       this.actualDest = d;
@@ -79,8 +78,8 @@ public class AMQConsumer implements BrowserListener
          if (info.isDurable())
          {
             subQueueName = new SimpleString(
-                  HornetQDestination.createQueueNameForDurableSubscription(
-                        true, info.getClientId(), info.getSubscriptionName()));
+                  ActiveMQDestination.createQueueNameForDurableSubscription(
+                     true, info.getClientId(), info.getSubscriptionName()));
 
             QueueQueryResult result = coreSession.executeQueueQuery(subQueueName);
             if (result.isExists())

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQProducer.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQProducer.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQProducer.java
index e74032f..a609186 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQProducer.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQProducer.java
@@ -27,7 +27,7 @@ public class AMQProducer
 
    public void init()
    {
-      //hornetq doesn't have producer at server.
+      //activemq doesn't have producer at server.
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerConsumer.java b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerConsumer.java
index 5a1bcfc..5c53d02 100644
--- a/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerConsumer.java
+++ b/activemq-protocols/activemq-openwire-protocol/src/main/java/org/apache/activemq/core/protocol/openwire/amq/AMQServerConsumer.java
@@ -18,8 +18,8 @@ import org.apache.activemq.core.filter.Filter;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.QueueBinding;
 import org.apache.activemq.core.protocol.openwire.OpenWireMessageConverter;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.HandleStatus;
-import org.apache.activemq.core.server.HornetQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.impl.QueueImpl;
@@ -83,7 +83,7 @@ public class AMQServerConsumer extends ServerConsumerImpl
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.errorBrowserHandlingMessage(e, current);
+               ActiveMQServerLogger.LOGGER.errorBrowserHandlingMessage(e, current);
                return;
             }
          }
@@ -127,7 +127,7 @@ public class AMQServerConsumer extends ServerConsumerImpl
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.errorBrowserHandlingMessage(e, ref);
+               ActiveMQServerLogger.LOGGER.errorBrowserHandlingMessage(e, ref);
                break;
             }
          }


[48/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java
new file mode 100644
index 0000000..84291bf
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java
@@ -0,0 +1,392 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.buffers.impl;
+
+import java.nio.ByteBuffer;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.message.impl.MessageInternal;
+
+/**
+ * A ResetLimitWrappedActiveMQBuffer
+ * TODO: Move this to commons
+ * @author Tim Fox
+ *
+ */
+public final class ResetLimitWrappedActiveMQBuffer extends ChannelBufferWrapper
+{
+   private final int limit;
+
+   private MessageInternal message;
+
+   /**
+    * We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions,
+    * for that reason this method will set the message to null here
+    * @param message
+    */
+   public void setMessage(MessageInternal message)
+   {
+      this.message = message;
+   }
+
+   public ResetLimitWrappedActiveMQBuffer(final int limit, final ActiveMQBuffer buffer, final MessageInternal message)
+   {
+      super(buffer.byteBuf());
+
+      this.limit = limit;
+
+      if (writerIndex() < limit)
+      {
+         writerIndex(limit);
+      }
+
+      buffer.readerIndex(limit);
+
+      this.message = message;
+   }
+
+   private void changed()
+   {
+      if (message != null)
+      {
+         message.bodyChanged();
+      }
+   }
+
+   public void setBuffer(final ActiveMQBuffer buffer)
+   {
+      if (this.buffer != null)
+      {
+         this.buffer.release();
+      }
+      this.buffer = buffer.byteBuf();
+   }
+
+   @Override
+   public void clear()
+   {
+      changed();
+
+      buffer.clear();
+
+      buffer.setIndex(limit, limit);
+
+   }
+
+   @Override
+   public void readerIndex(int readerIndex)
+   {
+      changed();
+
+      if (readerIndex < limit)
+      {
+         readerIndex = limit;
+      }
+
+      buffer.readerIndex(readerIndex);
+   }
+
+   @Override
+   public void resetReaderIndex()
+   {
+      changed();
+
+      buffer.readerIndex(limit);
+   }
+
+   @Override
+   public void resetWriterIndex()
+   {
+      changed();
+
+      buffer.writerIndex(limit);
+   }
+
+   @Override
+   public void setIndex(int readerIndex, int writerIndex)
+   {
+      changed();
+
+      if (readerIndex < limit)
+      {
+         readerIndex = limit;
+      }
+      if (writerIndex < limit)
+      {
+         writerIndex = limit;
+      }
+      buffer.setIndex(readerIndex, writerIndex);
+   }
+
+   @Override
+   public void writerIndex(int writerIndex)
+   {
+      changed();
+
+      if (writerIndex < limit)
+      {
+         writerIndex = limit;
+      }
+
+      buffer.writerIndex(writerIndex);
+   }
+
+   @Override
+   public void setByte(final int index, final byte value)
+   {
+      changed();
+
+      super.setByte(index, value);
+   }
+
+   @Override
+   public void setBytes(final int index, final byte[] src, final int srcIndex, final int length)
+   {
+      changed();
+
+      super.setBytes(index, src, srcIndex, length);
+   }
+
+   @Override
+   public void setBytes(final int index, final byte[] src)
+   {
+      changed();
+
+      super.setBytes(index, src);
+   }
+
+   @Override
+   public void setBytes(final int index, final ByteBuffer src)
+   {
+      changed();
+
+      super.setBytes(index, src);
+   }
+
+   @Override
+   public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
+   {
+      changed();
+
+      super.setBytes(index, src, srcIndex, length);
+   }
+
+   @Override
+   public void setBytes(final int index, final ActiveMQBuffer src, final int length)
+   {
+      changed();
+
+      super.setBytes(index, src, length);
+   }
+
+   @Override
+   public void setBytes(final int index, final ActiveMQBuffer src)
+   {
+      changed();
+
+      super.setBytes(index, src);
+   }
+
+   @Override
+   public void setChar(final int index, final char value)
+   {
+      changed();
+
+      super.setChar(index, value);
+   }
+
+   @Override
+   public void setDouble(final int index, final double value)
+   {
+      changed();
+
+      super.setDouble(index, value);
+   }
+
+   @Override
+   public void setFloat(final int index, final float value)
+   {
+      changed();
+
+      super.setFloat(index, value);
+   }
+
+   @Override
+   public void setInt(final int index, final int value)
+   {
+      changed();
+
+      super.setInt(index, value);
+   }
+
+   @Override
+   public void setLong(final int index, final long value)
+   {
+      changed();
+
+      super.setLong(index, value);
+   }
+
+   @Override
+   public void setShort(final int index, final short value)
+   {
+      changed();
+
+      super.setShort(index, value);
+   }
+
+   @Override
+   public void writeBoolean(final boolean val)
+   {
+      changed();
+
+      super.writeBoolean(val);
+   }
+
+   @Override
+   public void writeByte(final byte value)
+   {
+      changed();
+
+      super.writeByte(value);
+   }
+
+   @Override
+   public void writeBytes(final byte[] src, final int srcIndex, final int length)
+   {
+      changed();
+
+      super.writeBytes(src, srcIndex, length);
+   }
+
+   @Override
+   public void writeBytes(final byte[] src)
+   {
+      changed();
+
+      super.writeBytes(src);
+   }
+
+   @Override
+   public void writeBytes(final ByteBuffer src)
+   {
+      changed();
+
+      super.writeBytes(src);
+   }
+
+   @Override
+   public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
+   {
+      changed();
+
+      super.writeBytes(src, srcIndex, length);
+   }
+
+   @Override
+   public void writeBytes(final ActiveMQBuffer src, final int length)
+   {
+      changed();
+
+      super.writeBytes(src, length);
+   }
+
+   @Override
+   public void writeChar(final char chr)
+   {
+      changed();
+
+      super.writeChar(chr);
+   }
+
+   @Override
+   public void writeDouble(final double value)
+   {
+      changed();
+
+      super.writeDouble(value);
+   }
+
+   @Override
+   public void writeFloat(final float value)
+   {
+      changed();
+
+      super.writeFloat(value);
+   }
+
+   @Override
+   public void writeInt(final int value)
+   {
+      changed();
+
+      super.writeInt(value);
+   }
+
+   @Override
+   public void writeLong(final long value)
+   {
+      changed();
+
+      super.writeLong(value);
+   }
+
+   @Override
+   public void writeNullableSimpleString(final SimpleString val)
+   {
+      changed();
+
+      super.writeNullableSimpleString(val);
+   }
+
+   @Override
+   public void writeNullableString(final String val)
+   {
+      changed();
+
+      super.writeNullableString(val);
+   }
+
+   @Override
+   public void writeShort(final short value)
+   {
+      changed();
+
+      super.writeShort(value);
+   }
+
+   @Override
+   public void writeSimpleString(final SimpleString val)
+   {
+      changed();
+
+      super.writeSimpleString(val);
+   }
+
+   @Override
+   public void writeString(final String val)
+   {
+      changed();
+
+      super.writeString(val);
+   }
+
+   @Override
+   public void writeUTF(final String utf)
+   {
+      changed();
+
+      super.writeUTF(utf);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
deleted file mode 100644
index 71ef0a4..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.buffers.impl;
-
-import java.nio.ByteBuffer;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.message.impl.MessageInternal;
-
-/**
- * A ResetLimitWrappedHornetQBuffer
- * TODO: Move this to commons
- * @author Tim Fox
- *
- */
-public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
-{
-   private final int limit;
-
-   private MessageInternal message;
-
-   /**
-    * We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions,
-    * for that reason this method will set the message to null here
-    * @param message
-    */
-   public void setMessage(MessageInternal message)
-   {
-      this.message = message;
-   }
-
-   public ResetLimitWrappedHornetQBuffer(final int limit, final ActiveMQBuffer buffer, final MessageInternal message)
-   {
-      super(buffer.byteBuf());
-
-      this.limit = limit;
-
-      if (writerIndex() < limit)
-      {
-         writerIndex(limit);
-      }
-
-      buffer.readerIndex(limit);
-
-      this.message = message;
-   }
-
-   private void changed()
-   {
-      if (message != null)
-      {
-         message.bodyChanged();
-      }
-   }
-
-   public void setBuffer(final ActiveMQBuffer buffer)
-   {
-      if (this.buffer != null)
-      {
-         this.buffer.release();
-      }
-      this.buffer = buffer.byteBuf();
-   }
-
-   @Override
-   public void clear()
-   {
-      changed();
-
-      buffer.clear();
-
-      buffer.setIndex(limit, limit);
-
-   }
-
-   @Override
-   public void readerIndex(int readerIndex)
-   {
-      changed();
-
-      if (readerIndex < limit)
-      {
-         readerIndex = limit;
-      }
-
-      buffer.readerIndex(readerIndex);
-   }
-
-   @Override
-   public void resetReaderIndex()
-   {
-      changed();
-
-      buffer.readerIndex(limit);
-   }
-
-   @Override
-   public void resetWriterIndex()
-   {
-      changed();
-
-      buffer.writerIndex(limit);
-   }
-
-   @Override
-   public void setIndex(int readerIndex, int writerIndex)
-   {
-      changed();
-
-      if (readerIndex < limit)
-      {
-         readerIndex = limit;
-      }
-      if (writerIndex < limit)
-      {
-         writerIndex = limit;
-      }
-      buffer.setIndex(readerIndex, writerIndex);
-   }
-
-   @Override
-   public void writerIndex(int writerIndex)
-   {
-      changed();
-
-      if (writerIndex < limit)
-      {
-         writerIndex = limit;
-      }
-
-      buffer.writerIndex(writerIndex);
-   }
-
-   @Override
-   public void setByte(final int index, final byte value)
-   {
-      changed();
-
-      super.setByte(index, value);
-   }
-
-   @Override
-   public void setBytes(final int index, final byte[] src, final int srcIndex, final int length)
-   {
-      changed();
-
-      super.setBytes(index, src, srcIndex, length);
-   }
-
-   @Override
-   public void setBytes(final int index, final byte[] src)
-   {
-      changed();
-
-      super.setBytes(index, src);
-   }
-
-   @Override
-   public void setBytes(final int index, final ByteBuffer src)
-   {
-      changed();
-
-      super.setBytes(index, src);
-   }
-
-   @Override
-   public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
-   {
-      changed();
-
-      super.setBytes(index, src, srcIndex, length);
-   }
-
-   @Override
-   public void setBytes(final int index, final ActiveMQBuffer src, final int length)
-   {
-      changed();
-
-      super.setBytes(index, src, length);
-   }
-
-   @Override
-   public void setBytes(final int index, final ActiveMQBuffer src)
-   {
-      changed();
-
-      super.setBytes(index, src);
-   }
-
-   @Override
-   public void setChar(final int index, final char value)
-   {
-      changed();
-
-      super.setChar(index, value);
-   }
-
-   @Override
-   public void setDouble(final int index, final double value)
-   {
-      changed();
-
-      super.setDouble(index, value);
-   }
-
-   @Override
-   public void setFloat(final int index, final float value)
-   {
-      changed();
-
-      super.setFloat(index, value);
-   }
-
-   @Override
-   public void setInt(final int index, final int value)
-   {
-      changed();
-
-      super.setInt(index, value);
-   }
-
-   @Override
-   public void setLong(final int index, final long value)
-   {
-      changed();
-
-      super.setLong(index, value);
-   }
-
-   @Override
-   public void setShort(final int index, final short value)
-   {
-      changed();
-
-      super.setShort(index, value);
-   }
-
-   @Override
-   public void writeBoolean(final boolean val)
-   {
-      changed();
-
-      super.writeBoolean(val);
-   }
-
-   @Override
-   public void writeByte(final byte value)
-   {
-      changed();
-
-      super.writeByte(value);
-   }
-
-   @Override
-   public void writeBytes(final byte[] src, final int srcIndex, final int length)
-   {
-      changed();
-
-      super.writeBytes(src, srcIndex, length);
-   }
-
-   @Override
-   public void writeBytes(final byte[] src)
-   {
-      changed();
-
-      super.writeBytes(src);
-   }
-
-   @Override
-   public void writeBytes(final ByteBuffer src)
-   {
-      changed();
-
-      super.writeBytes(src);
-   }
-
-   @Override
-   public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
-   {
-      changed();
-
-      super.writeBytes(src, srcIndex, length);
-   }
-
-   @Override
-   public void writeBytes(final ActiveMQBuffer src, final int length)
-   {
-      changed();
-
-      super.writeBytes(src, length);
-   }
-
-   @Override
-   public void writeChar(final char chr)
-   {
-      changed();
-
-      super.writeChar(chr);
-   }
-
-   @Override
-   public void writeDouble(final double value)
-   {
-      changed();
-
-      super.writeDouble(value);
-   }
-
-   @Override
-   public void writeFloat(final float value)
-   {
-      changed();
-
-      super.writeFloat(value);
-   }
-
-   @Override
-   public void writeInt(final int value)
-   {
-      changed();
-
-      super.writeInt(value);
-   }
-
-   @Override
-   public void writeLong(final long value)
-   {
-      changed();
-
-      super.writeLong(value);
-   }
-
-   @Override
-   public void writeNullableSimpleString(final SimpleString val)
-   {
-      changed();
-
-      super.writeNullableSimpleString(val);
-   }
-
-   @Override
-   public void writeNullableString(final String val)
-   {
-      changed();
-
-      super.writeNullableString(val);
-   }
-
-   @Override
-   public void writeShort(final short value)
-   {
-      changed();
-
-      super.writeShort(value);
-   }
-
-   @Override
-   public void writeSimpleString(final SimpleString val)
-   {
-      changed();
-
-      super.writeSimpleString(val);
-   }
-
-   @Override
-   public void writeString(final String val)
-   {
-      changed();
-
-      super.writeString(val);
-   }
-
-   @Override
-   public void writeUTF(final String utf)
-   {
-      changed();
-
-      super.writeUTF(utf);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java
new file mode 100644
index 0000000..08e3f49
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java
@@ -0,0 +1,415 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.client;
+
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.Interceptor;
+import org.apache.activemq.core.protocol.core.Packet;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+import org.w3c.dom.Node;
+
+/**
+ * Logger Code 21
+ * <p>
+ * Each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
+ *
+ * <pre>
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ * </pre>
+ *
+ * so an INFO message would be 101000 to 101999.
+ * <p>
+ * Once released, methods should not be deleted as they may be referenced by knowledge base
+ * articles. Unused methods should be marked as deprecated.
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQClientLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQClientLogger LOGGER = Logger.getMessageLogger(ActiveMQClientLogger.class, ActiveMQClientLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 211000, value = "**** Dumping session creation stacks ****", format = Message.Format.MESSAGE_FORMAT)
+   void dumpingSessionStacks();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 211001, value = "session created", format = Message.Format.MESSAGE_FORMAT)
+   void dumpingSessionStack(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212000, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
+   void warn(String message);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212001, value = "Error on clearing messages", format = Message.Format.MESSAGE_FORMAT)
+   void errorClearingMessages(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212002, value = "Timed out waiting for handler to complete processing", format = Message.Format.MESSAGE_FORMAT)
+   void timeOutWaitingForProcessing();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212003, value = "Unable to close session", format = Message.Format.MESSAGE_FORMAT)
+   void unableToCloseSession(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212004, value = "Failed to connect to server.", format = Message.Format.MESSAGE_FORMAT)
+   void failedToConnectToServer();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212005, value = "Tried {0} times to connect. Now giving up on reconnecting it.", format = Message.Format.MESSAGE_FORMAT)
+   void failedToConnectToServer(Integer reconnectAttempts);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212006, value = "Waiting {0} milliseconds before next retry. RetryInterval={1} and multiplier={2}", format = Message.Format.MESSAGE_FORMAT)
+   void waitingForRetry(Long interval, Long retryInterval, Double multiplier);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212007,
+            value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void createConnectorException(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212008,
+            value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly "
+               + "before letting them go out of scope! {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void factoryLeftOpen(@Cause Exception e, int i);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212009, value = "resetting session after failure", format = Message.Format.MESSAGE_FORMAT)
+   void resettingSessionAfterFailure();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212010, value = "Server is starting, retry to create the session {0}", format = Message.Format.MESSAGE_FORMAT)
+   void retryCreateSessionSeverStarting(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", format = Message.Format.MESSAGE_FORMAT)
+   void commitAfterFailover();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212012, value = "failover occurred during commit throwing XAException.XA_RETRY", format = Message.Format.MESSAGE_FORMAT)
+   void failoverDuringCommit();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212014, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
+   void failoverDuringPrepareRollingBack();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212015, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
+   void errorDuringPrepare(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212016,
+            value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void clientSessionNotClosed(@Cause Exception e, int identity);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212017, value = "error adding packet", format = Message.Format.MESSAGE_FORMAT)
+   void errorAddingPacket(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212018, value = "error calling cancel", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingCancel(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212019, value = "error reading index", format = Message.Format.MESSAGE_FORMAT)
+   void errorReadingIndex(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212020, value = "error setting index", format = Message.Format.MESSAGE_FORMAT)
+   void errorSettingIndex(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212021, value = "error resetting index", format = Message.Format.MESSAGE_FORMAT)
+   void errorReSettingIndex(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212022, value = "error reading LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
+   void errorReadingCache(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212023, value = "error closing LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingCache(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212024, value = "Exception during finalization for LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
+   void errorFinalisingCache(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212025, value = "did not connect the cluster connection to other nodes", format = Message.Format.MESSAGE_FORMAT)
+   void errorConnectingToNodes(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212026, value = "Timed out waiting for pool to terminate", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutWaitingForTermination();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212027, value = "Timed out waiting for scheduled pool to terminate", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutWaitingForScheduledPoolTermination();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingLocator(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212029,
+            value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void serverLocatorNotClosed(@Cause Exception e, int identity);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212030, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
+   void errorSendingTopology(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212031, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
+   void errorSendingTopologyNodedown(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212032, value = "Timed out waiting to stop discovery thread", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutStoppingDiscovery();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212033, value = "unable to send notification when discovery group is stopped", format = Message.Format.MESSAGE_FORMAT)
+   void errorSendingNotifOnDiscoveryStop(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212034,
+            value = "There are more than one servers on the network broadcasting the same node id. "
+               + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely "
+               + "ignored. But if it is logged continuously it means you really do have more than one node on the same network "
+               + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as "
+               + "its live node. nodeID={0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void multipleServersBroadcastingSameNode(String nodeId);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212035, value = "error receiving packet in discovery", format = Message.Format.MESSAGE_FORMAT)
+   void errorReceivingPAcketInDiscovery(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212036,
+            value = "Can not find packet to clear: {0} last received command id first stored command id {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212037, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT)
+   void connectionFailureDetected(String message, ActiveMQExceptionType type);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212040, value = "Timed out waiting for netty ssl close future to complete", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutClosingSSL();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212041, value = "Timed out waiting for netty channel to close", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutClosingNettyChannel();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212042, value = "Timed out waiting for packet to be flushed", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutFlushingPacket();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212043, value = "Property {0} must be an Integer, it is {1}", format = Message.Format.MESSAGE_FORMAT)
+   void propertyNotInteger(String propName, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212044, value = "Property {0} must be an Long, it is {1}", format = Message.Format.MESSAGE_FORMAT)
+   void propertyNotLong(String propName, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212045, value = "Property {0} must be an Boolean, it is {1}", format = Message.Format.MESSAGE_FORMAT)
+   void propertyNotBoolean(String propName, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212046, value = "Cannot find activemq-version.properties on classpath: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void noVersionOnClasspath(String classpath);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {0}:{1}", format = Message.Format.MESSAGE_FORMAT)
+   void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212048, value = "local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound to a local address/port",
+            format = Message.Format.MESSAGE_FORMAT)
+   void broadcastGroupBindError();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212049,
+            value = "Could not bind to {0} ({1} address); " +
+               "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." +
+               "\nIgnoring discovery group-address, but this may lead to cross talking.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void ioDiscoveryError(String hostAddress, String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212050, value = "Compressed large message tried to read {0} bytes from stream {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void compressedLargeMessageError(int length, int nReadBytes);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212051,
+            value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void invalidConcurrentSessionUsage(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212052,
+            value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored",
+            format = Message.Format.MESSAGE_FORMAT)
+   void packetOutOfOrder(Object obj, @Cause Throwable t);
+
+   /**
+    * Warns about usage of {@link org.apache.activemq.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with
+    * confirmations disabled (confirmationWindowSize=-1).
+    */
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212053,
+            value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!",
+            format = Message.Format.MESSAGE_FORMAT)
+   void confirmationWindowDisabledWarning();
+
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212054,
+            value = "Destination address={0} is blocked. If the system is configured to block make sure you consume messages on this configuration.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void outOfCreditOnFlowControl(String address);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212055, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT)
+   void unableToCloseConsumer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)
+   void onMessageError(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214001, value = "failed to cleanup session", format = Message.Format.MESSAGE_FORMAT)
+   void failedToCleanupSession(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214002, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
+   void failedToExecuteListener(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214003, value = "Failed to handle failover", format = Message.Format.MESSAGE_FORMAT)
+   void failedToHandleFailover(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214004, value = "XA end operation failed ", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingEnd(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214005, value = "XA start operation failed {0} code:{1}", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingStart(String message, Integer code);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214006, value = "Session is not XA", format = Message.Format.MESSAGE_FORMAT)
+   void sessionNotXA();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214007, value = "Received exception asynchronously from server", format = Message.Format.MESSAGE_FORMAT)
+   void receivedExceptionAsynchronously(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214008, value = "Failed to handle packet", format = Message.Format.MESSAGE_FORMAT)
+   void failedToHandlePacket(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214009, value = "Failed to stop discovery group", format = Message.Format.MESSAGE_FORMAT)
+   void failedToStopDiscovery(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214010, value = "Failed to receive datagram", format = Message.Format.MESSAGE_FORMAT)
+   void failedToReceiveDatagramInDiscovery(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214011, value = "Failed to call discovery listener", format = Message.Format.MESSAGE_FORMAT)
+   void failedToCallListenerInDiscovery(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214012, value = "Unexpected error handling packet {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorHandlingPacket(@Cause Throwable t, Packet packet);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214013, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT)
+   void errorDecodingPacket(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214014, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingFailureListener(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214015, value = "Failed to execute connection life cycle listener", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingLifeCycleListener(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214016, value = "Failed to create netty connection", format = Message.Format.MESSAGE_FORMAT)
+   void errorCreatingNettyConnection(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214017, value = "Caught unexpected Throwable", format = Message.Format.MESSAGE_FORMAT)
+   void caughtunexpectedThrowable(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214018, value = "Failed to invoke getTextContent() on node {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorOnXMLTransform(@Cause Throwable t, Node n);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214019, value = "Invalid configuration", format = Message.Format.MESSAGE_FORMAT)
+   void errorOnXMLTransformInvalidConf(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidCipherSuite(String validSuites);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214022, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidProtocol(String validProtocols);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214023, value = "HTTP Handshake failed, the received accept value %s does not match the expected response %s")
+   void httpHandshakeFailed(String response, String expectedResponse);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214024, value = "HTTP upgrade not supported by remote acceptor")
+   void httpUpgradeNotSupportedByRemoteAcceptor();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java
new file mode 100644
index 0000000..f9ad2ba
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.client;
+
+
+import org.apache.activemq.api.core.ActiveMQAddressFullException;
+import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
+import org.apache.activemq.api.core.ActiveMQDisconnectedException;
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.apache.activemq.api.core.ActiveMQInterceptorRejectedPacketException;
+import org.apache.activemq.api.core.ActiveMQInternalErrorException;
+import org.apache.activemq.api.core.ActiveMQLargeMessageException;
+import org.apache.activemq.api.core.ActiveMQLargeMessageInterruptedException;
+import org.apache.activemq.api.core.ActiveMQNotConnectedException;
+import org.apache.activemq.api.core.ActiveMQObjectClosedException;
+import org.apache.activemq.api.core.ActiveMQTransactionOutcomeUnknownException;
+import org.apache.activemq.api.core.ActiveMQTransactionRolledBackException;
+import org.apache.activemq.api.core.ActiveMQUnBlockedException;
+import org.apache.activemq.core.cluster.DiscoveryGroup;
+import org.apache.activemq.spi.core.remoting.Connection;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+import org.w3c.dom.Node;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 11
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
+ *
+ * so 119000 to 119999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQClientMessageBundle
+{
+   ActiveMQClientMessageBundle BUNDLE = Messages.getBundle(ActiveMQClientMessageBundle.class);
+
+   @Message(id = 119000, value = "ClientSession closed while creating session", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException clientSessionClosed();
+
+   @Message(id = 119001, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
+
+   @Message(id = 119002, value = "Internal Error! ClientSessionFactoryImpl::createSessionInternal "
+                                          + "just reached a condition that was not supposed to happen. "
+                                      + "Please inform this condition to the ActiveMQ team", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException clietSessionInternal();
+
+   @Message(id = 119003, value = "Queue can not be both durable and temporary", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException queueMisConfigured();
+
+   @Message(id = 119004, value = "Failed to initialise session factory", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
+
+   @Message(id = 119005, value = "Exception in Netty transport", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException nettyError();
+
+   @Message(id = 119006, value =  "Channel disconnected", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNotConnectedException channelDisconnected();
+
+   @Message(id = 119007, value =  "Cannot connect to server(s). Tried with all available servers.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNotConnectedException cannotConnectToServers();
+
+   @Message(id = 119008, value =  "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
+
+   @Message(id = 119009, value =  "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
+
+   @Message(id = 119010, value =  "Connection is destroyed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNotConnectedException connectionDestroyed();
+
+   @Message(id = 119011, value =  "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
+
+   @Message(id = 119012, value =  "Timed out waiting to receive initial broadcast from cluster", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
+
+   @Message(id = 119013, value =  "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
+
+   @Message(id = 119014, value =  "Timed out waiting for response when sending packet {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQConnectionTimedOutException timedOutSendingPacket(Byte type);
+
+   @Message(id = 119015, value =  "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQDisconnectedException disconnected();
+
+   @Message(id = 119016, value =  "Connection failure detected. Unblocking a blocking call that will never get a resp" +
+         "onse", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
+
+   @Message(id = 119017, value =  "Consumer is closed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQObjectClosedException consumerClosed();
+
+   @Message(id = 119018, value =  "Producer is closed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQObjectClosedException producerClosed();
+
+   @Message(id = 119019, value =  "Session is closed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQObjectClosedException sessionClosed();
+
+   @Message(id = 119020, value =  "Cannot call receive(...) - a MessageHandler is set", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException messageHandlerSet();
+
+   @Message(id = 119021, value =  "Cannot set MessageHandler - consumer is in receive(...)", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException inReceive();
+
+   @Message(id = 119022, value =  "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize",
+         format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize);
+
+   @Message(id = 119023, value =  "The large message lost connection with its session, either because of a rollback or a closed session", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException largeMessageLostSession();
+
+   @Message(id = 119024, value =  "Could not select a TransportConfiguration to create SessionFactory", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException noTCForSessionFactory();
+
+   @Message(id = 119025, value = "Error saving the message body", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
+
+   @Message(id = 119026, value =  "Error reading the LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
+
+   @Message(id = 119027, value =  "Error closing stream from LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
+
+   @Message(id = 119028, value =  "Timeout waiting for LargeMessage Body", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageException timeoutOnLargeMessage();
+
+   @Message(id = 119029, value =  "Error writing body of message", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
+
+   @Message(id = 119030, value =  "The transaction was rolled back on failover to a backup server", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQTransactionRolledBackException txRolledBack();
+
+   @Message(id = 119031, value =  "The transaction was rolled back on failover however commit may have been successful" +
+         "", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown();
+
+   @Message(id = 119032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidType(Object type);
+
+   @Message(id = 119033, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidEncodeType(Object type);
+
+   @Message(id = 119034, value = "Params for management operations must be of the following type: int long double String boolean Map or array thereof but found {0}",
+         format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidManagementParam(Object type);
+
+   @Message(id = 119035, value = "Invalid window size {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidWindowSize(Integer size);
+
+   @Message(id = 119036, value = "No operation mapped to int {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noOperationMapped(Integer operation);
+
+   @Message(id = 119037, value = "Invalid last Received Command ID: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidCommandID(Integer lastReceivedCommandID);
+
+   @Message(id = 119038, value = "Cannot find channel with id {0} to close", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noChannelToClose(Long id);
+
+   @Message(id = 119039, value = "Close Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException closeListenerCannotBeNull();
+
+   @Message(id = 119040, value = "Fail Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException failListenerCannotBeNull();
+
+   @Message(id = 119041, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException connectionExists(Object id);
+
+   @Message(id = 119042, value = "Invalid argument null listener", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullListener();
+
+   @Message(id = 119043, value = "Invalid argument null handler", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullHandler();
+
+   @Message(id = 119044, value = "No available codec to decode password!", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noCodec();
+
+   @Message(id = 119045, value = "the first node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException firstNodeNull();
+
+   @Message(id = 119046, value = "the second node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException secondNodeNull();
+
+   @Message(id = 119047, value = "nodes have different node names", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nodeHaveDifferentNames();
+
+   @Message(id = 119048, value = "nodes hava a different number of attributes", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nodeHaveDifferentAttNumber();
+
+   @Message(id = 119049, value = "attribute {0}={1} does not match", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException attsDontMatch(String name, String value);
+
+   @Message(id = 119050, value = "one node has children and the other does not" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException oneNodeHasChildren();
+
+   @Message(id = 119051, value = "nodes hava a different number of children" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nodeHasDifferentChildNumber();
+
+   @Message(id = 119052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException mustBeBoolean(Node elem, String value);
+
+   @Message(id = 119053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException mustBeDouble(Node elem, String value);
+
+   @Message(id = 119054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as a Integer" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException mustBeInteger(Node elem, String value);
+
+   @Message(id = 119055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException mustBeLong(Node elem, String value);
+
+   @Message(id = 119056, value = "Failed to get decoder" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException failedToGetDecoder(@Cause Exception e);
+
+   @Message(id = 119057, value = "Error decoding password" , format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException errordecodingPassword(@Cause Exception e);
+
+   @Message(id = 119058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAddressFullException addressIsFull(String addressName, int size);
+
+   @Message(id = 119059, value = "Interceptor {0} rejected packet in a blocking call. This call will never complete."
+         , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
+
+   @Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown."
+         , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQLargeMessageInterruptedException largeMessageInterrupted();
+
+   @Message(id = 119061, value =  "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
+   String decodeError();
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java
deleted file mode 100644
index 742bb34..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.client;
-
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.Interceptor;
-import org.apache.activemq.core.protocol.core.Packet;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-import org.w3c.dom.Node;
-
-/**
- * Logger Code 21
- * <p>
- * Each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
- *
- * <pre>
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- * </pre>
- *
- * so an INFO message would be 101000 to 101999.
- * <p>
- * Once released, methods should not be deleted as they may be referenced by knowledge base
- * articles. Unused methods should be marked as deprecated.
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQClientLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQClientLogger LOGGER = Logger.getMessageLogger(HornetQClientLogger.class, HornetQClientLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 211000, value = "**** Dumping session creation stacks ****", format = Message.Format.MESSAGE_FORMAT)
-   void dumpingSessionStacks();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 211001, value = "session created", format = Message.Format.MESSAGE_FORMAT)
-   void dumpingSessionStack(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212000, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
-   void warn(String message);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212001, value = "Error on clearing messages", format = Message.Format.MESSAGE_FORMAT)
-   void errorClearingMessages(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212002, value = "Timed out waiting for handler to complete processing", format = Message.Format.MESSAGE_FORMAT)
-   void timeOutWaitingForProcessing();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212003, value = "Unable to close session", format = Message.Format.MESSAGE_FORMAT)
-   void unableToCloseSession(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212004, value = "Failed to connect to server.", format = Message.Format.MESSAGE_FORMAT)
-   void failedToConnectToServer();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212005, value = "Tried {0} times to connect. Now giving up on reconnecting it.", format = Message.Format.MESSAGE_FORMAT)
-   void failedToConnectToServer(Integer reconnectAttempts);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212006, value = "Waiting {0} milliseconds before next retry. RetryInterval={1} and multiplier={2}", format = Message.Format.MESSAGE_FORMAT)
-   void waitingForRetry(Long interval, Long retryInterval, Double multiplier);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212007,
-            value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void createConnectorException(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212008,
-            value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly "
-               + "before letting them go out of scope! {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void factoryLeftOpen(@Cause Exception e, int i);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212009, value = "resetting session after failure", format = Message.Format.MESSAGE_FORMAT)
-   void resettingSessionAfterFailure();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212010, value = "Server is starting, retry to create the session {0}", format = Message.Format.MESSAGE_FORMAT)
-   void retryCreateSessionSeverStarting(String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", format = Message.Format.MESSAGE_FORMAT)
-   void commitAfterFailover();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212012, value = "failover occurred during commit throwing XAException.XA_RETRY", format = Message.Format.MESSAGE_FORMAT)
-   void failoverDuringCommit();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212014, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
-   void failoverDuringPrepareRollingBack();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212015, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
-   void errorDuringPrepare(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212016,
-            value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void clientSessionNotClosed(@Cause Exception e, int identity);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212017, value = "error adding packet", format = Message.Format.MESSAGE_FORMAT)
-   void errorAddingPacket(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212018, value = "error calling cancel", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingCancel(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212019, value = "error reading index", format = Message.Format.MESSAGE_FORMAT)
-   void errorReadingIndex(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212020, value = "error setting index", format = Message.Format.MESSAGE_FORMAT)
-   void errorSettingIndex(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212021, value = "error resetting index", format = Message.Format.MESSAGE_FORMAT)
-   void errorReSettingIndex(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212022, value = "error reading LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
-   void errorReadingCache(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212023, value = "error closing LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
-   void errorClosingCache(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212024, value = "Exception during finalization for LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
-   void errorFinalisingCache(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212025, value = "did not connect the cluster connection to other nodes", format = Message.Format.MESSAGE_FORMAT)
-   void errorConnectingToNodes(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212026, value = "Timed out waiting for pool to terminate", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutWaitingForTermination();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212027, value = "Timed out waiting for scheduled pool to terminate", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutWaitingForScheduledPoolTermination();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingLocator(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212029,
-            value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void serverLocatorNotClosed(@Cause Exception e, int identity);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212030, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
-   void errorSendingTopology(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212031, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
-   void errorSendingTopologyNodedown(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212032, value = "Timed out waiting to stop discovery thread", format = Message.Format.MESSAGE_FORMAT)
-   void timedOutStoppingDiscovery();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212033, value = "unable to send notification when discovery group is stopped", format = Message.Format.MESSAGE_FORMAT)
-   void errorSendingNotifOnDiscoveryStop(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212034,
-            value = "There are more than one servers on the network broadcasting the same node id. "
-               + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely "
-               + "ignored. But if it is logged continuously it means you really do have more than one node on the same network "
-               + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as "
-               + "its live node. nodeID={0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void multipleServersBroadcastingSameNode(String nodeId);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212035, value = "error receiving packet in discovery", format = Message.Format.MESSAGE_FORMAT)
-   void errorReceivingPAcketInDiscovery(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212036,
-            value = "Can not find packet to clear: {0} last received command id first stored command id {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212037, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT)
-   void connectionFailureDetected(String message, ActiveMQExceptionType type);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212040, value = "Timed out waiting for netty ssl close future to complete", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutClosingSSL();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212041, value = "Timed out waiting for netty channel to close", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutClosingNettyChannel();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212042, value = "Timed out waiting for packet to be flushed", format = Message.Format.MESSAGE_FORMAT)
-   void timeoutFlushingPacket();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212043, value = "Property {0} must be an Integer, it is {1}", format = Message.Format.MESSAGE_FORMAT)
-   void propertyNotInteger(String propName, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212044, value = "Property {0} must be an Long, it is {1}", format = Message.Format.MESSAGE_FORMAT)
-   void propertyNotLong(String propName, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212045, value = "Property {0} must be an Boolean, it is {1}", format = Message.Format.MESSAGE_FORMAT)
-   void propertyNotBoolean(String propName, String name);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212046, value = "Cannot find hornetq-version.properties on classpath: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void noVersionOnClasspath(String classpath);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {0}:{1}", format = Message.Format.MESSAGE_FORMAT)
-   void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212048, value = "local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound to a local address/port",
-            format = Message.Format.MESSAGE_FORMAT)
-   void broadcastGroupBindError();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212049,
-            value = "Could not bind to {0} ({1} address); " +
-               "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." +
-               "\nIgnoring discovery group-address, but this may lead to cross talking.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void ioDiscoveryError(String hostAddress, String s);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212050, value = "Compressed large message tried to read {0} bytes from stream {1}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void compressedLargeMessageError(int length, int nReadBytes);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212051,
-            value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void invalidConcurrentSessionUsage(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212052,
-            value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored",
-            format = Message.Format.MESSAGE_FORMAT)
-   void packetOutOfOrder(Object obj, @Cause Throwable t);
-
-   /**
-    * Warns about usage of {@link org.apache.activemq.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with
-    * confirmations disabled (confirmationWindowSize=-1).
-    */
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212053,
-            value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!",
-            format = Message.Format.MESSAGE_FORMAT)
-   void confirmationWindowDisabledWarning();
-
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212054,
-            value = "Destination address={0} is blocked. If the system is configured to block make sure you consume messages on this configuration.",
-            format = Message.Format.MESSAGE_FORMAT)
-   void outOfCreditOnFlowControl(String address);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 212055, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT)
-   void unableToCloseConsumer(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)
-   void onMessageError(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214001, value = "failed to cleanup session", format = Message.Format.MESSAGE_FORMAT)
-   void failedToCleanupSession(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214002, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
-   void failedToExecuteListener(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214003, value = "Failed to handle failover", format = Message.Format.MESSAGE_FORMAT)
-   void failedToHandleFailover(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214004, value = "XA end operation failed ", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingEnd(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214005, value = "XA start operation failed {0} code:{1}", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingStart(String message, Integer code);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214006, value = "Session is not XA", format = Message.Format.MESSAGE_FORMAT)
-   void sessionNotXA();
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214007, value = "Received exception asynchronously from server", format = Message.Format.MESSAGE_FORMAT)
-   void receivedExceptionAsynchronously(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214008, value = "Failed to handle packet", format = Message.Format.MESSAGE_FORMAT)
-   void failedToHandlePacket(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214009, value = "Failed to stop discovery group", format = Message.Format.MESSAGE_FORMAT)
-   void failedToStopDiscovery(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214010, value = "Failed to receive datagram", format = Message.Format.MESSAGE_FORMAT)
-   void failedToReceiveDatagramInDiscovery(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214011, value = "Failed to call discovery listener", format = Message.Format.MESSAGE_FORMAT)
-   void failedToCallListenerInDiscovery(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214012, value = "Unexpected error handling packet {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorHandlingPacket(@Cause Throwable t, Packet packet);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214013, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT)
-   void errorDecodingPacket(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214014, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingFailureListener(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214015, value = "Failed to execute connection life cycle listener", format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingLifeCycleListener(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214016, value = "Failed to create netty connection", format = Message.Format.MESSAGE_FORMAT)
-   void errorCreatingNettyConnection(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214017, value = "Caught unexpected Throwable", format = Message.Format.MESSAGE_FORMAT)
-   void caughtunexpectedThrowable(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214018, value = "Failed to invoke getTextContent() on node {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorOnXMLTransform(@Cause Throwable t, Node n);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214019, value = "Invalid configuration", format = Message.Format.MESSAGE_FORMAT)
-   void errorOnXMLTransformInvalidConf(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidCipherSuite(String validSuites);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214022, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidProtocol(String validProtocols);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214023, value = "HTTP Handshake failed, the received accept value %s does not match the expected response %s")
-   void httpHandshakeFailed(String response, String expectedResponse);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 214024, value = "HTTP upgrade not supported by remote acceptor")
-   void httpUpgradeNotSupportedByRemoteAcceptor();
-}


[22/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
new file mode 100644
index 0000000..ec67e9d
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
@@ -0,0 +1,2411 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.Session;
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.BroadcastEndpointFactoryConfiguration;
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.JGroupsBroadcastGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.UDPBroadcastGroupConfiguration;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.ActiveMQClient;
+import org.apache.activemq.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.api.jms.JMSFactoryType;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.ra.inflow.ActiveMQActivation;
+import org.apache.activemq.ra.inflow.ActiveMQActivationSpec;
+import org.apache.activemq.ra.recovery.RecoveryManager;
+import org.apache.activemq.utils.SensitiveDataCodec;
+import org.jgroups.JChannel;
+
+/**
+ * The resource adapter for ActiveMQ
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ */
+public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable
+{
+   private static final long serialVersionUID = 4756893709825838770L;
+
+   /**
+    * The Name of the product that this resource adapter represents.
+    */
+   public static final String PRODUCT_NAME = "ActiveMQ";
+
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The bootstrap context
+    */
+   private BootstrapContext ctx;
+
+   /**
+    * The resource adapter properties
+    */
+   private final ActiveMQRAProperties raProperties;
+
+   /**
+    * The resource adapter properties before parsing
+    */
+   private String unparsedProperties;
+
+
+   /**
+    * The resource adapter connector classnames before parsing
+    */
+   private String unparsedConnectors;
+
+   /**
+    * Have the factory been configured
+    */
+   private final AtomicBoolean configured;
+
+   /**
+    * The activations by activation spec
+    */
+   private final Map<ActivationSpec, ActiveMQActivation> activations;
+
+   private ActiveMQConnectionFactory defaultActiveMQConnectionFactory;
+
+   private ActiveMQConnectionFactory recoveryActiveMQConnectionFactory;
+
+   private TransactionManager tm;
+
+   private String unparsedJndiParams;
+
+   private final RecoveryManager recoveryManager;
+
+   private boolean useAutoRecovery = true;
+
+   private final List<ActiveMQRAManagedConnectionFactory> managedConnectionFactories = new ArrayList<ActiveMQRAManagedConnectionFactory>();
+
+   private String entries;
+
+   /**
+    * Constructor
+    */
+   public ActiveMQResourceAdapter()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+
+      raProperties = new ActiveMQRAProperties();
+      configured = new AtomicBoolean(false);
+      activations = new ConcurrentHashMap<ActivationSpec, ActiveMQActivation>();
+      recoveryManager = new RecoveryManager();
+   }
+
+   public TransactionManager getTM()
+   {
+      return tm;
+   }
+
+   /**
+    * Endpoint activation
+    *
+    * @param endpointFactory The endpoint factory
+    * @param spec            The activation spec
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public void endpointActivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec) throws ResourceException
+   {
+      if (spec == null)
+      {
+         throw ActiveMQRABundle.BUNDLE.noActivationSpec();
+      }
+      if (!configured.getAndSet(true))
+      {
+         try
+         {
+            setup();
+         }
+         catch (ActiveMQException e)
+         {
+            throw new ResourceException("Unable to create activation", e);
+         }
+      }
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("endpointActivation(" + endpointFactory + ", " + spec + ")");
+      }
+
+      ActiveMQActivation activation = new ActiveMQActivation(this, endpointFactory, (ActiveMQActivationSpec) spec);
+      activations.put(spec, activation);
+      activation.start();
+   }
+
+   /**
+    * Endpoint deactivation
+    *
+    * @param endpointFactory The endpoint factory
+    * @param spec            The activation spec
+    */
+   public void endpointDeactivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("endpointDeactivation(" + endpointFactory + ", " + spec + ")");
+      }
+
+      ActiveMQActivation activation = activations.remove(spec);
+      if (activation != null)
+      {
+         activation.stop();
+      }
+   }
+
+   /**
+    * Get XA resources
+    *
+    * @param specs The activation specs
+    * @return The XA resources
+    * @throws ResourceException Thrown if an error occurs or unsupported
+    */
+   public XAResource[] getXAResources(final ActivationSpec[] specs) throws ResourceException
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getXAResources(" + Arrays.toString(specs) + ")");
+      }
+
+      if (useAutoRecovery)
+      {
+         // let the TM handle the recovery
+         return null;
+      }
+      else
+      {
+         List<XAResource> xaresources = new ArrayList<XAResource>();
+         for (ActivationSpec spec : specs)
+         {
+            ActiveMQActivation activation = activations.get(spec);
+            if (activation != null)
+            {
+               xaresources.addAll(activation.getXAResources());
+            }
+         }
+         return xaresources.toArray(new XAResource[xaresources.size()]);
+      }
+   }
+
+   /**
+    * Start
+    *
+    * @param ctx The bootstrap context
+    * @throws ResourceAdapterInternalException Thrown if an error occurs
+    */
+   public void start(final BootstrapContext ctx) throws ResourceAdapterInternalException
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start(" + ctx + ")");
+      }
+
+      locateTM();
+
+      recoveryManager.start(useAutoRecovery);
+
+      this.ctx = ctx;
+
+      if (!configured.getAndSet(true))
+      {
+         try
+         {
+            setup();
+         }
+         catch (ActiveMQException e)
+         {
+            throw new ResourceAdapterInternalException("Unable to create activation", e);
+         }
+      }
+
+      ActiveMQRALogger.LOGGER.info("ActiveMQ resource adaptor started");
+   }
+
+   /**
+    * Stop
+    */
+   public void stop()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("stop()");
+      }
+
+      for (Map.Entry<ActivationSpec, ActiveMQActivation> entry : activations.entrySet())
+      {
+         try
+         {
+            entry.getValue().stop();
+         }
+         catch (Exception ignored)
+         {
+            ActiveMQRALogger.LOGGER.debug("Ignored", ignored);
+         }
+      }
+
+      activations.clear();
+
+      for (ActiveMQRAManagedConnectionFactory managedConnectionFactory : managedConnectionFactories)
+      {
+         managedConnectionFactory.stop();
+      }
+
+      managedConnectionFactories.clear();
+
+      if (defaultActiveMQConnectionFactory != null)
+      {
+         defaultActiveMQConnectionFactory.close();
+      }
+
+      if (recoveryActiveMQConnectionFactory != null)
+      {
+         recoveryActiveMQConnectionFactory.close();
+      }
+
+      recoveryManager.stop();
+
+      ActiveMQRALogger.LOGGER.raStopped();
+   }
+
+   public void setUseAutoRecovery(Boolean useAutoRecovery)
+   {
+      this.useAutoRecovery = useAutoRecovery;
+   }
+
+   public Boolean isUseAutoRecovery()
+   {
+      return this.useAutoRecovery;
+   }
+
+   public Boolean isUseMaskedPassword()
+   {
+      return this.raProperties.isUseMaskedPassword();
+   }
+
+   public void setUseMaskedPassword(Boolean useMaskedPassword)
+   {
+      this.raProperties.setUseMaskedPassword(useMaskedPassword);
+   }
+
+   public void setPasswordCodec(String passwordCodec)
+   {
+      this.raProperties.setPasswordCodec(passwordCodec);
+   }
+
+   public String getPasswordCodec()
+   {
+      return this.raProperties.getPasswordCodec();
+   }
+
+   public void setConnectorClassName(final String connectorClassName)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setTransportType(" + connectorClassName + ")");
+      }
+      unparsedConnectors = connectorClassName;
+
+      raProperties.setParsedConnectorClassNames(ActiveMQRaUtils.parseConnectorConnectorConfig(connectorClassName));
+   }
+
+   public String getConnectorClassName()
+   {
+      return unparsedConnectors;
+   }
+
+   public String getConnectionParameters()
+   {
+      return unparsedProperties;
+   }
+
+   public void setConnectionParameters(final String config)
+   {
+      if (config != null)
+      {
+         this.unparsedProperties = config;
+         raProperties.setParsedConnectionParameters(ActiveMQRaUtils.parseConfig(config));
+      }
+   }
+
+
+   public Boolean getHA()
+   {
+      return raProperties.isHA();
+   }
+
+   public void setHA(final Boolean ha)
+   {
+      this.raProperties.setHA(ha);
+   }
+
+   public String getEntries()
+   {
+      return entries;
+   }
+
+   public String getJndiName()
+   {
+      if (!(entries == null || entries.isEmpty()))
+      {
+         Matcher m = Pattern.compile("\"(.*?)\"").matcher(entries);
+         if (m.find())
+         {
+            return m.group(1);
+         }
+      }
+      return null;
+   }
+
+   public void setEntries(String entries)
+   {
+      this.entries = entries;
+   }
+
+   /**
+    * Get the discovery group name
+    *
+    * @return The value
+    */
+   public String getDiscoveryAddress()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryGroupAddress()");
+      }
+
+      return raProperties.getDiscoveryAddress();
+   }
+
+   public void setJgroupsFile(String jgroupsFile)
+   {
+      raProperties.setJgroupsFile(jgroupsFile);
+   }
+
+   public String getJgroupsFile()
+   {
+      return raProperties.getJgroupsFile();
+   }
+
+   public String getJgroupsChannelName()
+   {
+      return raProperties.getJgroupsChannelName();
+   }
+
+   public void setJgroupsChannelName(String jgroupsChannelName)
+   {
+      raProperties.setJgroupsChannelName(jgroupsChannelName);
+   }
+
+   /**
+    * Set the discovery group name
+    *
+    * @param dgn The value
+    */
+   public void setDiscoveryAddress(final String dgn)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryGroupAddress(" + dgn + ")");
+      }
+
+      raProperties.setDiscoveryAddress(dgn);
+   }
+
+   /**
+    * Get the discovery group port
+    *
+    * @return The value
+    */
+   public Integer getDiscoveryPort()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryGroupPort()");
+      }
+
+      return raProperties.getDiscoveryPort();
+   }
+
+   /**
+    * set the discovery local bind address
+    *
+    * @param discoveryLocalBindAddress the address value
+    */
+   public void setDiscoveryLocalBindAddress(final String discoveryLocalBindAddress)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
+      }
+
+      raProperties.setDiscoveryLocalBindAddress(discoveryLocalBindAddress);
+   }
+
+   /**
+    * get the discovery local bind address
+    *
+    * @return the address value
+    */
+   public String getDiscoveryLocalBindAddress()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryLocalBindAddress()");
+      }
+
+      return raProperties.getDiscoveryLocalBindAddress();
+   }
+
+   /**
+    * Set the discovery group port
+    *
+    * @param dgp The value
+    */
+   public void setDiscoveryPort(final Integer dgp)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryGroupPort(" + dgp + ")");
+      }
+
+      raProperties.setDiscoveryPort(dgp);
+   }
+
+   /**
+    * Get discovery refresh timeout
+    *
+    * @return The value
+    */
+   public Long getDiscoveryRefreshTimeout()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryRefreshTimeout()");
+      }
+
+      return raProperties.getDiscoveryRefreshTimeout();
+   }
+
+   /**
+    * Set discovery refresh timeout
+    *
+    * @param discoveryRefreshTimeout The value
+    */
+   public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
+      }
+
+      raProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
+   }
+
+   /**
+    * Get discovery initial wait timeout
+    *
+    * @return The value
+    */
+   public Long getDiscoveryInitialWaitTimeout()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDiscoveryInitialWaitTimeout()");
+      }
+
+      return raProperties.getDiscoveryInitialWaitTimeout();
+   }
+
+   /**
+    * Set discovery initial wait timeout
+    *
+    * @param discoveryInitialWaitTimeout The value
+    */
+   public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
+      }
+
+      raProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
+   }
+
+   /**
+    * Get client failure check period
+    *
+    * @return The value
+    */
+   public Long getClientFailureCheckPeriod()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getClientFailureCheckPeriod()");
+      }
+
+      return raProperties.getClientFailureCheckPeriod();
+   }
+
+   /**
+    * Set client failure check period
+    *
+    * @param clientFailureCheckPeriod The value
+    */
+   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
+      }
+
+      raProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+   }
+
+   /**
+    * Get connection TTL
+    *
+    * @return The value
+    */
+   public Long getConnectionTTL()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConnectionTTL()");
+      }
+
+      return raProperties.getConnectionTTL();
+   }
+
+   /**
+    * Set connection TTL
+    *
+    * @param connectionTTL The value
+    */
+   public void setConnectionTTL(final Long connectionTTL)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConnectionTTL(" + connectionTTL + ")");
+      }
+
+      raProperties.setConnectionTTL(connectionTTL);
+   }
+
+   /**
+    * Get cacheLargeMessagesClient
+    *
+    * @return The value
+    */
+   public Boolean isCacheLargeMessagesClient()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isCacheLargeMessagesClient()");
+      }
+
+      return raProperties.isCacheLargeMessagesClient();
+   }
+
+   /**
+    * Set cacheLargeMessagesClient
+    *
+    * @param cacheLargeMessagesClient The value
+    */
+   public void setCacheLargeMessagesClient(final Boolean cacheLargeMessagesClient)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setCacheLargeMessagesClient(" + cacheLargeMessagesClient + ")");
+      }
+
+      raProperties.setCacheLargeMessagesClient(cacheLargeMessagesClient);
+   }
+
+   /**
+    * Get compressLargeMessage
+    *
+    * @return The value
+    */
+   public Boolean isCompressLargeMessage()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isCompressLargeMessage()");
+      }
+
+      return raProperties.isCompressLargeMessage();
+   }
+
+   /**
+    * Set failoverOnInitialConnection
+    *
+    * @param failoverOnInitialConnection The value
+    */
+   public void setFailoverOnInitialConnection(final Boolean failoverOnInitialConnection)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFailoverOnInitialConnection(" + failoverOnInitialConnection + ")");
+      }
+
+      raProperties.setFailoverOnInitialConnection(failoverOnInitialConnection);
+   }
+
+   /**
+    * Get isFailoverOnInitialConnection
+    *
+    * @return The value
+    */
+   public Boolean isFailoverOnInitialConnection()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isFailoverOnInitialConnection()");
+      }
+
+      return raProperties.isFailoverOnInitialConnection();
+   }
+
+   /**
+    * Set compressLargeMessage
+    *
+    * @param compressLargeMessage The value
+    */
+   public void setCompressLargeMessage(final Boolean compressLargeMessage)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setCompressLargeMessage(" + compressLargeMessage + ")");
+      }
+
+      raProperties.setCompressLargeMessage(compressLargeMessage);
+   }
+
+   /**
+    * Get call timeout
+    *
+    * @return The value
+    */
+   public Long getCallTimeout()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getCallTimeout()");
+      }
+
+      return raProperties.getCallTimeout();
+   }
+
+   /**
+    * Set call timeout
+    *
+    * @param callTimeout The value
+    */
+   public void setCallTimeout(final Long callTimeout)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setCallTimeout(" + callTimeout + ")");
+      }
+
+      raProperties.setCallTimeout(callTimeout);
+   }
+
+   /**
+    * Get call failover timeout
+    *
+    * @return The value
+    */
+   public Long getCallFailoverTimeout()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getCallFailoverTimeout()");
+      }
+
+      return raProperties.getCallFailoverTimeout();
+   }
+
+   /**
+    * Set call failover timeout
+    *
+    * @param callFailoverTimeout The value
+    */
+   public void setCallFailoverTimeout(final Long callFailoverTimeout)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")");
+      }
+
+      raProperties.setCallFailoverTimeout(callFailoverTimeout);
+   }
+
+   /**
+    * Get dups ok batch size
+    *
+    * @return The value
+    */
+   public Integer getDupsOKBatchSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDupsOKBatchSize()");
+      }
+
+      return raProperties.getDupsOKBatchSize();
+   }
+
+   /**
+    * Set dups ok batch size
+    *
+    * @param dupsOKBatchSize The value
+    */
+   public void setDupsOKBatchSize(final Integer dupsOKBatchSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
+      }
+
+      raProperties.setDupsOKBatchSize(dupsOKBatchSize);
+   }
+
+   /**
+    * Get transaction batch size
+    *
+    * @return The value
+    */
+   public Integer getTransactionBatchSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTransactionBatchSize()");
+      }
+
+      return raProperties.getTransactionBatchSize();
+   }
+
+   /**
+    * Set transaction batch size
+    *
+    * @param transactionBatchSize The value
+    */
+   public void setTransactionBatchSize(final Integer transactionBatchSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
+      }
+
+      raProperties.setTransactionBatchSize(transactionBatchSize);
+   }
+
+   /**
+    * Get consumer window size
+    *
+    * @return The value
+    */
+   public Integer getConsumerWindowSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConsumerWindowSize()");
+      }
+
+      return raProperties.getConsumerWindowSize();
+   }
+
+   /**
+    * Set consumer window size
+    *
+    * @param consumerWindowSize The value
+    */
+   public void setConsumerWindowSize(final Integer consumerWindowSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
+      }
+
+      raProperties.setConsumerWindowSize(consumerWindowSize);
+   }
+
+   /**
+    * Get consumer max rate
+    *
+    * @return The value
+    */
+   public Integer getConsumerMaxRate()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConsumerMaxRate()");
+      }
+
+      return raProperties.getConsumerMaxRate();
+   }
+
+   /**
+    * Set consumer max rate
+    *
+    * @param consumerMaxRate The value
+    */
+   public void setConsumerMaxRate(final Integer consumerMaxRate)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
+      }
+
+      raProperties.setConsumerMaxRate(consumerMaxRate);
+   }
+
+   /**
+    * Get confirmation window size
+    *
+    * @return The value
+    */
+   public Integer getConfirmationWindowSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConfirmationWindowSize()");
+      }
+
+      return raProperties.getConfirmationWindowSize();
+   }
+
+   /**
+    * Set confirmation window size
+    *
+    * @param confirmationWindowSize The value
+    */
+   public void setConfirmationWindowSize(final Integer confirmationWindowSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")");
+      }
+
+      raProperties.setConfirmationWindowSize(confirmationWindowSize);
+   }
+
+   /**
+    * Get producer max rate
+    *
+    * @return The value
+    */
+   public Integer getProducerMaxRate()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProducerMaxRate()");
+      }
+
+      return raProperties.getProducerMaxRate();
+   }
+
+   /**
+    * Set producer max rate
+    *
+    * @param producerMaxRate The value
+    */
+   public void setProducerMaxRate(final Integer producerMaxRate)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setProducerMaxRate(" + producerMaxRate + ")");
+      }
+
+      raProperties.setProducerMaxRate(producerMaxRate);
+   }
+
+   /**
+    * Get producer window size
+    *
+    * @return The value
+    */
+   public Integer getProducerWindowSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProducerWindowSize()");
+      }
+
+      return raProperties.getProducerWindowSize();
+   }
+
+   /**
+    * Set producer window size
+    *
+    * @param producerWindowSize The value
+    */
+   public void setProducerWindowSize(final Integer producerWindowSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setProducerWindowSize(" + producerWindowSize + ")");
+      }
+
+      raProperties.setProducerWindowSize(producerWindowSize);
+   }
+
+   /**
+    * Get min large message size
+    *
+    * @return The value
+    */
+   public Integer getMinLargeMessageSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMinLargeMessageSize()");
+      }
+
+      return raProperties.getMinLargeMessageSize();
+   }
+
+   /**
+    * Set min large message size
+    *
+    * @param minLargeMessageSize The value
+    */
+   public void setMinLargeMessageSize(final Integer minLargeMessageSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
+      }
+
+      raProperties.setMinLargeMessageSize(minLargeMessageSize);
+   }
+
+   /**
+    * Get block on acknowledge
+    *
+    * @return The value
+    */
+   public Boolean getBlockOnAcknowledge()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBlockOnAcknowledge()");
+      }
+
+      return raProperties.isBlockOnAcknowledge();
+   }
+
+   /**
+    * Set block on acknowledge
+    *
+    * @param blockOnAcknowledge The value
+    */
+   public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
+      }
+
+      raProperties.setBlockOnAcknowledge(blockOnAcknowledge);
+   }
+
+   /**
+    * Get block on non durable send
+    *
+    * @return The value
+    */
+   public Boolean getBlockOnNonDurableSend()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBlockOnNonDurableSend()");
+      }
+
+      return raProperties.isBlockOnNonDurableSend();
+   }
+
+   /**
+    * Set block on non durable send
+    *
+    * @param blockOnNonDurableSend The value
+    */
+   public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")");
+      }
+
+      raProperties.setBlockOnNonDurableSend(blockOnNonDurableSend);
+   }
+
+   /**
+    * Get block on durable send
+    *
+    * @return The value
+    */
+   public Boolean getBlockOnDurableSend()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBlockOnDurableSend()");
+      }
+
+      return raProperties.isBlockOnDurableSend();
+   }
+
+   /**
+    * Set block on durable send
+    *
+    * @param blockOnDurableSend The value
+    */
+   public void setBlockOnDurableSend(final Boolean blockOnDurableSend)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")");
+      }
+
+      raProperties.setBlockOnDurableSend(blockOnDurableSend);
+   }
+
+   /**
+    * Get auto group
+    *
+    * @return The value
+    */
+   public Boolean getAutoGroup()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getAutoGroup()");
+      }
+
+      return raProperties.isAutoGroup();
+   }
+
+   /**
+    * Set auto group
+    *
+    * @param autoGroup The value
+    */
+   public void setAutoGroup(final Boolean autoGroup)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setAutoGroup(" + autoGroup + ")");
+      }
+
+      raProperties.setAutoGroup(autoGroup);
+   }
+
+   /**
+    * Get pre acknowledge
+    *
+    * @return The value
+    */
+   public Boolean getPreAcknowledge()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPreAcknowledge()");
+      }
+
+      return raProperties.isPreAcknowledge();
+   }
+
+   /**
+    * Set pre acknowledge
+    *
+    * @param preAcknowledge The value
+    */
+   public void setPreAcknowledge(final Boolean preAcknowledge)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPreAcknowledge(" + preAcknowledge + ")");
+      }
+
+      raProperties.setPreAcknowledge(preAcknowledge);
+   }
+
+   /**
+    * Get number of initial connect attempts
+    *
+    * @return The value
+    */
+   public Integer getInitialConnectAttempts()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getInitialConnectAttempts()");
+      }
+
+      return raProperties.getInitialConnectAttempts();
+   }
+
+   /**
+    * Set number of initial connect attempts
+    *
+    * @param initialConnectAttempts The value
+    */
+   public void setInitialConnectAttempts(final Integer initialConnectAttempts)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setInitialConnectionAttempts(" + initialConnectAttempts + ")");
+      }
+
+      raProperties.setInitialConnectAttempts(initialConnectAttempts);
+   }
+
+   /**
+    * Get initial message packet size
+    *
+    * @return The value
+    */
+   public Integer getInitialMessagePacketSize()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getInitialMessagePacketSize()");
+      }
+
+      return raProperties.getInitialMessagePacketSize();
+   }
+
+   /**
+    * Set initial message packet size
+    *
+    * @param initialMessagePacketSize The value
+    */
+   public void setInitialMessagePacketSize(final Integer initialMessagePacketSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setInitialMessagePacketSize(" + initialMessagePacketSize + ")");
+      }
+
+      raProperties.setInitialMessagePacketSize(initialMessagePacketSize);
+   }
+
+   /**
+    * Get retry interval
+    *
+    * @return The value
+    */
+   public Long getRetryInterval()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getRetryInterval()");
+      }
+
+      return raProperties.getRetryInterval();
+   }
+
+   /**
+    * Set retry interval
+    *
+    * @param retryInterval The value
+    */
+   public void setRetryInterval(final Long retryInterval)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setRetryInterval(" + retryInterval + ")");
+      }
+
+      raProperties.setRetryInterval(retryInterval);
+   }
+
+   /**
+    * Get retry interval multiplier
+    *
+    * @return The value
+    */
+   public Double getRetryIntervalMultiplier()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getRetryIntervalMultiplier()");
+      }
+
+      return raProperties.getRetryIntervalMultiplier();
+   }
+
+   /**
+    * Set retry interval multiplier
+    *
+    * @param retryIntervalMultiplier The value
+    */
+   public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
+      }
+
+      raProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
+   }
+
+   /**
+    * Get maximum time for retry interval
+    *
+    * @return The value
+    */
+   public Long getMaxRetryInterval()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMaxRetryInterval()");
+      }
+
+      return raProperties.getMaxRetryInterval();
+   }
+
+   /**
+    * Set maximum time for retry interval
+    *
+    * @param maxRetryInterval The value
+    */
+   public void setMaxRetryInterval(final Long maxRetryInterval)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setMaxRetryInterval(" + maxRetryInterval + ")");
+      }
+
+      raProperties.setMaxRetryInterval(maxRetryInterval);
+   }
+
+   /**
+    * Get number of reconnect attempts
+    *
+    * @return The value
+    */
+   public Integer getReconnectAttempts()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getReconnectAttempts()");
+      }
+
+      return raProperties.getReconnectAttempts();
+   }
+
+   /**
+    * Set number of reconnect attempts
+    *
+    * @param reconnectAttempts The value
+    */
+   public void setReconnectAttempts(final Integer reconnectAttempts)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setReconnectAttempts(" + reconnectAttempts + ")");
+      }
+
+      raProperties.setReconnectAttempts(reconnectAttempts);
+   }
+
+   public String getConnectionLoadBalancingPolicyClassName()
+   {
+      return raProperties.getConnectionLoadBalancingPolicyClassName();
+   }
+
+   public void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + connectionLoadBalancingPolicyClassName + ")");
+      }
+      raProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   public Integer getScheduledThreadPoolMaxSize()
+   {
+      return raProperties.getScheduledThreadPoolMaxSize();
+   }
+
+   public void setScheduledThreadPoolMaxSize(final Integer scheduledThreadPoolMaxSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + scheduledThreadPoolMaxSize + ")");
+      }
+      raProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+   }
+
+   public Integer getThreadPoolMaxSize()
+   {
+      return raProperties.getThreadPoolMaxSize();
+   }
+
+   public void setThreadPoolMaxSize(final Integer threadPoolMaxSize)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + threadPoolMaxSize + ")");
+      }
+      raProperties.setThreadPoolMaxSize(threadPoolMaxSize);
+   }
+
+   public Boolean getUseGlobalPools()
+   {
+      return raProperties.isUseGlobalPools();
+   }
+
+   public void setUseGlobalPools(final Boolean useGlobalPools)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + useGlobalPools + ")");
+      }
+      raProperties.setUseGlobalPools(useGlobalPools);
+   }
+
+   /**
+    * Get the user name
+    *
+    * @return The value
+    */
+   public String getUserName()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return raProperties.getUserName();
+   }
+
+   /**
+    * Set the user name
+    *
+    * @param userName The value
+    */
+   public void setUserName(final String userName)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUserName(" + userName + ")");
+      }
+
+      raProperties.setUserName(userName);
+   }
+
+   /**
+    * Get the password
+    *
+    * @return The value
+    */
+   public String getPassword()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPassword()");
+      }
+
+      return raProperties.getPassword();
+   }
+
+   /**
+    * Set the password
+    *
+    * @param password The value
+    */
+   public void setPassword(final String password)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      raProperties.setPassword(password);
+   }
+
+   /**
+    * @return the useJNDI
+    */
+   public boolean isUseJNDI()
+   {
+      return raProperties.isUseJNDI();
+   }
+
+   /**
+    * @param value the useJNDI to set
+    */
+   public void setUseJNDI(final Boolean value)
+   {
+      raProperties.setUseJNDI(value);
+   }
+
+   /**
+    * @return return the jndi params to use
+    */
+   public String getJndiParams()
+   {
+      return unparsedJndiParams;
+   }
+
+   public void setJndiParams(String jndiParams)
+   {
+      unparsedJndiParams = jndiParams;
+      raProperties.setParsedJndiParams(ActiveMQRaUtils.parseHashtableConfig(jndiParams));
+   }
+
+   public Hashtable<?, ?> getParsedJndiParams()
+   {
+      return raProperties.getParsedJndiParams();
+   }
+
+   /**
+    * Get the client ID
+    *
+    * @return The value
+    */
+   public String getClientID()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getClientID()");
+      }
+
+      return raProperties.getClientID();
+   }
+
+   /**
+    * Set the client ID
+    *
+    * @param clientID The client id
+    */
+   public void setClientID(final String clientID)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
+      }
+
+      raProperties.setClientID(clientID);
+   }
+
+   /**
+    * Get the group ID
+    *
+    * @return The value
+    */
+   public String getGroupID()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getGroupID()");
+      }
+
+      return raProperties.getGroupID();
+   }
+
+   /**
+    * Set the group ID
+    *
+    * @param groupID The group id
+    */
+   public void setGroupID(final String groupID)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setGroupID(" + groupID + ")");
+      }
+
+      raProperties.setGroupID(groupID);
+   }
+
+   /**
+    * Get the use XA flag
+    *
+    * @return The value
+    */
+   public Boolean getUseLocalTx()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUseLocalTx()");
+      }
+
+      return raProperties.getUseLocalTx();
+   }
+
+   /**
+    * Set the use XA flag
+    *
+    * @param localTx The value
+    */
+   public void setUseLocalTx(final Boolean localTx)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUseXA(" + localTx + ")");
+      }
+
+      raProperties.setUseLocalTx(localTx);
+   }
+
+   public int getSetupAttempts()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSetupAttempts()");
+      }
+      return raProperties.getSetupAttempts();
+   }
+
+   public void setSetupAttempts(Integer setupAttempts)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")");
+      }
+      raProperties.setSetupAttempts(setupAttempts);
+   }
+
+   public long getSetupInterval()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSetupInterval()");
+      }
+      return raProperties.getSetupInterval();
+   }
+
+   public void setSetupInterval(Long interval)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSetupInterval(" + interval + ")");
+      }
+      raProperties.setSetupInterval(interval);
+   }
+
+   /**
+    * Indicates whether some other object is "equal to" this one.
+    *
+    * @param obj Object with which to compare
+    * @return True if this object is the same as the obj argument; false otherwise.
+    */
+   @Override
+   public boolean equals(final Object obj)
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")");
+      }
+
+      if (obj == null)
+      {
+         return false;
+      }
+
+      if (obj instanceof ActiveMQResourceAdapter)
+      {
+         return raProperties.equals(((ActiveMQResourceAdapter) obj).getProperties());
+      }
+      return false;
+   }
+
+   /**
+    * Return the hash code for the object
+    *
+    * @return The hash code
+    */
+   @Override
+   public int hashCode()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("hashCode()");
+      }
+
+      return raProperties.hashCode();
+   }
+
+   /**
+    * Get the work manager
+    *
+    * @return The manager
+    */
+   public WorkManager getWorkManager()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getWorkManager()");
+      }
+
+      if (ctx == null)
+      {
+         return null;
+      }
+
+      return ctx.getWorkManager();
+   }
+
+   public ClientSession createSession(final ClientSessionFactory parameterFactory,
+                                      final int ackMode,
+                                      final String user,
+                                      final String pass,
+                                      final Boolean preAck,
+                                      final Integer dupsOkBatchSize,
+                                      final Integer transactionBatchSize,
+                                      final boolean deliveryTransacted,
+                                      final boolean useLocalTx,
+                                      final Integer txTimeout) throws Exception
+   {
+
+      ClientSession result;
+
+      // if we are CMP or BMP using local tx we ignore the ack mode as we are transactional
+      if (deliveryTransacted || useLocalTx)
+      {
+         // JBPAPP-8845
+         // If transacted we need to send the ack flush as soon as possible
+         // as if any transaction times out, we need the ack on the server already
+         if (useLocalTx)
+         {
+            result = parameterFactory.createSession(user, pass, false, false, false, false, 0);
+         }
+         else
+         {
+            result = parameterFactory.createSession(user, pass, true, false, false, false, 0);
+         }
+      }
+      else
+      {
+         if (preAck != null && preAck)
+         {
+            result = parameterFactory.createSession(user, pass, false, true, true, true, -1);
+         }
+         else
+         {
+            // only auto ack and dups ok are supported
+            switch (ackMode)
+            {
+               case Session.AUTO_ACKNOWLEDGE:
+                  result = parameterFactory.createSession(user, pass, false, true, true, false, 0);
+                  break;
+               case Session.DUPS_OK_ACKNOWLEDGE:
+                  int actDupsOkBatchSize = dupsOkBatchSize != null ? dupsOkBatchSize
+                     : ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
+                  result = parameterFactory.createSession(user, pass, false, true, true, false, actDupsOkBatchSize);
+                  break;
+               default:
+                  throw new IllegalArgumentException("Invalid ackmode: " + ackMode);
+            }
+         }
+      }
+
+      ActiveMQRALogger.LOGGER.debug("Using queue connection " + result);
+
+      return result;
+
+   }
+
+
+   public RecoveryManager getRecoveryManager()
+   {
+      return recoveryManager;
+   }
+
+   /**
+    * Get the resource adapter properties
+    *
+    * @return The properties
+    */
+   protected ActiveMQRAProperties getProperties()
+   {
+      if (ActiveMQResourceAdapter.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProperties()");
+      }
+
+      return raProperties;
+   }
+
+   /**
+    * Setup the factory
+    */
+   protected void setup() throws ActiveMQException
+   {
+      raProperties.init();
+      defaultActiveMQConnectionFactory = createActiveMQConnectionFactory(raProperties);
+      recoveryActiveMQConnectionFactory = createRecoveryActiveMQConnectionFactory(raProperties);
+      recoveryManager.register(recoveryActiveMQConnectionFactory, raProperties.getUserName(), raProperties.getPassword());
+   }
+
+   public Map<ActivationSpec, ActiveMQActivation> getActivations()
+   {
+      return activations;
+   }
+
+   public ActiveMQConnectionFactory getDefaultActiveMQConnectionFactory() throws ResourceException
+   {
+      if (!configured.getAndSet(true))
+      {
+         try
+         {
+            setup();
+         }
+         catch (ActiveMQException e)
+         {
+            throw new ResourceException("Unable to create activation", e);
+         }
+      }
+      return defaultActiveMQConnectionFactory;
+   }
+
+   /**
+    * @param transactionManagerLocatorClass
+    * @see ActiveMQRAProperties#setTransactionManagerLocatorClass(java.lang.String)
+    */
+   public void setTransactionManagerLocatorClass(String transactionManagerLocatorClass)
+   {
+      raProperties.setTransactionManagerLocatorClass(transactionManagerLocatorClass);
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#getTransactionManagerLocatorClass()
+    */
+   public String getTransactionManagerLocatorClass()
+   {
+      return raProperties.getTransactionManagerLocatorClass();
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#getJgroupsChannelLocatorClass()
+    */
+   public String getJgroupsChannelLocatorClass()
+   {
+      return raProperties.getJgroupsChannelLocatorClass();
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#setJgroupsChannelLocatorClass()
+    */
+   public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass)
+   {
+      raProperties.setJgroupsChannelLocatorClass(jgroupsChannelLocatorClass);
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#getJgroupsChannelRefName()
+    */
+   public String getJgroupsChannelRefName()
+   {
+      return raProperties.getJgroupsChannelRefName();
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#setJgroupsChannelRefName()
+    */
+   public void setJgroupsChannelRefName(String jgroupsChannelRefName)
+   {
+      raProperties.setJgroupsChannelRefName(jgroupsChannelRefName);
+   }
+
+   /**
+    * @return
+    * @see ActiveMQRAProperties#getTransactionManagerLocatorMethod()
+    */
+   public String getTransactionManagerLocatorMethod()
+   {
+      return raProperties.getTransactionManagerLocatorMethod();
+   }
+
+   /**
+    * @param transactionManagerLocatorMethod
+    * @see ActiveMQRAProperties#setTransactionManagerLocatorMethod(java.lang.String)
+    */
+   public void setTransactionManagerLocatorMethod(String transactionManagerLocatorMethod)
+   {
+      raProperties.setTransactionManagerLocatorMethod(transactionManagerLocatorMethod);
+   }
+
+   public ActiveMQConnectionFactory createActiveMQConnectionFactory(final ConnectionFactoryProperties overrideProperties)
+   {
+      ActiveMQConnectionFactory cf;
+      List<String> connectorClassName = overrideProperties.getParsedConnectorClassNames() != null ? overrideProperties.getParsedConnectorClassNames()
+         : raProperties.getParsedConnectorClassNames();
+
+      String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress()
+         : getDiscoveryAddress();
+
+      Boolean ha = overrideProperties.isHA() != null ? overrideProperties.isHA() : getHA();
+
+      String jgroupsFileName = overrideProperties.getJgroupsFile() != null ? overrideProperties.getJgroupsFile()
+         : getJgroupsFile();
+
+      String jgroupsChannel = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName()
+         : getJgroupsChannelName();
+
+      String jgroupsLocatorClassName = raProperties.getJgroupsChannelLocatorClass();
+
+      if (ha == null)
+      {
+         ha = ActiveMQClient.DEFAULT_IS_HA;
+      }
+
+      if (discoveryAddress != null || jgroupsFileName != null || jgroupsLocatorClassName != null)
+      {
+         BroadcastEndpointFactoryConfiguration endpointFactoryConfiguration = null;
+
+         if (jgroupsLocatorClassName != null)
+         {
+            String jchannelRefName = raProperties.getJgroupsChannelRefName();
+            JChannel jchannel = ActiveMQRaUtils.locateJGroupsChannel(jgroupsLocatorClassName, jchannelRefName);
+            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jchannel, jgroupsChannel);
+         }
+         else if (discoveryAddress != null)
+         {
+            Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
+               : getDiscoveryPort();
+            if (discoveryPort == null)
+            {
+               discoveryPort = ActiveMQClient.DEFAULT_DISCOVERY_PORT;
+            }
+
+            String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
+               : raProperties.getDiscoveryLocalBindAddress();
+            endpointFactoryConfiguration = new UDPBroadcastGroupConfiguration()
+               .setGroupAddress(discoveryAddress)
+               .setGroupPort(discoveryPort)
+               .setLocalBindAddress(localBindAddress)
+               .setLocalBindPort(-1);
+         }
+         else if (jgroupsFileName != null)
+         {
+            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jgroupsFileName, jgroupsChannel);
+         }
+         Long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
+            : raProperties.getDiscoveryRefreshTimeout();
+         if (refreshTimeout == null)
+         {
+            refreshTimeout = ActiveMQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
+         }
+
+         Long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
+            : raProperties.getDiscoveryInitialWaitTimeout();
+
+         if (initialTimeout == null)
+         {
+            initialTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
+         }
+
+         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration()
+            .setRefreshTimeout(refreshTimeout)
+            .setDiscoveryInitialWaitTimeout(initialTimeout)
+            .setBroadcastEndpointFactoryConfiguration(endpointFactoryConfiguration);
+
+         if (ActiveMQRALogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQRALogger.LOGGER.debug("Creating Connection Factory on the resource adapter for discovery=" + groupConfiguration + " with ha=" + ha);
+         }
+
+         if (ha)
+         {
+            cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.XA_CF);
+         }
+         else
+         {
+            cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
+         }
+      }
+      else if (connectorClassName != null)
+      {
+         TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
+
+         List<Map<String, Object>> connectionParams;
+         if (overrideProperties.getParsedConnectorClassNames() != null)
+         {
+            connectionParams = overrideProperties.getParsedConnectionParameters();
+         }
+         else
+         {
+            connectionParams = raProperties.getParsedConnectionParameters();
+         }
+
+         for (int i = 0; i < connectorClassName.size(); i++)
+         {
+            TransportConfiguration tc;
+            if (connectionParams == null || i >= connectionParams.size())
+            {
+               tc = new TransportConfiguration(connectorClassName.get(i));
+               ActiveMQRALogger.LOGGER.debug("No connector params provided using default");
+            }
+            else
+            {
+               tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
+            }
+
+            transportConfigurations[i] = tc;
+         }
+
+
+         if (ActiveMQRALogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQRALogger.LOGGER.debug("Creating Connection Factory on the resource adapter for transport=" +
+                                            Arrays.toString(transportConfigurations) + " with ha=" + ha);
+         }
+
+         if (ha)
+         {
+            cf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.XA_CF, transportConfigurations);
+         }
+         else
+         {
+            cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, transportConfigurations);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for ActiveMQ ResourceAdapter Connection Factory");
+      }
+
+      setParams(cf, overrideProperties);
+      return cf;
+   }
+
+   public ActiveMQConnectionFactory createRecoveryActiveMQConnectionFactory(final ConnectionFactoryProperties overrideProperties)
+   {
+      ActiveMQConnectionFactory cf;
+      List<String> connectorClassName = overrideProperties.getParsedConnectorClassNames() != null ? overrideProperties.getParsedConnectorClassNames()
+         : raProperties.getParsedConnectorClassNames();
+
+      String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress()
+         : getDiscoveryAddress();
+
+      String jgroupsFileName = overrideProperties.getJgroupsFile() != null ? overrideProperties.getJgroupsFile()
+         : getJgroupsFile();
+
+      String jgroupsChannel = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName()
+         : getJgroupsChannelName();
+
+      if (connectorClassName == null)
+      {
+         BroadcastEndpointFactoryConfiguration endpointFactoryConfiguration = null;
+         if (discoveryAddress != null)
+         {
+            Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
+               : getDiscoveryPort();
+            if (discoveryPort == null)
+            {
+               discoveryPort = ActiveMQClient.DEFAULT_DISCOVERY_PORT;
+            }
+
+            String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
+               : raProperties.getDiscoveryLocalBindAddress();
+            endpointFactoryConfiguration = new UDPBroadcastGroupConfiguration()
+               .setGroupAddress(discoveryAddress)
+               .setGroupPort(discoveryPort)
+               .setLocalBindAddress(localBindAddress)
+               .setLocalBindPort(-1);
+         }
+         else if (jgroupsFileName != null)
+         {
+            endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jgroupsFileName, jgroupsChannel);
+         }
+         else
+         {
+            String jgroupsLocatorClass = raProperties.getJgroupsChannelLocatorClass();
+            if (jgroupsLocatorClass != null)
+            {
+               String jgroupsChannelRefName = raProperties.getJgroupsChannelRefName();
+               JChannel jchannel = ActiveMQRaUtils.locateJGroupsChannel(jgroupsLocatorClass, jgroupsChannelRefName);
+               endpointFactoryConfiguration = new JGroupsBroadcastGroupConfiguration(jchannel, jgroupsChannel);
+            }
+            if (endpointFactoryConfiguration == null)
+            {
+               throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for ActiveMQ ResourceAdapter Connection Factory");
+            }
+         }
+
+         Long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
+            : raProperties.getDiscoveryRefreshTimeout();
+         if (refreshTimeout == null)
+         {
+            refreshTimeout = ActiveMQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
+         }
+
+         Long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
+            : raProperties.getDiscoveryInitialWaitTimeout();
+         if (initialTimeout == null)
+         {
+            initialTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
+         }
+         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration()
+            .setRefreshTimeout(refreshTimeout)
+            .setDiscoveryInitialWaitTimeout(initialTimeout)
+            .setBroadcastEndpointFactoryConfiguration(endpointFactoryConfiguration);
+
+         groupConfiguration.setRefreshTimeout(refreshTimeout);
+
+         if (ActiveMQRALogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQRALogger.LOGGER.debug("Creating Recovery Connection Factory on the resource adapter for discovery=" + groupConfiguration);
+         }
+
+         cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
+      }
+      else
+      {
+         TransportConfiguration[] transportConfigurations = new TransportConfiguration[connectorClassName.size()];
+
+         List<Map<String, Object>> connectionParams;
+         if (overrideProperties.getParsedConnectorClassNames() != null)
+         {
+            connectionParams = overrideProperties.getParsedConnectionParameters();
+         }
+         else
+         {
+            connectionParams = raProperties.getParsedConnectionParameters();
+         }
+
+         for (int i = 0; i < connectorClassName.size(); i++)
+         {
+            TransportConfiguration tc;
+            if (connectionParams == null || i >= connectionParams.size())
+            {
+               tc = new TransportConfiguration(connectorClassName.get(i));
+               ActiveMQRALogger.LOGGER.debug("No connector params provided using default");
+            }
+            else
+            {
+               tc = new TransportConfiguration(connectorClassName.get(i), connectionParams.get(i));
+            }
+
+            transportConfigurations[i] = tc;
+         }
+
+
+         if (ActiveMQRALogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQRALogger.LOGGER.debug("Creating Recovery Connection Factory on the resource adapter for transport=" +
+                                            Arrays.toString(transportConfigurations));
+         }
+
+         cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, transportConfigurations);
+      }
+      setParams(cf, overrideProperties);
+
+      //now make sure we are HA in any way
+
+      cf.setReconnectAttempts(0);
+      cf.setInitialConnectAttempts(0);
+      return cf;
+   }
+
+   public Map<String, Object> overrideConnectionParameters(final Map<String, Object> connectionParams,
+                                                           final Map<String, Object> overrideConnectionParams)
+   {
+      Map<String, Object> map = new HashMap<String, Object>();
+      if (connectionParams != null)
+      {
+         map.putAll(connectionParams);
+      }
+      if (overrideConnectionParams != null)
+      {
+         for (Map.Entry<String, Object> stringObjectEntry : overrideConnectionParams.entrySet())
+         {
+            map.put(stringObjectEntry.getKey(), stringObjectEntry.getValue());
+         }
+      }
+      return map;
+   }
+
+   private void locateTM()
+   {
+      String[] locatorClasses = raProperties.getTransactionManagerLocatorClass().split(";");
+      String[] locatorMethods = raProperties.getTransactionManagerLocatorMethod().split(";");
+
+      for (int i = 0; i < locatorClasses.length; i++)
+      {
+         tm = ActiveMQRaUtils.locateTM(locatorClasses[i], locatorMethods[i]);
+         if (tm != null)
+         {
+            break;
+         }
+      }
+
+      if (tm == null)
+      {
+         ActiveMQRALogger.LOGGER.noTXLocator();
+      }
+      else
+      {
+         ActiveMQRALogger.LOGGER.debug("TM located = " + tm);
+      }
+   }
+
+
+   private void setParams(final ActiveMQConnectionFactory cf,
+                          final ConnectionFactoryProperties overrideProperties)
+   {
+      Boolean val = overrideProperties.isAutoGroup() != null ? overrideProperties.isAutoGroup()
+         : raProperties.isAutoGroup();
+      if (val != null)
+      {
+         cf.setAutoGroup(val);
+      }
+      val = overrideProperties.isBlockOnAcknowledge() != null ? overrideProperties.isBlockOnAcknowledge()
+         : raProperties.isBlockOnAcknowledge();
+      if (val != null)
+      {
+         cf.setBlockOnAcknowledge(val);
+      }
+      val = overrideProperties.isBlockOnNonDurableSend() != null ? overrideProperties.isBlockOnNonDurableSend()
+         : raProperties.isBlockOnNonDurableSend();
+      if (val != null)
+      {
+         cf.setBlockOnNonDurableSend(val);
+      }
+      val = overrideProperties.isBlockOnDurableSend() != null ? overrideProperties.isBlockOnDurableSend()
+         : raProperties.isBlockOnDurableSend();
+      if (val != null)
+      {
+         cf.setBlockOnDurableSend(val);
+      }
+      val = overrideProperties.isPreAcknowledge() != null ? overrideProperties.isPreAcknowledge()
+         : raProperties.isPreAcknowledge();
+      if (val != null)
+      {
+         cf.setPreAcknowledge(val);
+      }
+      val = overrideProperties.isUseGlobalPools() != null ? overrideProperties.isUseGlobalPools()
+         : raProperties.isUseGlobalPools();
+      if (val != null)
+      {
+         cf.setUseGlobalPools(val);
+      }
+
+      val = overrideProperties.isCacheLargeMessagesClient() != null ? overrideProperties.isCacheLargeMessagesClient()
+         : raProperties.isCacheLargeMessagesClient();
+      if (val != null)
+      {
+         cf.setCacheLargeMessagesClient(val);
+      }
+
+      val = overrideProperties.isCompressLargeMessage() != null ? overrideProperties.isCompressLargeMessage()
+         : raProperties.isCompressLargeMessage();
+      if (val != null)
+      {
+         cf.setCompressLargeMessage(val);
+      }
+
+      val = overrideProperties.isFailoverOnInitialConnection() != null ? overrideProperties.isFailoverOnInitialConnection()
+         : raProperties.isFailoverOnInitialConnection();
+      if (val != null)
+      {
+         cf.setFailoverOnInitialConnection(val);
+      }
+
+      Integer val2 = overrideProperties.getConsumerMaxRate() != null ? overrideProperties.getConsumerMaxRate()
+         : raProperties.getConsumerMaxRate();
+      if (val2 != null)
+      {
+         cf.setConsumerMaxRate(val2);
+      }
+      val2 = overrideProperties.getConsumerWindowSize() != null ? overrideProperties.getConsumerWindowSize()
+         : raProperties.getConsumerWindowSize();
+      if (val2 != null)
+      {
+         cf.setConsumerWindowSize(val2);
+      }
+      val2 = overrideProperties.getDupsOKBatchSize() != null ? overrideProperties.getDupsOKBatchSize()
+         : raProperties.getDupsOKBatchSize();
+      if (val2 != null)
+      {
+         cf.setDupsOKBatchSize(val2);
+      }
+
+      val2 = overrideProperties.getMinLargeMessageSize() != null ? overrideProperties.getMinLargeMessageSize()
+         : raProperties.getMinLargeMessageSize();
+      if (val2 != null)
+      {
+         cf.setMinLargeMessageSize(val2);
+      }
+      val2 = overrideProperties.getProducerMaxRate() != null ? overrideProperties.getProducerMaxRate()
+         : raProperties.getProducerMaxRate();
+      if (val2 != null)
+      {
+         cf.setProducerMaxRate(val2);
+      }
+      val2 = overrideProperties.getProducerWindowSize() != null ? overrideProperties.getProducerWindowSize()
+         : raProperties.getProducerWindowSize();
+      if (val2 != null)
+      {
+         cf.setProducerWindowSize(val2);
+      }
+      val2 = overrideProperties.getConfirmationWindowSize() != null ? overrideProperties.getConfirmationWindowSize()
+         : raProperties.getConfirmationWindowSize();
+      if (val2 != null)
+      {
+         cf.setConfirmationWindowSize(val2);
+      }
+      val2 = overrideProperties.getReconnectAttempts() != null ? overrideProperties.getReconnectAttempts()
+         : raProperties.getReconnectAttempts();
+      if (val2 != null)
+      {
+         cf.setReconnectAttempts(val2);
+      }
+      else
+      {
+         //the global default is 0 but we should always try to reconnect JCA
+         cf.setReconnectAttempts(-1);
+      }
+      val2 = overrideProperties.getThreadPoolMaxSize() != null ? overrideProperties.getThreadPoolMaxSize()
+         : raProperties.getThreadPoolMaxSize();
+      if (val2 != null)
+      {
+         cf.setThreadPoolMaxSize(val2);
+      }
+      val2 = overrideProperties.getScheduledThreadPoolMaxSize() != null ? overrideProperties.getScheduledThreadPoolMaxSize()
+         : raProperties.getScheduledThreadPoolMaxSize();
+      if (val2 != null)
+      {
+         cf.setScheduledThreadPoolMaxSize(val2);
+      }
+      val2 = overrideProperties.getTransactionBatchSize() != null ? overrideProperties.getTransactionBatchSize()
+         : raProperties.getTransactionBatchSize();
+      if (val2 != null)
+      {
+         cf.setTransactionBatchSize(val2);
+      }
+      val2 = overrideProperties.getInitialConnectAttempts() != null ? overrideProperties.getInitialConnectAttempts()
+         : raProperties.getInitialConnectAttempts();
+      if (val2 != null)
+      {
+         cf.setInitialConnectAttempts(val2);
+      }
+      val2 = overrideProperties.getInitialMessagePacketSize() != null ? overrideProperties.getInitialMessagePacketSize()
+         : raProperties.getInitialMessagePacketSize();
+      if (val2 != null)
+      {
+         cf.setInitialMessagePacketSize(val2);
+      }
+
+      Long val3 = overrideProperties.getClientFailureCheckPeriod() != null ? overrideProperties.getClientFailureCheckPeriod()
+         : raProperties.getClientFailureCheckPeriod();
+      if (val3 != null)
+      {
+         cf.setClientFailureCheckPeriod(val3);
+      }
+      val3 = overrideProperties.getCallTimeout() != null ? overrideProperties.getCallTimeout()
+         : raProperties.getCallTimeout();
+      if (val3 != null)
+      {
+         cf.setCallTimeout(val3);
+      }
+      val3 = overrideProperties.getCallFailoverTimeout() != null ? overrideProperties.getCallFailoverTimeout()
+         : raProperties.getCallFailoverTimeout();
+      if (val3 != null)
+      {
+         cf.setCallFailoverTimeout(val3);
+      }
+      val3 = overrideProperties.getConnectionTTL() != null ? overrideProperties.getConnectionTTL()
+         : raProperties.getConnectionTTL();
+      if (val3 != null)
+      {
+         cf.setConnectionTTL(val3);
+      }
+
+      val3 = overrideProperties.getRetryInterval() != null ? overrideProperties.getRetryInterval()
+         : raProperties.getRetryInterval();
+      if (val3 != null)
+      {
+         cf.setRetryInterval(val3);
+      }
+
+      val3 = overrideProperties.getMaxRetryInterval() != null ? overrideProperties.getMaxRetryInterval()
+         : raProperties.getMaxRetryInterval();
+      if (val3 != null)
+      {
+         cf.setMaxRetryInterval(val3);
+      }
+
+      Double val4 = overrideProperties.getRetryIntervalMultiplier() != null ? overrideProperties.getRetryIntervalMultiplier()
+         : raProperties.getRetryIntervalMultiplier();
+      if (val4 != null)
+      {
+         cf.setRetryIntervalMultiplier(val4);
+      }
+      String val5 = overrideProperties.getClientID() != null ? overrideProperties.getClientID()
+         : raProperties.getClientID();
+      if (val5 != null)
+      {
+         cf.setClientID(val5);
+      }
+      val5 = overrideProperties.getConnectionLoadBalancingPolicyClassName() != null ? overrideProperties.getConnectionLoadBalancingPolicyClassName()
+         : raProperties.getConnectionLoadBalancingPolicyClassName();
+      if (val5 != null)
+      {
+         cf.setConnectionLoadBalancingPolicyClassName(val5);
+      }
+   }
+
+   public void setManagedConnectionFactory(ActiveMQRAManagedConnectionFactory activeMQRAManagedConnectionFactory)
+   {
+      managedConnectionFactories.add(activeMQRAManagedConnectionFactory);
+   }
+
+   public SensitiveDataCodec<String> getCodecInstance()
+   {
+      return raProperties.getCodecInstance();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQXAResourceWrapper.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQXAResourceWrapper.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQXAResourceWrapper.java
new file mode 100644
index 0000000..b862424
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQXAResourceWrapper.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.ra;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.apache.activemq.core.client.impl.ActiveMQXAResource;
+import org.apache.activemq.utils.VersionLoader;
+
+/**
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ *
+ * Wraps XAResource with org.jboss.tm.XAResourceWrapper.  This adds extra meta-data to to the XAResource used by
+ * Transaction Manager for recovery scenarios.
+ */
+
+public class ActiveMQXAResourceWrapper implements org.jboss.tm.XAResourceWrapper, org.jboss.jca.core.spi.transaction.xa.XAResourceWrapper, ActiveMQXAResource
+{
+   private final XAResource xaResource;
+
+   // The EIS Name
+   private final String productName;
+
+   // The EIS Version
+   private final String productVersion;
+
+   // A composite of NodeID + JNDIName that allows adminstrator looking at an XAResource to determine it's origin.
+   private final String jndiNameNodeId;
+
+   /**
+    * Creates a new XAResourceWrapper.  PRODUCT_NAME, productVersion and jndiName are useful for log output in the
+    * Transaction Manager.  For ActiveMQ only the resourceManagerID is required to allow Transaction Manager to recover
+    * from relevant recovery scenarios.
+    *
+    * @param xaResource
+    * @param jndiName
+    */
+   public ActiveMQXAResourceWrapper(XAResource xaResource, String jndiName, String nodeId)
+   {
+      this.xaResource = xaResource;
+      this.productName = ActiveMQResourceAdapter.PRODUCT_NAME;
+      this.productVersion = VersionLoader.getVersion().getFullVersion();
+      this.jndiNameNodeId = jndiName + " NodeId:" + nodeId;
+   }
+
+   @Override
+   public XAResource getResource()
+   {
+      return xaResource;
+   }
+
+   @Override
+   public String getProductName()
+   {
+      return productName;
+   }
+
+   @Override
+   public String getProductVersion()
+   {
+      return productVersion;
+   }
+
+   @Override
+   public String getJndiName()
+   {
+      return jndiNameNodeId;
+   }
+
+   @Override
+   public void commit(Xid xid, boolean b) throws XAException
+   {
+      getResource().commit(xid, b);
+   }
+
+   @Override
+   public void end(Xid xid, int i) throws XAException
+   {
+      getResource().end(xid, i);
+   }
+
+   @Override
+   public void forget(Xid xid) throws XAException
+   {
+      getResource().forget(xid);
+   }
+
+   @Override
+   public int getTransactionTimeout() throws XAException
+   {
+      return getResource().getTransactionTimeout();
+   }
+
+   @Override
+   public boolean isSameRM(XAResource xaResource) throws XAException
+   {
+      return getResource().isSameRM(xaResource);
+   }
+
+   @Override
+   public int prepare(Xid xid) throws XAException
+   {
+      return getResource().prepare(xid);
+   }
+
+   @Override
+   public Xid[] recover(int i) throws XAException
+   {
+      return getResource().recover(i);
+   }
+
+   @Override
+   public void rollback(Xid xid) throws XAException
+   {
+      getResource().rollback(xid);
+   }
+
+   @Override
+   public boolean setTransactionTimeout(int i) throws XAException
+   {
+      return getResource().setTransactionTimeout(i);
+   }
+
+   @Override
+   public void start(Xid xid, int i) throws XAException
+   {
+      getResource().start(xid, i);
+   }
+
+}


[32/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/JMSManagementService.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/JMSManagementService.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/JMSManagementService.java
index 79c81d3..3f14f55 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/JMSManagementService.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/JMSManagementService.java
@@ -14,9 +14,9 @@ package org.apache.activemq.jms.server.management;
 
 import org.apache.activemq.api.jms.management.JMSServerControl;
 import org.apache.activemq.core.server.Queue;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQQueue;
-import org.apache.activemq.jms.client.HornetQTopic;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQQueue;
+import org.apache.activemq.jms.client.ActiveMQTopic;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 
@@ -31,15 +31,15 @@ public interface JMSManagementService
 
    void unregisterJMSServer() throws Exception;
 
-   void registerQueue(HornetQQueue queue, Queue serverQueue) throws Exception;
+   void registerQueue(ActiveMQQueue queue, Queue serverQueue) throws Exception;
 
    void unregisterQueue(String name) throws Exception;
 
-   void registerTopic(HornetQTopic topic) throws Exception;
+   void registerTopic(ActiveMQTopic topic) throws Exception;
 
    void unregisterTopic(String name) throws Exception;
 
-   void registerConnectionFactory(String name, ConnectionFactoryConfiguration config, HornetQConnectionFactory connectionFactory) throws Exception;
+   void registerConnectionFactory(String name, ConnectionFactoryConfiguration config, ActiveMQConnectionFactory connectionFactory) throws Exception;
 
    void unregisterConnectionFactory(String name) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/impl/JMSManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/impl/JMSManagementServiceImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/impl/JMSManagementServiceImpl.java
index 151a20d..650f97e 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/impl/JMSManagementServiceImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/management/impl/JMSManagementServiceImpl.java
@@ -23,12 +23,12 @@ import org.apache.activemq.api.jms.management.JMSServerControl;
 import org.apache.activemq.api.jms.management.TopicControl;
 import org.apache.activemq.core.messagecounter.MessageCounter;
 import org.apache.activemq.core.messagecounter.MessageCounterManager;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.management.ManagementService;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQQueue;
-import org.apache.activemq.jms.client.HornetQTopic;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQQueue;
+import org.apache.activemq.jms.client.ActiveMQTopic;
 import org.apache.activemq.jms.management.impl.JMSConnectionFactoryControlImpl;
 import org.apache.activemq.jms.management.impl.JMSQueueControlImpl;
 import org.apache.activemq.jms.management.impl.JMSServerControlImpl;
@@ -54,7 +54,7 @@ public class JMSManagementServiceImpl implements JMSManagementService
 
    // Static --------------------------------------------------------
 
-   public JMSManagementServiceImpl(final ManagementService managementService, final HornetQServer server, final JMSServerManager jmsServerManager)
+   public JMSManagementServiceImpl(final ManagementService managementService, final ActiveMQServer server, final JMSServerManager jmsServerManager)
    {
       this.managementService = managementService;
       this.jmsServerManager = jmsServerManager;
@@ -80,7 +80,7 @@ public class JMSManagementServiceImpl implements JMSManagementService
       managementService.unregisterFromRegistry(ResourceNames.JMS_SERVER);
    }
 
-   public synchronized void registerQueue(final HornetQQueue queue, final Queue serverQueue) throws Exception
+   public synchronized void registerQueue(final ActiveMQQueue queue, final Queue serverQueue) throws Exception
    {
       QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue.getAddress());
       MessageCounterManager messageCounterManager = managementService.getMessageCounterManager();
@@ -104,7 +104,7 @@ public class JMSManagementServiceImpl implements JMSManagementService
       managementService.unregisterFromRegistry(ResourceNames.JMS_QUEUE + name);
    }
 
-   public synchronized void registerTopic(final HornetQTopic topic) throws Exception
+   public synchronized void registerTopic(final ActiveMQTopic topic) throws Exception
    {
       ObjectName objectName = managementService.getObjectNameBuilder().getJMSTopicObjectName(topic.getTopicName());
       AddressControl addressControl = (AddressControl)managementService.getResource(ResourceNames.CORE_ADDRESS + topic.getAddress());
@@ -122,7 +122,7 @@ public class JMSManagementServiceImpl implements JMSManagementService
 
    public synchronized void registerConnectionFactory(final String name,
                                                       final ConnectionFactoryConfiguration cfConfig,
-                                                      final HornetQConnectionFactory connectionFactory) throws Exception
+                                                      final ActiveMQConnectionFactory connectionFactory) throws Exception
    {
       ObjectName objectName = managementService.getObjectNameBuilder().getConnectionFactoryObjectName(name);
       JMSConnectionFactoryControlImpl control = new JMSConnectionFactoryControlImpl(cfConfig, connectionFactory, jmsServerManager, name);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRecoveryRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRecoveryRegistry.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRecoveryRegistry.java
new file mode 100644
index 0000000..797fe83
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRecoveryRegistry.java
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server.recovery;
+
+import javax.transaction.xa.XAResource;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
+import org.jboss.tm.XAResourceRecovery;
+
+/**
+ * <p>This class is used by the Resource Adapter to register RecoveryDiscovery, which is based on the {@link XARecoveryConfig}</p>
+ * <p>Each outbound or inboud connection will pass the configuration here through by calling the method {@link ActiveMQRecoveryRegistry#register(XARecoveryConfig)}</p>
+ * <p>Later the {@link RecoveryDiscovery} will call {@link ActiveMQRecoveryRegistry#nodeUp(String, Pair, String, String)}
+ * so we will keep a track of nodes on the cluster
+ * or nodes where this server is connected to. </p>
+ *
+ * @author clebertsuconic
+ */
+public class ActiveMQRecoveryRegistry implements XAResourceRecovery
+{
+
+   private static final ActiveMQRecoveryRegistry theInstance = new ActiveMQRecoveryRegistry();
+
+   private final ConcurrentHashMap<XARecoveryConfig, RecoveryDiscovery> configSet = new ConcurrentHashMap<XARecoveryConfig, RecoveryDiscovery>();
+
+   /**
+    * The list by server id and resource adapter wrapper, what will actually be calling recovery.
+    * This will be returned by getXAResources
+    */
+   private final ConcurrentHashMap<String, ActiveMQXAResourceWrapper> recoveries = new ConcurrentHashMap<String, ActiveMQXAResourceWrapper>();
+
+   /**
+    * In case of failures, we retry on the next getXAResources
+    */
+   private final Set<RecoveryDiscovery> failedDiscoverySet = new HashSet<RecoveryDiscovery>();
+
+   private ActiveMQRecoveryRegistry()
+   {
+   }
+
+   /**
+    * This will be called periodically by the Transaction Manager
+    */
+   public XAResource[] getXAResources()
+   {
+      try
+      {
+         checkFailures();
+
+         ActiveMQXAResourceWrapper[] resourceArray = new ActiveMQXAResourceWrapper[recoveries.size()];
+         resourceArray = recoveries.values().toArray(resourceArray);
+
+         if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug("\n=======================================================================================");
+            ActiveMQJMSServerLogger.LOGGER.debug("Returning the following list on getXAREsources:");
+            for (Map.Entry<String, ActiveMQXAResourceWrapper> entry : recoveries.entrySet())
+            {
+               ActiveMQJMSServerLogger.LOGGER.debug("server-id=" + entry.getKey() + ", value=" + entry.getValue());
+            }
+            ActiveMQJMSServerLogger.LOGGER.debug("=======================================================================================\n");
+         }
+
+         return resourceArray;
+      }
+      catch (Throwable e)
+      {
+         ActiveMQJMSServerLogger.LOGGER.warn(e.getMessage(), e);
+         return new XAResource[]{};
+      }
+   }
+
+   public static ActiveMQRecoveryRegistry getInstance()
+   {
+      return theInstance;
+   }
+
+   /**
+    * This will be called by then resource adapters, to register a new discovery
+    *
+    * @param resourceConfig
+    */
+   public void register(final XARecoveryConfig resourceConfig)
+   {
+      RecoveryDiscovery newInstance = new RecoveryDiscovery(resourceConfig);
+      RecoveryDiscovery discoveryRecord = configSet.putIfAbsent(resourceConfig, newInstance);
+      if (discoveryRecord == null)
+      {
+         discoveryRecord = newInstance;
+         discoveryRecord.start(false);
+      }
+      // you could have a configuration shared with multiple MDBs or RAs
+      discoveryRecord.incrementUsage();
+   }
+
+   /**
+    * Reference counts and deactivate a configuration
+    * Notice: this won't remove the servers since a server may have previous XIDs
+    *
+    * @param resourceConfig
+    */
+   public void unRegister(final XARecoveryConfig resourceConfig)
+   {
+      RecoveryDiscovery discoveryRecord = configSet.get(resourceConfig);
+      if (discoveryRecord != null && discoveryRecord.decrementUsage() == 0)
+      {
+         discoveryRecord = configSet.remove(resourceConfig);
+         if (discoveryRecord != null)
+         {
+            discoveryRecord.stop();
+         }
+      }
+   }
+
+   /**
+    * We need to make sure that all resources are closed, we don't actually do this when a resourceConfig is closed but
+    * maybe we should.
+    */
+   public void stop()
+   {
+      for (RecoveryDiscovery recoveryDiscovery : configSet.values())
+      {
+         recoveryDiscovery.stop();
+      }
+      for (ActiveMQXAResourceWrapper activeMQXAResourceWrapper : recoveries.values())
+      {
+         activeMQXAResourceWrapper.close();
+      }
+      recoveries.clear();
+      configSet.clear();
+   }
+
+   /**
+    * in case of a failure the Discovery will register itslef to retry
+    *
+    * @param failedDiscovery
+    */
+   public void failedDiscovery(RecoveryDiscovery failedDiscovery)
+   {
+      ActiveMQJMSServerLogger.LOGGER.debug("RecoveryDiscovery being set to restart:" + failedDiscovery);
+      synchronized (failedDiscoverySet)
+      {
+         failedDiscoverySet.add(failedDiscovery);
+      }
+   }
+
+   /**
+    * @param nodeID
+    * @param networkConfiguration
+    * @param username
+    * @param password
+    */
+   public void nodeUp(String nodeID,
+                      Pair<TransportConfiguration, TransportConfiguration> networkConfiguration,
+                      String username,
+                      String password)
+   {
+
+      if (recoveries.get(nodeID) == null)
+      {
+         if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug(nodeID + " being registered towards " + networkConfiguration);
+         }
+         XARecoveryConfig config = new XARecoveryConfig(true,
+                                                        extractTransportConfiguration(networkConfiguration),
+                                                        username,
+                                                        password);
+
+         ActiveMQXAResourceWrapper wrapper = new ActiveMQXAResourceWrapper(config);
+         recoveries.putIfAbsent(nodeID, wrapper);
+      }
+   }
+
+   public void nodeDown(String nodeID)
+   {
+   }
+
+   /**
+    * this will go through the list of retries
+    */
+   private void checkFailures()
+   {
+      final HashSet<RecoveryDiscovery> failures = new HashSet<RecoveryDiscovery>();
+
+      // it will transfer all the discoveries to a new collection
+      synchronized (failedDiscoverySet)
+      {
+         failures.addAll(failedDiscoverySet);
+         failedDiscoverySet.clear();
+      }
+
+      if (failures.size() > 0)
+      {
+         // This shouldn't happen on a regular scenario, however when this retry happens this needs
+         // to be done on a new thread
+         Thread t = new Thread("ActiveMQ Recovery Discovery Reinitialization")
+         {
+            @Override
+            public void run()
+            {
+               for (RecoveryDiscovery discovery : failures)
+               {
+                  try
+                  {
+                     ActiveMQJMSServerLogger.LOGGER.debug("Retrying discovery " + discovery);
+                     discovery.start(true);
+                  }
+                  catch (Throwable e)
+                  {
+                     ActiveMQJMSServerLogger.LOGGER.warn(e.getMessage(), e);
+                  }
+               }
+            }
+         };
+
+         t.start();
+      }
+   }
+
+   /**
+    * @param networkConfiguration
+    * @return
+    */
+   private TransportConfiguration[] extractTransportConfiguration(Pair<TransportConfiguration, TransportConfiguration> networkConfiguration)
+   {
+      if (networkConfiguration.getB() != null)
+      {
+         return new TransportConfiguration[]{networkConfiguration.getA(), networkConfiguration.getB()};
+      }
+      return new TransportConfiguration[]{networkConfiguration.getA()};
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRegistryBase.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRegistryBase.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRegistryBase.java
new file mode 100644
index 0000000..d232831
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQRegistryBase.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server.recovery;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.jboss.tm.XAResourceRecoveryRegistry;
+
+/**
+ * This class is a base class for the integration layer where
+ * This class is used on integration points and this is just a bridge to the real registry at
+ * {@link ActiveMQRecoveryRegistry}
+ *
+ * @author Clebert
+ *
+ *
+ */
+public abstract class ActiveMQRegistryBase
+{
+
+   private final AtomicBoolean started = new AtomicBoolean(false);
+
+   public ActiveMQRegistryBase()
+   {
+   }
+
+
+   public abstract XAResourceRecoveryRegistry getTMRegistry();
+
+   public void register(final XARecoveryConfig resourceConfig)
+   {
+      init();
+      ActiveMQRecoveryRegistry.getInstance().register(resourceConfig);
+   }
+
+
+
+   public void unRegister(final XARecoveryConfig resourceConfig)
+   {
+      init();
+      ActiveMQRecoveryRegistry.getInstance().unRegister(resourceConfig);
+   }
+
+   public void stop()
+   {
+      if (started.compareAndSet(true, false) && getTMRegistry() != null)
+      {
+         getTMRegistry().removeXAResourceRecovery(ActiveMQRecoveryRegistry.getInstance());
+         ActiveMQRecoveryRegistry.getInstance().stop();
+      }
+   }
+
+   private void init()
+   {
+      if (started.compareAndSet(false, true) && getTMRegistry() != null)
+      {
+         getTMRegistry().addXAResourceRecovery(ActiveMQRecoveryRegistry.getInstance());
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceRecovery.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceRecovery.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceRecovery.java
new file mode 100644
index 0000000..1cd59f4
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceRecovery.java
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server.recovery;
+
+import javax.transaction.xa.XAResource;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.ats.jta.recovery.XAResourceRecovery;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
+
+/**
+ * A XAResourceRecovery instance that can be used to recover any JMS provider.
+ * <p>
+ * In reality only recover, rollback and commit will be called but we still need to be implement all
+ * methods just in case.
+ * <p>
+ * To enable this add the following to the jbossts-properties file
+ * <pre>
+ * &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.ACTIVEMQ1"
+ *                 value="org.apache.activemq.jms.server.recovery.ActiveMQXAResourceRecovery;org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory"/&gt;
+ * </pre>
+ * <p>
+ * you'll need something like this if the ActiveMQ Server is remote
+ * <pre>
+ *      &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.ACTIVEMQ2"
+ *                  value="org.apache.activemq.jms.server.recovery.ActiveMQXAResourceRecovery;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost,port=5445"/&gt;
+ * </pre>
+ * <p>
+ * you'll need something like this if the ActiveMQ Server is remote and has failover configured
+ * <pre>
+ *             &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.ACTIVEMQ2"
+ *                       value="org.apache.activemq.jms.server.recovery.ActiveMQXAResourceRecovery;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost,port=5445;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost2,port=5446"/&gt;
+ * </pre>
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ */
+public class ActiveMQXAResourceRecovery implements XAResourceRecovery
+{
+   private final boolean trace = ActiveMQJMSServerLogger.LOGGER.isTraceEnabled();
+
+   private boolean hasMore;
+
+   private ActiveMQXAResourceWrapper res;
+
+   public ActiveMQXAResourceRecovery()
+   {
+      if (trace)
+      {
+         ActiveMQJMSServerLogger.LOGGER.trace("Constructing ActiveMQXAResourceRecovery");
+      }
+   }
+
+   public boolean initialise(final String config)
+   {
+      if (ActiveMQJMSServerLogger.LOGGER.isTraceEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.trace(this + " intialise: " + config);
+      }
+
+      String[] configs = config.split(";");
+      XARecoveryConfig[] xaRecoveryConfigs = new XARecoveryConfig[configs.length];
+      for (int i = 0, configsLength = configs.length; i < configsLength; i++)
+      {
+         String s = configs[i];
+         ConfigParser parser = new ConfigParser(s);
+         String connectorFactoryClassName = parser.getConnectorFactoryClassName();
+         Map<String, Object> connectorParams = parser.getConnectorParameters();
+         String username = parser.getUsername();
+         String password = parser.getPassword();
+         TransportConfiguration transportConfiguration = new TransportConfiguration(connectorFactoryClassName, connectorParams);
+         xaRecoveryConfigs[i] = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfiguration}, username, password);
+      }
+
+
+      res = new ActiveMQXAResourceWrapper(xaRecoveryConfigs);
+
+      if (ActiveMQJMSServerLogger.LOGGER.isTraceEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.trace(this + " initialised");
+      }
+
+      return true;
+   }
+
+   public boolean hasMoreResources()
+   {
+      if (ActiveMQJMSServerLogger.LOGGER.isTraceEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.trace(this + " hasMoreResources");
+      }
+
+      /*
+       * The way hasMoreResources is supposed to work is as follows:
+       * For each "sweep" the recovery manager will call hasMoreResources, then if it returns
+       * true it will call getXAResource.
+       * It will repeat that until hasMoreResources returns false.
+       * Then the sweep is over.
+       * For the next sweep hasMoreResources should return true, etc.
+       *
+       * In our case where we only need to return one XAResource per sweep,
+       * hasMoreResources should basically alternate between true and false.
+       *
+       *
+       */
+
+      hasMore = !hasMore;
+
+      return hasMore;
+   }
+
+   public XAResource getXAResource()
+   {
+      if (ActiveMQJMSServerLogger.LOGGER.isTraceEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.trace(this + " getXAResource");
+      }
+
+      return res;
+   }
+
+   public XAResource[] getXAResources()
+   {
+      return new XAResource[]{res};
+   }
+
+   @Override
+   protected void finalize()
+   {
+      res.close();
+   }
+
+   public static class ConfigParser
+   {
+      private final String connectorFactoryClassName;
+
+      private final Map<String, Object> connectorParameters;
+
+      private String username;
+
+      private String password;
+
+      public ConfigParser(final String config)
+      {
+         if (config == null || config.length() == 0)
+         {
+            throw new IllegalArgumentException("Must specify provider connector factory class name in config");
+         }
+
+         String[] strings = config.split(",");
+
+         // First (mandatory) param is the connector factory class name
+         if (strings.length < 1)
+         {
+            throw new IllegalArgumentException("Must specify provider connector factory class name in config");
+         }
+
+         connectorFactoryClassName = strings[0].trim();
+
+         // Next two (optional) parameters are the username and password to use for creating the session for recovery
+
+         if (strings.length >= 2)
+         {
+
+            username = strings[1].trim();
+            if (username.length() == 0)
+            {
+               username = null;
+            }
+
+            if (strings.length == 2)
+            {
+               throw new IllegalArgumentException("If username is specified, password must be specified too");
+            }
+
+            password = strings[2].trim();
+            if (password.length() == 0)
+            {
+               password = null;
+            }
+         }
+
+         // other tokens are for connector configurations
+         connectorParameters = new HashMap<String, Object>();
+         if (strings.length >= 3)
+         {
+            for (int i = 3; i < strings.length; i++)
+            {
+               String[] str = strings[i].split("=");
+               if (str.length == 2)
+               {
+                  connectorParameters.put(str[0].trim(), str[1].trim());
+               }
+            }
+         }
+      }
+
+      public String getConnectorFactoryClassName()
+      {
+         return connectorFactoryClassName;
+      }
+
+      public Map<String, Object> getConnectorParameters()
+      {
+         return connectorParameters;
+      }
+
+      public String getUsername()
+      {
+         return username;
+      }
+
+      public String getPassword()
+      {
+         return password;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceWrapper.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceWrapper.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceWrapper.java
new file mode 100644
index 0000000..04a7457
--- /dev/null
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/ActiveMQXAResourceWrapper.java
@@ -0,0 +1,531 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.server.recovery;
+
+import java.util.Arrays;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.ActiveMQNotConnectedException;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.ActiveMQClient;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.core.client.SessionFailureListener;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
+
+/**
+ * XAResourceWrapper.
+ *
+ * Mainly from org.jboss.server.XAResourceWrapper from the JBoss AS server module
+ *
+ * The reason why we don't use that class directly is that it assumes on failure of connection
+ * the RM_FAIL or RM_ERR is thrown, but in ActiveMQ we throw XA_RETRY since we want the recovery manager to be able
+ * to retry on failure without having to manually retry
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *
+ * @version $Revision: 45341 $
+ */
+public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureListener
+{
+   /** The state lock */
+   private static final Object lock = new Object();
+
+   private ServerLocator serverLocator;
+
+   private ClientSessionFactory csf;
+
+   private ClientSession delegate;
+
+   private XARecoveryConfig[] xaRecoveryConfigs;
+
+   public ActiveMQXAResourceWrapper(XARecoveryConfig... xaRecoveryConfigs)
+   {
+      this.xaRecoveryConfigs = xaRecoveryConfigs;
+
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("Recovery configured with " + Arrays.toString(xaRecoveryConfigs) +
+            ", instance=" +
+            System.identityHashCode(this));
+      }
+   }
+
+   public Xid[] recover(final int flag) throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("looking for recover at " + xaResource + " configuration " + Arrays.toString(this.xaRecoveryConfigs));
+      }
+
+      try
+      {
+         Xid[] xids = xaResource.recover(flag);
+
+         if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled() && xids != null && xids.length > 0)
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug("Recovering these following IDs " + Arrays.toString(xids) + " at " + this);
+         }
+
+         return xids;
+      }
+      catch (XAException e)
+      {
+         ActiveMQJMSServerLogger.LOGGER.xaRecoverError(e);
+         throw check(e);
+      }
+   }
+
+   public void commit(final Xid xid, final boolean onePhase) throws XAException
+   {
+      XAResource xaResource = getDelegate(true);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("Commit " + xaResource + " xid " + " onePhase=" + onePhase);
+      }
+      try
+      {
+         xaResource.commit(xid, onePhase);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public void rollback(final Xid xid) throws XAException
+   {
+      XAResource xaResource = getDelegate(true);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("Rollback " + xaResource + " xid ");
+      }
+      try
+      {
+         xaResource.rollback(xid);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public void forget(final Xid xid) throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("Forget " + xaResource + " xid ");
+      }
+
+      try
+      {
+         xaResource.forget(xid);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public boolean isSameRM(XAResource xaRes) throws XAException
+   {
+      if (xaRes instanceof ActiveMQXAResourceWrapper)
+      {
+         xaRes = ((ActiveMQXAResourceWrapper)xaRes).getDelegate(false);
+      }
+
+      XAResource xaResource = getDelegate(false);
+      try
+      {
+         return xaResource.isSameRM(xaRes);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public int prepare(final Xid xid) throws XAException
+   {
+      XAResource xaResource = getDelegate(true);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("prepare " + xaResource + " xid ");
+      }
+      try
+      {
+         return xaResource.prepare(xid);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public void start(final Xid xid, final int flags) throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("start " + xaResource + " xid ");
+      }
+      try
+      {
+         xaResource.start(xid, flags);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public void end(final Xid xid, final int flags) throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("end " + xaResource + " xid ");
+      }
+      try
+      {
+         xaResource.end(xid, flags);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public int getTransactionTimeout() throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("getTransactionTimeout " + xaResource + " xid ");
+      }
+      try
+      {
+         return xaResource.getTransactionTimeout();
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public boolean setTransactionTimeout(final int seconds) throws XAException
+   {
+      XAResource xaResource = getDelegate(false);
+      if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+      {
+         ActiveMQJMSServerLogger.LOGGER.debug("setTransactionTimeout " + xaResource + " xid ");
+      }
+      try
+      {
+         return xaResource.setTransactionTimeout(seconds);
+      }
+      catch (XAException e)
+      {
+         throw check(e);
+      }
+   }
+
+   public void connectionFailed(final ActiveMQException me, boolean failedOver)
+   {
+      if (me.getType() == ActiveMQExceptionType.DISCONNECTED)
+      {
+         if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug("being disconnected for server shutdown", me);
+         }
+      }
+      else
+      {
+         ActiveMQJMSServerLogger.LOGGER.xaRecoverConnectionError(me, csf);
+      }
+      close();
+   }
+
+   @Override
+   public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
+   {
+      connectionFailed(me, failedOver);
+   }
+
+   public void beforeReconnect(final ActiveMQException me)
+   {
+   }
+
+   /**
+    * Get the connectionFactory XAResource
+    *
+    * @return the connectionFactory
+    * @throws XAException for any problem
+    */
+   private XAResource getDelegate(boolean retry) throws XAException
+   {
+      XAResource result = null;
+      Exception error = null;
+      try
+      {
+         result = connect();
+      }
+      catch (Exception e)
+      {
+         error = e;
+      }
+
+      if (result == null)
+      {
+         // we should always throw a retry for certain methods comit etc, if not the tx is marked as a heuristic and
+         // all chaos is let loose
+         if (retry)
+         {
+            XAException xae = new XAException("Connection unavailable for xa recovery");
+            xae.errorCode = XAException.XA_RETRY;
+            if (error != null)
+            {
+               xae.initCause(error);
+            }
+            if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+            {
+               ActiveMQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
+            }
+            throw xae;
+         }
+         else
+         {
+            XAException xae = new XAException("Error trying to connect to any providers for xa recovery");
+            xae.errorCode = XAException.XAER_RMERR;
+            if (error != null)
+            {
+               xae.initCause(error);
+            }
+            if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+            {
+               ActiveMQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
+            }
+            throw xae;
+         }
+
+      }
+
+      return result;
+   }
+
+   /**
+    * Connect to the server if not already done so
+    *
+    * @return the connectionFactory XAResource
+    * @throws Exception for any problem
+    */
+   protected XAResource connect() throws Exception
+   {
+      // Do we already have a valid connectionFactory?
+      synchronized (ActiveMQXAResourceWrapper.lock)
+      {
+         if (delegate != null)
+         {
+            return delegate;
+         }
+      }
+
+      for (XARecoveryConfig xaRecoveryConfig : xaRecoveryConfigs)
+      {
+
+         if (xaRecoveryConfig == null)
+         {
+            continue;
+         }
+         if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug("Trying to connect recovery on " + xaRecoveryConfig + " of " + Arrays.toString(xaRecoveryConfigs));
+         }
+
+         ClientSession cs = null;
+
+         try
+         {
+            // setting ha=false because otherwise the connector would go towards any server, causing Heuristic exceptions
+            // we really need to control what server it's connected to
+
+            // Manual configuration may still use discovery, so we will keep this
+            if (xaRecoveryConfig.getDiscoveryConfiguration() != null)
+            {
+               serverLocator = ActiveMQClient.createServerLocator(false, xaRecoveryConfig.getDiscoveryConfiguration());
+            }
+            else
+            {
+               serverLocator = ActiveMQClient.createServerLocator(false, xaRecoveryConfig.getTransportConfig());
+            }
+            serverLocator.disableFinalizeCheck();
+            csf = serverLocator.createSessionFactory();
+            if (xaRecoveryConfig.getUsername() == null)
+            {
+               cs = csf.createSession(true, false, false);
+            }
+            else
+            {
+               cs = csf.createSession(xaRecoveryConfig.getUsername(),
+                  xaRecoveryConfig.getPassword(),
+                  true,
+                  false,
+                  false,
+                  false,
+                  1);
+            }
+         }
+         catch (Throwable e)
+         {
+            ActiveMQJMSServerLogger.LOGGER.xaRecoverAutoConnectionError(e, xaRecoveryConfig);
+            if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled())
+            {
+               ActiveMQJMSServerLogger.LOGGER.debug(e.getMessage(), e);
+            }
+
+            try
+            {
+               if (cs != null) cs.close();
+               if (serverLocator != null) serverLocator.close();
+            }
+            catch (Throwable ignored)
+            {
+               if (ActiveMQJMSServerLogger.LOGGER.isTraceEnabled())
+               {
+                  ActiveMQJMSServerLogger.LOGGER.trace(e.getMessage(), ignored);
+               }
+            }
+            continue;
+         }
+
+         cs.addFailureListener(this);
+
+         synchronized (ActiveMQXAResourceWrapper.lock)
+         {
+            delegate = cs;
+         }
+
+         return delegate;
+      }
+      ActiveMQJMSServerLogger.LOGGER.recoveryConnectFailed(Arrays.toString(xaRecoveryConfigs));
+      throw new ActiveMQNotConnectedException();
+   }
+
+   /* (non-Javadoc)
+    * @see java.lang.Object#toString()
+    */
+   @Override
+   public String toString()
+   {
+      return "ActiveMQXAResourceWrapper [serverLocator=" + serverLocator +
+         ", csf=" +
+         csf +
+         ", delegate=" +
+         delegate +
+         ", xaRecoveryConfigs=" +
+         Arrays.toString(xaRecoveryConfigs) +
+         ", instance=" +
+         System.identityHashCode(this) +
+         "]";
+   }
+
+   /**
+    * Close the connection
+    */
+   public void close()
+   {
+      ServerLocator oldServerLocator = null;
+      ClientSessionFactory oldCSF = null;
+      ClientSession oldDelegate = null;
+      synchronized (ActiveMQXAResourceWrapper.lock)
+      {
+         oldCSF = csf;
+         csf = null;
+         oldDelegate = delegate;
+         delegate = null;
+         oldServerLocator = serverLocator;
+         serverLocator = null;
+      }
+
+      if (oldDelegate != null)
+      {
+         try
+         {
+            oldDelegate.close();
+         }
+         catch (Throwable ignorable)
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
+         }
+      }
+
+      if (oldCSF != null)
+      {
+         try
+         {
+            oldCSF.close();
+         }
+         catch (Throwable ignorable)
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
+         }
+      }
+
+      if (oldServerLocator != null)
+      {
+         try
+         {
+            oldServerLocator.close();
+         }
+         catch (Throwable ignorable)
+         {
+            ActiveMQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
+         }
+      }
+   }
+
+   /**
+    * Check whether an XAException is fatal. If it is an RM problem
+    * we close the connection so the next call will reconnect.
+    *
+    * @param e the xa exception
+    * @return never
+    * @throws XAException always
+    */
+   protected XAException check(final XAException e) throws XAException
+   {
+      ActiveMQJMSServerLogger.LOGGER.xaRecoveryError(e);
+
+
+      // If any exception happened, we close the connection so we may start fresh
+      close();
+      throw e;
+   }
+
+   @Override
+   protected void finalize() throws Throwable
+   {
+      close();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRecoveryRegistry.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRecoveryRegistry.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRecoveryRegistry.java
deleted file mode 100644
index d9b5c86..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRecoveryRegistry.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server.recovery;
-
-import javax.transaction.xa.XAResource;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.activemq.api.core.Pair;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
-import org.jboss.tm.XAResourceRecovery;
-
-/**
- * <p>This class is used by the Resource Adapter to register RecoveryDiscovery, which is based on the {@link XARecoveryConfig}</p>
- * <p>Each outbound or inboud connection will pass the configuration here through by calling the method {@link HornetQRecoveryRegistry#register(XARecoveryConfig)}</p>
- * <p>Later the {@link RecoveryDiscovery} will call {@link HornetQRecoveryRegistry#nodeUp(String, Pair, String, String)}
- * so we will keep a track of nodes on the cluster
- * or nodes where this server is connected to. </p>
- *
- * @author clebertsuconic
- */
-public class HornetQRecoveryRegistry implements XAResourceRecovery
-{
-
-   private static final HornetQRecoveryRegistry theInstance = new HornetQRecoveryRegistry();
-
-   private final ConcurrentHashMap<XARecoveryConfig, RecoveryDiscovery> configSet = new ConcurrentHashMap<XARecoveryConfig, RecoveryDiscovery>();
-
-   /**
-    * The list by server id and resource adapter wrapper, what will actually be calling recovery.
-    * This will be returned by getXAResources
-    */
-   private final ConcurrentHashMap<String, HornetQXAResourceWrapper> recoveries = new ConcurrentHashMap<String, HornetQXAResourceWrapper>();
-
-   /**
-    * In case of failures, we retry on the next getXAResources
-    */
-   private final Set<RecoveryDiscovery> failedDiscoverySet = new HashSet<RecoveryDiscovery>();
-
-   private HornetQRecoveryRegistry()
-   {
-   }
-
-   /**
-    * This will be called periodically by the Transaction Manager
-    */
-   public XAResource[] getXAResources()
-   {
-      try
-      {
-         checkFailures();
-
-         HornetQXAResourceWrapper[] resourceArray = new HornetQXAResourceWrapper[recoveries.size()];
-         resourceArray = recoveries.values().toArray(resourceArray);
-
-         if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-         {
-            HornetQJMSServerLogger.LOGGER.debug("\n=======================================================================================");
-            HornetQJMSServerLogger.LOGGER.debug("Returning the following list on getXAREsources:");
-            for (Map.Entry<String, HornetQXAResourceWrapper> entry : recoveries.entrySet())
-            {
-               HornetQJMSServerLogger.LOGGER.debug("server-id=" + entry.getKey() + ", value=" + entry.getValue());
-            }
-            HornetQJMSServerLogger.LOGGER.debug("=======================================================================================\n");
-         }
-
-         return resourceArray;
-      }
-      catch (Throwable e)
-      {
-         HornetQJMSServerLogger.LOGGER.warn(e.getMessage(), e);
-         return new XAResource[]{};
-      }
-   }
-
-   public static HornetQRecoveryRegistry getInstance()
-   {
-      return theInstance;
-   }
-
-   /**
-    * This will be called by then resource adapters, to register a new discovery
-    *
-    * @param resourceConfig
-    */
-   public void register(final XARecoveryConfig resourceConfig)
-   {
-      RecoveryDiscovery newInstance = new RecoveryDiscovery(resourceConfig);
-      RecoveryDiscovery discoveryRecord = configSet.putIfAbsent(resourceConfig, newInstance);
-      if (discoveryRecord == null)
-      {
-         discoveryRecord = newInstance;
-         discoveryRecord.start(false);
-      }
-      // you could have a configuration shared with multiple MDBs or RAs
-      discoveryRecord.incrementUsage();
-   }
-
-   /**
-    * Reference counts and deactivate a configuration
-    * Notice: this won't remove the servers since a server may have previous XIDs
-    *
-    * @param resourceConfig
-    */
-   public void unRegister(final XARecoveryConfig resourceConfig)
-   {
-      RecoveryDiscovery discoveryRecord = configSet.get(resourceConfig);
-      if (discoveryRecord != null && discoveryRecord.decrementUsage() == 0)
-      {
-         discoveryRecord = configSet.remove(resourceConfig);
-         if (discoveryRecord != null)
-         {
-            discoveryRecord.stop();
-         }
-      }
-   }
-
-   /**
-    * We need to make sure that all resources are closed, we don't actually do this when a resourceConfig is closed but
-    * maybe we should.
-    */
-   public void stop()
-   {
-      for (RecoveryDiscovery recoveryDiscovery : configSet.values())
-      {
-         recoveryDiscovery.stop();
-      }
-      for (HornetQXAResourceWrapper hornetQXAResourceWrapper : recoveries.values())
-      {
-         hornetQXAResourceWrapper.close();
-      }
-      recoveries.clear();
-      configSet.clear();
-   }
-
-   /**
-    * in case of a failure the Discovery will register itslef to retry
-    *
-    * @param failedDiscovery
-    */
-   public void failedDiscovery(RecoveryDiscovery failedDiscovery)
-   {
-      HornetQJMSServerLogger.LOGGER.debug("RecoveryDiscovery being set to restart:" + failedDiscovery);
-      synchronized (failedDiscoverySet)
-      {
-         failedDiscoverySet.add(failedDiscovery);
-      }
-   }
-
-   /**
-    * @param nodeID
-    * @param networkConfiguration
-    * @param username
-    * @param password
-    */
-   public void nodeUp(String nodeID,
-                      Pair<TransportConfiguration, TransportConfiguration> networkConfiguration,
-                      String username,
-                      String password)
-   {
-
-      if (recoveries.get(nodeID) == null)
-      {
-         if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-         {
-            HornetQJMSServerLogger.LOGGER.debug(nodeID + " being registered towards " + networkConfiguration);
-         }
-         XARecoveryConfig config = new XARecoveryConfig(true,
-                                                        extractTransportConfiguration(networkConfiguration),
-                                                        username,
-                                                        password);
-
-         HornetQXAResourceWrapper wrapper = new HornetQXAResourceWrapper(config);
-         recoveries.putIfAbsent(nodeID, wrapper);
-      }
-   }
-
-   public void nodeDown(String nodeID)
-   {
-   }
-
-   /**
-    * this will go through the list of retries
-    */
-   private void checkFailures()
-   {
-      final HashSet<RecoveryDiscovery> failures = new HashSet<RecoveryDiscovery>();
-
-      // it will transfer all the discoveries to a new collection
-      synchronized (failedDiscoverySet)
-      {
-         failures.addAll(failedDiscoverySet);
-         failedDiscoverySet.clear();
-      }
-
-      if (failures.size() > 0)
-      {
-         // This shouldn't happen on a regular scenario, however when this retry happens this needs
-         // to be done on a new thread
-         Thread t = new Thread("HornetQ Recovery Discovery Reinitialization")
-         {
-            @Override
-            public void run()
-            {
-               for (RecoveryDiscovery discovery : failures)
-               {
-                  try
-                  {
-                     HornetQJMSServerLogger.LOGGER.debug("Retrying discovery " + discovery);
-                     discovery.start(true);
-                  }
-                  catch (Throwable e)
-                  {
-                     HornetQJMSServerLogger.LOGGER.warn(e.getMessage(), e);
-                  }
-               }
-            }
-         };
-
-         t.start();
-      }
-   }
-
-   /**
-    * @param networkConfiguration
-    * @return
-    */
-   private TransportConfiguration[] extractTransportConfiguration(Pair<TransportConfiguration, TransportConfiguration> networkConfiguration)
-   {
-      if (networkConfiguration.getB() != null)
-      {
-         return new TransportConfiguration[]{networkConfiguration.getA(), networkConfiguration.getB()};
-      }
-      return new TransportConfiguration[]{networkConfiguration.getA()};
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRegistryBase.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRegistryBase.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRegistryBase.java
deleted file mode 100644
index c9381bb..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQRegistryBase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server.recovery;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.jboss.tm.XAResourceRecoveryRegistry;
-
-/**
- * This class is a base class for the integration layer where
- * This class is used on integration points and this is just a bridge to the real registry at
- * {@link HornetQRecoveryRegistry}
- *
- * @author Clebert
- *
- *
- */
-public abstract class HornetQRegistryBase
-{
-
-   private final AtomicBoolean started = new AtomicBoolean(false);
-
-   public HornetQRegistryBase()
-   {
-   }
-
-
-   public abstract XAResourceRecoveryRegistry getTMRegistry();
-
-   public void register(final XARecoveryConfig resourceConfig)
-   {
-      init();
-      HornetQRecoveryRegistry.getInstance().register(resourceConfig);
-   }
-
-
-
-   public void unRegister(final XARecoveryConfig resourceConfig)
-   {
-      init();
-      HornetQRecoveryRegistry.getInstance().unRegister(resourceConfig);
-   }
-
-   public void stop()
-   {
-      if (started.compareAndSet(true, false) && getTMRegistry() != null)
-      {
-         getTMRegistry().removeXAResourceRecovery(HornetQRecoveryRegistry.getInstance());
-         HornetQRecoveryRegistry.getInstance().stop();
-      }
-   }
-
-   private void init()
-   {
-      if (started.compareAndSet(false, true) && getTMRegistry() != null)
-      {
-         getTMRegistry().addXAResourceRecovery(HornetQRecoveryRegistry.getInstance());
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceRecovery.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceRecovery.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceRecovery.java
deleted file mode 100644
index 448e6b1..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceRecovery.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server.recovery;
-
-import javax.transaction.xa.XAResource;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.arjuna.ats.jta.recovery.XAResourceRecovery;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
-
-/**
- * A XAResourceRecovery instance that can be used to recover any JMS provider.
- * <p>
- * In reality only recover, rollback and commit will be called but we still need to be implement all
- * methods just in case.
- * <p>
- * To enable this add the following to the jbossts-properties file
- * <pre>
- * &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ1"
- *                 value="org.apache.activemq.jms.server.recovery.HornetQXAResourceRecovery;org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory"/&gt;
- * </pre>
- * <p>
- * you'll need something like this if the HornetQ Server is remote
- * <pre>
- *      &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ2"
- *                  value="org.apache.activemq.jms.server.recovery.HornetQXAResourceRecovery;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost,port=5445"/&gt;
- * </pre>
- * <p>
- * you'll need something like this if the HornetQ Server is remote and has failover configured
- * <pre>
- *             &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ2"
- *                       value="org.apache.activemq.jms.server.recovery.HornetQXAResourceRecovery;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost,port=5445;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory,guest,guest,host=localhost2,port=5446"/&gt;
- * </pre>
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @version <tt>$Revision: 1.1 $</tt>
- */
-public class HornetQXAResourceRecovery implements XAResourceRecovery
-{
-   private final boolean trace = HornetQJMSServerLogger.LOGGER.isTraceEnabled();
-
-   private boolean hasMore;
-
-   private HornetQXAResourceWrapper res;
-
-   public HornetQXAResourceRecovery()
-   {
-      if (trace)
-      {
-         HornetQJMSServerLogger.LOGGER.trace("Constructing HornetQXAResourceRecovery");
-      }
-   }
-
-   public boolean initialise(final String config)
-   {
-      if (HornetQJMSServerLogger.LOGGER.isTraceEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.trace(this + " intialise: " + config);
-      }
-
-      String[] configs = config.split(";");
-      XARecoveryConfig[] xaRecoveryConfigs = new XARecoveryConfig[configs.length];
-      for (int i = 0, configsLength = configs.length; i < configsLength; i++)
-      {
-         String s = configs[i];
-         ConfigParser parser = new ConfigParser(s);
-         String connectorFactoryClassName = parser.getConnectorFactoryClassName();
-         Map<String, Object> connectorParams = parser.getConnectorParameters();
-         String username = parser.getUsername();
-         String password = parser.getPassword();
-         TransportConfiguration transportConfiguration = new TransportConfiguration(connectorFactoryClassName, connectorParams);
-         xaRecoveryConfigs[i] = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfiguration}, username, password);
-      }
-
-
-      res = new HornetQXAResourceWrapper(xaRecoveryConfigs);
-
-      if (HornetQJMSServerLogger.LOGGER.isTraceEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.trace(this + " initialised");
-      }
-
-      return true;
-   }
-
-   public boolean hasMoreResources()
-   {
-      if (HornetQJMSServerLogger.LOGGER.isTraceEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.trace(this + " hasMoreResources");
-      }
-
-      /*
-       * The way hasMoreResources is supposed to work is as follows:
-       * For each "sweep" the recovery manager will call hasMoreResources, then if it returns
-       * true it will call getXAResource.
-       * It will repeat that until hasMoreResources returns false.
-       * Then the sweep is over.
-       * For the next sweep hasMoreResources should return true, etc.
-       *
-       * In our case where we only need to return one XAResource per sweep,
-       * hasMoreResources should basically alternate between true and false.
-       *
-       *
-       */
-
-      hasMore = !hasMore;
-
-      return hasMore;
-   }
-
-   public XAResource getXAResource()
-   {
-      if (HornetQJMSServerLogger.LOGGER.isTraceEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.trace(this + " getXAResource");
-      }
-
-      return res;
-   }
-
-   public XAResource[] getXAResources()
-   {
-      return new XAResource[]{res};
-   }
-
-   @Override
-   protected void finalize()
-   {
-      res.close();
-   }
-
-   public static class ConfigParser
-   {
-      private final String connectorFactoryClassName;
-
-      private final Map<String, Object> connectorParameters;
-
-      private String username;
-
-      private String password;
-
-      public ConfigParser(final String config)
-      {
-         if (config == null || config.length() == 0)
-         {
-            throw new IllegalArgumentException("Must specify provider connector factory class name in config");
-         }
-
-         String[] strings = config.split(",");
-
-         // First (mandatory) param is the connector factory class name
-         if (strings.length < 1)
-         {
-            throw new IllegalArgumentException("Must specify provider connector factory class name in config");
-         }
-
-         connectorFactoryClassName = strings[0].trim();
-
-         // Next two (optional) parameters are the username and password to use for creating the session for recovery
-
-         if (strings.length >= 2)
-         {
-
-            username = strings[1].trim();
-            if (username.length() == 0)
-            {
-               username = null;
-            }
-
-            if (strings.length == 2)
-            {
-               throw new IllegalArgumentException("If username is specified, password must be specified too");
-            }
-
-            password = strings[2].trim();
-            if (password.length() == 0)
-            {
-               password = null;
-            }
-         }
-
-         // other tokens are for connector configurations
-         connectorParameters = new HashMap<String, Object>();
-         if (strings.length >= 3)
-         {
-            for (int i = 3; i < strings.length; i++)
-            {
-               String[] str = strings[i].split("=");
-               if (str.length == 2)
-               {
-                  connectorParameters.put(str[0].trim(), str[1].trim());
-               }
-            }
-         }
-      }
-
-      public String getConnectorFactoryClassName()
-      {
-         return connectorFactoryClassName;
-      }
-
-      public Map<String, Object> getConnectorParameters()
-      {
-         return connectorParameters;
-      }
-
-      public String getUsername()
-      {
-         return username;
-      }
-
-      public String getPassword()
-      {
-         return password;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceWrapper.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceWrapper.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceWrapper.java
deleted file mode 100644
index 293137b..0000000
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/HornetQXAResourceWrapper.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.server.recovery;
-
-import java.util.Arrays;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.api.core.ActiveMQNotConnectedException;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.HornetQClient;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.core.client.SessionFailureListener;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
-
-/**
- * XAResourceWrapper.
- *
- * Mainly from org.jboss.server.XAResourceWrapper from the JBoss AS server module
- *
- * The reason why we don't use that class directly is that it assumes on failure of connection
- * the RM_FAIL or RM_ERR is thrown, but in HornetQ we throw XA_RETRY since we want the recovery manager to be able
- * to retry on failure without having to manually retry
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *
- * @version $Revision: 45341 $
- */
-public class HornetQXAResourceWrapper implements XAResource, SessionFailureListener
-{
-   /** The state lock */
-   private static final Object lock = new Object();
-
-   private ServerLocator serverLocator;
-
-   private ClientSessionFactory csf;
-
-   private ClientSession delegate;
-
-   private XARecoveryConfig[] xaRecoveryConfigs;
-
-   public HornetQXAResourceWrapper(XARecoveryConfig... xaRecoveryConfigs)
-   {
-      this.xaRecoveryConfigs = xaRecoveryConfigs;
-
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("Recovery configured with " + Arrays.toString(xaRecoveryConfigs) +
-            ", instance=" +
-            System.identityHashCode(this));
-      }
-   }
-
-   public Xid[] recover(final int flag) throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("looking for recover at " + xaResource + " configuration " + Arrays.toString(this.xaRecoveryConfigs));
-      }
-
-      try
-      {
-         Xid[] xids = xaResource.recover(flag);
-
-         if (HornetQJMSServerLogger.LOGGER.isDebugEnabled() && xids != null && xids.length > 0)
-         {
-            HornetQJMSServerLogger.LOGGER.debug("Recovering these following IDs " + Arrays.toString(xids) + " at " + this);
-         }
-
-         return xids;
-      }
-      catch (XAException e)
-      {
-         HornetQJMSServerLogger.LOGGER.xaRecoverError(e);
-         throw check(e);
-      }
-   }
-
-   public void commit(final Xid xid, final boolean onePhase) throws XAException
-   {
-      XAResource xaResource = getDelegate(true);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("Commit " + xaResource + " xid " + " onePhase=" + onePhase);
-      }
-      try
-      {
-         xaResource.commit(xid, onePhase);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public void rollback(final Xid xid) throws XAException
-   {
-      XAResource xaResource = getDelegate(true);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("Rollback " + xaResource + " xid ");
-      }
-      try
-      {
-         xaResource.rollback(xid);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public void forget(final Xid xid) throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("Forget " + xaResource + " xid ");
-      }
-
-      try
-      {
-         xaResource.forget(xid);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public boolean isSameRM(XAResource xaRes) throws XAException
-   {
-      if (xaRes instanceof HornetQXAResourceWrapper)
-      {
-         xaRes = ((HornetQXAResourceWrapper)xaRes).getDelegate(false);
-      }
-
-      XAResource xaResource = getDelegate(false);
-      try
-      {
-         return xaResource.isSameRM(xaRes);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public int prepare(final Xid xid) throws XAException
-   {
-      XAResource xaResource = getDelegate(true);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("prepare " + xaResource + " xid ");
-      }
-      try
-      {
-         return xaResource.prepare(xid);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public void start(final Xid xid, final int flags) throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("start " + xaResource + " xid ");
-      }
-      try
-      {
-         xaResource.start(xid, flags);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public void end(final Xid xid, final int flags) throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("end " + xaResource + " xid ");
-      }
-      try
-      {
-         xaResource.end(xid, flags);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public int getTransactionTimeout() throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("getTransactionTimeout " + xaResource + " xid ");
-      }
-      try
-      {
-         return xaResource.getTransactionTimeout();
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public boolean setTransactionTimeout(final int seconds) throws XAException
-   {
-      XAResource xaResource = getDelegate(false);
-      if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-      {
-         HornetQJMSServerLogger.LOGGER.debug("setTransactionTimeout " + xaResource + " xid ");
-      }
-      try
-      {
-         return xaResource.setTransactionTimeout(seconds);
-      }
-      catch (XAException e)
-      {
-         throw check(e);
-      }
-   }
-
-   public void connectionFailed(final ActiveMQException me, boolean failedOver)
-   {
-      if (me.getType() == ActiveMQExceptionType.DISCONNECTED)
-      {
-         if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-         {
-            HornetQJMSServerLogger.LOGGER.debug("being disconnected for server shutdown", me);
-         }
-      }
-      else
-      {
-         HornetQJMSServerLogger.LOGGER.xaRecoverConnectionError(me, csf);
-      }
-      close();
-   }
-
-   @Override
-   public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
-   {
-      connectionFailed(me, failedOver);
-   }
-
-   public void beforeReconnect(final ActiveMQException me)
-   {
-   }
-
-   /**
-    * Get the connectionFactory XAResource
-    *
-    * @return the connectionFactory
-    * @throws XAException for any problem
-    */
-   private XAResource getDelegate(boolean retry) throws XAException
-   {
-      XAResource result = null;
-      Exception error = null;
-      try
-      {
-         result = connect();
-      }
-      catch (Exception e)
-      {
-         error = e;
-      }
-
-      if (result == null)
-      {
-         // we should always throw a retry for certain methods comit etc, if not the tx is marked as a heuristic and
-         // all chaos is let loose
-         if (retry)
-         {
-            XAException xae = new XAException("Connection unavailable for xa recovery");
-            xae.errorCode = XAException.XA_RETRY;
-            if (error != null)
-            {
-               xae.initCause(error);
-            }
-            if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-            {
-               HornetQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
-            }
-            throw xae;
-         }
-         else
-         {
-            XAException xae = new XAException("Error trying to connect to any providers for xa recovery");
-            xae.errorCode = XAException.XAER_RMERR;
-            if (error != null)
-            {
-               xae.initCause(error);
-            }
-            if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-            {
-               HornetQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
-            }
-            throw xae;
-         }
-
-      }
-
-      return result;
-   }
-
-   /**
-    * Connect to the server if not already done so
-    *
-    * @return the connectionFactory XAResource
-    * @throws Exception for any problem
-    */
-   protected XAResource connect() throws Exception
-   {
-      // Do we already have a valid connectionFactory?
-      synchronized (HornetQXAResourceWrapper.lock)
-      {
-         if (delegate != null)
-         {
-            return delegate;
-         }
-      }
-
-      for (XARecoveryConfig xaRecoveryConfig : xaRecoveryConfigs)
-      {
-
-         if (xaRecoveryConfig == null)
-         {
-            continue;
-         }
-         if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-         {
-            HornetQJMSServerLogger.LOGGER.debug("Trying to connect recovery on " + xaRecoveryConfig + " of " + Arrays.toString(xaRecoveryConfigs));
-         }
-
-         ClientSession cs = null;
-
-         try
-         {
-            // setting ha=false because otherwise the connector would go towards any server, causing Heuristic exceptions
-            // we really need to control what server it's connected to
-
-            // Manual configuration may still use discovery, so we will keep this
-            if (xaRecoveryConfig.getDiscoveryConfiguration() != null)
-            {
-               serverLocator = HornetQClient.createServerLocator(false, xaRecoveryConfig.getDiscoveryConfiguration());
-            }
-            else
-            {
-               serverLocator = HornetQClient.createServerLocator(false, xaRecoveryConfig.getTransportConfig());
-            }
-            serverLocator.disableFinalizeCheck();
-            csf = serverLocator.createSessionFactory();
-            if (xaRecoveryConfig.getUsername() == null)
-            {
-               cs = csf.createSession(true, false, false);
-            }
-            else
-            {
-               cs = csf.createSession(xaRecoveryConfig.getUsername(),
-                  xaRecoveryConfig.getPassword(),
-                  true,
-                  false,
-                  false,
-                  false,
-                  1);
-            }
-         }
-         catch (Throwable e)
-         {
-            HornetQJMSServerLogger.LOGGER.xaRecoverAutoConnectionError(e, xaRecoveryConfig);
-            if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
-            {
-               HornetQJMSServerLogger.LOGGER.debug(e.getMessage(), e);
-            }
-
-            try
-            {
-               if (cs != null) cs.close();
-               if (serverLocator != null) serverLocator.close();
-            }
-            catch (Throwable ignored)
-            {
-               if (HornetQJMSServerLogger.LOGGER.isTraceEnabled())
-               {
-                  HornetQJMSServerLogger.LOGGER.trace(e.getMessage(), ignored);
-               }
-            }
-            continue;
-         }
-
-         cs.addFailureListener(this);
-
-         synchronized (HornetQXAResourceWrapper.lock)
-         {
-            delegate = cs;
-         }
-
-         return delegate;
-      }
-      HornetQJMSServerLogger.LOGGER.recoveryConnectFailed(Arrays.toString(xaRecoveryConfigs));
-      throw new ActiveMQNotConnectedException();
-   }
-
-   /* (non-Javadoc)
-    * @see java.lang.Object#toString()
-    */
-   @Override
-   public String toString()
-   {
-      return "HornetQXAResourceWrapper [serverLocator=" + serverLocator +
-         ", csf=" +
-         csf +
-         ", delegate=" +
-         delegate +
-         ", xaRecoveryConfigs=" +
-         Arrays.toString(xaRecoveryConfigs) +
-         ", instance=" +
-         System.identityHashCode(this) +
-         "]";
-   }
-
-   /**
-    * Close the connection
-    */
-   public void close()
-   {
-      ServerLocator oldServerLocator = null;
-      ClientSessionFactory oldCSF = null;
-      ClientSession oldDelegate = null;
-      synchronized (HornetQXAResourceWrapper.lock)
-      {
-         oldCSF = csf;
-         csf = null;
-         oldDelegate = delegate;
-         delegate = null;
-         oldServerLocator = serverLocator;
-         serverLocator = null;
-      }
-
-      if (oldDelegate != null)
-      {
-         try
-         {
-            oldDelegate.close();
-         }
-         catch (Throwable ignorable)
-         {
-            HornetQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
-         }
-      }
-
-      if (oldCSF != null)
-      {
-         try
-         {
-            oldCSF.close();
-         }
-         catch (Throwable ignorable)
-         {
-            HornetQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
-         }
-      }
-
-      if (oldServerLocator != null)
-      {
-         try
-         {
-            oldServerLocator.close();
-         }
-         catch (Throwable ignorable)
-         {
-            HornetQJMSServerLogger.LOGGER.debug(ignorable.getMessage(), ignorable);
-         }
-      }
-   }
-
-   /**
-    * Check whether an XAException is fatal. If it is an RM problem
-    * we close the connection so the next call will reconnect.
-    *
-    * @param e the xa exception
-    * @return never
-    * @throws XAException always
-    */
-   protected XAException check(final XAException e) throws XAException
-   {
-      HornetQJMSServerLogger.LOGGER.xaRecoveryError(e);
-
-
-      // If any exception happened, we close the connection so we may start fresh
-      close();
-      throw e;
-   }
-
-   @Override
-   protected void finalize() throws Throwable
-   {
-      close();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/RecoveryDiscovery.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/RecoveryDiscovery.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/RecoveryDiscovery.java
index 7510361..b705db9 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/RecoveryDiscovery.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/RecoveryDiscovery.java
@@ -23,12 +23,12 @@ import org.apache.activemq.api.core.client.ServerLocator;
 import org.apache.activemq.api.core.client.SessionFailureListener;
 import org.apache.activemq.api.core.client.TopologyMember;
 import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
-import org.apache.activemq.jms.server.HornetQJMSServerLogger;
+import org.apache.activemq.jms.server.ActiveMQJMSServerLogger;
 
 /**
  * <p>This class will have a simple Connection Factory and will listen
  * for topology updates. </p>
- * <p>This Discovery is instantiated by {@link HornetQRecoveryRegistry}
+ * <p>This Discovery is instantiated by {@link ActiveMQRecoveryRegistry}
  *
  * @author clebertsuconic
  */
@@ -51,7 +51,7 @@ public class RecoveryDiscovery implements SessionFailureListener
    {
       if (!started)
       {
-         HornetQJMSServerLogger.LOGGER.debug("Starting RecoveryDiscovery on " + config);
+         ActiveMQJMSServerLogger.LOGGER.debug("Starting RecoveryDiscovery on " + config);
          started = true;
 
          locator = config.createServerLocator();
@@ -65,16 +65,16 @@ public class RecoveryDiscovery implements SessionFailureListener
             // in case of failure we will retry
             sessionFactory.addFailureListener(this);
 
-            HornetQJMSServerLogger.LOGGER.debug("RecoveryDiscovery started fine on " + config);
+            ActiveMQJMSServerLogger.LOGGER.debug("RecoveryDiscovery started fine on " + config);
          }
          catch (Exception startupError)
          {
             if (!retry)
             {
-               HornetQJMSServerLogger.LOGGER.xaRecoveryStartError(config);
+               ActiveMQJMSServerLogger.LOGGER.xaRecoveryStartError(config);
             }
             stop();
-            HornetQRecoveryRegistry.getInstance().failedDiscovery(this);
+            ActiveMQRecoveryRegistry.getInstance().failedDiscovery(this);
          }
 
       }
@@ -123,7 +123,7 @@ public class RecoveryDiscovery implements SessionFailureListener
          }
          catch (Exception ignored)
          {
-            HornetQJMSServerLogger.LOGGER.debug(ignored, ignored);
+            ActiveMQJMSServerLogger.LOGGER.debug(ignored, ignored);
          }
 
          try
@@ -132,7 +132,7 @@ public class RecoveryDiscovery implements SessionFailureListener
          }
          catch (Exception ignored)
          {
-            HornetQJMSServerLogger.LOGGER.debug(ignored, ignored);
+            ActiveMQJMSServerLogger.LOGGER.debug(ignored, ignored);
          }
 
          sessionFactory = null;
@@ -160,7 +160,7 @@ public class RecoveryDiscovery implements SessionFailureListener
             Pair<TransportConfiguration, TransportConfiguration> connector =
                new Pair<TransportConfiguration, TransportConfiguration>(topologyMember.getLive(),
                                                                         topologyMember.getBackup());
-            HornetQRecoveryRegistry.getInstance().nodeUp(topologyMember.getNodeId(), connector,
+            ActiveMQRecoveryRegistry.getInstance().nodeUp(topologyMember.getNodeId(), connector,
                                                          config.getUsername(), config.getPassword());
          }
       }
@@ -180,15 +180,15 @@ public class RecoveryDiscovery implements SessionFailureListener
    {
       if (exception.getType() == ActiveMQExceptionType.DISCONNECTED)
       {
-         HornetQJMSServerLogger.LOGGER.warn("being disconnected for server shutdown", exception);
+         ActiveMQJMSServerLogger.LOGGER.warn("being disconnected for server shutdown", exception);
       }
       else
       {
-         HornetQJMSServerLogger.LOGGER.warn("Notified of connection failure in xa discovery, we will retry on the next recovery",
+         ActiveMQJMSServerLogger.LOGGER.warn("Notified of connection failure in xa discovery, we will retry on the next recovery",
                                             exception);
       }
       internalStop();
-      HornetQRecoveryRegistry.getInstance().failedDiscovery(this);
+      ActiveMQRecoveryRegistry.getInstance().failedDiscovery(this);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/XARecoveryConfig.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/XARecoveryConfig.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/XARecoveryConfig.java
index 6c00917..24e40c0 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/XARecoveryConfig.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/XARecoveryConfig.java
@@ -16,9 +16,9 @@ import java.util.Arrays;
 
 import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
 
 /**
  *
@@ -40,7 +40,7 @@ public class XARecoveryConfig
    private final String username;
    private final String password;
 
-   public static XARecoveryConfig newConfig(HornetQConnectionFactory factory,
+   public static XARecoveryConfig newConfig(ActiveMQConnectionFactory factory,
                                             String userName,
                                             String password)
    {
@@ -107,11 +107,11 @@ public class XARecoveryConfig
    {
       if (getDiscoveryConfiguration() != null)
       {
-         return HornetQClient.createServerLocator(isHA(), getDiscoveryConfiguration());
+         return ActiveMQClient.createServerLocator(isHA(), getDiscoveryConfiguration());
       }
       else
       {
-         return HornetQClient.createServerLocator(isHA(), getTransportConfig());
+         return ActiveMQClient.createServerLocator(isHA(), getTransportConfig());
       }
 
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/package-info.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/package-info.java
index 7d0ae6e..a44d114 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/package-info.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/server/recovery/package-info.java
@@ -12,10 +12,10 @@
  */
 /**
  * This package is used to locate resources and connectors along the cluster set
- * I - JCA Connection Factories or InBound MDBs will call HornetQRegistryBase::register(XARecoveryConfig)
+ * I - JCA Connection Factories or InBound MDBs will call ActiveMQRegistryBase::register(XARecoveryConfig)
  * II - For each XARecoveryConfig the RegistryBase will instantiate a ResourceDiscoveryUnit which will
  *      connect using that configuration and inform the Registry of any topology members
- * III - For each topology member found on the DiscoveryUnits, the RegistryBase will registry a HornetQResourceRecovery
+ * III - For each topology member found on the DiscoveryUnits, the RegistryBase will registry a ActiveMQResourceRecovery
  *       that will exist per server
   */
 package org.apache.activemq.jms.server.recovery;


[09/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionImpl.java
index 2f93ffe..f92a8e6 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/cursor/impl/PageSubscriptionImpl.java
@@ -41,7 +41,7 @@ import org.apache.activemq.core.paging.cursor.PageSubscriptionCounter;
 import org.apache.activemq.core.paging.cursor.PagedReference;
 import org.apache.activemq.core.paging.impl.Page;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.ServerMessage;
@@ -60,7 +60,7 @@ import org.apache.activemq.utils.LinkedListIterator;
  */
 final class PageSubscriptionImpl implements PageSubscription
 {
-   private final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private boolean empty = true;
 
@@ -229,7 +229,7 @@ final class PageSubscriptionImpl implements PageSubscription
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.problemCleaningCursorPages(e);
+                  ActiveMQServerLogger.LOGGER.problemCleaningCursorPages(e);
                }
                finally
                {
@@ -285,7 +285,7 @@ final class PageSubscriptionImpl implements PageSubscription
                if (currentPage != null && entry.getKey() == pageStore.getCurrentPage().getPageId() &&
                   currentPage.isLive())
                {
-                  HornetQServerLogger.LOGGER.trace("We can't clear page " + entry.getKey() +
+                  ActiveMQServerLogger.LOGGER.trace("We can't clear page " + entry.getKey() +
                                                       " now since it's the current page");
                }
                else
@@ -533,7 +533,7 @@ final class PageSubscriptionImpl implements PageSubscription
          public void onError(final int errorCode, final String errorMessage)
          {
             error = " errorCode=" + errorCode + ", msg=" + errorMessage;
-            HornetQServerLogger.LOGGER.pageSubscriptionError(this, error);
+            ActiveMQServerLogger.LOGGER.pageSubscriptionError(this, error);
          }
 
          @Override
@@ -737,7 +737,7 @@ final class PageSubscriptionImpl implements PageSubscription
       {
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("********** processing reload!!!!!!!");
+            ActiveMQServerLogger.LOGGER.trace("********** processing reload!!!!!!!");
          }
          Collections.sort(recoveredACK);
 
@@ -750,7 +750,7 @@ final class PageSubscriptionImpl implements PageSubscription
 
             if (pageInfo == null)
             {
-               HornetQServerLogger.LOGGER.pageNotFound(pos);
+               ActiveMQServerLogger.LOGGER.pageNotFound(pos);
                if (txDeleteCursorOnReload == -1)
                {
                   txDeleteCursorOnReload = store.generateID();
@@ -779,7 +779,7 @@ final class PageSubscriptionImpl implements PageSubscription
       executor.execute(future);
       while (!future.await(1000))
       {
-         HornetQServerLogger.LOGGER.timedOutFlushingExecutorsPagingCursor(this);
+         ActiveMQServerLogger.LOGGER.timedOutFlushingExecutorsPagingCursor(this);
       }
    }
 
@@ -821,7 +821,7 @@ final class PageSubscriptionImpl implements PageSubscription
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e);
+               ActiveMQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e);
             }
             info.setCompleteInfo(null);
          }
@@ -835,7 +835,7 @@ final class PageSubscriptionImpl implements PageSubscription
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e);
+                  ActiveMQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e);
                }
             }
          }
@@ -906,13 +906,13 @@ final class PageSubscriptionImpl implements PageSubscription
       {
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("a new position is being processed as ACK");
+            ActiveMQServerLogger.LOGGER.trace("a new position is being processed as ACK");
          }
          if (lastAckedPosition != null && lastAckedPosition.getPageNr() != pos.getPageNr())
          {
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Scheduling cleanup on pageSubscription for address = " + pageStore.getAddress() + " queue = " + this.getQueue().getName());
+               ActiveMQServerLogger.LOGGER.trace("Scheduling cleanup on pageSubscription for address = " + pageStore.getAddress() + " queue = " + this.getQueue().getName());
             }
 
             // there's a different page being acked, we will do the check right away
@@ -930,7 +930,7 @@ final class PageSubscriptionImpl implements PageSubscription
       {
          // This could become null if the page file was deleted, or if the queue was removed maybe?
          // it's better to diagnose it (based on support tickets) instead of NPE
-         HornetQServerLogger.LOGGER.warn("PageCursorInfo == null on address " + this.getPagingStore().getAddress() + ", pos = " + pos + ", queue = " + cursorId);
+         ActiveMQServerLogger.LOGGER.warn("PageCursorInfo == null on address " + this.getPagingStore().getAddress() + ", pos = " + pos + ", queue = " + cursorId);
       }
       else
       {
@@ -1130,7 +1130,7 @@ final class PageSubscriptionImpl implements PageSubscription
 
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("numberOfMessages =  " + getNumberOfMessages() +
+            ActiveMQServerLogger.LOGGER.trace("numberOfMessages =  " + getNumberOfMessages() +
                                                 " confirmed =  " +
                                                 (confirmed.get() + 1) +
                                                 " pendingTX = " + pendingTX +
@@ -1379,7 +1379,7 @@ final class PageSubscriptionImpl implements PageSubscription
                                                                                           .getTransactionID());
                   if (tx == null)
                   {
-                     HornetQServerLogger.LOGGER.pageSubscriptionCouldntLoad(message.getPagedMessage().getTransactionID(),
+                     ActiveMQServerLogger.LOGGER.pageSubscriptionCouldntLoad(message.getPagedMessage().getTransactionID(),
                                                                             message.getPosition(), pageStore.getAddress(), queue.getName());
                      valid = false;
                      ignored = true;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/Page.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/Page.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/Page.java
index 883ef3b..95f9d32 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/Page.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/Page.java
@@ -27,8 +27,8 @@ import org.apache.activemq.core.paging.PagedMessage;
 import org.apache.activemq.core.paging.cursor.LivePageCache;
 import org.apache.activemq.core.paging.cursor.PageSubscriptionCounter;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.utils.ConcurrentHashSet;
 import org.apache.activemq.utils.DataConstants;
@@ -39,8 +39,8 @@ import org.apache.activemq.utils.DataConstants;
 public final class Page implements Comparable<Page>
 {
    // Constants -----------------------------------------------------
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
-   private static final boolean isDebug = HornetQServerLogger.LOGGER.isDebugEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isDebug = ActiveMQServerLogger.LOGGER.isDebugEnabled();
 
    public static final int SIZE_RECORD = DataConstants.SIZE_BYTE + DataConstants.SIZE_INT + DataConstants.SIZE_BYTE;
 
@@ -103,12 +103,12 @@ public final class Page implements Comparable<Page>
    {
       if (isDebug)
       {
-         HornetQServerLogger.LOGGER.debug("reading page " + this.pageId + " on address = " + storeName);
+         ActiveMQServerLogger.LOGGER.debug("reading page " + this.pageId + " on address = " + storeName);
       }
 
       if (!file.isOpen())
       {
-         throw HornetQMessageBundle.BUNDLE.invalidPageIO();
+         throw ActiveMQMessageBundle.BUNDLE.invalidPageIO();
       }
 
       ArrayList<PagedMessage> messages = new ArrayList<PagedMessage>();
@@ -156,7 +156,7 @@ public final class Page implements Comparable<Page>
                      msg.initMessage(storage);
                      if (isTrace)
                      {
-                        HornetQServerLogger.LOGGER.trace("Reading message " + msg + " on pageId=" + this.pageId + " for address=" + storeName);
+                        ActiveMQServerLogger.LOGGER.trace("Reading message " + msg + " on pageId=" + this.pageId + " for address=" + storeName);
                      }
                      messages.add(msg);
                   }
@@ -277,7 +277,7 @@ public final class Page implements Comparable<Page>
 
       if (isDebug)
       {
-         HornetQServerLogger.LOGGER.debug("Deleting pageId=" + pageId + " on store " + storeName);
+         ActiveMQServerLogger.LOGGER.debug("Deleting pageId=" + pageId + " on store " + storeName);
       }
 
       if (messages != null)
@@ -300,7 +300,7 @@ public final class Page implements Comparable<Page>
       {
          if (suspiciousRecords)
          {
-            HornetQServerLogger.LOGGER.pageInvalid(file.getFileName(), file.getFileName());
+            ActiveMQServerLogger.LOGGER.pageInvalid(file.getFileName(), file.getFileName());
             file.renameTo(file.getFileName() + ".invalidPage");
          }
          else
@@ -312,7 +312,7 @@ public final class Page implements Comparable<Page>
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.pageDeleteError(e);
+         ActiveMQServerLogger.LOGGER.pageDeleteError(e);
          return false;
       }
    }
@@ -351,7 +351,7 @@ public final class Page implements Comparable<Page>
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.pageFinaliseError(e);
+         ActiveMQServerLogger.LOGGER.pageFinaliseError(e);
       }
    }
 
@@ -385,7 +385,7 @@ public final class Page implements Comparable<Page>
     */
    private void markFileAsSuspect(final String fileName, final int position, final int msgNumber)
    {
-      HornetQServerLogger.LOGGER.pageSuspectFile(fileName, position, msgNumber);
+      ActiveMQServerLogger.LOGGER.pageSuspectFile(fileName, position, msgNumber);
       suspiciousRecords = true;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PageTransactionInfoImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PageTransactionInfoImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PageTransactionInfoImpl.java
index dd172db..ea17a60 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PageTransactionInfoImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PageTransactionInfoImpl.java
@@ -25,7 +25,7 @@ import org.apache.activemq.core.paging.PagingManager;
 import org.apache.activemq.core.paging.cursor.PagePosition;
 import org.apache.activemq.core.paging.cursor.PageSubscription;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionOperationAbstract;
 import org.apache.activemq.core.transaction.TransactionPropertyIndexes;
@@ -98,7 +98,7 @@ public final class PageTransactionInfoImpl implements PageTransactionInfo
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.pageTxDeleteError(e, recordID);
+            ActiveMQServerLogger.LOGGER.pageTxDeleteError(e, recordID);
          }
 
          pagingManager.removeTransaction(this.transactionID);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingManagerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingManagerImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingManagerImpl.java
index ea87e28..fb7549f 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingManagerImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingManagerImpl.java
@@ -24,7 +24,7 @@ import org.apache.activemq.core.paging.PageTransactionInfo;
 import org.apache.activemq.core.paging.PagingManager;
 import org.apache.activemq.core.paging.PagingStore;
 import org.apache.activemq.core.paging.PagingStoreFactory;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.settings.HierarchicalRepository;
 import org.apache.activemq.core.settings.impl.AddressSettings;
 
@@ -59,7 +59,7 @@ public final class PagingManagerImpl implements PagingManager
    // Static
    // --------------------------------------------------------------------------------------------------------------------------
 
-   private static boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    // Constructors
    // --------------------------------------------------------------------------------------------------------------------
@@ -200,7 +200,7 @@ public final class PagingManagerImpl implements PagingManager
    {
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Adding pageTransaction " + pageTransaction.getTransactionID());
+         ActiveMQServerLogger.LOGGER.trace("Adding pageTransaction " + pageTransaction.getTransactionID());
       }
       transactions.put(pageTransaction.getTransactionID(), pageTransaction);
    }
@@ -209,7 +209,7 @@ public final class PagingManagerImpl implements PagingManager
    {
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Removing pageTransaction " + id);
+         ActiveMQServerLogger.LOGGER.trace("Removing pageTransaction " + id);
       }
       transactions.remove(id);
    }
@@ -218,7 +218,7 @@ public final class PagingManagerImpl implements PagingManager
    {
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("looking up pageTX = " + id);
+         ActiveMQServerLogger.LOGGER.trace("looking up pageTX = " + id);
       }
       return transactions.get(id);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreFactoryNIO.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreFactoryNIO.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreFactoryNIO.java
index 7a427ba..fe63613 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreFactoryNIO.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreFactoryNIO.java
@@ -32,7 +32,7 @@ import org.apache.activemq.core.paging.PagingManager;
 import org.apache.activemq.core.paging.PagingStore;
 import org.apache.activemq.core.paging.PagingStoreFactory;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.settings.HierarchicalRepository;
 import org.apache.activemq.core.settings.impl.AddressSettings;
 import org.apache.activemq.utils.ExecutorFactory;
@@ -164,7 +164,7 @@ public class PagingStoreFactoryNIO implements PagingStoreFactory
 
             if (!addressFile.exists())
             {
-               HornetQServerLogger.LOGGER.pageStoreFactoryNoIdFile(file.toString(), PagingStoreFactoryNIO.ADDRESS_FILE);
+               ActiveMQServerLogger.LOGGER.pageStoreFactoryNoIdFile(file.toString(), PagingStoreFactoryNIO.ADDRESS_FILE);
                continue;
             }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreImpl.java
index 7609165..d0c8ae1 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/paging/impl/PagingStoreImpl.java
@@ -26,8 +26,8 @@ import org.apache.activemq.core.paging.cursor.impl.LivePageCacheImpl;
 import org.apache.activemq.core.paging.cursor.impl.PageCursorProviderImpl;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.RouteContextList;
@@ -118,7 +118,7 @@ public class PagingStoreImpl implements PagingStore
 
    private volatile AtomicBoolean blocking = new AtomicBoolean(false);
 
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    public PagingStoreImpl(final SimpleString address,
                           final ScheduledExecutorService scheduledExecutor,
@@ -391,7 +391,7 @@ public class PagingStoreImpl implements PagingStore
 
       if (!future.await(60000))
       {
-         HornetQServerLogger.LOGGER.pageStoreTimeout(address);
+         ActiveMQServerLogger.LOGGER.pageStoreTimeout(address);
       }
    }
 
@@ -550,7 +550,7 @@ public class PagingStoreImpl implements PagingStore
             {
                // If not possible to starting page due to an IO error, we will just consider it non paging.
                // This shouldn't happen anyway
-               HornetQServerLogger.LOGGER.pageStoreStartIOError(e);
+               ActiveMQServerLogger.LOGGER.pageStoreStartIOError(e);
                return false;
             }
          }
@@ -661,7 +661,7 @@ public class PagingStoreImpl implements PagingStore
                   returnPage.delete(null);
 
                   // This will trigger this address to exit the page mode,
-                  // and this will make HornetQ start using the journal again
+                  // and this will make ActiveMQ start using the journal again
                   return null;
                }
                else
@@ -747,7 +747,7 @@ public class PagingStoreImpl implements PagingStore
             }
             else if (!blocking.get())
             {
-               HornetQServerLogger.LOGGER.blockingMessageProduction(address, sizeInBytes.get(), maxSize);
+               ActiveMQServerLogger.LOGGER.blockingMessageProduction(address, sizeInBytes.get(), maxSize);
                blocking.set(true);
             }
 
@@ -782,7 +782,7 @@ public class PagingStoreImpl implements PagingStore
                   executor.execute(memoryFreedRunnablesExecutor);
                   if (blocking.get())
                   {
-                     HornetQServerLogger.LOGGER.unblockingMessageProduction(address, sizeInBytes.get(), maxSize);
+                     ActiveMQServerLogger.LOGGER.unblockingMessageProduction(address, sizeInBytes.get(), maxSize);
                      blocking.set(false);
                   }
                }
@@ -801,7 +801,7 @@ public class PagingStoreImpl implements PagingStore
             {
                if (startPaging())
                {
-                  HornetQServerLogger.LOGGER.pageStoreStart(storeName, addressSize, maxSize);
+                  ActiveMQServerLogger.LOGGER.pageStoreStart(storeName, addressSize, maxSize);
                }
             }
          }
@@ -835,7 +835,7 @@ public class PagingStoreImpl implements PagingStore
             {
                printedDropMessagesWarning = true;
 
-               HornetQServerLogger.LOGGER.pageStoreDropMessages(storeName, sizeInBytes.get(), maxSize);
+               ActiveMQServerLogger.LOGGER.pageStoreDropMessages(storeName, sizeInBytes.get(), maxSize);
             }
 
             if (message.isLargeMessage())
@@ -845,7 +845,7 @@ public class PagingStoreImpl implements PagingStore
 
             if (addressFullMessagePolicy == AddressFullMessagePolicy.FAIL)
             {
-               throw HornetQMessageBundle.BUNDLE.addressIsFull(address.toString());
+               throw ActiveMQMessageBundle.BUNDLE.addressIsFull(address.toString());
             }
 
             // Address is full, we just pretend we are paging, and drop the data
@@ -933,7 +933,7 @@ public class PagingStoreImpl implements PagingStore
 
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Paging message " + pagedMessage + " on pageStore " + this.getStoreName() +
+               ActiveMQServerLogger.LOGGER.trace("Paging message " + pagedMessage + " on pageStore " + this.getStoreName() +
                   " pageId=" + currentPage.getPageId());
             }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/StorageManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/StorageManager.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/StorageManager.java
index 77415a4..02b9345 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/StorageManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/StorageManager.java
@@ -37,7 +37,7 @@ import org.apache.activemq.core.persistence.impl.PageCountPending;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.RouteContextList;
@@ -64,7 +64,7 @@ import org.apache.activemq.utils.IDGenerator;
  *
 
  */
-public interface StorageManager extends IDGenerator, HornetQComponent
+public interface StorageManager extends IDGenerator, ActiveMQComponent
 {
 
    /**
@@ -405,7 +405,7 @@ public interface StorageManager extends IDGenerator, HornetQComponent
     * Closes the {@link org.apache.activemq.utils.IDGenerator} persisting the current record ID.
     * <p/>
     * Effectively a "pre-stop" method. Necessary due to the "stop"-order at
-    * {@link org.apache.activemq.core.server.impl.HornetQServerImpl}
+    * {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl}
     */
    void persistIdGenerator();
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/BatchingIDGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/BatchingIDGenerator.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/BatchingIDGenerator.java
index 07d6121..09fd1a7 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/BatchingIDGenerator.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/BatchingIDGenerator.java
@@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.apache.activemq.api.core.ActiveMQBuffer;
 import org.apache.activemq.core.journal.EncodingSupport;
 import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.utils.DataConstants;
 import org.apache.activemq.utils.IDGenerator;
 
@@ -101,7 +101,7 @@ public final class BatchingIDGenerator implements IDGenerator
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.batchingIdError(e);
+         ActiveMQServerLogger.LOGGER.batchingIdError(e);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/DescribeJournal.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/DescribeJournal.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/DescribeJournal.java
index 836b2be..e03f311 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/DescribeJournal.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/DescribeJournal.java
@@ -86,7 +86,7 @@ public final class DescribeJournal
 
       SequentialFileFactory bindingsFF = new NIOSequentialFileFactory(bindingsDir, null);
 
-      JournalImpl bindings = new JournalImpl(1024 * 1024, 2, -1, 0, bindingsFF, "hornetq-bindings", "bindings", 1);
+      JournalImpl bindings = new JournalImpl(1024 * 1024, 2, -1, 0, bindingsFF, "activemq-bindings", "bindings", 1);
       describeJournal(bindingsFF, bindings, bindingsDir);
    }
 
@@ -103,8 +103,8 @@ public final class DescribeJournal
                                                     0,
                                                     0,
                                                     messagesFF,
-                                                    "hornetq-data",
-                                                    "hq",
+                                                    "activemq-data",
+                                                    "amq",
                                                     1);
 
       describeJournal(messagesFF, messagesJournal, messagesDir);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java
index 039eca2..2c630ed 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java
@@ -88,8 +88,8 @@ import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationLiveIsStoppingMessage.LiveStopping;
 import org.apache.activemq.core.replication.ReplicatedJournal;
 import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.JournalType;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
@@ -110,7 +110,7 @@ import org.apache.activemq.utils.Base64;
 import org.apache.activemq.utils.ByteUtil;
 import org.apache.activemq.utils.DataConstants;
 import org.apache.activemq.utils.ExecutorFactory;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 import org.apache.activemq.utils.XidCodecSupport;
 
 import static org.apache.activemq.core.persistence.impl.journal.JournalRecordIds.ACKNOWLEDGE_CURSOR;
@@ -235,7 +235,7 @@ public class JournalStorageManager implements StorageManager
 
       if (config.getJournalType() != JournalType.NIO && config.getJournalType() != JournalType.ASYNCIO)
       {
-         throw HornetQMessageBundle.BUNDLE.invalidJournal();
+         throw ActiveMQMessageBundle.BUNDLE.invalidJournal();
       }
 
       bindingsDir = config.getBindingsDirectory();
@@ -255,7 +255,7 @@ public class JournalStorageManager implements StorageManager
                                               config.getJournalCompactMinFiles(),
                                               config.getJournalCompactPercentage(),
                                               bindingsFF,
-                                              "hornetq-bindings",
+                                              "activemq-bindings",
                                               "bindings",
                                               1);
 
@@ -275,7 +275,7 @@ public class JournalStorageManager implements StorageManager
 
       if (config.getJournalType() == JournalType.ASYNCIO)
       {
-         HornetQServerLogger.LOGGER.journalUseAIO();
+         ActiveMQServerLogger.LOGGER.journalUseAIO();
 
          journalFF = new AIOSequentialFileFactory(journalDir,
                                                   config.getJournalBufferSize_AIO(),
@@ -285,7 +285,7 @@ public class JournalStorageManager implements StorageManager
       }
       else if (config.getJournalType() == JournalType.NIO)
       {
-         HornetQServerLogger.LOGGER.journalUseNIO();
+         ActiveMQServerLogger.LOGGER.journalUseNIO();
          journalFF = new NIOSequentialFileFactory(journalDir,
                                                   true,
                                                   config.getJournalBufferSize_NIO(),
@@ -295,7 +295,7 @@ public class JournalStorageManager implements StorageManager
       }
       else
       {
-         throw HornetQMessageBundle.BUNDLE.invalidJournalType2(config.getJournalType());
+         throw ActiveMQMessageBundle.BUNDLE.invalidJournalType2(config.getJournalType());
       }
 
       idGenerator = new BatchingIDGenerator(0, JournalStorageManager.CHECKPOINT_BATCH_SIZE, this);
@@ -305,8 +305,8 @@ public class JournalStorageManager implements StorageManager
                                              config.getJournalCompactMinFiles(),
                                              config.getJournalCompactPercentage(),
                                              journalFF,
-                                             "hornetq-data",
-                                             "hq",
+                                             "activemq-data",
+                                             "amq",
                                              config.getJournalType() == JournalType.ASYNCIO ? config.getJournalMaxIO_AIO()
                                                 : config.getJournalMaxIO_NIO());
 
@@ -370,7 +370,7 @@ public class JournalStorageManager implements StorageManager
 
       if (!(messageJournal instanceof JournalImpl) || !(bindingsJournal instanceof JournalImpl))
       {
-         throw HornetQMessageBundle.BUNDLE.notJournalImpl();
+         throw ActiveMQMessageBundle.BUNDLE.notJournalImpl();
       }
 
 
@@ -512,7 +512,7 @@ public class JournalStorageManager implements StorageManager
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorStoppingReplicationManager(e);
+            ActiveMQServerLogger.LOGGER.errorStoppingReplicationManager(e);
          }
          replicator = null;
          // delete inside the writeLock. Avoids a lot of state checking and races with
@@ -540,7 +540,7 @@ public class JournalStorageManager implements StorageManager
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeMsgId);
+            ActiveMQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeMsgId);
          }
          if (replicator != null)
          {
@@ -664,7 +664,7 @@ public class JournalStorageManager implements StorageManager
    {
       if (!started)
       {
-         HornetQServerLogger.LOGGER.serverIsStopped();
+         ActiveMQServerLogger.LOGGER.serverIsStopped();
          throw new IllegalStateException("Server is stopped");
       }
       waitOnOperations(0);
@@ -675,7 +675,7 @@ public class JournalStorageManager implements StorageManager
    {
       if (!started)
       {
-         HornetQServerLogger.LOGGER.serverIsStopped();
+         ActiveMQServerLogger.LOGGER.serverIsStopped();
          throw new IllegalStateException("Server is stopped");
       }
       return getContext().waitCompletion(timeout);
@@ -898,7 +898,7 @@ public class JournalStorageManager implements StorageManager
       if (message.getMessageID() <= 0)
       {
          // Sanity check only... this shouldn't happen unless there is a bug
-         throw HornetQMessageBundle.BUNDLE.messageIdNotAssigned();
+         throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
       }
 
       readLock();
@@ -1058,7 +1058,7 @@ public class JournalStorageManager implements StorageManager
    {
       if (message.getMessageID() <= 0)
       {
-         throw HornetQMessageBundle.BUNDLE.messageIdNotAssigned();
+         throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
       }
 
       readLock();
@@ -1556,7 +1556,7 @@ public class JournalStorageManager implements StorageManager
             {
                long percent = (long) ((((double) reccount) / ((double) totalSize)) * 100f);
 
-               HornetQServerLogger.LOGGER.percentLoaded(percent);
+               ActiveMQServerLogger.LOGGER.percentLoaded(percent);
             }
 
             RecordInfo record = records.get(reccount);
@@ -1622,7 +1622,7 @@ public class JournalStorageManager implements StorageManager
 
                   if (message == null)
                   {
-                     HornetQServerLogger.LOGGER.cannotFindMessage(record.id);
+                     ActiveMQServerLogger.LOGGER.cannotFindMessage(record.id);
                   }
                   else
                   {
@@ -1643,7 +1643,7 @@ public class JournalStorageManager implements StorageManager
 
                   if (queueMessages == null)
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueue(encoding.queueID, messageID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueue(encoding.queueID, messageID);
                   }
                   else
                   {
@@ -1651,7 +1651,7 @@ public class JournalStorageManager implements StorageManager
 
                      if (rec == null)
                      {
-                        HornetQServerLogger.LOGGER.cannotFindMessage(messageID);
+                        ActiveMQServerLogger.LOGGER.cannotFindMessage(messageID);
                      }
                   }
 
@@ -1669,7 +1669,7 @@ public class JournalStorageManager implements StorageManager
 
                   if (queueMessages == null)
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueDelCount(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueDelCount(encoding.queueID);
                   }
                   else
                   {
@@ -1677,7 +1677,7 @@ public class JournalStorageManager implements StorageManager
 
                      if (rec == null)
                      {
-                        HornetQServerLogger.LOGGER.journalCannotFindMessageDelCount(messageID);
+                        ActiveMQServerLogger.LOGGER.journalCannotFindMessageDelCount(messageID);
                      }
                      else
                      {
@@ -1724,7 +1724,7 @@ public class JournalStorageManager implements StorageManager
 
                   if (queueMessages == null)
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueScheduled(encoding.queueID, messageID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueScheduled(encoding.queueID, messageID);
                   }
                   else
                   {
@@ -1733,7 +1733,7 @@ public class JournalStorageManager implements StorageManager
 
                      if (rec == null)
                      {
-                        HornetQServerLogger.LOGGER.cannotFindMessage(messageID);
+                        ActiveMQServerLogger.LOGGER.cannotFindMessage(messageID);
                      }
                      else
                      {
@@ -1784,7 +1784,7 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueReloading(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueReloading(encoding.queueID);
                      messageJournal.appendDeleteRecord(record.id, false);
 
                   }
@@ -1805,7 +1805,7 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueReloadingPage(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueReloadingPage(encoding.queueID);
                      messageJournal.appendDeleteRecord(record.id, false);
                   }
 
@@ -1826,7 +1826,7 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueReloadingPageCursor(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueReloadingPageCursor(encoding.queueID);
                      messageJournal.appendDeleteRecord(record.id, false);
                   }
 
@@ -1848,7 +1848,7 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.cantFindQueueOnPageComplete(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.cantFindQueueOnPageComplete(encoding.queueID);
                      messageJournal.appendDeleteRecord(record.id, false);
                   }
 
@@ -1908,7 +1908,7 @@ public class JournalStorageManager implements StorageManager
          {
             if (msg.getRefCount() == 0)
             {
-               HornetQServerLogger.LOGGER.largeMessageWithNoRef(msg.getMessageID());
+               ActiveMQServerLogger.LOGGER.largeMessageWithNoRef(msg.getMessageID());
                msg.decrementDelayDeletionCount();
             }
          }
@@ -2211,7 +2211,7 @@ public class JournalStorageManager implements StorageManager
       }
    }
 
-   // HornetQComponent implementation
+   // ActiveMQComponent implementation
    // ------------------------------------------------------
 
    public synchronized void start() throws Exception
@@ -2229,7 +2229,7 @@ public class JournalStorageManager implements StorageManager
 
       cleanupIncompleteFiles();
 
-      singleThreadExecutor = Executors.newSingleThreadExecutor(new HornetQThreadFactory("HornetQ-IO-SingleThread",
+      singleThreadExecutor = Executors.newSingleThreadExecutor(new ActiveMQThreadFactory("ActiveMQ-IO-SingleThread",
                                                                                         true,
                                                                                         getThisClassLoader()));
 
@@ -2392,7 +2392,7 @@ public class JournalStorageManager implements StorageManager
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
          }
       }
    }
@@ -2466,7 +2466,7 @@ public class JournalStorageManager implements StorageManager
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeServerMessage.getMessageID());
+               ActiveMQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeServerMessage.getMessageID());
             }
          }
 
@@ -2518,7 +2518,7 @@ public class JournalStorageManager implements StorageManager
          }
          else
          {
-            throw HornetQMessageBundle.BUNDLE.cannotCreateDir(dir);
+            throw ActiveMQMessageBundle.BUNDLE.cannotCreateDir(dir);
          }
       }
    }
@@ -2708,13 +2708,13 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueReloadingACK(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueReloadingACK(encoding.queueID);
                   }
                   break;
                }
                case PAGE_CURSOR_COUNTER_VALUE:
                {
-                  HornetQServerLogger.LOGGER.journalPAGEOnPrepared();
+                  ActiveMQServerLogger.LOGGER.journalPAGEOnPrepared();
 
                   break;
                }
@@ -2737,7 +2737,7 @@ public class JournalStorageManager implements StorageManager
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.journalCannotFindQueueReloadingACK(encoding.queueID);
+                     ActiveMQServerLogger.LOGGER.journalCannotFindQueueReloadingACK(encoding.queueID);
                   }
 
                   break;
@@ -2745,7 +2745,7 @@ public class JournalStorageManager implements StorageManager
 
                default:
                {
-                  HornetQServerLogger.LOGGER.journalInvalidRecordType(recordType);
+                  ActiveMQServerLogger.LOGGER.journalInvalidRecordType(recordType);
                }
             }
          }
@@ -2767,13 +2767,13 @@ public class JournalStorageManager implements StorageManager
                      if (!pendingLargeMessages.remove(new Pair<Long, Long>(recordDeleted.id, messageID)))
                      {
                         // TODO: Logging
-                        HornetQServerLogger.LOGGER.warn("Large message " + recordDeleted.id + " wasn't found when dealing with add pending large message");
+                        ActiveMQServerLogger.LOGGER.warn("Large message " + recordDeleted.id + " wasn't found when dealing with add pending large message");
                      }
                      installLargeMessageConfirmationOnTX(tx, recordDeleted.id);
                      break;
                   }
                   default:
-                     HornetQServerLogger.LOGGER.journalInvalidRecordTypeOnPreparedTX(b);
+                     ActiveMQServerLogger.LOGGER.journalInvalidRecordTypeOnPreparedTX(b);
                }
             }
 
@@ -3110,7 +3110,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.spi.core.remoting.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.spi.core.remoting.ActiveMQBuffer)
        */
       public void decode(final ActiveMQBuffer buffer)
       {
@@ -3118,7 +3118,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.spi.core.remoting.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.spi.core.remoting.ActiveMQBuffer)
        */
       public void encode(final ActiveMQBuffer buffer)
       {
@@ -3149,7 +3149,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.spi.core.remoting.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.spi.core.remoting.ActiveMQBuffer)
        */
       public void decode(final ActiveMQBuffer buffer)
       {
@@ -3157,7 +3157,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.spi.core.remoting.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.spi.core.remoting.ActiveMQBuffer)
        */
       public void encode(final ActiveMQBuffer buffer)
       {
@@ -3283,7 +3283,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.api.core.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#encode(org.apache.activemq.api.core.ActiveMQBuffer)
        */
       @Override
       public void encode(ActiveMQBuffer buffer)
@@ -3293,7 +3293,7 @@ public class JournalStorageManager implements StorageManager
       }
 
       /* (non-Javadoc)
-       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.api.core.HornetQBuffer)
+       * @see org.apache.activemq.core.journal.EncodingSupport#decode(org.apache.activemq.api.core.ActiveMQBuffer)
        */
       @Override
       public void decode(ActiveMQBuffer buffer)
@@ -3730,7 +3730,7 @@ public class JournalStorageManager implements StorageManager
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.journalError(e);
+                  ActiveMQServerLogger.LOGGER.journalError(e);
                }
             }
          }
@@ -3853,7 +3853,7 @@ public class JournalStorageManager implements StorageManager
             }
             catch (Throwable e)
             {
-               HornetQServerLogger.LOGGER.journalErrorConfirmingLargeMessage(e, msg);
+               ActiveMQServerLogger.LOGGER.journalErrorConfirmingLargeMessage(e, msg);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageImpl.java
index 5781e65..e8fca87 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageImpl.java
@@ -22,7 +22,7 @@ import org.apache.activemq.api.core.ActiveMQInternalErrorException;
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.message.BodyEncoder;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.ServerMessage;
@@ -38,7 +38,7 @@ import org.apache.activemq.utils.TypedProperties;
 public final class LargeServerMessageImpl extends ServerMessageImpl implements LargeServerMessage
 {
    // Constants -----------------------------------------------------
-   private static boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    // Attributes ----------------------------------------------------
 
@@ -171,7 +171,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.errorIncrementDelayDeletionCount(e);
+         ActiveMQServerLogger.LOGGER.errorIncrementDelayDeletionCount(e);
       }
    }
 
@@ -200,7 +200,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
       {
          if (LargeServerMessageImpl.isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Deleting file " + file + " as the usage was complete");
+            ActiveMQServerLogger.LOGGER.trace("Deleting file " + file + " as the usage was complete");
          }
 
          try
@@ -209,7 +209,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.error(e.getMessage(), e);
+            ActiveMQServerLogger.LOGGER.error(e.getMessage(), e);
          }
       }
    }
@@ -273,7 +273,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.largeMessageErrorReleasingResources(e);
+            ActiveMQServerLogger.LOGGER.largeMessageErrorReleasingResources(e);
          }
       }
    }
@@ -356,7 +356,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.lareMessageErrorCopying(e, this);
+         ActiveMQServerLogger.LOGGER.lareMessageErrorCopying(e, this);
          return null;
       }
    }
@@ -522,7 +522,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+               ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
             }
          }
          return bodySize;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageInSync.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageInSync.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageInSync.java
index 25461f3..a8b46ae 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageInSync.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/LargeServerMessageInSync.java
@@ -23,7 +23,7 @@ import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.persistence.StorageManager.LargeMessageExtension;
 import org.apache.activemq.core.replication.ReplicatedLargeMessage;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 
 public final class LargeServerMessageInSync implements ReplicatedLargeMessage
@@ -103,7 +103,7 @@ public final class LargeServerMessageInSync implements ReplicatedLargeMessage
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.largeMessageErrorReleasingResources(e);
+            ActiveMQServerLogger.LOGGER.largeMessageErrorReleasingResources(e);
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/OperationContextImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/OperationContextImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/OperationContextImpl.java
index 8bdb709..8d6d1c7 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/OperationContextImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/OperationContextImpl.java
@@ -24,7 +24,7 @@ import org.apache.activemq.api.core.ActiveMQExceptionType;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.journal.impl.SimpleWaitIOCallback;
 import org.apache.activemq.core.persistence.OperationContext;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.utils.ExecutorFactory;
 
 /**
@@ -241,7 +241,7 @@ public class OperationContextImpl implements OperationContext
       }
       catch (Throwable e)
       {
-         HornetQServerLogger.LOGGER.errorExecutingIOAsyncTask(e);
+         ActiveMQServerLogger.LOGGER.errorExecutingIOAsyncTask(e);
          executorsPending.decrementAndGet();
          task.onError(ActiveMQExceptionType.INTERNAL_ERROR.getCode(),
                       "It wasn't possible to complete IO operation - " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/BindingType.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/BindingType.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/BindingType.java
index 7e7be9d..0cd4ca8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/BindingType.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/BindingType.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.core.postoffice;
 
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 
 /**
  * A BindingType
@@ -49,7 +49,7 @@ public enum BindingType
       }
       else
       {
-         throw HornetQMessageBundle.BUNDLE.cannotConvertToInt();
+         throw ActiveMQMessageBundle.BUNDLE.cannotConvertToInt();
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/PostOffice.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/PostOffice.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/PostOffice.java
index 7874779..2bd7218 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/PostOffice.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/PostOffice.java
@@ -16,7 +16,7 @@ import java.util.Map;
 
 import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.RoutingContext;
@@ -38,7 +38,7 @@ import org.apache.activemq.core.transaction.Transaction;
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  *
  */
-public interface PostOffice extends HornetQComponent
+public interface PostOffice extends ActiveMQComponent
 {
    void addBinding(Binding binding) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/QueueInfo.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/QueueInfo.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/QueueInfo.java
index 2cc396e..0fc360f 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/QueueInfo.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/QueueInfo.java
@@ -16,7 +16,7 @@ import java.io.Serializable;
 import java.util.List;
 
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.server.HornetQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
 
 /**
  * A QueueInfo
@@ -56,15 +56,15 @@ public class QueueInfo implements Serializable
    {
       if (routingName == null)
       {
-         throw HornetQMessageBundle.BUNDLE.routeNameIsNull();
+         throw ActiveMQMessageBundle.BUNDLE.routeNameIsNull();
       }
       if (clusterName == null)
       {
-         throw HornetQMessageBundle.BUNDLE.clusterNameIsNull();
+         throw ActiveMQMessageBundle.BUNDLE.clusterNameIsNull();
       }
       if (address == null)
       {
-         throw HornetQMessageBundle.BUNDLE.addressIsNull();
+         throw ActiveMQMessageBundle.BUNDLE.addressIsNull();
       }
 
       this.routingName = routingName;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/BindingsImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/BindingsImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/BindingsImpl.java
index 900dbdb..9744d89 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/BindingsImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/BindingsImpl.java
@@ -30,7 +30,7 @@ import org.apache.activemq.core.message.impl.MessageImpl;
 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.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.RoutingContext;
 import org.apache.activemq.core.server.ServerMessage;
@@ -51,7 +51,7 @@ public final class BindingsImpl implements Bindings
    // This is public as we use on test assertions
    public static final int MAX_GROUP_RETRY = 10;
 
-   private static boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final ConcurrentMap<SimpleString, List<Binding>> routingNameBindingMap = new ConcurrentHashMap<SimpleString, List<Binding>>();
 
@@ -98,7 +98,7 @@ public final class BindingsImpl implements Bindings
    {
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("addBinding(" + binding + ") being called");
+         ActiveMQServerLogger.LOGGER.trace("addBinding(" + binding + ") being called");
       }
       if (binding.isExclusive())
       {
@@ -129,7 +129,7 @@ public final class BindingsImpl implements Bindings
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Adding binding " + binding + " into " + this + " bindingTable: " + debugBindings());
+         ActiveMQServerLogger.LOGGER.trace("Adding binding " + binding + " into " + this + " bindingTable: " + debugBindings());
       }
 
    }
@@ -161,7 +161,7 @@ public final class BindingsImpl implements Bindings
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Removing binding " + binding + " into " + this + " bindingTable: " + debugBindings());
+         ActiveMQServerLogger.LOGGER.trace("Removing binding " + binding + " into " + this + " bindingTable: " + debugBindings());
       }
    }
 
@@ -174,7 +174,7 @@ public final class BindingsImpl implements Bindings
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Redistributing message " + message);
+         ActiveMQServerLogger.LOGGER.trace("Redistributing message " + message);
       }
 
       SimpleString routingName = originatingQueue.getName();
@@ -326,7 +326,7 @@ public final class BindingsImpl implements Bindings
          {
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Routing message " + message + " on binding=" + this);
+               ActiveMQServerLogger.LOGGER.trace("Routing message " + message + " on binding=" + this);
             }
             for (Map.Entry<SimpleString, List<Binding>> entry : routingNameBindingMap.entrySet())
             {
@@ -512,7 +512,7 @@ public final class BindingsImpl implements Bindings
 
             if (resp == null)
             {
-               HornetQServerLogger.LOGGER.debug("it got a timeout on propose, trying again, number of retries: " + tries);
+               ActiveMQServerLogger.LOGGER.debug("it got a timeout on propose, trying again, number of retries: " + tries);
                // it timed out, so we will check it through routeAndcheckNull
                theBinding = null;
             }
@@ -572,7 +572,7 @@ public final class BindingsImpl implements Bindings
          }
          else
          {
-            HornetQServerLogger.LOGGER.impossibleToRouteGrouped();
+            ActiveMQServerLogger.LOGGER.impossibleToRouteGrouped();
             route(message, context, false);
          }
       }
@@ -683,7 +683,7 @@ public final class BindingsImpl implements Bindings
          }
          else
          {
-            HornetQServerLogger.LOGGER.warn("Couldn't find binding with id=" + bindingID + " on routeFromCluster for message=" + message + " binding = " + this);
+            ActiveMQServerLogger.LOGGER.warn("Couldn't find binding with id=" + bindingID + " on routeFromCluster for message=" + message + " binding = " + this);
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/DuplicateIDCacheImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/DuplicateIDCacheImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/DuplicateIDCacheImpl.java
index f4d09de..5e55ded 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/DuplicateIDCacheImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/DuplicateIDCacheImpl.java
@@ -21,7 +21,7 @@ import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.persistence.StorageManager;
 import org.apache.activemq.core.postoffice.DuplicateIDCache;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionOperationAbstract;
@@ -213,7 +213,7 @@ public class DuplicateIDCacheImpl implements DuplicateIDCache
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.errorDeletingDuplicateCache(e);
+                  ActiveMQServerLogger.LOGGER.errorDeletingDuplicateCache(e);
                }
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/PostOfficeImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/PostOfficeImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/PostOfficeImpl.java
index 59d5133..c57d79c 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/PostOfficeImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/PostOfficeImpl.java
@@ -51,9 +51,9 @@ import org.apache.activemq.core.postoffice.BindingsFactory;
 import org.apache.activemq.core.postoffice.DuplicateIDCache;
 import org.apache.activemq.core.postoffice.PostOffice;
 import org.apache.activemq.core.postoffice.QueueInfo;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
@@ -86,7 +86,7 @@ import org.apache.activemq.utils.UUIDGenerator;
  */
 public class PostOfficeImpl implements PostOffice, NotificationListener, BindingsFactory
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    public static final SimpleString HDR_RESET_QUEUE_DATA = new SimpleString("_HQ_RESET_QUEUE_DATA");
 
@@ -126,9 +126,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
    private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
-   public PostOfficeImpl(final HornetQServer server,
+   public PostOfficeImpl(final ActiveMQServer server,
                          final StorageManager storageManager,
                          final PagingManager pagingManager,
                          final QueueFactory bindableFactory,
@@ -171,7 +171,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       this.server = server;
    }
 
-   // HornetQComponent implementation ---------------------------------------
+   // ActiveMQComponent implementation ---------------------------------------
 
    public synchronized void start() throws Exception
    {
@@ -223,7 +223,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
       if (isTrace)
       {
-         HornetQServerLogger.LOGGER.trace("Receiving notification : " + notification + " on server " + this.server);
+         ActiveMQServerLogger.LOGGER.trace("Receiving notification : " + notification + " on server " + this.server);
       }
       synchronized (notificationLock)
       {
@@ -237,7 +237,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
                if (!props.containsProperty(ManagementHelper.HDR_BINDING_TYPE))
                {
-                  throw HornetQMessageBundle.BUNDLE.bindingTypeNotSpecified();
+                  throw ActiveMQMessageBundle.BUNDLE.bindingTypeNotSpecified();
                }
 
                Integer bindingType = props.getIntProperty(ManagementHelper.HDR_BINDING_TYPE);
@@ -256,7 +256,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
                if (!props.containsProperty(ManagementHelper.HDR_BINDING_ID))
                {
-                  throw HornetQMessageBundle.BUNDLE.bindingIdNotSpecified();
+                  throw ActiveMQMessageBundle.BUNDLE.bindingIdNotSpecified();
                }
 
                long id = props.getLongProperty(ManagementHelper.HDR_BINDING_ID);
@@ -265,7 +265,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
                if (!props.containsProperty(ManagementHelper.HDR_DISTANCE))
                {
-                  throw HornetQMessageBundle.BUNDLE.distancenotSpecified();
+                  throw ActiveMQMessageBundle.BUNDLE.distancenotSpecified();
                }
 
                int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE);
@@ -481,9 +481,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
       String uid = UUIDGenerator.getInstance().generateStringUUID();
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("ClusterCommunication::Sending notification for addBinding " + binding + " from server " + server);
+         ActiveMQServerLogger.LOGGER.debug("ClusterCommunication::Sending notification for addBinding " + binding + " from server " + server);
       }
 
       managementService.sendNotification(new Notification(uid, CoreNotificationType.BINDING_ADDED, props));
@@ -671,15 +671,15 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       else
       {
          // this is a debug and not warn because this could be a regular scenario on publish-subscribe queues (or topic subscriptions on JMS)
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug("Couldn't find any bindings for address=" + address + " on message=" + message);
+            ActiveMQServerLogger.LOGGER.debug("Couldn't find any bindings for address=" + address + " on message=" + message);
          }
       }
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("Message after routed=" + message);
+         ActiveMQServerLogger.LOGGER.trace("Message after routed=" + message);
       }
 
       if (context.getQueueCount() == 0)
@@ -696,14 +696,14 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
             SimpleString dlaAddress = addressSettings.getDeadLetterAddress();
 
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug("sending message to dla address = " + dlaAddress + ", message=" + message);
+               ActiveMQServerLogger.LOGGER.debug("sending message to dla address = " + dlaAddress + ", message=" + message);
             }
 
             if (dlaAddress == null)
             {
-               HornetQServerLogger.LOGGER.noDLA(address);
+               ActiveMQServerLogger.LOGGER.noDLA(address);
             }
             else
             {
@@ -716,9 +716,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
          }
          else
          {
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug("Message " + message + " is not going anywhere as it didn't have a binding on address:" + address);
+               ActiveMQServerLogger.LOGGER.debug("Message " + message + " is not going anywhere as it didn't have a binding on address:" + address);
             }
 
             if (message.isLargeMessage())
@@ -869,9 +869,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
          throw new IllegalStateException("Cannot find queue " + queueName);
       }
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("PostOffice.sendQueueInfoToQueue on server=" + this.server + ", queueName=" + queueName + " and address=" + address);
+         ActiveMQServerLogger.LOGGER.debug("PostOffice.sendQueueInfoToQueue on server=" + this.server + ", queueName=" + queueName + " and address=" + address);
       }
 
       Queue queue = (Queue) binding.getBindable();
@@ -889,9 +889,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
          for (QueueInfo info : queueInfos.values())
          {
-            if (HornetQServerLogger.LOGGER.isTraceEnabled())
+            if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
             {
-               HornetQServerLogger.LOGGER.trace("QueueInfo on sendQueueInfoToQueue = " + info);
+               ActiveMQServerLogger.LOGGER.trace("QueueInfo on sendQueueInfoToQueue = " + info);
             }
             if (info.matchesAddress(address))
             {
@@ -1162,7 +1162,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
          {
             public void onError(final int errorCode, final String errorMessage)
             {
-               HornetQServerLogger.LOGGER.ioErrorAddingReferences(errorCode, errorMessage);
+               ActiveMQServerLogger.LOGGER.ioErrorAddingReferences(errorCode, errorMessage);
             }
 
             public void done()
@@ -1264,7 +1264,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
          if (cacheBridge.contains(bridgeDupBytes))
          {
-            HornetQServerLogger.LOGGER.duplicateMessageDetectedThruBridge(message);
+            ActiveMQServerLogger.LOGGER.duplicateMessageDetectedThruBridge(message);
 
             if (context.getTransaction() != null)
             {
@@ -1307,7 +1307,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
             if (rejectDuplicates && isDuplicate)
             {
-               HornetQServerLogger.LOGGER.duplicateMessageDetected(message);
+               ActiveMQServerLogger.LOGGER.duplicateMessageDetected(message);
 
                String warnMessage = "Duplicate message detected - message will not be routed. Message information:" + message.toString();
 
@@ -1360,7 +1360,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
          if (reaperRunnable != null)
             reaperRunnable.stop();
          reaperRunnable = new Reaper();
-         reaperThread = new Thread(reaperRunnable, "hornetq-expiry-reaper-thread");
+         reaperThread = new Thread(reaperRunnable, "activemq-expiry-reaper-thread");
 
          reaperThread.setPriority(reaperPriority);
 
@@ -1433,7 +1433,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.errorExpiringMessages(e);
+                  ActiveMQServerLogger.LOGGER.errorExpiringMessages(e);
                }
             }
          }
@@ -1530,7 +1530,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       return addressManager;
    }
 
-   public HornetQServer getServer()
+   public ActiveMQServer getServer()
    {
       return server;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/SimpleAddressManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/SimpleAddressManager.java b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/SimpleAddressManager.java
index 51c038b..2cf3dd4 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/SimpleAddressManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/postoffice/impl/SimpleAddressManager.java
@@ -22,8 +22,8 @@ import org.apache.activemq.core.postoffice.AddressManager;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.Bindings;
 import org.apache.activemq.core.postoffice.BindingsFactory;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionOperationAbstract;
 import org.apache.activemq.utils.ConcurrentHashSet;
@@ -60,12 +60,12 @@ public class SimpleAddressManager implements AddressManager
    {
       if (nameMap.putIfAbsent(binding.getUniqueName(), binding) != null || pendingDeletes.contains(binding.getUniqueName()))
       {
-         throw HornetQMessageBundle.BUNDLE.bindingAlreadyExists(binding);
+         throw ActiveMQMessageBundle.BUNDLE.bindingAlreadyExists(binding);
       }
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("Adding binding " + binding + " with address = " + binding.getUniqueName(), new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace("Adding binding " + binding + " with address = " + binding.getUniqueName(), new Exception("trace"));
       }
 
       return addMappingInternal(binding.getAddress(), binding);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/protocol/ProtocolHandler.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/protocol/ProtocolHandler.java b/activemq-server/src/main/java/org/apache/activemq/core/protocol/ProtocolHandler.java
index a305c9c..68c07ff 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/protocol/ProtocolHandler.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/protocol/ProtocolHandler.java
@@ -31,7 +31,7 @@ import io.netty.handler.codec.http.HttpHeaders;
 import io.netty.handler.codec.http.HttpObjectAggregator;
 import io.netty.handler.codec.http.HttpRequestDecoder;
 import io.netty.handler.codec.http.HttpResponseEncoder;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
 import org.apache.activemq.core.protocol.stomp.WebSocketServerHandler;
 import org.apache.activemq.core.remoting.impl.netty.ConnectionCreator;
@@ -112,7 +112,7 @@ public class ProtocolHandler
                ctx.fireChannelRead(msg);
             }
             // HORNETQ-1391
-            else if (upgrade != null && upgrade.equalsIgnoreCase(NettyConnector.HORNETQ_REMOTING))
+            else if (upgrade != null && upgrade.equalsIgnoreCase(NettyConnector.ACTIVEMQ_REMOTING))
             {
                // Send the response and close the connection if necessary.
                ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN)).addListener(ChannelFutureListener.CLOSE);
@@ -168,7 +168,7 @@ public class ProtocolHandler
          //if we get here we assume we use the core protocol as we match nothing else
          if (protocolToUse == null)
          {
-            protocolToUse = HornetQClient.DEFAULT_CORE_PROTOCOL;
+            protocolToUse = ActiveMQClient.DEFAULT_CORE_PROTOCOL;
          }
          ProtocolManager protocolManagerToUse = protocolMap.get(protocolToUse);
          ConnectionCreator channelHandler = nettyAcceptor.createConnectionCreator();


[03/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ActiveMQServerSideProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ActiveMQServerSideProtocolManagerFactory.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ActiveMQServerSideProtocolManagerFactory.java
new file mode 100644
index 0000000..6922004
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ActiveMQServerSideProtocolManagerFactory.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.server.cluster;
+
+import org.apache.activemq.core.protocol.ServerPacketDecoder;
+import org.apache.activemq.core.protocol.core.impl.ActiveMQClientProtocolManager;
+import org.apache.activemq.core.protocol.core.impl.PacketDecoder;
+import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.spi.core.remoting.ClientProtocolManagerFactory;
+
+/**
+ * A protocol manager that will replace the packet manager for inter-server communications
+ * @author Clebert Suconic
+ */
+public class ActiveMQServerSideProtocolManagerFactory implements ClientProtocolManagerFactory
+{
+   private static final ActiveMQServerSideProtocolManagerFactory INSTANCE = new ActiveMQServerSideProtocolManagerFactory();
+
+   public static ActiveMQServerSideProtocolManagerFactory getInstance()
+   {
+      return INSTANCE;
+   }
+
+   private ActiveMQServerSideProtocolManagerFactory()
+   {
+   }
+
+   private static final long serialVersionUID = 1;
+
+   @Override
+   public ClientProtocolManager newProtocolManager()
+   {
+      return new ActiveMQReplicationProtocolManager();
+   }
+
+   class ActiveMQReplicationProtocolManager extends ActiveMQClientProtocolManager
+   {
+      @Override
+      protected PacketDecoder getPacketDecoder()
+      {
+         return ServerPacketDecoder.INSTANCE;
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BackupManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BackupManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BackupManager.java
index ef6af02..8a7c428 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BackupManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BackupManager.java
@@ -29,18 +29,18 @@ import org.apache.activemq.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.core.client.impl.Topology;
 import org.apache.activemq.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.NodeManager;
 import org.apache.activemq.utils.ExecutorFactory;
 
 /*
 * takes care of updating the cluster with a backups transport configuration which is based on each cluster connection.
 * */
-public class BackupManager implements HornetQComponent
+public class BackupManager implements ActiveMQComponent
 {
-   private HornetQServer server;
+   private ActiveMQServer server;
    private Executor executor;
    private ScheduledExecutorService scheduledExecutor;
    private NodeManager nodeManager;
@@ -51,7 +51,7 @@ public class BackupManager implements HornetQComponent
 
    private boolean started;
 
-   public BackupManager(HornetQServer server, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutor, NodeManager nodeManager,
+   public BackupManager(ActiveMQServer server, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutor, NodeManager nodeManager,
                         Configuration configuration, ClusterManager clusterManager)
    {
       this.server = server;
@@ -218,7 +218,7 @@ public class BackupManager implements HornetQComponent
             backupServerLocator.setIdentity("backupLocatorFor='" + server + "'");
             backupServerLocator.setReconnectAttempts(-1);
             backupServerLocator.setInitialConnectAttempts(-1);
-            backupServerLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+            backupServerLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
          }
       }
 
@@ -242,12 +242,12 @@ public class BackupManager implements HornetQComponent
                   if (localBackupLocator == null)
                   {
                      if (!stopping)
-                        HornetQServerLogger.LOGGER.error("Error announcing backup: backupServerLocator is null. " + this);
+                        ActiveMQServerLogger.LOGGER.error("Error announcing backup: backupServerLocator is null. " + this);
                      return;
                   }
-                  if (HornetQServerLogger.LOGGER.isDebugEnabled())
+                  if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                   {
-                     HornetQServerLogger.LOGGER.debug(BackupConnector.this + ":: announcing " + connector + " to " + backupServerLocator);
+                     ActiveMQServerLogger.LOGGER.debug(BackupConnector.this + ":: announcing " + connector + " to " + backupServerLocator);
                   }
                   announcingBackup = true;
                   //connect to the cluster
@@ -264,7 +264,7 @@ public class BackupManager implements HornetQComponent
                                                       true,
                                                       connector,
                                                       null);
-                     HornetQServerLogger.LOGGER.backupAnnounced();
+                     ActiveMQServerLogger.LOGGER.backupAnnounced();
                      backupAnnounced = true;
                   }
                }
@@ -278,7 +278,7 @@ public class BackupManager implements HornetQComponent
                      return;
                   if (stopping)
                      return;
-                  HornetQServerLogger.LOGGER.errorAnnouncingBackup();
+                  ActiveMQServerLogger.LOGGER.errorAnnouncingBackup();
 
                   scheduledExecutor.schedule(new Runnable()
                   {
@@ -365,13 +365,13 @@ public class BackupManager implements HornetQComponent
       {
          if (tcConfigs != null && tcConfigs.length > 0)
          {
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug(BackupManager.this + "Creating a serverLocator for " + Arrays.toString(tcConfigs));
+               ActiveMQServerLogger.LOGGER.debug(BackupManager.this + "Creating a serverLocator for " + Arrays.toString(tcConfigs));
             }
             ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, tcConfigs);
             locator.setClusterConnection(true);
-            locator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+            locator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
             return locator;
          }
          return null;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/Bridge.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/Bridge.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/Bridge.java
index 9e68b40..e4cc604 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/Bridge.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/Bridge.java
@@ -14,7 +14,7 @@ package org.apache.activemq.core.server.cluster;
 
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.core.server.Consumer;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.management.NotificationService;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
@@ -29,7 +29,7 @@ import org.apache.activemq.spi.core.protocol.RemotingConnection;
  *
  *
  */
-public interface Bridge extends Consumer, HornetQComponent
+public interface Bridge extends Consumer, ActiveMQComponent
 {
    SimpleString getName();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BroadcastGroup.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BroadcastGroup.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BroadcastGroup.java
index 996b3a6..4853c0e 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BroadcastGroup.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/BroadcastGroup.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.server.cluster;
 
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.management.NotificationService;
 
 /**
@@ -26,7 +26,7 @@ import org.apache.activemq.core.server.management.NotificationService;
  *
  *
  */
-public interface BroadcastGroup extends HornetQComponent
+public interface BroadcastGroup extends ActiveMQComponent
 {
    void setNotificationService(NotificationService notificationService);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConfigurationUtil.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConfigurationUtil.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConfigurationUtil.java
index 8cd4dda..48fe192 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConfigurationUtil.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConfigurationUtil.java
@@ -17,7 +17,7 @@ import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.ClusterConnectionConfiguration;
 import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 
 import java.lang.reflect.Array;
 import java.util.List;
@@ -28,14 +28,14 @@ public class ClusterConfigurationUtil
    {
       if (config.getName() == null)
       {
-         HornetQServerLogger.LOGGER.clusterConnectionNotUnique();
+         ActiveMQServerLogger.LOGGER.clusterConnectionNotUnique();
 
          return null;
       }
 
       if (config.getAddress() == null)
       {
-         HornetQServerLogger.LOGGER.clusterConnectionNoForwardAddress();
+         ActiveMQServerLogger.LOGGER.clusterConnectionNoForwardAddress();
 
          return null;
       }
@@ -44,7 +44,7 @@ public class ClusterConfigurationUtil
 
       if (connector == null)
       {
-         HornetQServerLogger.LOGGER.clusterConnectionNoConnector(config.getConnectorName());
+         ActiveMQServerLogger.LOGGER.clusterConnectionNoConnector(config.getConnectorName());
          return null;
       }
       return connector;
@@ -57,7 +57,7 @@ public class ClusterConfigurationUtil
 
       if (dg == null)
       {
-         HornetQServerLogger.LOGGER.clusterConnectionNoDiscoveryGroup(config.getDiscoveryGroupName());
+         ActiveMQServerLogger.LOGGER.clusterConnectionNoDiscoveryGroup(config.getDiscoveryGroupName());
          return null;
       }
       return dg;
@@ -80,7 +80,7 @@ public class ClusterConfigurationUtil
 
          if (connector == null)
          {
-            HornetQServerLogger.LOGGER.bridgeNoConnector(connectorName);
+            ActiveMQServerLogger.LOGGER.bridgeNoConnector(connectorName);
 
             return null;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConnection.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConnection.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConnection.java
index e5facf7..dcabbc3 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConnection.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterConnection.java
@@ -19,8 +19,8 @@ import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
 import org.apache.activemq.core.client.impl.Topology;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
 
 /**
  * A ClusterConnection
@@ -31,13 +31,13 @@ import org.apache.activemq.core.server.HornetQServer;
  *
  *
  */
-public interface ClusterConnection extends HornetQComponent, ClusterTopologyListener
+public interface ClusterConnection extends ActiveMQComponent, ClusterTopologyListener
 {
    SimpleString getName();
 
    String getNodeID();
 
-   HornetQServer getServer();
+   ActiveMQServer getServer();
 
    void nodeAnnounced(long eventUID, String nodeID, String backupGroupName, String scaleDownGroupName, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean backup);
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterControl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterControl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterControl.java
index ccd4805..1567374 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterControl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterControl.java
@@ -33,9 +33,9 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.NodeAnnounceMessag
 import org.apache.activemq.core.protocol.core.impl.wireformat.QuorumVoteMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.QuorumVoteReplyMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ScaleDownAnnounceMessage;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.cluster.qourum.QuorumVoteHandler;
 import org.apache.activemq.core.server.cluster.qourum.Vote;
 
@@ -49,13 +49,13 @@ public class ClusterControl implements AutoCloseable
 
    private final ClientSessionFactoryInternal sessionFactory;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final String clusterUser;
 
    private final String clusterPassword;
 
-   public ClusterControl(ClientSessionFactoryInternal sessionFactory, HornetQServer server)
+   public ClusterControl(ClientSessionFactoryInternal sessionFactory, ActiveMQServer server)
    {
       this.sessionFactory = sessionFactory;
       this.server = server;
@@ -80,7 +80,7 @@ public class ClusterControl implements AutoCloseable
 
       if (!packet.isAuthorized())
       {
-         throw HornetQMessageBundle.BUNDLE.unableToValidateClusterUser(clusterUser);
+         throw ActiveMQMessageBundle.BUNDLE.unableToValidateClusterUser(clusterUser);
       }
    }
 
@@ -98,7 +98,7 @@ public class ClusterControl implements AutoCloseable
       ClusterConnectionConfiguration config = ConfigurationUtils.getReplicationClusterConfiguration(server.getConfiguration(), replicationClusterName);
       if (config == null)
       {
-         HornetQServerLogger.LOGGER.announceBackupNoClusterConnections();
+         ActiveMQServerLogger.LOGGER.announceBackupNoClusterConnections();
          throw new ActiveMQException("lacking cluster connection");
 
       }
@@ -106,7 +106,7 @@ public class ClusterControl implements AutoCloseable
 
       if (connector == null)
       {
-         HornetQServerLogger.LOGGER.announceBackupNoConnector(config.getConnectorName());
+         ActiveMQServerLogger.LOGGER.announceBackupNoConnector(config.getConnectorName());
          throw new ActiveMQException("lacking cluster connection");
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterController.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterController.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterController.java
index 3836788..371994e 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterController.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterController.java
@@ -27,7 +27,7 @@ import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.ServerLocator;
 import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
 import org.apache.activemq.core.client.impl.ServerLocatorImpl;
@@ -44,9 +44,9 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.NodeAnnounceMessag
 import org.apache.activemq.core.protocol.core.impl.wireformat.QuorumVoteMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.QuorumVoteReplyMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ScaleDownAnnounceMessage;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.cluster.qourum.QuorumManager;
 import org.apache.activemq.core.server.cluster.qourum.QuorumVoteHandler;
 import org.apache.activemq.core.server.cluster.qourum.Vote;
@@ -56,13 +56,13 @@ import org.apache.activemq.spi.core.remoting.Acceptor;
 /**
  * used for creating and managing cluster control connections for each cluster connection and the replication connection
  */
-public class ClusterController implements HornetQComponent
+public class ClusterController implements ActiveMQComponent
 {
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final QuorumManager quorumManager;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private Map<SimpleString, ServerLocatorInternal> locators = new HashMap<>();
 
@@ -79,7 +79,7 @@ public class ClusterController implements HornetQComponent
    private boolean started;
    private SimpleString replicatedClusterName;
 
-   public ClusterController(HornetQServer server, ScheduledExecutorService scheduledExecutor)
+   public ClusterController(ActiveMQServer server, ScheduledExecutorService scheduledExecutor)
    {
       this.server = server;
       executor = server.getExecutorFactory().getExecutor();
@@ -99,7 +99,7 @@ public class ClusterController implements HornetQComponent
          replicationLocator = locators.get(replicatedClusterName);
          if (replicationLocator == null)
          {
-            HornetQServerLogger.LOGGER.noClusterConnectionForReplicationCluster();
+            ActiveMQServerLogger.LOGGER.noClusterConnectionForReplicationCluster();
             replicationLocator = defaultLocator;
          }
       }
@@ -162,12 +162,12 @@ public class ClusterController implements HornetQComponent
     */
    public void addClusterConnection(SimpleString name, DiscoveryGroupConfiguration dg)
    {
-      ServerLocatorImpl serverLocator = (ServerLocatorImpl) HornetQClient.createServerLocatorWithHA(dg);
+      ServerLocatorImpl serverLocator = (ServerLocatorImpl) ActiveMQClient.createServerLocatorWithHA(dg);
       //if the cluster isn't available we want to hang around until it is
       serverLocator.setReconnectAttempts(-1);
       serverLocator.setInitialConnectAttempts(-1);
       //this is used for replication so need to use the server packet decoder
-      serverLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+      serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
       locators.put(name, serverLocator);
    }
 
@@ -179,12 +179,12 @@ public class ClusterController implements HornetQComponent
     */
    public void addClusterConnection(SimpleString name, TransportConfiguration[] tcConfigs)
    {
-      ServerLocatorImpl serverLocator = (ServerLocatorImpl) HornetQClient.createServerLocatorWithHA(tcConfigs);
+      ServerLocatorImpl serverLocator = (ServerLocatorImpl) ActiveMQClient.createServerLocatorWithHA(tcConfigs);
       //if the cluster isn't available we want to hang around until it is
       serverLocator.setReconnectAttempts(-1);
       serverLocator.setInitialConnectAttempts(-1);
       //this is used for replication so need to use the server packet decoder
-      serverLocator.setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+      serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
       locators.put(name, serverLocator);
    }
 
@@ -248,7 +248,7 @@ public class ClusterController implements HornetQComponent
     */
    public ClusterControl connectToNodeInCluster(ClientSessionFactoryInternal sf)
    {
-      sf.getServerLocator().setProtocolManagerFactory(HornetQServerSideProtocolManagerFactory.getInstance());
+      sf.getServerLocator().setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance());
       return new ClusterControl(sf, server);
    }
 
@@ -374,7 +374,7 @@ public class ClusterController implements HornetQComponent
                }
                if (isTrace)
                {
-                  HornetQServerLogger.LOGGER.trace("Server " + server + " receiving nodeUp from NodeID=" + msg.getNodeID() + ", pair=" + pair);
+                  ActiveMQServerLogger.LOGGER.trace("Server " + server + " receiving nodeUp from NodeID=" + msg.getNodeID() + ", pair=" + pair);
                }
 
                if (acceptorUsed != null)
@@ -387,12 +387,12 @@ public class ClusterController implements HornetQComponent
                   }
                   else
                   {
-                     HornetQServerLogger.LOGGER.debug("Cluster connection is null on acceptor = " + acceptorUsed);
+                     ActiveMQServerLogger.LOGGER.debug("Cluster connection is null on acceptor = " + acceptorUsed);
                   }
                }
                else
                {
-                  HornetQServerLogger.LOGGER.debug("there is no acceptor used configured at the CoreProtocolManager " + this);
+                  ActiveMQServerLogger.LOGGER.debug("there is no acceptor used configured at the CoreProtocolManager " + this);
                }
             }
             else if (packet.getType() == PacketImpl.QUORUM_VOTE)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterManager.java
index 3ecdbaa..5da2be8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ClusterManager.java
@@ -31,7 +31,7 @@ import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.core.config.BridgeConfiguration;
 import org.apache.activemq.core.config.ClusterConnectionConfiguration;
@@ -43,11 +43,11 @@ import org.apache.activemq.core.protocol.core.Channel;
 import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.PacketImpl;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.NodeManager;
 import org.apache.activemq.core.server.Queue;
 import org.apache.activemq.core.server.cluster.ha.HAManager;
@@ -73,7 +73,7 @@ import org.apache.activemq.utils.FutureLatch;
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author Clebert Suconic
  */
-public final class ClusterManager implements HornetQComponent
+public final class ClusterManager implements ActiveMQComponent
 {
    private ClusterController clusterController;
 
@@ -85,7 +85,7 @@ public final class ClusterManager implements HornetQComponent
 
    private final ExecutorFactory executorFactory;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
    private final PostOffice postOffice;
 
@@ -146,7 +146,7 @@ public final class ClusterManager implements HornetQComponent
    private final NodeManager nodeManager;
 
    public ClusterManager(final ExecutorFactory executorFactory,
-                         final HornetQServer server,
+                         final ActiveMQServer server,
                          final PostOffice postOffice,
                          final ScheduledExecutorService scheduledExecutor,
                          final ManagementService managementService,
@@ -288,7 +288,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.unableToStartBroadcastGroup(e, group.getName());
+            ActiveMQServerLogger.LOGGER.unableToStartBroadcastGroup(e, group.getName());
          }
       }
 
@@ -300,7 +300,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.unableToStartClusterConnection(e, conn.getName());
+            ActiveMQServerLogger.LOGGER.unableToStartClusterConnection(e, conn.getName());
          }
       }
 
@@ -314,7 +314,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.unableToStartBridge(e, bridge.getName());
+            ActiveMQServerLogger.LOGGER.unableToStartBridge(e, bridge.getName());
          }
       }
 
@@ -376,7 +376,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorClosingServerLocator(e, clusterLocator);
+            ActiveMQServerLogger.LOGGER.errorClosingServerLocator(e, clusterLocator);
          }
       }
       clusterLocators.clear();
@@ -433,26 +433,26 @@ public final class ClusterManager implements HornetQComponent
    {
       if (config.getName() == null)
       {
-         HornetQServerLogger.LOGGER.bridgeNotUnique();
+         ActiveMQServerLogger.LOGGER.bridgeNotUnique();
 
          return;
       }
 
       if (config.getQueueName() == null)
       {
-         HornetQServerLogger.LOGGER.bridgeNoQueue(config.getName());
+         ActiveMQServerLogger.LOGGER.bridgeNoQueue(config.getName());
 
          return;
       }
 
       if (config.getForwardingAddress() == null)
       {
-         HornetQServerLogger.LOGGER.bridgeNoForwardAddress(config.getName());
+         ActiveMQServerLogger.LOGGER.bridgeNoForwardAddress(config.getName());
       }
 
       if (bridges.containsKey(config.getName()))
       {
-         HornetQServerLogger.LOGGER.bridgeAlreadyDeployed(config.getName());
+         ActiveMQServerLogger.LOGGER.bridgeAlreadyDeployed(config.getName());
 
          return;
       }
@@ -463,7 +463,7 @@ public final class ClusterManager implements HornetQComponent
 
       if (binding == null)
       {
-         HornetQServerLogger.LOGGER.bridgeQueueNotFound(config.getQueueName(), config.getName());
+         ActiveMQServerLogger.LOGGER.bridgeQueueNotFound(config.getQueueName(), config.getName());
 
          return;
       }
@@ -478,18 +478,18 @@ public final class ClusterManager implements HornetQComponent
             .get(config.getDiscoveryGroupName());
          if (discoveryGroupConfiguration == null)
          {
-            HornetQServerLogger.LOGGER.bridgeNoDiscoveryGroup(config.getDiscoveryGroupName());
+            ActiveMQServerLogger.LOGGER.bridgeNoDiscoveryGroup(config.getDiscoveryGroupName());
 
             return;
          }
 
          if (config.isHA())
          {
-            serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(discoveryGroupConfiguration);
+            serverLocator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithHA(discoveryGroupConfiguration);
          }
          else
          {
-            serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithoutHA(discoveryGroupConfiguration);
+            serverLocator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithoutHA(discoveryGroupConfiguration);
          }
 
       }
@@ -499,17 +499,17 @@ public final class ClusterManager implements HornetQComponent
 
          if (tcConfigs == null)
          {
-            HornetQServerLogger.LOGGER.bridgeCantFindConnectors(config.getName());
+            ActiveMQServerLogger.LOGGER.bridgeCantFindConnectors(config.getName());
             return;
          }
 
          if (config.isHA())
          {
-            serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(tcConfigs);
+            serverLocator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithHA(tcConfigs);
          }
          else
          {
-            serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithoutHA(tcConfigs);
+            serverLocator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithoutHA(tcConfigs);
          }
 
       }
@@ -541,7 +541,7 @@ public final class ClusterManager implements HornetQComponent
 
       if (!config.isUseDuplicateDetection())
       {
-         HornetQServerLogger.LOGGER.debug("Bridge " + config.getName() +
+         ActiveMQServerLogger.LOGGER.debug("Bridge " + config.getName() +
                                              " is configured to not use duplicate detecion, it will send messages synchronously");
       }
 
@@ -595,11 +595,11 @@ public final class ClusterManager implements HornetQComponent
       {
          if (packet.getType() == PacketImpl.EXCEPTION)
          {
-            HornetQExceptionMessage msg = (HornetQExceptionMessage) packet;
+            ActiveMQExceptionMessage msg = (ActiveMQExceptionMessage) packet;
             final ActiveMQException exception = msg.getException();
             if (exception.getType() == ActiveMQExceptionType.CLUSTER_SECURITY_EXCEPTION)
             {
-               HornetQServerLogger.LOGGER.clusterManagerAuthenticationError(exception.getMessage());
+               ActiveMQServerLogger.LOGGER.clusterManagerAuthenticationError(exception.getMessage());
                executor.execute(new Runnable()
                {
                   @Override
@@ -652,7 +652,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
          }
       }
       bridges.clear();
@@ -696,7 +696,7 @@ public final class ClusterManager implements HornetQComponent
 
       if (clusterConnections.containsKey(config.getName()))
       {
-         HornetQServerLogger.LOGGER.clusterConnectionAlreadyExists(config.getConnectorName());
+         ActiveMQServerLogger.LOGGER.clusterConnectionAlreadyExists(config.getConnectorName());
          return;
       }
 
@@ -708,9 +708,9 @@ public final class ClusterManager implements HornetQComponent
 
          if (dg == null) return;
 
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug(this + " Starting a Discovery Group Cluster Connection, name=" +
+            ActiveMQServerLogger.LOGGER.debug(this + " Starting a Discovery Group Cluster Connection, name=" +
                                                 config.getDiscoveryGroupName() +
                                                 ", dg=" +
                                                 dg);
@@ -753,9 +753,9 @@ public final class ClusterManager implements HornetQComponent
       {
          TransportConfiguration[] tcConfigs = ClusterConfigurationUtil.getTransportConfigurations(config, configuration);
 
-         if (HornetQServerLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
          {
-            HornetQServerLogger.LOGGER.debug(this + " defining cluster connection towards " + Arrays.toString(tcConfigs));
+            ActiveMQServerLogger.LOGGER.debug(this + " defining cluster connection towards " + Arrays.toString(tcConfigs));
          }
 
          clusterConnection = new ClusterConnectionImpl(this,
@@ -804,9 +804,9 @@ public final class ClusterManager implements HornetQComponent
 
       clusterConnections.put(config.getName(), clusterConnection);
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("ClusterConnection.start at " + clusterConnection, new Exception("trace"));
+         ActiveMQServerLogger.LOGGER.trace("ClusterConnection.start at " + clusterConnection, new Exception("trace"));
       }
    }
 
@@ -824,7 +824,7 @@ public final class ClusterManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            throw HornetQMessageBundle.BUNDLE.errorCreatingTransformerClass(e, transformerClassName);
+            throw ActiveMQMessageBundle.BUNDLE.errorCreatingTransformerClass(e, transformerClassName);
          }
       }
       return transformer;
@@ -835,7 +835,7 @@ public final class ClusterManager implements HornetQComponent
    {
       if (broadcastGroups.containsKey(config.getName()))
       {
-         HornetQServerLogger.LOGGER.broadcastGroupAlreadyExists(config.getName());
+         ActiveMQServerLogger.LOGGER.broadcastGroupAlreadyExists(config.getName());
 
          return;
       }
@@ -882,7 +882,7 @@ public final class ClusterManager implements HornetQComponent
 
    private void logWarnNoConnector(final String connectorName, final String bgName)
    {
-      HornetQServerLogger.LOGGER.broadcastGroupNoConnector(connectorName, bgName);
+      ActiveMQServerLogger.LOGGER.broadcastGroupNoConnector(connectorName, bgName);
    }
 
    private synchronized Collection<ClusterConnection> cloneClusterConnections()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/HornetQServerSideProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/HornetQServerSideProtocolManagerFactory.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/HornetQServerSideProtocolManagerFactory.java
deleted file mode 100644
index a08a3b1..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/HornetQServerSideProtocolManagerFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.server.cluster;
-
-import org.apache.activemq.core.protocol.ServerPacketDecoder;
-import org.apache.activemq.core.protocol.core.impl.HornetQClientProtocolManager;
-import org.apache.activemq.core.protocol.core.impl.PacketDecoder;
-import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
-import org.apache.activemq.spi.core.remoting.ClientProtocolManagerFactory;
-
-/**
- * A protocol manager that will replace the packet manager for inter-server communications
- * @author Clebert Suconic
- */
-public class HornetQServerSideProtocolManagerFactory implements ClientProtocolManagerFactory
-{
-   private static final HornetQServerSideProtocolManagerFactory INSTANCE = new  HornetQServerSideProtocolManagerFactory();
-
-   public static HornetQServerSideProtocolManagerFactory getInstance()
-   {
-      return INSTANCE;
-   }
-
-   private HornetQServerSideProtocolManagerFactory()
-   {
-   }
-
-   private static final long serialVersionUID = 1;
-
-   @Override
-   public ClientProtocolManager newProtocolManager()
-   {
-      return new HornetQReplicationProtocolManager();
-   }
-
-   class HornetQReplicationProtocolManager extends HornetQClientProtocolManager
-   {
-      @Override
-      protected PacketDecoder getPacketDecoder()
-      {
-         return ServerPacketDecoder.INSTANCE;
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedHAManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedHAManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedHAManager.java
index b53a2be..bf1a58c 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedHAManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedHAManager.java
@@ -18,8 +18,8 @@ import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.TopologyMember;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.core.server.ActivationParams;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.cluster.ClusterControl;
 import org.apache.activemq.core.server.cluster.ClusterController;
 
@@ -33,16 +33,16 @@ public class ColocatedHAManager implements HAManager
 
    private final ColocatedPolicy haPolicy;
 
-   private final HornetQServer server;
+   private final ActiveMQServer server;
 
-   private Map<String, HornetQServer> backupServers = new HashMap<>();
+   private Map<String, ActiveMQServer> backupServers = new HashMap<>();
 
    private boolean started;
 
-   public ColocatedHAManager(ColocatedPolicy haPolicy, HornetQServer hornetQServer)
+   public ColocatedHAManager(ColocatedPolicy haPolicy, ActiveMQServer activeMQServer)
    {
       this.haPolicy = haPolicy;
-      server = hornetQServer;
+      server = activeMQServer;
    }
 
    /**
@@ -63,11 +63,11 @@ public class ColocatedHAManager implements HAManager
     */
    public void stop()
    {
-      for (HornetQServer hornetQServer : backupServers.values())
+      for (ActiveMQServer activeMQServer : backupServers.values())
       {
          try
          {
-            hornetQServer.stop();
+            activeMQServer.stop();
          }
          catch (Exception e)
          {
@@ -107,7 +107,7 @@ public class ColocatedHAManager implements HAManager
     *
     * @return the backups
     */
-   public Map<String, HornetQServer> getBackupServers()
+   public Map<String, ActiveMQServer> getBackupServers()
    {
       return backupServers;
    }
@@ -149,7 +149,7 @@ public class ColocatedHAManager implements HAManager
    private synchronized boolean activateSharedStoreBackup(String journalDirectory, String bindingsDirectory, String largeMessagesDirectory, String pagingDirectory) throws Exception
    {
       Configuration configuration = server.getConfiguration().copy();
-      HornetQServer backup = server.createBackupServer(configuration);
+      ActiveMQServer backup = server.createBackupServer(configuration);
       try
       {
          int portOffset = haPolicy.getBackupPortOffset() * (backupServers.size() + 1);
@@ -166,10 +166,10 @@ public class ColocatedHAManager implements HAManager
       catch (Exception e)
       {
          backup.stop();
-         HornetQServerLogger.LOGGER.activateSharedStoreSlaveFailed(e);
+         ActiveMQServerLogger.LOGGER.activateSharedStoreSlaveFailed(e);
          return false;
       }
-      HornetQServerLogger.LOGGER.activatingSharedStoreSlave();
+      ActiveMQServerLogger.LOGGER.activatingSharedStoreSlave();
       return true;
    }
 
@@ -184,7 +184,7 @@ public class ColocatedHAManager implements HAManager
    private synchronized boolean activateReplicatedBackup(SimpleString nodeID) throws Exception
    {
       Configuration configuration = server.getConfiguration().copy();
-      HornetQServer backup = server.createBackupServer(configuration);
+      ActiveMQServer backup = server.createBackupServer(configuration);
       try
       {
          TopologyMember member = server.getClusterManager().getDefaultConnection(null).getTopology().getMember(nodeID.toString());
@@ -202,10 +202,10 @@ public class ColocatedHAManager implements HAManager
       catch (Exception e)
       {
          backup.stop();
-         HornetQServerLogger.LOGGER.activateReplicatedBackupFailed(e);
+         ActiveMQServerLogger.LOGGER.activateReplicatedBackupFailed(e);
          return false;
       }
-      HornetQServerLogger.LOGGER.activatingReplica(nodeID);
+      ActiveMQServerLogger.LOGGER.activatingReplica(nodeID);
       return true;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedPolicy.java
index bd897a4..3f32ca8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ColocatedPolicy.java
@@ -14,7 +14,7 @@ package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.core.server.impl.ColocatedActivation;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.LiveActivation;
 
 import java.util.ArrayList;
@@ -86,7 +86,7 @@ public class ColocatedPolicy implements HAPolicy<LiveActivation>
    }
 
    @Override
-   public LiveActivation createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception
+   public LiveActivation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception
    {
       return new ColocatedActivation(server, this, livePolicy.createActivation(server, wasLive, activationParams, shutdownOnCriticalIO));
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAManager.java
index c5ca29b..b9d0410 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAManager.java
@@ -12,20 +12,20 @@
  */
 package org.apache.activemq.core.server.cluster.ha;
 
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServer;
 
 import java.util.Map;
 
 /*
 * An HAManager takes care of any colocated backups in a VM.
 * */
-public interface HAManager extends HornetQComponent
+public interface HAManager extends ActiveMQComponent
 {
    /**
     * return the current backup servers
     *
     * @return the backups
     */
-   Map<String, HornetQServer> getBackupServers();
+   Map<String, ActiveMQServer> getBackupServers();
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAPolicy.java
index 747b864..44274d2 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/HAPolicy.java
@@ -15,7 +15,7 @@ package org.apache.activemq.core.server.cluster.ha;
 import java.util.Map;
 
 import org.apache.activemq.core.server.impl.Activation;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 
 /**
  * Every live server will have an HAPolicy that configures the type of server that it should be either live, backup or
@@ -26,7 +26,7 @@ public interface HAPolicy<T extends Activation>
    /*
    * created the Activation associated with this policy.
    * */
-   T createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception;
+   T createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception;
 
    boolean isSharedStore();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/LiveOnlyPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/LiveOnlyPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/LiveOnlyPolicy.java
index 1b83bb2..25b1798 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/LiveOnlyPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/LiveOnlyPolicy.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.core.server.impl.Activation;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.LiveOnlyActivation;
 
 import java.util.Map;
@@ -32,7 +32,7 @@ public class LiveOnlyPolicy implements HAPolicy<Activation>
    }
 
    @Override
-   public Activation createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
+   public Activation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
    {
       return new LiveOnlyActivation(server, this);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicaPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicaPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicaPolicy.java
index f0c623d..c472e28 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicaPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicaPolicy.java
@@ -14,7 +14,7 @@ package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.core.server.impl.Activation;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.SharedNothingBackupActivation;
 
 import java.util.Map;
@@ -125,9 +125,9 @@ public class ReplicaPolicy extends BackupPolicy
    }
 
    @Override
-   public Activation createActivation(HornetQServerImpl server, boolean wasLive,
+   public Activation createActivation(ActiveMQServerImpl server, boolean wasLive,
                                       Map<String, Object> activationParams,
-                                      HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception
+                                      ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception
    {
       SharedNothingBackupActivation backupActivation = new SharedNothingBackupActivation(server, wasLive, activationParams, shutdownOnCriticalIO, this);
       backupActivation.init();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicatedPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicatedPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicatedPolicy.java
index e528d37..94929c2 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicatedPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ReplicatedPolicy.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.LiveActivation;
 import org.apache.activemq.core.server.impl.SharedNothingLiveActivation;
 
@@ -160,7 +160,7 @@ public class ReplicatedPolicy implements HAPolicy<LiveActivation>
    }
 
    @Override
-   public LiveActivation createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
+   public LiveActivation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
    {
       return new SharedNothingLiveActivation(server, this);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ScaleDownPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ScaleDownPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ScaleDownPolicy.java
index dfb6f57..f36a8bc 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ScaleDownPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/ScaleDownPolicy.java
@@ -15,12 +15,12 @@ package org.apache.activemq.core.server.cluster.ha;
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServer;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 
 import java.lang.reflect.Array;
 import java.util.ArrayList;
@@ -110,48 +110,48 @@ public class ScaleDownPolicy
       this.enabled = enabled;
    }
 
-   public static ServerLocatorInternal getScaleDownConnector(ScaleDownPolicy scaleDownPolicy, HornetQServer hornetQServer) throws ActiveMQException
+   public static ServerLocatorInternal getScaleDownConnector(ScaleDownPolicy scaleDownPolicy, ActiveMQServer activeMQServer) throws ActiveMQException
    {
       if (!scaleDownPolicy.getConnectors().isEmpty())
       {
-         return (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(connectorNameListToArray(scaleDownPolicy.getConnectors(), hornetQServer));
+         return (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithHA(connectorNameListToArray(scaleDownPolicy.getConnectors(), activeMQServer));
       }
       else if (scaleDownPolicy.getDiscoveryGroup() != null)
       {
-         DiscoveryGroupConfiguration dg = hornetQServer.getConfiguration().getDiscoveryGroupConfigurations().get(scaleDownPolicy.getDiscoveryGroup());
+         DiscoveryGroupConfiguration dg = activeMQServer.getConfiguration().getDiscoveryGroupConfigurations().get(scaleDownPolicy.getDiscoveryGroup());
 
          if (dg == null)
          {
-            throw HornetQMessageBundle.BUNDLE.noDiscoveryGroupFound(dg);
+            throw ActiveMQMessageBundle.BUNDLE.noDiscoveryGroupFound(dg);
          }
-         return  (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(dg);
+         return  (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithHA(dg);
       }
       else
       {
-         Map<String, TransportConfiguration> connectorConfigurations = hornetQServer.getConfiguration().getConnectorConfigurations();
+         Map<String, TransportConfiguration> connectorConfigurations = activeMQServer.getConfiguration().getConnectorConfigurations();
          for (TransportConfiguration transportConfiguration : connectorConfigurations.values())
          {
             if (transportConfiguration.getFactoryClassName().equals(InVMConnectorFactory.class.getName()))
             {
-               return (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(transportConfiguration);
+               return (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithHA(transportConfiguration);
             }
          }
       }
-      throw HornetQMessageBundle.BUNDLE.noConfigurationFoundForScaleDown();
+      throw ActiveMQMessageBundle.BUNDLE.noConfigurationFoundForScaleDown();
    }
 
-   private static TransportConfiguration[] connectorNameListToArray(final List<String> connectorNames, HornetQServer hornetQServer)
+   private static TransportConfiguration[] connectorNameListToArray(final List<String> connectorNames, ActiveMQServer activeMQServer)
    {
       TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class,
             connectorNames.size());
       int count = 0;
       for (String connectorName : connectorNames)
       {
-         TransportConfiguration connector = hornetQServer.getConfiguration().getConnectorConfigurations().get(connectorName);
+         TransportConfiguration connector = activeMQServer.getConfiguration().getConnectorConfigurations().get(connectorName);
 
          if (connector == null)
          {
-            HornetQServerLogger.LOGGER.bridgeNoConnector(connectorName);
+            ActiveMQServerLogger.LOGGER.bridgeNoConnector(connectorName);
 
             return null;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreMasterPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreMasterPolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreMasterPolicy.java
index 4f625c3..682c9f5 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreMasterPolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreMasterPolicy.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.LiveActivation;
 import org.apache.activemq.core.server.impl.SharedStoreLiveActivation;
 
@@ -86,7 +86,7 @@ public class SharedStoreMasterPolicy implements HAPolicy<LiveActivation>
    }
 
    @Override
-   public LiveActivation createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
+   public LiveActivation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
    {
       return  new SharedStoreLiveActivation(server, this);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreSlavePolicy.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreSlavePolicy.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreSlavePolicy.java
index 51ad6e9..56e5faa 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreSlavePolicy.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/SharedStoreSlavePolicy.java
@@ -14,7 +14,7 @@ package org.apache.activemq.core.server.cluster.ha;
 
 import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.core.server.impl.Activation;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.SharedStoreBackupActivation;
 
 import java.util.Map;
@@ -97,7 +97,7 @@ public class SharedStoreSlavePolicy extends BackupPolicy
    }
 
    @Override
-   public Activation createActivation(HornetQServerImpl server, boolean wasLive, Map<String, Object> activationParams, HornetQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
+   public Activation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO)
    {
       return new SharedStoreBackupActivation(server, this);
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/StandaloneHAManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/StandaloneHAManager.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/StandaloneHAManager.java
index 94cedb2..a828cdf 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/StandaloneHAManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/ha/StandaloneHAManager.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.core.server.cluster.ha;
 
-import org.apache.activemq.core.server.HornetQServer;
+import org.apache.activemq.core.server.ActiveMQServer;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -22,12 +22,12 @@ import java.util.Map;
 * */
 public class StandaloneHAManager implements HAManager
 {
-   Map<String, HornetQServer> servers = new HashMap<>();
+   Map<String, ActiveMQServer> servers = new HashMap<>();
 
    boolean isStarted = false;
 
    @Override
-   public Map<String, HornetQServer> getBackupServers()
+   public Map<String, ActiveMQServer> getBackupServers()
    {
       return servers;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BridgeImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BridgeImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BridgeImpl.java
index 93af434..9bead5d 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BridgeImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BridgeImpl.java
@@ -41,8 +41,8 @@ import org.apache.activemq.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.core.filter.Filter;
 import org.apache.activemq.core.message.impl.MessageImpl;
 import org.apache.activemq.core.persistence.StorageManager;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.HandleStatus;
-import org.apache.activemq.core.server.HornetQServerLogger;
 import org.apache.activemq.core.server.LargeServerMessage;
 import org.apache.activemq.core.server.MessageReference;
 import org.apache.activemq.core.server.Queue;
@@ -72,7 +72,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 {
    // Constants -----------------------------------------------------
 
-   private static final boolean isTrace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    // Attributes ----------------------------------------------------
 
@@ -282,14 +282,14 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       {
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Cancelling reference " + ref + " on bridge " + this);
+            ActiveMQServerLogger.LOGGER.trace("Cancelling reference " + ref + " on bridge " + this);
          }
          list.addFirst(ref);
       }
 
       if (isTrace && list.isEmpty())
       {
-         HornetQServerLogger.LOGGER.trace("didn't have any references to cancel on bridge " + this);
+         ActiveMQServerLogger.LOGGER.trace("didn't have any references to cancel on bridge " + this);
       }
 
       Queue refqueue = null;
@@ -307,7 +307,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          catch (Exception e)
          {
             // There isn't much we can do besides log an error
-            HornetQServerLogger.LOGGER.errorCancellingRefOnBridge(e, ref2);
+            ActiveMQServerLogger.LOGGER.errorCancellingRefOnBridge(e, ref2);
          }
       }
    }
@@ -323,7 +323,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
       if (!ok)
       {
-         HornetQServerLogger.LOGGER.timedOutWaitingToStopBridge();
+         ActiveMQServerLogger.LOGGER.timedOutWaitingToStopBridge();
       }
    }
 
@@ -341,7 +341,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
                }
                catch (Exception dontcare)
                {
-                  HornetQServerLogger.LOGGER.debug(dontcare.getMessage(), dontcare);
+                  ActiveMQServerLogger.LOGGER.debug(dontcare.getMessage(), dontcare);
                }
                session = null;
             }
@@ -372,9 +372,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
       stopping = true;
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Bridge " + this.name + " being stopped");
+         ActiveMQServerLogger.LOGGER.debug("Bridge " + this.name + " being stopped");
       }
 
       if (futureScheduledReconnection != null)
@@ -395,16 +395,16 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.broadcastBridgeStoppedError(e);
+            ActiveMQServerLogger.LOGGER.broadcastBridgeStoppedError(e);
          }
       }
    }
 
    public void pause() throws Exception
    {
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Bridge " + this.name + " being paused");
+         ActiveMQServerLogger.LOGGER.debug("Bridge " + this.name + " being paused");
       }
 
       executor.execute(new PauseRunnable());
@@ -420,7 +420,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.notificationBridgeStoppedError(e);
+            ActiveMQServerLogger.LOGGER.notificationBridgeStoppedError(e);
          }
       }
    }
@@ -491,7 +491,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             {
                if (isTrace)
                {
-                  HornetQServerLogger.LOGGER.trace(this + " Acking " + ref + " on queue " + ref.getQueue());
+                  ActiveMQServerLogger.LOGGER.trace(this + " Acking " + ref + " on queue " + ref.getQueue());
                }
                ref.getQueue().acknowledge(ref);
                pendingAcks.countDown();
@@ -499,7 +499,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.bridgeFailedToAck(e);
+            ActiveMQServerLogger.LOGGER.bridgeFailedToAck(e);
          }
       }
    }
@@ -525,9 +525,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          final ServerMessage transformedMessage = transformer.transform(message);
          if (transformedMessage != message)
          {
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug("The transformer " + transformer +
+               ActiveMQServerLogger.LOGGER.debug("The transformer " + transformer +
                                                    " made a copy of the message " +
                                                    message +
                                                    " as transformedMessage");
@@ -552,9 +552,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       {
          if (!active)
          {
-            if (HornetQServerLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
             {
-               HornetQServerLogger.LOGGER.debug(this + "::Ignoring reference on bridge as it is set to inactive ref=" + ref);
+               ActiveMQServerLogger.LOGGER.debug(this + "::Ignoring reference on bridge as it is set to inactive ref=" + ref);
             }
             return HandleStatus.BUSY;
          }
@@ -566,7 +566,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
          if (isTrace)
          {
-            HornetQServerLogger.LOGGER.trace("Bridge " + this + " is handling reference=" + ref);
+            ActiveMQServerLogger.LOGGER.trace("Bridge " + this + " is handling reference=" + ref);
          }
 
          ref.handled();
@@ -626,7 +626,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
    public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
    {
-      HornetQServerLogger.LOGGER.bridgeConnectionFailed(me, failedOver);
+      ActiveMQServerLogger.LOGGER.bridgeConnectionFailed(me, failedOver);
 
       synchronized (connectionGuard)
       {
@@ -660,7 +660,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          {
             try
             {
-               HornetQServerLogger.LOGGER.debug("Moving " + queue.getMessageCount() + " messages from " + queue.getName() + " to " + scaleDownTargetNodeID);
+               ActiveMQServerLogger.LOGGER.debug("Moving " + queue.getMessageCount() + " messages from " + queue.getName() + " to " + scaleDownTargetNodeID);
                ((QueueImpl)queue).moveReferencesBetweenSnFQueues(SimpleString.toSimpleString(scaleDownTargetNodeID));
 
                // stop the bridge from trying to reconnect and clean up all the bindings
@@ -668,19 +668,19 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.warn(e.getMessage(), e);
+               ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
             }
          }
       }
       else if (scaleDownTargetNodeID != null)
       {
          // the disconnected node is scaling down to me, no need to reconnect to it
-         HornetQServerLogger.LOGGER.debug("Received scaleDownTargetNodeID: " + scaleDownTargetNodeID + "; cancelling reconnect.");
+         ActiveMQServerLogger.LOGGER.debug("Received scaleDownTargetNodeID: " + scaleDownTargetNodeID + "; cancelling reconnect.");
          fail(true);
       }
       else
       {
-         HornetQServerLogger.LOGGER.debug("Received invalid scaleDownTargetNodeID: " + scaleDownTargetNodeID);
+         ActiveMQServerLogger.LOGGER.debug("Received invalid scaleDownTargetNodeID: " + scaleDownTargetNodeID);
 
          //we never fail permanently here, this only happens once all reconnect tries have happened
          fail(false);
@@ -725,7 +725,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             catch (final ActiveMQException e)
             {
                unsetLargeMessageDelivery();
-               HornetQServerLogger.LOGGER.bridgeUnableToSendMessage(e, ref);
+               ActiveMQServerLogger.LOGGER.bridgeUnableToSendMessage(e, ref);
 
                connectionFailed(e, false);
             }
@@ -745,9 +745,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       // from the acks so it will get resent, duplicate detection will cope
       // with any messages resent
 
-      if (HornetQServerLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQServerLogger.LOGGER.isTraceEnabled())
       {
-         HornetQServerLogger.LOGGER.trace("going to send message: " + message + " from " + this.getQueue());
+         ActiveMQServerLogger.LOGGER.trace("going to send message: " + message + " from " + this.getQueue());
       }
 
       try
@@ -756,7 +756,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       }
       catch (final ActiveMQException e)
       {
-         HornetQServerLogger.LOGGER.bridgeUnableToSendMessage(e, ref);
+         ActiveMQServerLogger.LOGGER.bridgeUnableToSendMessage(e, ref);
 
          // We remove this reference as we are returning busy which means the reference will never leave the Queue.
          // because of this we have to remove the reference here
@@ -810,7 +810,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
    }
    protected void fail(final boolean permanently)
    {
-      HornetQServerLogger.LOGGER.debug(this + "\n\t::fail being called, permanently=" + permanently);
+      ActiveMQServerLogger.LOGGER.debug(this + "\n\t::fail being called, permanently=" + permanently);
 
       if (queue != null)
       {
@@ -818,13 +818,13 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          {
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Removing consumer on fail " + this + " from queue " + queue);
+               ActiveMQServerLogger.LOGGER.trace("Removing consumer on fail " + this + " from queue " + queue);
             }
             queue.removeConsumer(this);
          }
          catch (Exception dontcare)
          {
-            HornetQServerLogger.LOGGER.debug(dontcare);
+            ActiveMQServerLogger.LOGGER.debug(dontcare);
          }
       }
 
@@ -916,7 +916,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       {
          if (!keepConnecting) return;
 
-         HornetQServerLogger.LOGGER.debug("Connecting  " + this + " to its destination [" + nodeUUID.toString() + "], csf=" + this.csf);
+         ActiveMQServerLogger.LOGGER.debug("Connecting  " + this + " to its destination [" + nodeUUID.toString() + "], csf=" + this.csf);
 
          retryCount++;
 
@@ -947,7 +947,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
                }
                catch (Throwable e)
                {
-                  HornetQServerLogger.LOGGER.errorQueryingBridge(e, name);
+                  ActiveMQServerLogger.LOGGER.errorQueryingBridge(e, name);
                   // This was an issue during startup, we will not count this retry
                   retryCount--;
 
@@ -959,7 +959,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
                {
                   if (!query.isExists())
                   {
-                     HornetQServerLogger.LOGGER.errorQueryingBridge(forwardingAddress, retryCount);
+                     ActiveMQServerLogger.LOGGER.errorQueryingBridge(forwardingAddress, retryCount);
                      scheduleRetryConnect();
                      return;
                   }
@@ -968,7 +968,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
                {
                   if (!query.isExists())
                   {
-                     HornetQServerLogger.LOGGER.bridgeNoBindings(getName(), getForwardingAddress(), getForwardingAddress());
+                     ActiveMQServerLogger.LOGGER.bridgeNoBindings(getName(), getForwardingAddress(), getForwardingAddress());
                   }
                }
             }
@@ -985,7 +985,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             queue.addConsumer(BridgeImpl.this);
             queue.deliverAsync();
 
-            HornetQServerLogger.LOGGER.bridgeConnected(this);
+            ActiveMQServerLogger.LOGGER.bridgeConnected(this);
 
             // We only do this on plain core bridges
             if (isPlainCoreBridge())
@@ -1001,7 +1001,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             // the session was created while its server was starting, retry it:
             if (e.getType() == ActiveMQExceptionType.SESSION_CREATION_REJECTED)
             {
-               HornetQServerLogger.LOGGER.errorStartingBridge(name);
+               ActiveMQServerLogger.LOGGER.errorStartingBridge(name);
 
                // We are not going to count this one as a retry
                retryCount--;
@@ -1011,9 +1011,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
             }
             else
             {
-               if (HornetQServerLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
                {
-                  HornetQServerLogger.LOGGER.debug("Bridge " + this + " is unable to connect to destination. Retrying", e);
+                  ActiveMQServerLogger.LOGGER.debug("Bridge " + this + " is unable to connect to destination. Retrying", e);
                }
 
                scheduleRetryConnect();
@@ -1021,7 +1021,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorConnectingBridge(e, this);
+            ActiveMQServerLogger.LOGGER.errorConnectingBridge(e, this);
          }
       }
    }
@@ -1030,19 +1030,19 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
    {
       if (serverLocator.isClosed())
       {
-         HornetQServerLogger.LOGGER.bridgeLocatorShutdown();
+         ActiveMQServerLogger.LOGGER.bridgeLocatorShutdown();
          return;
       }
 
       if (stopping)
       {
-         HornetQServerLogger.LOGGER.bridgeStopping();
+         ActiveMQServerLogger.LOGGER.bridgeStopping();
          return;
       }
 
       if (reconnectAttemptsInUse >= 0 && retryCount > reconnectAttemptsInUse)
       {
-         HornetQServerLogger.LOGGER.bridgeAbortStart(name, retryCount, reconnectAttempts);
+         ActiveMQServerLogger.LOGGER.bridgeAbortStart(name, retryCount, reconnectAttempts);
          fail(true);
          return;
       }
@@ -1057,7 +1057,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
          timeout = maxRetryInterval;
       }
 
-      HornetQServerLogger.LOGGER.debug("Bridge " + this +
+      ActiveMQServerLogger.LOGGER.debug("Bridge " + this +
                                           " retrying connection #" +
                                           retryCount +
                                           ", maxRetry=" +
@@ -1084,9 +1084,9 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       if (stopping)
          return;
 
-      if (HornetQServerLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQServerLogger.LOGGER.isDebugEnabled())
       {
-         HornetQServerLogger.LOGGER.debug("Scheduling retry for bridge " + this.name + " in " + milliseconds + " milliseconds");
+         ActiveMQServerLogger.LOGGER.debug("Scheduling retry for bridge " + this.name + " in " + milliseconds + " milliseconds");
       }
 
       futureScheduledReconnection =
@@ -1154,18 +1154,18 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
       {
          try
          {
-            HornetQServerLogger.LOGGER.debug("stopping bridge " + BridgeImpl.this);
+            ActiveMQServerLogger.LOGGER.debug("stopping bridge " + BridgeImpl.this);
             queue.removeConsumer(BridgeImpl.this);
 
             if (!pendingAcks.await(10, TimeUnit.SECONDS))
             {
-               HornetQServerLogger.LOGGER.timedOutWaitingCompletions(BridgeImpl.this.toString(),
+               ActiveMQServerLogger.LOGGER.timedOutWaitingCompletions(BridgeImpl.this.toString(),
                                                                      pendingAcks.getCount());
             }
 
             synchronized (BridgeImpl.this)
             {
-               HornetQServerLogger.LOGGER.debug("Closing Session for bridge " + BridgeImpl.this.name);
+               ActiveMQServerLogger.LOGGER.debug("Closing Session for bridge " + BridgeImpl.this.name);
 
                started = false;
 
@@ -1178,7 +1178,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
             if (session != null)
             {
-               HornetQServerLogger.LOGGER.debug("Cleaning up session " + session);
+               ActiveMQServerLogger.LOGGER.debug("Cleaning up session " + session);
                session.removeFailureListener(BridgeImpl.this);
                try
                {
@@ -1202,17 +1202,17 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
             if (isTrace)
             {
-               HornetQServerLogger.LOGGER.trace("Removing consumer on stopRunnable " + this + " from queue " + queue);
+               ActiveMQServerLogger.LOGGER.trace("Removing consumer on stopRunnable " + this + " from queue " + queue);
             }
-            HornetQServerLogger.LOGGER.bridgeStopped(name);
+            ActiveMQServerLogger.LOGGER.bridgeStopped(name);
          }
          catch (RuntimeException e)
          {
-            HornetQServerLogger.LOGGER.error("Failed to stop bridge", e);
+            ActiveMQServerLogger.LOGGER.error("Failed to stop bridge", e);
          }
          catch (InterruptedException e)
          {
-            HornetQServerLogger.LOGGER.error("Failed to stop bridge", e);
+            ActiveMQServerLogger.LOGGER.error("Failed to stop bridge", e);
          }
       }
    }
@@ -1227,7 +1227,7 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
             if (!pendingAcks.await(60, TimeUnit.SECONDS))
             {
-               HornetQServerLogger.LOGGER.timedOutWaitingCompletions(BridgeImpl.this.toString(),
+               ActiveMQServerLogger.LOGGER.timedOutWaitingCompletions(BridgeImpl.this.toString(),
                                                                      pendingAcks.getCount());
             }
 
@@ -1239,11 +1239,11 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled
 
             internalCancelReferences();
 
-            HornetQServerLogger.LOGGER.bridgePaused(name);
+            ActiveMQServerLogger.LOGGER.bridgePaused(name);
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorPausingBridge(e);
+            ActiveMQServerLogger.LOGGER.errorPausingBridge(e);
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BroadcastGroupImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BroadcastGroupImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BroadcastGroupImpl.java
index 33e8fae..46ae3b7 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BroadcastGroupImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/cluster/impl/BroadcastGroupImpl.java
@@ -25,7 +25,7 @@ import org.apache.activemq.api.core.BroadcastEndpointFactory;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.management.CoreNotificationType;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.NodeManager;
 import org.apache.activemq.core.server.cluster.BroadcastGroup;
 import org.apache.activemq.core.server.management.Notification;
@@ -137,7 +137,7 @@ public class BroadcastGroupImpl implements BroadcastGroup, Runnable
       }
       catch (Exception e1)
       {
-         HornetQServerLogger.LOGGER.broadcastGroupClosed(e1);
+         ActiveMQServerLogger.LOGGER.broadcastGroupClosed(e1);
       }
 
       started = false;
@@ -153,7 +153,7 @@ public class BroadcastGroupImpl implements BroadcastGroup, Runnable
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.broadcastGroupClosed(e);
+            ActiveMQServerLogger.LOGGER.broadcastGroupClosed(e);
          }
       }
 
@@ -232,12 +232,12 @@ public class BroadcastGroupImpl implements BroadcastGroup, Runnable
          // only log the exception at ERROR level once, even if it fails multiple times in a row - HORNETQ-919
          if (!loggedBroadcastException)
          {
-            HornetQServerLogger.LOGGER.errorBroadcastingConnectorConfigs(e);
+            ActiveMQServerLogger.LOGGER.errorBroadcastingConnectorConfigs(e);
             loggedBroadcastException = true;
          }
          else
          {
-            HornetQServerLogger.LOGGER.debug("Failed to broadcast connector configs...again", e);
+            ActiveMQServerLogger.LOGGER.debug("Failed to broadcast connector configs...again", e);
          }
       }
    }


[11/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/management/impl/ActiveMQServerControlImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/ActiveMQServerControlImpl.java
new file mode 100644
index 0000000..92b3fe6
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/management/impl/ActiveMQServerControlImpl.java
@@ -0,0 +1,2187 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.management.impl;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.transaction.xa.Xid;
+
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.management.AddressControl;
+import org.apache.activemq.api.core.management.BridgeControl;
+import org.apache.activemq.api.core.management.CoreNotificationType;
+import org.apache.activemq.api.core.management.DivertControl;
+import org.apache.activemq.api.core.management.ActiveMQServerControl;
+import org.apache.activemq.api.core.management.QueueControl;
+import org.apache.activemq.core.config.BridgeConfiguration;
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.config.DivertConfiguration;
+import org.apache.activemq.core.messagecounter.MessageCounterManager;
+import org.apache.activemq.core.messagecounter.impl.MessageCounterManagerImpl;
+import org.apache.activemq.core.persistence.StorageManager;
+import org.apache.activemq.core.persistence.config.PersistedAddressSetting;
+import org.apache.activemq.core.persistence.config.PersistedRoles;
+import org.apache.activemq.core.postoffice.Binding;
+import org.apache.activemq.core.postoffice.DuplicateIDCache;
+import org.apache.activemq.core.postoffice.PostOffice;
+import org.apache.activemq.core.postoffice.impl.LocalQueueBinding;
+import org.apache.activemq.core.remoting.server.RemotingService;
+import org.apache.activemq.core.security.CheckType;
+import org.apache.activemq.core.security.Role;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
+import org.apache.activemq.core.server.Consumer;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.JournalType;
+import org.apache.activemq.core.server.Queue;
+import org.apache.activemq.core.server.ServerConsumer;
+import org.apache.activemq.core.server.ServerSession;
+import org.apache.activemq.core.server.cluster.ha.HAPolicy;
+import org.apache.activemq.core.server.cluster.ha.LiveOnlyPolicy;
+import org.apache.activemq.core.server.cluster.ha.ScaleDownPolicy;
+import org.apache.activemq.core.server.cluster.ha.SharedStoreSlavePolicy;
+import org.apache.activemq.core.server.group.GroupingHandler;
+import org.apache.activemq.core.settings.impl.AddressFullMessagePolicy;
+import org.apache.activemq.core.settings.impl.AddressSettings;
+import org.apache.activemq.core.settings.impl.SlowConsumerPolicy;
+import org.apache.activemq.core.transaction.ResourceManager;
+import org.apache.activemq.core.transaction.Transaction;
+import org.apache.activemq.core.transaction.TransactionDetail;
+import org.apache.activemq.core.transaction.impl.CoreTransactionDetail;
+import org.apache.activemq.core.transaction.impl.XidImpl;
+import org.apache.activemq.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.utils.SecurityFormatter;
+import org.apache.activemq.utils.TypedProperties;
+import org.apache.activemq.utils.json.JSONArray;
+import org.apache.activemq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ *
+ */
+public class ActiveMQServerControlImpl extends AbstractControl implements ActiveMQServerControl, NotificationEmitter,
+                                                                         org.apache.activemq.core.server.management.NotificationListener
+{
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final PostOffice postOffice;
+
+   private final Configuration configuration;
+
+   private final ResourceManager resourceManager;
+
+   private final RemotingService remotingService;
+
+   private final ActiveMQServer server;
+
+   private final MessageCounterManager messageCounterManager;
+
+   private final NotificationBroadcasterSupport broadcaster;
+
+   private final AtomicLong notifSeq = new AtomicLong(0);
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQServerControlImpl(final PostOffice postOffice,
+                                    final Configuration configuration,
+                                    final ResourceManager resourceManager,
+                                    final RemotingService remotingService,
+                                    final ActiveMQServer messagingServer,
+                                    final MessageCounterManager messageCounterManager,
+                                    final StorageManager storageManager,
+                                    final NotificationBroadcasterSupport broadcaster) throws Exception
+   {
+      super(ActiveMQServerControl.class, storageManager);
+      this.postOffice = postOffice;
+      this.configuration = configuration;
+      this.resourceManager = resourceManager;
+      this.remotingService = remotingService;
+      server = messagingServer;
+      this.messageCounterManager = messageCounterManager;
+      this.broadcaster = broadcaster;
+      server.getManagementService().addNotificationListener(this);
+   }
+
+   // ActiveMQServerControlMBean implementation --------------------
+
+   public boolean isStarted()
+   {
+      clearIO();
+      try
+      {
+         return server.isStarted();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getVersion()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return server.getVersion().getFullVersion();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isBackup()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return server.getHAPolicy().isBackup();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isSharedStore()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return server.getHAPolicy().isSharedStore();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getBindingsDirectory()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getBindingsDirectory();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getInterceptorClassNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getIncomingInterceptorClassNames().toArray(new String[configuration.getIncomingInterceptorClassNames()
+               .size()]);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getIncomingInterceptorClassNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getIncomingInterceptorClassNames().toArray(new String[configuration.getIncomingInterceptorClassNames()
+               .size()]);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getOutgoingInterceptorClassNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getOutgoingInterceptorClassNames().toArray(new String[configuration.getOutgoingInterceptorClassNames()
+               .size()]);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalBufferSize()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalBufferSize_AIO()
+               : configuration.getJournalBufferSize_NIO();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalBufferTimeout()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalBufferTimeout_AIO()
+               : configuration.getJournalBufferTimeout_NIO();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         HAPolicy haPolicy = server.getHAPolicy();
+         if (haPolicy instanceof SharedStoreSlavePolicy)
+         {
+            ((SharedStoreSlavePolicy) haPolicy).setFailoverOnServerShutdown(failoverOnServerShutdown);
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+
+   public boolean isFailoverOnServerShutdown()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         HAPolicy haPolicy = server.getHAPolicy();
+         if (haPolicy instanceof SharedStoreSlavePolicy)
+         {
+            return ((SharedStoreSlavePolicy) haPolicy).isFailoverOnServerShutdown();
+         }
+         else
+         {
+            return false;
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalMaxIO()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalType() == JournalType.ASYNCIO ? configuration.getJournalMaxIO_AIO()
+               : configuration.getJournalMaxIO_NIO();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getJournalDirectory()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalDirectory();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalFileSize()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalFileSize();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalMinFiles()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalMinFiles();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalCompactMinFiles()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalCompactMinFiles();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getJournalCompactPercentage()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalCompactPercentage();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isPersistenceEnabled()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isPersistenceEnabled();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getJournalType()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getJournalType().toString();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getPagingDirectory()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getPagingDirectory();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getScheduledThreadPoolMaxSize()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getScheduledThreadPoolMaxSize();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getThreadPoolMaxSize()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getThreadPoolMaxSize();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public long getSecurityInvalidationInterval()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.getSecurityInvalidationInterval();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isClustered()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isClustered();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isCreateBindingsDir()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isCreateBindingsDir();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isCreateJournalDir()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isCreateJournalDir();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isJournalSyncNonTransactional()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isJournalSyncNonTransactional();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isJournalSyncTransactional()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isJournalSyncTransactional();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isSecurityEnabled()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isSecurityEnabled();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isAsyncConnectionExecutionEnabled()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isAsyncConnectionExecutionEnabled();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void deployQueue(final String address, final String name, final String filterString) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.deployQueue(new SimpleString(address),
+               new SimpleString(name),
+               new SimpleString(filterString),
+               true,
+               false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void deployQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
+   {
+      checkStarted();
+
+      SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
+      clearIO();
+      try
+      {
+
+         server.deployQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void createQueue(final String address, final String name) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.createQueue(new SimpleString(address), new SimpleString(name), null, true, false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void createQueue(final String address, final String name, final boolean durable) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.createQueue(new SimpleString(address), new SimpleString(name), null, durable, false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void createQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         SimpleString filter = null;
+         if (filterStr != null && !filterStr.trim().equals(""))
+         {
+            filter = new SimpleString(filterStr);
+         }
+
+         server.createQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getQueueNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Object[] queues = server.getManagementService().getResources(QueueControl.class);
+         String[] names = new String[queues.length];
+         for (int i = 0; i < queues.length; i++)
+         {
+            QueueControl queue = (QueueControl) queues[i];
+            names[i] = queue.getName();
+         }
+
+         return names;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getAddressNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Object[] addresses = server.getManagementService().getResources(AddressControl.class);
+         String[] names = new String[addresses.length];
+         for (int i = 0; i < addresses.length; i++)
+         {
+            AddressControl address = (AddressControl) addresses[i];
+            names[i] = address.getAddress();
+         }
+
+         return names;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void destroyQueue(final String name) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         SimpleString queueName = new SimpleString(name);
+
+         server.destroyQueue(queueName, null, true);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getConnectionCount()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return server.getConnectionCount();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void enableMessageCounters()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         setMessageCounterEnabled(true);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void disableMessageCounters()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         setMessageCounterEnabled(false);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void resetAllMessageCounters()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         messageCounterManager.resetAllCounters();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void resetAllMessageCounterHistories()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         messageCounterManager.resetAllCounterHistories();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public boolean isMessageCounterEnabled()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return configuration.isMessageCounterEnabled();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public synchronized long getMessageCounterSamplePeriod()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return messageCounterManager.getSamplePeriod();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public synchronized void setMessageCounterSamplePeriod(final long newPeriod)
+   {
+      checkStarted();
+
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         if (newPeriod < MessageCounterManagerImpl.MIN_SAMPLE_PERIOD)
+         {
+            throw ActiveMQMessageBundle.BUNDLE.invalidMessageCounterPeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
+         }
+
+         if (messageCounterManager != null && newPeriod != messageCounterManager.getSamplePeriod())
+         {
+            messageCounterManager.reschedule(newPeriod);
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public int getMessageCounterMaxDayCount()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         return messageCounterManager.getMaxDayCount();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void setMessageCounterMaxDayCount(final int count)
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         if (count <= 0)
+         {
+            throw ActiveMQMessageBundle.BUNDLE.greaterThanZero(count);
+         }
+         messageCounterManager.setMaxDayCount(count);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] listPreparedTransactions()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+
+         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
+         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
+         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
+         {
+            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
+            {
+               // sort by creation time, oldest first
+               return (int) (entry1.getValue() - entry2.getValue());
+            }
+         });
+         String[] s = new String[xidsSortedByCreationTime.size()];
+         int i = 0;
+         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
+         {
+            Date creation = new Date(entry.getValue());
+            Xid xid = entry.getKey();
+            s[i++] = dateFormat.format(creation) + " base64: " + XidImpl.toBase64String(xid) + " " + xid.toString();
+         }
+         return s;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String listPreparedTransactionDetailsAsJSON() throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
+         if (xids == null || xids.size() == 0)
+         {
+            return "";
+         }
+
+         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
+         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
+         {
+            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
+            {
+               // sort by creation time, oldest first
+               return (int) (entry1.getValue() - entry2.getValue());
+            }
+         });
+
+         JSONArray txDetailListJson = new JSONArray();
+         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
+         {
+            Xid xid = entry.getKey();
+            TransactionDetail detail = new CoreTransactionDetail(xid,
+                  resourceManager.getTransaction(xid),
+                  entry.getValue());
+
+            txDetailListJson.put(detail.toJSON());
+         }
+         return txDetailListJson.toString();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String listPreparedTransactionDetailsAsHTML() throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
+         if (xids == null || xids.size() == 0)
+         {
+            return "<h3>*** Prepared Transaction Details ***</h3><p>No entry.</p>";
+         }
+
+         ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
+         Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
+         {
+            public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
+            {
+               // sort by creation time, oldest first
+               return (int) (entry1.getValue() - entry2.getValue());
+            }
+         });
+
+         StringBuilder html = new StringBuilder();
+         html.append("<h3>*** Prepared Transaction Details ***</h3>");
+
+         for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
+         {
+            Xid xid = entry.getKey();
+            TransactionDetail detail = new CoreTransactionDetail(xid,
+                  resourceManager.getTransaction(xid),
+                  entry.getValue());
+
+            JSONObject txJson = detail.toJSON();
+
+            html.append("<table border=\"1\">");
+            html.append("<tr><th>creation_time</th>");
+            html.append("<td>" + txJson.get(TransactionDetail.KEY_CREATION_TIME) + "</td>");
+            html.append("<th>xid_as_base_64</th>");
+            html.append("<td colspan=\"3\">" + txJson.get(TransactionDetail.KEY_XID_AS_BASE64) + "</td></tr>");
+            html.append("<tr><th>xid_format_id</th>");
+            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_FORMAT_ID) + "</td>");
+            html.append("<th>xid_global_txid</th>");
+            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_GLOBAL_TXID) + "</td>");
+            html.append("<th>xid_branch_qual</th>");
+            html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_BRANCH_QUAL) + "</td></tr>");
+
+            html.append("<tr><th colspan=\"6\">Message List</th></tr>");
+            html.append("<tr><td colspan=\"6\">");
+            html.append("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">");
+
+            JSONArray msgs = txJson.getJSONArray(TransactionDetail.KEY_TX_RELATED_MESSAGES);
+            for (int i = 0; i < msgs.length(); i++)
+            {
+               JSONObject msgJson = msgs.getJSONObject(i);
+               JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES);
+               StringBuilder propstr = new StringBuilder();
+               @SuppressWarnings("unchecked")
+               Iterator<String> propkeys = props.keys();
+               while (propkeys.hasNext())
+               {
+                  String key = propkeys.next();
+                  propstr.append(key);
+                  propstr.append("=");
+                  propstr.append(props.get(key));
+                  propstr.append(", ");
+               }
+
+               html.append("<th>operation_type</th>");
+               html.append("<td>" + msgJson.get(TransactionDetail.KEY_MSG_OP_TYPE) + "</th>");
+               html.append("<th>message_type</th>");
+               html.append("<td>" + msgJson.get(TransactionDetail.KEY_MSG_TYPE) + "</td></tr>");
+               html.append("<tr><th>properties</th>");
+               html.append("<td colspan=\"3\">" + propstr.toString() + "</td></tr>");
+            }
+            html.append("</table></td></tr>");
+            html.append("</table><br/>");
+         }
+
+         return html.toString();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] listHeuristicCommittedTransactions()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         List<Xid> xids = resourceManager.getHeuristicCommittedTransactions();
+         String[] s = new String[xids.size()];
+         int i = 0;
+         for (Xid xid : xids)
+         {
+            s[i++] = XidImpl.toBase64String(xid);
+         }
+         return s;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] listHeuristicRolledBackTransactions()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         List<Xid> xids = resourceManager.getHeuristicRolledbackTransactions();
+         String[] s = new String[xids.size()];
+         int i = 0;
+         for (Xid xid : xids)
+         {
+            s[i++] = XidImpl.toBase64String(xid);
+         }
+         return s;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public synchronized boolean commitPreparedTransaction(final String transactionAsBase64) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         List<Xid> xids = resourceManager.getPreparedTransactions();
+
+         for (Xid xid : xids)
+         {
+            if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
+            {
+               Transaction transaction = resourceManager.removeTransaction(xid);
+               transaction.commit(false);
+               long recordID = server.getStorageManager().storeHeuristicCompletion(xid, true);
+               storageManager.waitOnOperations();
+               resourceManager.putHeuristicCompletion(recordID, xid, true);
+               return true;
+            }
+         }
+         return false;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public synchronized boolean rollbackPreparedTransaction(final String transactionAsBase64) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+
+         List<Xid> xids = resourceManager.getPreparedTransactions();
+
+         for (Xid xid : xids)
+         {
+            if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
+            {
+               Transaction transaction = resourceManager.removeTransaction(xid);
+               transaction.rollback();
+               long recordID = server.getStorageManager().storeHeuristicCompletion(xid, false);
+               server.getStorageManager().waitOnOperations();
+               resourceManager.putHeuristicCompletion(recordID, xid, false);
+               return true;
+            }
+         }
+         return false;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] listRemoteAddresses()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Set<RemotingConnection> connections = remotingService.getConnections();
+
+         String[] remoteAddresses = new String[connections.size()];
+         int i = 0;
+         for (RemotingConnection connection : connections)
+         {
+            remoteAddresses[i++] = connection.getRemoteAddress();
+         }
+         return remoteAddresses;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+
+   }
+
+   public String[] listRemoteAddresses(final String ipAddress)
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Set<RemotingConnection> connections = remotingService.getConnections();
+         List<String> remoteConnections = new ArrayList<String>();
+         for (RemotingConnection connection : connections)
+         {
+            String remoteAddress = connection.getRemoteAddress();
+            if (remoteAddress.contains(ipAddress))
+            {
+               remoteConnections.add(connection.getRemoteAddress());
+            }
+         }
+         return remoteConnections.toArray(new String[remoteConnections.size()]);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+
+   }
+
+   public synchronized boolean closeConnectionsForAddress(final String ipAddress)
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         boolean closed = false;
+         Set<RemotingConnection> connections = remotingService.getConnections();
+         for (RemotingConnection connection : connections)
+         {
+            String remoteAddress = connection.getRemoteAddress();
+            if (remoteAddress.contains(ipAddress))
+            {
+               connection.fail(ActiveMQMessageBundle.BUNDLE.connectionsClosedByManagement(ipAddress));
+               remotingService.removeConnection(connection.getID());
+               closed = true;
+            }
+         }
+
+         return closed;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+
+   }
+
+   public synchronized boolean closeConsumerConnectionsForAddress(final String address)
+   {
+      boolean closed = false;
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         for (Binding binding : postOffice.getMatchingBindings(SimpleString.toSimpleString(address)).getBindings())
+         {
+            if (binding instanceof LocalQueueBinding)
+            {
+               Queue queue = ((LocalQueueBinding) binding).getQueue();
+               for (Consumer consumer : queue.getConsumers())
+               {
+                  if (consumer instanceof ServerConsumer)
+                  {
+                     ServerConsumer serverConsumer = (ServerConsumer) consumer;
+                     RemotingConnection connection = null;
+
+                     for (RemotingConnection potentialConnection : remotingService.getConnections())
+                     {
+                        if (potentialConnection.getID().toString().equals(serverConsumer.getConnectionID()))
+                        {
+                           connection = potentialConnection;
+                        }
+                     }
+
+                     if (connection != null)
+                     {
+                        remotingService.removeConnection(connection.getID());
+                        connection.fail(ActiveMQMessageBundle.BUNDLE.consumerConnectionsClosedByManagement(address));
+                        closed = true;
+                     }
+                  }
+               }
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         ActiveMQServerLogger.LOGGER.failedToCloseConsumerConnectionsForAddress(address, e);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+      return closed;
+   }
+
+   public synchronized boolean closeConnectionsForUser(final String userName)
+   {
+      boolean closed = false;
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         for (ServerSession serverSession : server.getSessions())
+         {
+            if (serverSession.getUsername() != null && serverSession.getUsername().equals(userName))
+            {
+               RemotingConnection connection = null;
+
+               for (RemotingConnection potentialConnection : remotingService.getConnections())
+               {
+                  if (potentialConnection.getID().toString().equals(serverSession.getConnectionID().toString()))
+                  {
+                     connection = potentialConnection;
+                  }
+               }
+
+               if (connection != null)
+               {
+                  remotingService.removeConnection(connection.getID());
+                  connection.fail(ActiveMQMessageBundle.BUNDLE.connectionsForUserClosedByManagement(userName));
+                  closed = true;
+               }
+            }
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+      return closed;
+   }
+
+   public String[] listConnectionIDs()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Set<RemotingConnection> connections = remotingService.getConnections();
+         String[] connectionIDs = new String[connections.size()];
+         int i = 0;
+         for (RemotingConnection connection : connections)
+         {
+            connectionIDs[i++] = connection.getID().toString();
+         }
+         return connectionIDs;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] listSessions(final String connectionID)
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         List<ServerSession> sessions = server.getSessions(connectionID);
+         String[] sessionIDs = new String[sessions.size()];
+         int i = 0;
+         for (ServerSession serverSession : sessions)
+         {
+            sessionIDs[i++] = serverSession.getName();
+         }
+         return sessionIDs;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+
+   /* (non-Javadoc)
+   * @see org.apache.activemq.api.core.management.ActiveMQServerControl#listProducersInfoAsJSON()
+   */
+   public String listProducersInfoAsJSON() throws Exception
+   {
+      JSONArray producers = new JSONArray();
+
+
+      for (ServerSession session : server.getSessions())
+      {
+         session.describeProducersInfo(producers);
+      }
+
+      return producers.toString();
+   }
+
+
+   public Object[] getConnectors() throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations()
+               .values();
+
+         Object[] ret = new Object[connectorConfigurations.size()];
+
+         int i = 0;
+         for (TransportConfiguration config : connectorConfigurations)
+         {
+            Object[] tc = new Object[3];
+
+            tc[0] = config.getName();
+            tc[1] = config.getFactoryClassName();
+            tc[2] = config.getParams();
+
+            ret[i++] = tc;
+         }
+
+         return ret;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getConnectorsAsJSON() throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         JSONArray array = new JSONArray();
+
+         for (TransportConfiguration config : configuration.getConnectorConfigurations().values())
+         {
+            array.put(new JSONObject(config));
+         }
+
+         return array.toString();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void addSecuritySettings(final String addressMatch,
+                                   final String sendRoles,
+                                   final String consumeRoles,
+                                   final String createDurableQueueRoles,
+                                   final String deleteDurableQueueRoles,
+                                   final String createNonDurableQueueRoles,
+                                   final String deleteNonDurableQueueRoles,
+                                   final String manageRoles) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Set<Role> roles = SecurityFormatter.createSecurity(sendRoles,
+               consumeRoles,
+               createDurableQueueRoles,
+               deleteDurableQueueRoles,
+               createNonDurableQueueRoles,
+               deleteNonDurableQueueRoles,
+               manageRoles);
+
+         server.getSecurityRepository().addMatch(addressMatch, roles);
+
+         PersistedRoles persistedRoles = new PersistedRoles(addressMatch,
+               sendRoles,
+               consumeRoles,
+               createDurableQueueRoles,
+               deleteDurableQueueRoles,
+               createNonDurableQueueRoles,
+               deleteNonDurableQueueRoles,
+               manageRoles);
+
+         storageManager.storeSecurityRoles(persistedRoles);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void removeSecuritySettings(final String addressMatch) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.getSecurityRepository().removeMatch(addressMatch);
+         storageManager.deleteSecurityRoles(new SimpleString(addressMatch));
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public Object[] getRoles(final String addressMatch) throws Exception
+   {
+      checkStarted();
+
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Set<Role> roles = server.getSecurityRepository().getMatch(addressMatch);
+
+         Object[] objRoles = new Object[roles.size()];
+
+         int i = 0;
+         for (Role role : roles)
+         {
+            objRoles[i++] = new Object[]{role.getName(),
+                  CheckType.SEND.hasRole(role),
+                  CheckType.CONSUME.hasRole(role),
+                  CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
+                  CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
+                  CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
+                  CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
+                  CheckType.MANAGE.hasRole(role)};
+         }
+         return objRoles;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getRolesAsJSON(final String addressMatch) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         JSONArray json = new JSONArray();
+         Set<Role> roles = server.getSecurityRepository().getMatch(addressMatch);
+
+         for (Role role : roles)
+         {
+            json.put(new JSONObject(role));
+         }
+         return json.toString();
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String getAddressSettingsAsJSON(final String address) throws Exception
+   {
+      checkStarted();
+
+      AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address);
+      Map<String, Object> settings = new HashMap<String, Object>();
+      if (addressSettings.getDeadLetterAddress() != null)
+      {
+         settings.put("DLA", addressSettings.getDeadLetterAddress());
+      }
+      if (addressSettings.getExpiryAddress() != null)
+      {
+         settings.put("expiryAddress", addressSettings.getExpiryAddress());
+      }
+      settings.put("expiryDelay", addressSettings.getExpiryDelay());
+      settings.put("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts());
+      settings.put("pageCacheMaxSize", addressSettings.getPageCacheMaxSize());
+      settings.put("maxSizeBytes", addressSettings.getMaxSizeBytes());
+      settings.put("pageSizeBytes", addressSettings.getPageSizeBytes());
+      settings.put("redeliveryDelay", addressSettings.getRedeliveryDelay());
+      settings.put("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier());
+      settings.put("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay());
+      settings.put("redistributionDelay", addressSettings.getRedistributionDelay());
+      settings.put("lastValueQueue", addressSettings.isLastValueQueue());
+      settings.put("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute());
+      String policy = addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.PAGE ? "PAGE"
+            : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.BLOCK ? "BLOCK"
+            : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.DROP ? "DROP"
+            : "FAIL";
+      settings.put("addressFullMessagePolicy", policy);
+      settings.put("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold());
+      settings.put("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod());
+      policy = addressSettings.getSlowConsumerPolicy() == SlowConsumerPolicy.NOTIFY ? "NOTIFY"
+         : "KILL";
+      settings.put("slowConsumerPolicy", policy);
+
+      JSONObject jsonObject = new JSONObject(settings);
+      return jsonObject.toString();
+   }
+
+
+   public void addAddressSettings(final String address,
+                                  final String DLA,
+                                  final String expiryAddress,
+                                  final long expiryDelay,
+                                  final boolean lastValueQueue,
+                                  final int deliveryAttempts,
+                                  final long maxSizeBytes,
+                                  final int pageSizeBytes,
+                                  final int pageMaxCacheSize,
+                                  final long redeliveryDelay,
+                                  final double redeliveryMultiplier,
+                                  final long maxRedeliveryDelay,
+                                  final long redistributionDelay,
+                                  final boolean sendToDLAOnNoRoute,
+                                  final String addressFullMessagePolicy,
+                                  final long slowConsumerThreshold,
+                                  final long slowConsumerCheckPeriod,
+                                  final String slowConsumerPolicy) throws Exception
+   {
+      checkStarted();
+
+      // JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes
+      if (pageSizeBytes > maxSizeBytes && maxSizeBytes > 0)
+      {
+         throw new IllegalStateException("pageSize has to be lower than maxSizeBytes. Invalid argument (" + pageSizeBytes + " < " + maxSizeBytes + ")");
+      }
+
+      if (maxSizeBytes < -1)
+      {
+         throw new IllegalStateException("Invalid argument on maxSizeBytes");
+      }
+
+      AddressSettings addressSettings = new AddressSettings();
+      addressSettings.setDeadLetterAddress(DLA == null ? null : new SimpleString(DLA));
+      addressSettings.setExpiryAddress(expiryAddress == null ? null : new SimpleString(expiryAddress));
+      addressSettings.setExpiryDelay(expiryDelay);
+      addressSettings.setLastValueQueue(lastValueQueue);
+      addressSettings.setMaxDeliveryAttempts(deliveryAttempts);
+      addressSettings.setPageCacheMaxSize(pageMaxCacheSize);
+      addressSettings.setMaxSizeBytes(maxSizeBytes);
+      addressSettings.setPageSizeBytes(pageSizeBytes);
+      addressSettings.setRedeliveryDelay(redeliveryDelay);
+      addressSettings.setRedeliveryMultiplier(redeliveryMultiplier);
+      addressSettings.setMaxRedeliveryDelay(maxRedeliveryDelay);
+      addressSettings.setRedistributionDelay(redistributionDelay);
+      addressSettings.setSendToDLAOnNoRoute(sendToDLAOnNoRoute);
+      if (addressFullMessagePolicy == null)
+      {
+         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+      }
+      else if (addressFullMessagePolicy.equalsIgnoreCase("PAGE"))
+      {
+         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+      }
+      else if (addressFullMessagePolicy.equalsIgnoreCase("DROP"))
+      {
+         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.DROP);
+      }
+      else if (addressFullMessagePolicy.equalsIgnoreCase("BLOCK"))
+      {
+         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+      }
+      else if (addressFullMessagePolicy.equalsIgnoreCase("FAIL"))
+      {
+         addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.FAIL);
+      }
+      addressSettings.setSlowConsumerThreshold(slowConsumerThreshold);
+      addressSettings.setSlowConsumerCheckPeriod(slowConsumerCheckPeriod);
+      if (slowConsumerPolicy == null)
+      {
+         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
+      }
+      else if (slowConsumerPolicy.equalsIgnoreCase("NOTIFY"))
+      {
+         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
+      }
+      else if (slowConsumerPolicy.equalsIgnoreCase("KILL"))
+      {
+         addressSettings.setSlowConsumerPolicy(SlowConsumerPolicy.KILL);
+      }
+      server.getAddressSettingsRepository().addMatch(address, addressSettings);
+
+      storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));
+   }
+
+   public void removeAddressSettings(final String addressMatch) throws Exception
+   {
+      checkStarted();
+
+      server.getAddressSettingsRepository().removeMatch(addressMatch);
+      storageManager.deleteAddressSetting(new SimpleString(addressMatch));
+   }
+
+   public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address));
+
+         GroupingHandler handler = server.getGroupingHandler();
+         if (handler != null)
+         {
+            // the group handler would miss responses if the group was requested before the reset was done
+            // on that case we ask the groupinghandler to replay its send in case it's waiting for the information
+            handler.resendPending();
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getDivertNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Object[] diverts = server.getManagementService().getResources(DivertControl.class);
+         String[] names = new String[diverts.length];
+         for (int i = 0; i < diverts.length; i++)
+         {
+            DivertControl divert = (DivertControl) diverts[i];
+            names[i] = divert.getUniqueName();
+         }
+
+         return names;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void createDivert(final String name,
+                            final String routingName,
+                            final String address,
+                            final String forwardingAddress,
+                            final boolean exclusive,
+                            final String filterString,
+                            final String transformerClassName) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         DivertConfiguration config = new DivertConfiguration()
+            .setName(name)
+            .setRoutingName(routingName)
+            .setAddress(address)
+            .setForwardingAddress(forwardingAddress)
+            .setExclusive(exclusive)
+            .setFilterString(filterString)
+            .setTransformerClassName(transformerClassName);
+         server.deployDivert(config);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void destroyDivert(final String name) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.destroyDivert(SimpleString.toSimpleString(name));
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public String[] getBridgeNames()
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         Object[] bridges = server.getManagementService().getResources(BridgeControl.class);
+         String[] names = new String[bridges.length];
+         for (int i = 0; i < bridges.length; i++)
+         {
+            BridgeControl bridge = (BridgeControl) bridges[i];
+            names[i] = bridge.getName();
+         }
+
+         return names;
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void createBridge(final String name,
+                            final String queueName,
+                            final String forwardingAddress,
+                            final String filterString,
+                            final String transformerClassName,
+                            final long retryInterval,
+                            final double retryIntervalMultiplier,
+                            final int initialConnectAttempts,
+                            final int reconnectAttempts,
+                            final boolean useDuplicateDetection,
+                            final int confirmationWindowSize,
+                            final long clientFailureCheckPeriod,
+                            final String staticConnectorsOrDiscoveryGroup,
+                            boolean useDiscoveryGroup,
+                            final boolean ha,
+                            final String user,
+                            final String password) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+
+      try
+      {
+         BridgeConfiguration config = new BridgeConfiguration()
+               .setName(name)
+               .setQueueName(queueName)
+               .setForwardingAddress(forwardingAddress)
+               .setFilterString(filterString)
+               .setTransformerClassName(transformerClassName)
+               .setClientFailureCheckPeriod(clientFailureCheckPeriod)
+               .setRetryInterval(retryInterval)
+               .setRetryIntervalMultiplier(retryIntervalMultiplier)
+               .setInitialConnectAttempts(initialConnectAttempts)
+               .setReconnectAttempts(reconnectAttempts)
+               .setUseDuplicateDetection(useDuplicateDetection)
+               .setConfirmationWindowSize(confirmationWindowSize)
+               .setHA(ha)
+               .setUser(user)
+               .setPassword(password);
+
+         if (useDiscoveryGroup)
+         {
+            config.setDiscoveryGroupName(staticConnectorsOrDiscoveryGroup);
+         }
+         else
+         {
+            config.setStaticConnectors(toList(staticConnectorsOrDiscoveryGroup));
+         }
+
+         server.deployBridge(config);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+
+   public void destroyBridge(final String name) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      try
+      {
+         server.destroyBridge(name);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void forceFailover() throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+
+      try
+      {
+         server.stop(true);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   @Override
+   public void updateDuplicateIdCache(String address, Object[] ids) throws Exception
+   {
+      clearIO();
+      try
+      {
+         DuplicateIDCache duplicateIDCache = server.getPostOffice().getDuplicateIDCache(new SimpleString(address));
+         for (Object id : ids)
+         {
+            duplicateIDCache.addToCache(((String)id).getBytes(), null);
+         }
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   @Override
+   public void scaleDown(String connector) throws Exception
+   {
+      checkStarted();
+
+      clearIO();
+      HAPolicy haPolicy = server.getHAPolicy();
+      if (haPolicy instanceof LiveOnlyPolicy)
+      {
+         LiveOnlyPolicy liveOnlyPolicy = (LiveOnlyPolicy) haPolicy;
+
+         if (liveOnlyPolicy.getScaleDownPolicy() == null)
+         {
+            liveOnlyPolicy.setScaleDownPolicy(new ScaleDownPolicy());
+         }
+
+         liveOnlyPolicy.getScaleDownPolicy().setEnabled(true);
+
+         if (connector != null)
+         {
+            liveOnlyPolicy.getScaleDownPolicy().getConnectors().add(0, connector);
+         }
+
+         server.stop(true);
+      }
+
+   }
+
+   // NotificationEmitter implementation ----------------------------
+
+   public void removeNotificationListener(final NotificationListener listener,
+                                          final NotificationFilter filter,
+                                          final Object handback) throws ListenerNotFoundException
+   {
+      clearIO();
+      try
+      {
+         broadcaster.removeNotificationListener(listener, filter, handback);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
+   {
+      clearIO();
+      try
+      {
+         broadcaster.removeNotificationListener(listener);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public void addNotificationListener(final NotificationListener listener,
+                                       final NotificationFilter filter,
+                                       final Object handback) throws IllegalArgumentException
+   {
+      clearIO();
+      try
+      {
+         broadcaster.addNotificationListener(listener, filter, handback);
+      }
+      finally
+      {
+         blockOnIO();
+      }
+   }
+
+   public MBeanNotificationInfo[] getNotificationInfo()
+   {
+      CoreNotificationType[] values = CoreNotificationType.values();
+      String[] names = new String[values.length];
+      for (int i = 0; i < values.length; i++)
+      {
+         names[i] = values[i].toString();
+      }
+      return new MBeanNotificationInfo[]{new MBeanNotificationInfo(names,
+            this.getClass().getName(),
+            "Notifications emitted by a Core Server")};
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   private synchronized void setMessageCounterEnabled(final boolean enable)
+   {
+      if (isStarted())
+      {
+         if (configuration.isMessageCounterEnabled() && !enable)
+         {
+            stopMessageCounters();
+         }
+         else if (!configuration.isMessageCounterEnabled() && enable)
+         {
+            startMessageCounters();
+         }
+      }
+      configuration.setMessageCounterEnabled(enable);
+   }
+
+   private void startMessageCounters()
+   {
+      messageCounterManager.start();
+   }
+
+   private void stopMessageCounters()
+   {
+      messageCounterManager.stop();
+
+      messageCounterManager.resetAllCounters();
+
+      messageCounterManager.resetAllCounterHistories();
+   }
+
+   public long getConnectionTTLOverride()
+   {
+      return configuration.getConnectionTTLOverride();
+   }
+
+   public int getIDCacheSize()
+   {
+      return configuration.getIDCacheSize();
+   }
+
+   public String getLargeMessagesDirectory()
+   {
+      return configuration.getLargeMessagesDirectory();
+   }
+
+   public String getManagementAddress()
+   {
+      return configuration.getManagementAddress().toString();
+   }
+
+   public String getManagementNotificationAddress()
+   {
+      return configuration.getManagementNotificationAddress().toString();
+   }
+
+   public long getMessageExpiryScanPeriod()
+   {
+      return configuration.getMessageExpiryScanPeriod();
+   }
+
+   public long getMessageExpiryThreadPriority()
+   {
+      return configuration.getMessageExpiryThreadPriority();
+   }
+
+   public long getTransactionTimeout()
+   {
+      return configuration.getTransactionTimeout();
+   }
+
+   public long getTransactionTimeoutScanPeriod()
+   {
+      return configuration.getTransactionTimeoutScanPeriod();
+   }
+
+   public boolean isPersistDeliveryCountBeforeDelivery()
+   {
+      return configuration.isPersistDeliveryCountBeforeDelivery();
+   }
+
+   public boolean isPersistIDCache()
+   {
+      return configuration.isPersistIDCache();
+   }
+
+   public boolean isWildcardRoutingEnabled()
+   {
+      return configuration.isWildcardRoutingEnabled();
+   }
+
+   @Override
+   protected MBeanOperationInfo[] fillMBeanOperationInfo()
+   {
+      return MBeanInfoHelper.getMBeanOperationsInfo(ActiveMQServerControl.class);
+   }
+
+   private void checkStarted()
+   {
+      if (!server.isStarted())
+      {
+         throw new IllegalStateException("ActiveMQ Server is not started. It can not be managed yet");
+      }
+   }
+
+   public String[] listTargetAddresses(final String sessionID)
+   {
+      ServerSession session = server.getSessionByID(sessionID);
+      if (session != null)
+      {
+         return session.getTargetAddresses();
+      }
+      return new String[0];
+   }
+
+   private static List<String> toList(final String commaSeparatedString)
+   {
+      List<String> list = new ArrayList<String>();
+      if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+      {
+         return list;
+      }
+      String[] values = commaSeparatedString.split(",");
+      for (String value : values)
+      {
+         list.add(value.trim());
+      }
+      return list;
+   }
+
+   @Override
+   public void onNotification(org.apache.activemq.core.server.management.Notification notification)
+   {
+      if (!(notification.getType() instanceof CoreNotificationType)) return;
+      CoreNotificationType type = (CoreNotificationType) notification.getType();
+      TypedProperties prop = notification.getProperties();
+
+      this.broadcaster.sendNotification(new Notification(type.toString(), this,
+            notifSeq.incrementAndGet(), notification.toString()));
+   }
+
+}
+


[20/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALogger.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALogger.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALogger.java
deleted file mode 100644
index d582e50..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRALogger.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.ra;
-
-import org.apache.activemq.ra.inflow.HornetQActivationSpec;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * Logger Code 15
- * <p/>
- * each message id must be 6 digits long starting with 15, the 3rd digit donates
- * the level so
- * <p/>
- * <pre>
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- * </pre>
- * <p/>
- * so an INFO message would be 151000 to 151999
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 3/15/12
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQRALogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQRALogger LOGGER = Logger.getMessageLogger(HornetQRALogger.class, HornetQRALogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151000, value = "awaiting topic/queue creation {0}", format = Message.Format.MESSAGE_FORMAT)
-   void awaitingTopicQueueCreation(String destination);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151001, value = "Attempting to reconnect {0}", format = Message.Format.MESSAGE_FORMAT)
-   void attemptingReconnect(HornetQActivationSpec spec);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151002, value = "Reconnected with HornetQ", format = Message.Format.MESSAGE_FORMAT)
-   void reconnected();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151003, value = "HornetQ resource adaptor stopped", format = Message.Format.MESSAGE_FORMAT)
-   void raStopped();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151004, value = "Instantiating {0} \"{1}\" directly since UseJNDI=false.", format = Message.Format.MESSAGE_FORMAT)
-   void instantiatingDestination(String destinationType, String destination);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 151005, value = "awaiting HornetQ Server availability", format = Message.Format.MESSAGE_FORMAT)
-   void awaitingJMSServerCreation();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152000, value = "It wasn''t possible to lookup for a Transaction Manager through the configured properties TransactionManagerLocatorClass and TransactionManagerLocatorMethod\nHornetQ Resource Adapter won''t be able to set and verify transaction timeouts in certain cases.", format = Message.Format.MESSAGE_FORMAT)
-   void noTXLocator();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152001, value = "problem resetting HornetQ xa session after failure", format = Message.Format.MESSAGE_FORMAT)
-   void problemResettingXASession();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152002, value = "Unable to roll local transaction back", format = Message.Format.MESSAGE_FORMAT)
-   void unableToRollbackTX();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152003, value = "unable to reset session after failure", format = Message.Format.MESSAGE_FORMAT)
-   void unableToResetSession();
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152004, value = "Handling JMS exception failure", format = Message.Format.MESSAGE_FORMAT)
-   void handlingJMSFailure(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152005, value = "Failure in HornetQ activation {0}", format = Message.Format.MESSAGE_FORMAT)
-   void failureInActivation(@Cause Throwable t, HornetQActivationSpec spec);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 152006, value = "Unable to call after delivery", format = Message.Format.MESSAGE_FORMAT)
-   void unableToCallAfterDelivery(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 154000, value = "Error while creating object Reference.", format = Message.Format.MESSAGE_FORMAT)
-   void errorCreatingReference(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 154001, value = "Unable to stop HornetQ resource adapter.", format = Message.Format.MESSAGE_FORMAT)
-   void errorStoppingRA(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 154003, value = "Unable to reconnect {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorReconnecting(@Cause Throwable t, HornetQActivationSpec spec);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 154004, value = "Failed to deliver message", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeliveringMessage(@Cause Throwable t);
-
-   @LogMessage(level = Logger.Level.DEBUG)
-   @Message(id = 153001, value = "using different HornetQRAConnectionFactory", format = Message.Format.MESSAGE_FORMAT)
-   void warnDifferentConnectionfactory();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMCFProperties.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMCFProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMCFProperties.java
deleted file mode 100644
index a161027..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMCFProperties.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.io.Serializable;
-
-import javax.jms.Queue;
-import javax.jms.Topic;
-
-
-/**
- * The MCF default properties - these are set in the <tx-connection-factory> at the jms-ds.xml
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQRAMCFProperties extends ConnectionFactoryProperties implements Serializable
-{
-   /**
-    * Serial version UID
-    */
-   static final long serialVersionUID = -5951352236582886862L;
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The queue type
-    */
-   private static final String QUEUE_TYPE = Queue.class.getName();
-
-   /**
-    * The topic type
-    */
-   private static final String TOPIC_TYPE = Topic.class.getName();
-
-
-   private String strConnectorClassName;
-
-   public String strConnectionParameters;
-
-   /**
-    * The connection type
-    */
-   private int type = HornetQRAConnectionFactory.CONNECTION;
-
-   /**
-    * Use tryLock
-    */
-   private Integer useTryLock;
-
-   /**
-    * Constructor
-    */
-   public HornetQRAMCFProperties()
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-
-      useTryLock = null;
-   }
-
-   /**
-    * Get the connection type
-    *
-    * @return The type
-    */
-   public int getType()
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getType()");
-      }
-
-      return type;
-   }
-
-   public String getConnectorClassName()
-   {
-      return strConnectorClassName;
-   }
-
-   public void setConnectorClassName(final String connectorClassName)
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConnectorClassName(" + connectorClassName + ")");
-      }
-
-      strConnectorClassName = connectorClassName;
-
-      setParsedConnectorClassNames(HornetQRaUtils.parseConnectorConnectorConfig(connectorClassName));
-   }
-   /**
-    * @return the connectionParameters
-    */
-   public String getStrConnectionParameters()
-   {
-      return strConnectionParameters;
-   }
-
-   public void setConnectionParameters(final String configuration)
-   {
-      strConnectionParameters = configuration;
-      setParsedConnectionParameters(HornetQRaUtils.parseConfig(configuration));
-   }
-
-   /**
-    * Set the default session type.
-    *
-    * @param defaultType either javax.jms.Topic or javax.jms.Queue
-    */
-   public void setSessionDefaultType(final String defaultType)
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSessionDefaultType(" + type + ")");
-      }
-
-      if (defaultType.equals(HornetQRAMCFProperties.QUEUE_TYPE))
-      {
-         type = HornetQRAConnectionFactory.QUEUE_CONNECTION;
-      }
-      else if (defaultType.equals(HornetQRAMCFProperties.TOPIC_TYPE))
-      {
-         type = HornetQRAConnectionFactory.TOPIC_CONNECTION;
-      }
-      else
-      {
-         type = HornetQRAConnectionFactory.CONNECTION;
-      }
-   }
-
-   /**
-    * Get the default session type.
-    *
-    * @return The default session type
-    */
-   public String getSessionDefaultType()
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSessionDefaultType()");
-      }
-
-      if (type == HornetQRAConnectionFactory.CONNECTION)
-      {
-         return "BOTH";
-      }
-      else if (type == HornetQRAConnectionFactory.QUEUE_CONNECTION)
-      {
-         return HornetQRAMCFProperties.TOPIC_TYPE;
-      }
-      else
-      {
-         return HornetQRAMCFProperties.QUEUE_TYPE;
-      }
-   }
-
-   /**
-    * Get the useTryLock.
-    *
-    * @return the useTryLock.
-    */
-   public Integer getUseTryLock()
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUseTryLock()");
-      }
-
-      return useTryLock;
-   }
-
-   /**
-    * Set the useTryLock.
-    *
-    * @param useTryLock the useTryLock.
-    */
-   public void setUseTryLock(final Integer useTryLock)
-   {
-      if (HornetQRAMCFProperties.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUseTryLock(" + useTryLock + ")");
-      }
-
-      this.useTryLock = useTryLock;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnection.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnection.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnection.java
deleted file mode 100644
index d61c2b5..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnection.java
+++ /dev/null
@@ -1,921 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.ResourceAllocationException;
-import javax.jms.Session;
-import javax.jms.XASession;
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionEvent;
-import javax.resource.spi.ConnectionEventListener;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.IllegalStateException;
-import javax.resource.spi.LocalTransaction;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionMetaData;
-import javax.resource.spi.SecurityException;
-import javax.security.auth.Subject;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.activemq.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.jms.client.HornetQConnection;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQXAConnection;
-
-/**
- * The managed connection
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- */
-public final class HornetQRAManagedConnection implements ManagedConnection, ExceptionListener
-{
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The managed connection factory
-    */
-   private final HornetQRAManagedConnectionFactory mcf;
-
-   /**
-    * The connection request information
-    */
-   private final HornetQRAConnectionRequestInfo cri;
-
-   /**
-    * The resource adapter
-    */
-   private final HornetQResourceAdapter ra;
-
-   /**
-    * The user name
-    */
-   private final String userName;
-
-   /**
-    * The password
-    */
-   private final String password;
-
-   /**
-    * Has the connection been destroyed
-    */
-   private final AtomicBoolean isDestroyed = new AtomicBoolean(false);
-
-   /**
-    * Event listeners
-    */
-   private final List<ConnectionEventListener> eventListeners;
-
-   /**
-    * Handles
-    */
-   private final Set<HornetQRASession> handles;
-
-   /**
-    * Lock
-    */
-   private ReentrantLock lock = new ReentrantLock();
-
-   // Physical connection stuff
-   private HornetQConnectionFactory connectionFactory;
-
-   private HornetQXAConnection connection;
-
-   // The ManagedConnection will play with a XA and a NonXASession to couple with
-   // cases where a commit is called on a non-XAed (or non-enlisted) case.
-   private Session nonXAsession;
-
-   private XASession xaSession;
-
-   private XAResource xaResource;
-
-   private final TransactionManager tm;
-
-   private boolean inManagedTx;
-
-   /**
-    * Constructor
-    *
-    * @param mcf      The managed connection factory
-    * @param cri      The connection request information
-    * @param userName The user name
-    * @param password The password
-    */
-   public HornetQRAManagedConnection(final HornetQRAManagedConnectionFactory mcf,
-                                     final HornetQRAConnectionRequestInfo cri,
-                                     final HornetQResourceAdapter ra,
-                                     final String userName,
-                                     final String password) throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cri + ", " + userName + ", ****)");
-      }
-
-      this.mcf = mcf;
-      this.cri = cri;
-      this.tm = ra.getTM();
-      this.ra = ra;
-      this.userName = userName;
-      this.password = password;
-      eventListeners = Collections.synchronizedList(new ArrayList<ConnectionEventListener>());
-      handles = Collections.synchronizedSet(new HashSet<HornetQRASession>());
-
-      connection = null;
-      nonXAsession = null;
-      xaSession = null;
-      xaResource = null;
-
-      try
-      {
-         setup();
-      }
-      catch (ResourceException e)
-      {
-         try
-         {
-            destroy();
-         }
-         catch (Throwable ignored)
-         {
-         }
-
-         throw e;
-      }
-      catch (Throwable t)
-      {
-         try
-         {
-            destroy();
-         }
-         catch (Throwable ignored)
-         {
-         }
-         throw new ResourceException("Error during setup", t);
-      }
-   }
-
-   /**
-    * Get a connection
-    *
-    * @param subject       The security subject
-    * @param cxRequestInfo The request info
-    * @return The connection
-    * @throws ResourceException Thrown if an error occurs
-    */
-   public synchronized Object getConnection(final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConnection(" + subject + ", " + cxRequestInfo + ")");
-      }
-
-      // Check user first
-      HornetQRACredential credential = HornetQRACredential.getCredential(mcf, subject, cxRequestInfo);
-
-      // Null users are allowed!
-      if (userName != null && !userName.equals(credential.getUserName()))
-      {
-         throw new SecurityException("Password credentials not the same, reauthentication not allowed");
-      }
-
-      if (userName == null && credential.getUserName() != null)
-      {
-         throw new SecurityException("Password credentials not the same, reauthentication not allowed");
-      }
-
-      if (isDestroyed.get())
-      {
-         throw new IllegalStateException("The managed connection is already destroyed");
-      }
-
-      HornetQRASession session = new HornetQRASession(this, (HornetQRAConnectionRequestInfo) cxRequestInfo);
-      handles.add(session);
-      return session;
-   }
-
-   /**
-    * Destroy all handles.
-    *
-    * @throws ResourceException Failed to close one or more handles.
-    */
-   private void destroyHandles() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("destroyHandles()");
-      }
-
-      try
-      {
-
-         if (connection != null)
-         {
-            connection.stop();
-         }
-      }
-      catch (Throwable t)
-      {
-         HornetQRALogger.LOGGER.trace("Ignored error stopping connection", t);
-      }
-
-      for (HornetQRASession session : handles)
-      {
-         session.destroy();
-      }
-
-      handles.clear();
-   }
-
-   /**
-    * Destroy the physical connection.
-    *
-    * @throws ResourceException Could not property close the session and connection.
-    */
-   public void destroy() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("destroy()");
-      }
-
-      if (isDestroyed.get() || connection == null)
-      {
-         return;
-      }
-
-      isDestroyed.set(true);
-
-      try
-      {
-         connection.setExceptionListener(null);
-      }
-      catch (JMSException e)
-      {
-         HornetQRALogger.LOGGER.debug("Error unsetting the exception listener " + this, e);
-      }
-      if (connection != null)
-      {
-         connection.signalStopToAllSessions();
-      }
-
-      destroyHandles();
-
-      try
-      {
-         /**
-          * (xa|nonXA)Session.close() may NOT be called BEFORE connection.close()
-          * <p>
-          * If the ClientSessionFactory is trying to fail-over or reconnect with -1 attempts, and
-          * one calls session.close() it may effectively dead-lock.
-          * <p>
-          * connection close will close the ClientSessionFactory which will close all sessions.
-          */
-         if (connection != null)
-         {
-            connection.close();
-         }
-
-         // The following calls should not be necessary, as the connection should close the
-         // ClientSessionFactory, which will close the sessions.
-         try
-         {
-            if (nonXAsession != null)
-            {
-               nonXAsession.close();
-            }
-
-            if (xaSession != null)
-            {
-               xaSession.close();
-            }
-         }
-         catch (JMSException e)
-         {
-            HornetQRALogger.LOGGER.debug("Error closing session " + this, e);
-         }
-
-         // we must close the HornetQConnectionFactory because it contains a ServerLocator
-         if (connectionFactory != null)
-         {
-            connectionFactory.close();
-         }
-      }
-      catch (Throwable e)
-      {
-         throw new ResourceException("Could not properly close the session and connection", e);
-      }
-   }
-
-   /**
-    * Cleanup
-    *
-    * @throws ResourceException Thrown if an error occurs
-    */
-   public void cleanup() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("cleanup()");
-      }
-
-      if (isDestroyed.get())
-      {
-         throw new IllegalStateException("ManagedConnection already destroyed");
-      }
-
-      destroyHandles();
-
-      inManagedTx = false;
-
-      inManagedTx = false;
-
-      // I'm recreating the lock object when we return to the pool
-      // because it looks too nasty to expect the connection handle
-      // to unlock properly in certain race conditions
-      // where the dissociation of the managed connection is "random".
-      lock = new ReentrantLock();
-   }
-
-   /**
-    * Move a handler from one mc to this one.
-    *
-    * @param obj An object of type HornetQSession.
-    * @throws ResourceException     Failed to associate connection.
-    * @throws IllegalStateException ManagedConnection in an illegal state.
-    */
-   public void associateConnection(final Object obj) throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("associateConnection(" + obj + ")");
-      }
-
-      if (!isDestroyed.get() && obj instanceof HornetQRASession)
-      {
-         HornetQRASession h = (HornetQRASession) obj;
-         h.setManagedConnection(this);
-         handles.add(h);
-      }
-      else
-      {
-         throw new IllegalStateException("ManagedConnection in an illegal state");
-      }
-   }
-
-   public void checkTransactionActive() throws JMSException
-   {
-      // don't bother looking at the transaction if there's an active XID
-      if (!inManagedTx && tm != null)
-      {
-         try
-         {
-            Transaction tx = tm.getTransaction();
-            if (tx != null)
-            {
-               int status = tx.getStatus();
-               // Only allow states that will actually succeed
-               if (status != Status.STATUS_ACTIVE && status != Status.STATUS_PREPARING &&
-                  status != Status.STATUS_PREPARED &&
-                  status != Status.STATUS_COMMITTING)
-               {
-                  throw new javax.jms.IllegalStateException("Transaction " + tx + " not active");
-               }
-            }
-         }
-         catch (SystemException e)
-         {
-            JMSException jmsE = new javax.jms.IllegalStateException("Unexpected exception on the Transaction ManagerTransaction");
-            jmsE.initCause(e);
-            throw jmsE;
-         }
-      }
-   }
-
-
-   /**
-    * Aqquire a lock on the managed connection
-    */
-   protected void lock()
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("lock()");
-      }
-
-      lock.lock();
-   }
-
-   /**
-    * Aqquire a lock on the managed connection within the specified period
-    *
-    * @throws JMSException Thrown if an error occurs
-    */
-   protected void tryLock() throws JMSException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("tryLock()");
-      }
-
-      Integer tryLock = mcf.getUseTryLock();
-      if (tryLock == null || tryLock.intValue() <= 0)
-      {
-         lock();
-         return;
-      }
-      try
-      {
-         if (lock.tryLock(tryLock.intValue(), TimeUnit.SECONDS) == false)
-         {
-            throw new ResourceAllocationException("Unable to obtain lock in " + tryLock + " seconds: " + this);
-         }
-      }
-      catch (InterruptedException e)
-      {
-         throw new ResourceAllocationException("Interrupted attempting lock: " + this);
-      }
-   }
-
-   /**
-    * Unlock the managed connection
-    */
-   protected void unlock()
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("unlock()");
-      }
-
-      lock.unlock();
-   }
-
-   /**
-    * Add a connection event listener.
-    *
-    * @param l The connection event listener to be added.
-    */
-   public void addConnectionEventListener(final ConnectionEventListener l)
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("addConnectionEventListener(" + l + ")");
-      }
-
-      eventListeners.add(l);
-   }
-
-   /**
-    * Remove a connection event listener.
-    *
-    * @param l The connection event listener to be removed.
-    */
-   public void removeConnectionEventListener(final ConnectionEventListener l)
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("removeConnectionEventListener(" + l + ")");
-      }
-
-      eventListeners.remove(l);
-   }
-
-   /**
-    * Get the XAResource for the connection.
-    *
-    * @return The XAResource for the connection.
-    * @throws ResourceException XA transaction not supported
-    */
-   public XAResource getXAResource() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getXAResource()");
-      }
-
-      //
-      // Spec says a mc must always return the same XA resource,
-      // so we cache it.
-      //
-      if (xaResource == null)
-      {
-         ClientSessionInternal csi = (ClientSessionInternal) xaSession.getXAResource();
-         HornetQRAXAResource hqXAResource = new HornetQRAXAResource(this, xaSession.getXAResource());
-         xaResource = new HornetQXAResourceWrapper(hqXAResource, ra.getJndiName(), csi.getNodeId());
-      }
-
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("XAResource=" + xaResource);
-      }
-
-      return xaResource;
-   }
-
-   /**
-    * Get the location transaction for the connection.
-    *
-    * @return The local transaction for the connection.
-    * @throws ResourceException Thrown if operation fails.
-    */
-   public LocalTransaction getLocalTransaction() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getLocalTransaction()");
-      }
-
-      LocalTransaction tx = new HornetQRALocalTransaction(this);
-
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("LocalTransaction=" + tx);
-      }
-
-      return tx;
-   }
-
-   /**
-    * Get the meta data for the connection.
-    *
-    * @return The meta data for the connection.
-    * @throws ResourceException     Thrown if the operation fails.
-    * @throws IllegalStateException Thrown if the managed connection already is destroyed.
-    */
-   public ManagedConnectionMetaData getMetaData() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMetaData()");
-      }
-
-      if (isDestroyed.get())
-      {
-         throw new IllegalStateException("The managed connection is already destroyed");
-      }
-
-      return new HornetQRAMetaData(this);
-   }
-
-   /**
-    * Set the log writer -- NOT SUPPORTED
-    *
-    * @param out The log writer
-    * @throws ResourceException If operation fails
-    */
-   public void setLogWriter(final PrintWriter out) throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setLogWriter(" + out + ")");
-      }
-   }
-
-   /**
-    * Get the log writer -- NOT SUPPORTED
-    *
-    * @return Always null
-    * @throws ResourceException If operation fails
-    */
-   public PrintWriter getLogWriter() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getLogWriter()");
-      }
-
-      return null;
-   }
-
-   /**
-    * Notifies user of a JMS exception.
-    *
-    * @param exception The JMS exception
-    */
-   public void onException(final JMSException exception)
-   {
-      if (HornetQConnection.EXCEPTION_FAILOVER.equals(exception.getErrorCode()))
-      {
-         return;
-      }
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("onException(" + exception + ")");
-      }
-
-      if (isDestroyed.get())
-      {
-         if (HornetQRAManagedConnection.trace)
-         {
-            HornetQRALogger.LOGGER.trace("Ignoring error on already destroyed connection " + this, exception);
-         }
-         return;
-      }
-
-      HornetQRALogger.LOGGER.handlingJMSFailure(exception);
-
-      try
-      {
-         connection.setExceptionListener(null);
-      }
-      catch (JMSException e)
-      {
-         HornetQRALogger.LOGGER.debug("Unable to unset exception listener", e);
-      }
-
-      ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);
-      sendEvent(event);
-   }
-
-   /**
-    * Get the session for this connection.
-    *
-    * @return The session
-    * @throws JMSException
-    */
-   protected Session getSession() throws JMSException
-   {
-      if (xaResource != null && inManagedTx)
-      {
-         if (HornetQRAManagedConnection.trace)
-         {
-            HornetQRALogger.LOGGER.trace("getSession() -> XA session " + xaSession.getSession());
-         }
-
-         return xaSession.getSession();
-      }
-      else
-      {
-         if (HornetQRAManagedConnection.trace)
-         {
-            HornetQRALogger.LOGGER.trace("getSession() -> non XA session " + nonXAsession);
-         }
-
-         return nonXAsession;
-      }
-   }
-
-   /**
-    * Send an event.
-    *
-    * @param event The event to send.
-    */
-   protected void sendEvent(final ConnectionEvent event)
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("sendEvent(" + event + ")");
-      }
-
-      int type = event.getId();
-
-      // convert to an array to avoid concurrent modification exceptions
-      ConnectionEventListener[] list = eventListeners.toArray(new ConnectionEventListener[eventListeners.size()]);
-
-      for (ConnectionEventListener l : list)
-      {
-         switch (type)
-         {
-            case ConnectionEvent.CONNECTION_CLOSED:
-               l.connectionClosed(event);
-               break;
-
-            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
-               l.localTransactionStarted(event);
-               break;
-
-            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
-               l.localTransactionCommitted(event);
-               break;
-
-            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
-               l.localTransactionRolledback(event);
-               break;
-
-            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
-               l.connectionErrorOccurred(event);
-               break;
-
-            default:
-               throw new IllegalArgumentException("Illegal eventType: " + type);
-         }
-      }
-   }
-
-   /**
-    * Remove a handle from the handle map.
-    *
-    * @param handle The handle to remove.
-    */
-   protected void removeHandle(final HornetQRASession handle)
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("removeHandle(" + handle + ")");
-      }
-
-      handles.remove(handle);
-   }
-
-   /**
-    * Get the request info for this connection.
-    *
-    * @return The connection request info for this connection.
-    */
-   protected HornetQRAConnectionRequestInfo getCRI()
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getCRI()");
-      }
-
-      return cri;
-   }
-
-   /**
-    * Get the connection factory for this connection.
-    *
-    * @return The connection factory for this connection.
-    */
-   protected HornetQRAManagedConnectionFactory getManagedConnectionFactory()
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getManagedConnectionFactory()");
-      }
-
-      return mcf;
-   }
-
-   /**
-    * Start the connection
-    *
-    * @throws JMSException Thrown if the connection can't be started
-    */
-   void start() throws JMSException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start()");
-      }
-
-      if (connection != null)
-      {
-         connection.start();
-      }
-   }
-
-   /**
-    * Stop the connection
-    *
-    * @throws JMSException Thrown if the connection can't be stopped
-    */
-   void stop() throws JMSException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("stop()");
-      }
-
-      if (connection != null)
-      {
-         connection.stop();
-      }
-   }
-
-   /**
-    * Get the user name
-    *
-    * @return The user name
-    */
-   protected String getUserName()
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUserName()");
-      }
-
-      return userName;
-   }
-
-   /**
-    * Setup the connection.
-    *
-    * @throws ResourceException Thrown if a connection couldn't be created
-    */
-   private void setup() throws ResourceException
-   {
-      if (HornetQRAManagedConnection.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setup()");
-      }
-
-      try
-      {
-
-         createCF();
-
-         boolean transacted = cri.isTransacted();
-         int acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-         if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
-         {
-            if (userName != null && password != null)
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXATopicConnection(userName, password);
-            }
-            else
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXATopicConnection();
-            }
-
-            connection.setExceptionListener(this);
-
-            xaSession = connection.createXATopicSession();
-            nonXAsession = connection.createNonXATopicSession(transacted, acknowledgeMode);
-
-         }
-         else if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION)
-         {
-            if (userName != null && password != null)
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXAQueueConnection(userName, password);
-            }
-            else
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXAQueueConnection();
-            }
-
-            connection.setExceptionListener(this);
-
-            xaSession = connection.createXAQueueSession();
-            nonXAsession = connection.createNonXAQueueSession(transacted, acknowledgeMode);
-
-         }
-         else
-         {
-            if (userName != null && password != null)
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXAConnection(userName, password);
-            }
-            else
-            {
-               connection = (HornetQXAConnection) connectionFactory.createXAConnection();
-            }
-
-            connection.setExceptionListener(this);
-
-            xaSession = connection.createXASession();
-            nonXAsession = connection.createNonXASession(transacted, acknowledgeMode);
-         }
-
-      }
-      catch (JMSException je)
-      {
-         throw new ResourceException(je.getMessage(), je);
-      }
-   }
-
-   private void createCF()
-   {
-      if (connectionFactory == null)
-      {
-         connectionFactory = ra.createHornetQConnectionFactory(mcf.getProperties());
-      }
-   }
-
-   protected void setInManagedTx(boolean inManagedTx)
-   {
-      this.inManagedTx = inManagedTx;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnectionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnectionFactory.java
deleted file mode 100644
index 788d867..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAManagedConnectionFactory.java
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.ConnectionMetaData;
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionFactory;
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterAssociation;
-import javax.security.auth.Subject;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
-
-/**
- * HornetQ ManagedConnectionFactory
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>.
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public final class HornetQRAManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation
-{
-   /**
-    * Serial version UID
-    */
-   static final long serialVersionUID = -1452379518562456741L;
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * The resource adapter
-    */
-   private HornetQResourceAdapter ra;
-
-   /**
-    * Connection manager
-    */
-   private ConnectionManager cm;
-
-   /**
-    * The managed connection factory properties
-    */
-   private final HornetQRAMCFProperties mcfProperties;
-
-   /**
-    * Connection Factory used if properties are set
-    */
-   private HornetQConnectionFactory recoveryConnectionFactory;
-
-   /*
-   * The resource recovery if there is one
-   * */
-   private XARecoveryConfig resourceRecovery;
-
-   /**
-    * Constructor
-    */
-   public HornetQRAManagedConnectionFactory()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-
-      ra = null;
-      cm = null;
-      mcfProperties = new HornetQRAMCFProperties();
-   }
-
-   /**
-    * Creates a Connection Factory instance
-    *
-    * @return javax.resource.cci.ConnectionFactory instance
-    * @throws ResourceException Thrown if a connection factory can't be created
-    */
-   public Object createConnectionFactory() throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.debug("createConnectionFactory()");
-      }
-
-      return createConnectionFactory(new HornetQRAConnectionManager());
-   }
-
-   /**
-    * Creates a Connection Factory instance
-    *
-    * @param cxManager The connection manager
-    * @return javax.resource.cci.ConnectionFactory instance
-    * @throws ResourceException Thrown if a connection factory can't be created
-    */
-   public Object createConnectionFactory(final ConnectionManager cxManager) throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createConnectionFactory(" + cxManager + ")");
-      }
-
-      cm = cxManager;
-
-      HornetQRAConnectionFactory cf = new HornetQRAConnectionFactoryImpl(this, cm);
-
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Created connection factory: " + cf +
-                                         ", using connection manager: " +
-                                         cm);
-      }
-      return cf;
-   }
-
-   /**
-    * Creates a new physical connection to the underlying EIS resource manager.
-    *
-    * @param subject       Caller's security information
-    * @param cxRequestInfo Additional resource adapter specific connection request information
-    * @return The managed connection
-    * @throws ResourceException Thrown if a managed connection can't be created
-    */
-   public ManagedConnection createManagedConnection(final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("createManagedConnection(" + subject + ", " + cxRequestInfo + ")");
-      }
-
-      HornetQRAConnectionRequestInfo cri = getCRI((HornetQRAConnectionRequestInfo) cxRequestInfo);
-
-      HornetQRACredential credential = HornetQRACredential.getCredential(this, subject, cri);
-
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("jms credential: " + credential);
-      }
-
-      HornetQRAManagedConnection mc = new HornetQRAManagedConnection(this,
-                                                                     cri,
-                                                                     ra,
-                                                                     credential.getUserName(),
-                                                                     credential.getPassword());
-
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("created new managed connection: " + mc);
-      }
-
-      registerRecovery();
-
-      return mc;
-   }
-
-   private synchronized void registerRecovery()
-   {
-      if (recoveryConnectionFactory == null)
-      {
-         recoveryConnectionFactory = ra.createRecoveryHornetQConnectionFactory(mcfProperties);
-         resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null);
-      }
-   }
-
-   public XARecoveryConfig getResourceRecovery()
-   {
-      return resourceRecovery;
-   }
-
-   /**
-    * Returns a matched connection from the candidate set of connections.
-    *
-    * @param connectionSet The candidate connection set
-    * @param subject       Caller's security information
-    * @param cxRequestInfo Additional resource adapter specific connection request information
-    * @return The managed connection
-    * @throws ResourceException Thrown if the managed connection can not be found
-    */
-   public ManagedConnection matchManagedConnections(@SuppressWarnings("rawtypes") final Set connectionSet, final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("matchManagedConnections(" + connectionSet +
-                                         ", " +
-                                         subject +
-                                         ", " +
-                                         cxRequestInfo +
-                                         ")");
-      }
-
-      HornetQRAConnectionRequestInfo cri = getCRI((HornetQRAConnectionRequestInfo) cxRequestInfo);
-      HornetQRACredential credential = HornetQRACredential.getCredential(this, subject, cri);
-
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("Looking for connection matching credentials: " + credential);
-      }
-
-      Iterator<?> connections = connectionSet.iterator();
-
-      while (connections.hasNext())
-      {
-         Object obj = connections.next();
-
-         if (obj instanceof HornetQRAManagedConnection)
-         {
-            HornetQRAManagedConnection mc = (HornetQRAManagedConnection) obj;
-            ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();
-
-            if ((mc.getUserName() == null || mc.getUserName() != null && mc.getUserName()
-               .equals(credential.getUserName())) && mcf.equals(this))
-            {
-               if (cri.equals(mc.getCRI()))
-               {
-                  if (HornetQRAManagedConnectionFactory.trace)
-                  {
-                     HornetQRALogger.LOGGER.trace("Found matching connection: " + mc);
-                  }
-
-                  return mc;
-               }
-            }
-         }
-      }
-
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("No matching connection was found");
-      }
-
-      return null;
-   }
-
-   /**
-    * Set the log writer -- NOT SUPPORTED
-    *
-    * @param out The writer
-    * @throws ResourceException Thrown if the writer can't be set
-    */
-   public void setLogWriter(final PrintWriter out) throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setLogWriter(" + out + ")");
-      }
-   }
-
-   /**
-    * Get the log writer -- NOT SUPPORTED
-    *
-    * @return The writer
-    * @throws ResourceException Thrown if the writer can't be retrieved
-    */
-   public PrintWriter getLogWriter() throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getLogWriter()");
-      }
-
-      return null;
-   }
-
-   /**
-    * Get the resource adapter
-    *
-    * @return The resource adapter
-    */
-   public ResourceAdapter getResourceAdapter()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getResourceAdapter()");
-      }
-
-      return ra;
-   }
-
-   /**
-    * Set the resource adapter
-    * <p/>
-    * This should ensure that when the RA is stopped, this MCF will be stopped as well.
-    *
-    * @param ra The resource adapter
-    * @throws ResourceException Thrown if incorrect resource adapter
-    */
-   public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")");
-      }
-
-      if (ra == null || !(ra instanceof HornetQResourceAdapter))
-      {
-         throw new ResourceException("Resource adapter is " + ra);
-      }
-
-      this.ra = (HornetQResourceAdapter) ra;
-      this.ra.setManagedConnectionFactory(this);
-   }
-
-   /**
-    * Indicates whether some other object is "equal to" this one.
-    *
-    * @param obj Object with which to compare
-    * @return True if this object is the same as the obj argument; false otherwise.
-    */
-   @Override
-   public boolean equals(final Object obj)
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("equals(" + obj + ")");
-      }
-
-      if (obj == null)
-      {
-         return false;
-      }
-
-      if (obj instanceof HornetQRAManagedConnectionFactory)
-      {
-         HornetQRAManagedConnectionFactory other = (HornetQRAManagedConnectionFactory) obj;
-
-         return mcfProperties.equals(other.getProperties()) && ra.equals(other.getResourceAdapter());
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   /**
-    * Return the hash code for the object
-    *
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("hashCode()");
-      }
-
-      int hash = mcfProperties.hashCode();
-      hash += 31 * ra.hashCode();
-
-      return hash;
-   }
-
-   /**
-    * Get the default session type
-    *
-    * @return The value
-    */
-   public String getSessionDefaultType()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSessionDefaultType()");
-      }
-
-      return mcfProperties.getSessionDefaultType();
-   }
-
-   /**
-    * Set the default session type
-    *
-    * @param type either javax.jms.Topic or javax.jms.Queue
-    */
-   public void setSessionDefaultType(final String type)
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSessionDefaultType(" + type + ")");
-      }
-
-      mcfProperties.setSessionDefaultType(type);
-   }
-
-   /**
-    * @return the connectionParameters
-    */
-   public String getConnectionParameters()
-   {
-      return mcfProperties.getStrConnectionParameters();
-   }
-
-   public void setConnectionParameters(final String configuration)
-   {
-      mcfProperties.setConnectionParameters(configuration);
-   }
-
-   /**
-    * @return the transportType
-    */
-   public String getConnectorClassName()
-   {
-      return mcfProperties.getConnectorClassName();
-   }
-
-   public void setConnectorClassName(final String value)
-   {
-      mcfProperties.setConnectorClassName(value);
-   }
-
-   public String getConnectionLoadBalancingPolicyClassName()
-   {
-      return mcfProperties.getConnectionLoadBalancingPolicyClassName();
-   }
-
-   public void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
-   {
-      mcfProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
-   }
-
-   public String getDiscoveryAddress()
-   {
-      return mcfProperties.getDiscoveryAddress();
-   }
-
-   public void setDiscoveryAddress(final String discoveryAddress)
-   {
-      mcfProperties.setDiscoveryAddress(discoveryAddress);
-   }
-
-   public Integer getDiscoveryPort()
-   {
-      return mcfProperties.getDiscoveryPort();
-   }
-
-   public void setDiscoveryPort(final Integer discoveryPort)
-   {
-      mcfProperties.setDiscoveryPort(discoveryPort);
-   }
-
-   public Long getDiscoveryRefreshTimeout()
-   {
-      return mcfProperties.getDiscoveryRefreshTimeout();
-   }
-
-   public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout)
-   {
-      mcfProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
-   }
-
-   public Long getDiscoveryInitialWaitTimeout()
-   {
-      return mcfProperties.getDiscoveryInitialWaitTimeout();
-   }
-
-   public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout)
-   {
-      mcfProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
-   }
-
-   public String getClientID()
-   {
-      return mcfProperties.getClientID();
-   }
-
-   public void setClientID(final String clientID)
-   {
-      mcfProperties.setClientID(clientID);
-   }
-
-   public Integer getDupsOKBatchSize()
-   {
-      return mcfProperties.getDupsOKBatchSize();
-   }
-
-   public void setDupsOKBatchSize(final Integer dupsOKBatchSize)
-   {
-      mcfProperties.setDupsOKBatchSize(dupsOKBatchSize);
-   }
-
-   public Integer getTransactionBatchSize()
-   {
-      return mcfProperties.getTransactionBatchSize();
-   }
-
-   public void setTransactionBatchSize(final Integer transactionBatchSize)
-   {
-      mcfProperties.setTransactionBatchSize(transactionBatchSize);
-   }
-
-   public Long getClientFailureCheckPeriod()
-   {
-      return mcfProperties.getClientFailureCheckPeriod();
-   }
-
-   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
-   {
-      mcfProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
-   }
-
-   public Long getConnectionTTL()
-   {
-      return mcfProperties.getConnectionTTL();
-   }
-
-   public void setConnectionTTL(final Long connectionTTL)
-   {
-      mcfProperties.setConnectionTTL(connectionTTL);
-   }
-
-   public Long getCallTimeout()
-   {
-      return mcfProperties.getCallTimeout();
-   }
-
-   public void setCallTimeout(final Long callTimeout)
-   {
-      mcfProperties.setCallTimeout(callTimeout);
-   }
-
-   public Integer getConsumerWindowSize()
-   {
-      return mcfProperties.getConsumerWindowSize();
-   }
-
-   public void setConsumerWindowSize(final Integer consumerWindowSize)
-   {
-      mcfProperties.setConsumerWindowSize(consumerWindowSize);
-   }
-
-   public Integer getConsumerMaxRate()
-   {
-      return mcfProperties.getConsumerMaxRate();
-   }
-
-   public void setConsumerMaxRate(final Integer consumerMaxRate)
-   {
-      mcfProperties.setConsumerMaxRate(consumerMaxRate);
-   }
-
-   public Integer getConfirmationWindowSize()
-   {
-      return mcfProperties.getConfirmationWindowSize();
-   }
-
-   public void setConfirmationWindowSize(final Integer confirmationWindowSize)
-   {
-      mcfProperties.setConfirmationWindowSize(confirmationWindowSize);
-   }
-
-   public Integer getProducerMaxRate()
-   {
-      return mcfProperties.getProducerMaxRate();
-   }
-
-   public void setProducerMaxRate(final Integer producerMaxRate)
-   {
-      mcfProperties.setProducerMaxRate(producerMaxRate);
-   }
-
-   public Integer getMinLargeMessageSize()
-   {
-      return mcfProperties.getMinLargeMessageSize();
-   }
-
-   public void setMinLargeMessageSize(final Integer minLargeMessageSize)
-   {
-      mcfProperties.setMinLargeMessageSize(minLargeMessageSize);
-   }
-
-   public Boolean isBlockOnAcknowledge()
-   {
-      return mcfProperties.isBlockOnAcknowledge();
-   }
-
-   public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge)
-   {
-      mcfProperties.setBlockOnAcknowledge(blockOnAcknowledge);
-   }
-
-   public Boolean isBlockOnNonDurableSend()
-   {
-      return mcfProperties.isBlockOnNonDurableSend();
-   }
-
-   public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend)
-   {
-      mcfProperties.setBlockOnNonDurableSend(blockOnNonDurableSend);
-   }
-
-   public Boolean isBlockOnDurableSend()
-   {
-      return mcfProperties.isBlockOnDurableSend();
-   }
-
-   public void setBlockOnDurableSend(final Boolean blockOnDurableSend)
-   {
-      mcfProperties.setBlockOnDurableSend(blockOnDurableSend);
-   }
-
-   public Boolean isAutoGroup()
-   {
-      return mcfProperties.isAutoGroup();
-   }
-
-   public void setAutoGroup(final Boolean autoGroup)
-   {
-      mcfProperties.setAutoGroup(autoGroup);
-   }
-
-   public Boolean isPreAcknowledge()
-   {
-      return mcfProperties.isPreAcknowledge();
-   }
-
-   public void setPreAcknowledge(final Boolean preAcknowledge)
-   {
-      mcfProperties.setPreAcknowledge(preAcknowledge);
-   }
-
-   public Long getRetryInterval()
-   {
-      return mcfProperties.getRetryInterval();
-   }
-
-   public void setRetryInterval(final Long retryInterval)
-   {
-      mcfProperties.setRetryInterval(retryInterval);
-   }
-
-   public Double getRetryIntervalMultiplier()
-   {
-      return mcfProperties.getRetryIntervalMultiplier();
-   }
-
-   public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier)
-   {
-      mcfProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
-   }
-
-   public Integer getReconnectAttempts()
-   {
-      return mcfProperties.getReconnectAttempts();
-   }
-
-   public void setReconnectAttempts(final Integer reconnectAttempts)
-   {
-      mcfProperties.setReconnectAttempts(reconnectAttempts);
-   }
-
-   public Boolean isUseGlobalPools()
-   {
-      return mcfProperties.isUseGlobalPools();
-   }
-
-   public void setUseGlobalPools(final Boolean useGlobalPools)
-   {
-      mcfProperties.setUseGlobalPools(useGlobalPools);
-   }
-
-   public Integer getScheduledThreadPoolMaxSize()
-   {
-      return mcfProperties.getScheduledThreadPoolMaxSize();
-   }
-
-   public void setScheduledThreadPoolMaxSize(final Integer scheduledThreadPoolMaxSize)
-   {
-      mcfProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
-   }
-
-   public Integer getThreadPoolMaxSize()
-   {
-      return mcfProperties.getThreadPoolMaxSize();
-   }
-
-   public void setThreadPoolMaxSize(final Integer threadPoolMaxSize)
-   {
-      mcfProperties.setThreadPoolMaxSize(threadPoolMaxSize);
-   }
-
-   public Boolean isHA()
-   {
-      return mcfProperties.isHA();
-   }
-
-   public void setHA(Boolean ha)
-   {
-      mcfProperties.setHA(ha);
-   }
-
-   /**
-    * Get the useTryLock.
-    *
-    * @return the useTryLock.
-    */
-   public Integer getUseTryLock()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUseTryLock()");
-      }
-
-      return mcfProperties.getUseTryLock();
-   }
-
-   /**
-    * Set the useTryLock.
-    *
-    * @param useTryLock the useTryLock.
-    */
-   public void setUseTryLock(final Integer useTryLock)
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUseTryLock(" + useTryLock + ")");
-      }
-
-      mcfProperties.setUseTryLock(useTryLock);
-   }
-
-   /**
-    * Get the connection metadata
-    *
-    * @return The metadata
-    */
-   public ConnectionMetaData getMetaData()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMetadata()");
-      }
-
-      return new HornetQRAConnectionMetaData();
-   }
-
-   /**
-    * Get the managed connection factory properties
-    *
-    * @return The properties
-    */
-   protected HornetQRAMCFProperties getProperties()
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getProperties()");
-      }
-
-      return mcfProperties;
-   }
-
-   /**
-    * Get a connection request info instance
-    *
-    * @param info The instance that should be updated; may be <code>null</code>
-    * @return The instance
-    */
-   private HornetQRAConnectionRequestInfo getCRI(final HornetQRAConnectionRequestInfo info)
-   {
-      if (HornetQRAManagedConnectionFactory.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getCRI(" + info + ")");
-      }
-
-      if (info == null)
-      {
-         // Create a default one
-         return new HornetQRAConnectionRequestInfo(ra.getProperties(), mcfProperties.getType());
-      }
-      else
-      {
-         // Fill the one with any defaults
-         info.setDefaults(ra.getProperties());
-         return info;
-      }
-   }
-
-   // this should be called when HornetQResourceAdapter.stop() is called since this MCF is registered with it
-   public void stop()
-   {
-      if (resourceRecovery != null)
-      {
-         ra.getRecoveryManager().unRegister(resourceRecovery);
-      }
-
-      if (recoveryConnectionFactory != null)
-      {
-         recoveryConnectionFactory.close();
-         recoveryConnectionFactory = null;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMapMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMapMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMapMessage.java
deleted file mode 100644
index 30abb59..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAMapMessage.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.util.Arrays;
-import java.util.Enumeration;
-
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @version $Revision: 71554 $
- */
-public class HornetQRAMapMessage extends HornetQRAMessage implements MapMessage
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    *
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRAMapMessage(final MapMessage message, final HornetQRASession session)
-   {
-      super(message, session);
-
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean getBoolean(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBoolean(" + name + ")");
-      }
-
-      return ((MapMessage)message).getBoolean(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public byte getByte(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getByte(" + name + ")");
-      }
-
-      return ((MapMessage)message).getByte(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public byte[] getBytes(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getBytes(" + name + ")");
-      }
-
-      return ((MapMessage)message).getBytes(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public char getChar(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getChar(" + name + ")");
-      }
-
-      return ((MapMessage)message).getChar(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public double getDouble(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDouble(" + name + ")");
-      }
-
-      return ((MapMessage)message).getDouble(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public float getFloat(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getFloat(" + name + ")");
-      }
-
-      return ((MapMessage)message).getFloat(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int getInt(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getInt(" + name + ")");
-      }
-
-      return ((MapMessage)message).getInt(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public long getLong(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getLong(" + name + ")");
-      }
-
-      return ((MapMessage)message).getLong(name);
-   }
-
-   /**
-    * Get the map names
-    * @return The values
-    * @exception JMSException Thrown if an error occurs
-    */
-   @SuppressWarnings("rawtypes")
-   public Enumeration getMapNames() throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMapNames()");
-      }
-
-      return ((MapMessage)message).getMapNames();
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Object getObject(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getObject(" + name + ")");
-      }
-
-      return ((MapMessage)message).getObject(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public short getShort(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getShort(" + name + ")");
-      }
-
-      return ((MapMessage)message).getShort(name);
-   }
-
-   /**
-    * Get
-    * @param name The name
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public String getString(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getString(" + name + ")");
-      }
-
-      return ((MapMessage)message).getString(name);
-   }
-
-   /**
-    * Does the item exist
-    * @param name The name
-    * @return True / false
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean itemExists(final String name) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("itemExists(" + name + ")");
-      }
-
-      return ((MapMessage)message).itemExists(name);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setBoolean(final String name, final boolean value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBoolean(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setBoolean(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setByte(final String name, final byte value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setByte(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setByte(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @param offset The offset
-    * @param length The length
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setBytes(final String name, final byte[] value, final int offset, final int length) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBytes(" + name + ", " + Arrays.toString(value) + ", " + offset + ", " +
-                  length + ")");
-      }
-
-      ((MapMessage)message).setBytes(name, value, offset, length);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setBytes(final String name, final byte[] value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setBytes(" + name + ", " + Arrays.toString(value) + ")");
-      }
-
-      ((MapMessage)message).setBytes(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setChar(final String name, final char value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setChar(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setChar(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setDouble(final String name, final double value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDouble(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setDouble(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setFloat(final String name, final float value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setFloat(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setFloat(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setInt(final String name, final int value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setInt(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setInt(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setLong(final String name, final long value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setLong(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setLong(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setObject(final String name, final Object value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setObject(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setObject(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setShort(final String name, final short value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setShort(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setShort(name, value);
-   }
-
-   /**
-    * Set
-    * @param name The name
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setString(final String name, final String value) throws JMSException
-   {
-      if (HornetQRAMapMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setString(" + name + ", " + value + ")");
-      }
-
-      ((MapMessage)message).setString(name, value);
-   }
-}


[40/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessage.java
new file mode 100644
index 0000000..c955f41
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessage.java
@@ -0,0 +1,1089 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.Message;
+import javax.jms.MessageFormatException;
+import javax.jms.MessageNotWriteableException;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.core.message.impl.MessageInternal;
+import org.apache.activemq.reader.MessageUtil;
+import org.apache.activemq.utils.UUID;
+
+
+/**
+ * ActiveMQ implementation of a JMS Message.
+ * <br>
+ * JMS Messages only live on the client side - the server only deals with MessageImpl
+ * instances
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:bershath@yahoo.com">Tyronne Wickramarathne</a> Partially ported from JBossMQ implementation
+ *         originally written by:
+ * @author Norbert Lataille (Norbert.Lataille@m4x.org)
+ * @author Hiram Chirino (Cojonudo14@hotmail.com)
+ * @author David Maplesden (David.Maplesden@orion.co.nz)
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ */
+public class ActiveMQMessage implements javax.jms.Message
+{
+   // Constants -----------------------------------------------------
+   public static final byte TYPE = org.apache.activemq.api.core.Message.DEFAULT_TYPE;
+
+   public static Map<String, Object> coreMaptoJMSMap(final Map<String, Object> coreMessage)
+   {
+      Map<String, Object> jmsMessage = new HashMap<String, Object>();
+
+      String deliveryMode = (Boolean)coreMessage.get("durable") ? "PERSISTENT" : "NON_PERSISTENT";
+      byte priority = (Byte)coreMessage.get("priority");
+      long timestamp = (Long)coreMessage.get("timestamp");
+      long expiration = (Long)coreMessage.get("expiration");
+
+      jmsMessage.put("JMSPriority", priority);
+      jmsMessage.put("JMSTimestamp", timestamp);
+      jmsMessage.put("JMSExpiration", expiration);
+      jmsMessage.put("JMSDeliveryMode", deliveryMode);
+
+      for (Map.Entry<String, Object> entry : coreMessage.entrySet())
+      {
+         if (entry.getKey().equals("type") || entry.getKey().equals("durable") ||
+             entry.getKey().equals("expiration") ||
+             entry.getKey().equals("timestamp") ||
+             entry.getKey().equals("priority"))
+         {
+            // Ignore
+         }
+         else if (entry.getKey().equals("userID"))
+         {
+            jmsMessage.put("JMSMessageID", entry.getValue().toString());
+         }
+         else
+         {
+            Object value = entry.getValue();
+            if (value instanceof SimpleString)
+            {
+               jmsMessage.put(entry.getKey(), value.toString());
+            }
+            else
+            {
+               jmsMessage.put(entry.getKey(), value);
+            }
+         }
+      }
+
+      return jmsMessage;
+   }
+
+   // Static --------------------------------------------------------
+
+   private static final HashSet<String> reservedIdentifiers = new HashSet<String>();
+   static
+   {
+      ActiveMQMessage.reservedIdentifiers.add("NULL");
+      ActiveMQMessage.reservedIdentifiers.add("TRUE");
+      ActiveMQMessage.reservedIdentifiers.add("FALSE");
+      ActiveMQMessage.reservedIdentifiers.add("NOT");
+      ActiveMQMessage.reservedIdentifiers.add("AND");
+      ActiveMQMessage.reservedIdentifiers.add("OR");
+      ActiveMQMessage.reservedIdentifiers.add("BETWEEN");
+      ActiveMQMessage.reservedIdentifiers.add("LIKE");
+      ActiveMQMessage.reservedIdentifiers.add("IN");
+      ActiveMQMessage.reservedIdentifiers.add("IS");
+      ActiveMQMessage.reservedIdentifiers.add("ESCAPE");
+   }
+
+   public static ActiveMQMessage createMessage(final ClientMessage message, final ClientSession session)
+   {
+      int type = message.getType();
+
+      ActiveMQMessage msg;
+
+      switch (type)
+      {
+         case ActiveMQMessage.TYPE: // 0
+         {
+            msg = new ActiveMQMessage(message, session);
+            break;
+         }
+         case ActiveMQBytesMessage.TYPE: // 4
+         {
+            msg = new ActiveMQBytesMessage(message, session);
+            break;
+         }
+         case ActiveMQMapMessage.TYPE: // 5
+         {
+            msg = new ActiveMQMapMessage(message, session);
+            break;
+         }
+         case ActiveMQObjectMessage.TYPE:
+         {
+            msg = new ActiveMQObjectMessage(message, session);
+            break;
+         }
+         case ActiveMQStreamMessage.TYPE: // 6
+         {
+            msg = new ActiveMQStreamMessage(message, session);
+            break;
+         }
+         case ActiveMQTextMessage.TYPE: // 3
+         {
+            msg = new ActiveMQTextMessage(message, session);
+            break;
+         }
+         default:
+         {
+            throw new JMSRuntimeException("Invalid message type " + type);
+         }
+      }
+
+      return msg;
+   }
+
+   // Attributes ----------------------------------------------------
+
+   // The underlying message
+   protected ClientMessage message;
+
+   private ClientSession session;
+
+   // Read-only?
+   protected boolean readOnly;
+
+   // Properties read-only?
+   protected boolean propertiesReadOnly;
+
+   // Cache it
+   private Destination dest;
+
+   // Cache it
+   private String msgID;
+
+   // Cache it
+   private Destination replyTo;
+
+   // Cache it
+   private String jmsCorrelationID;
+
+   // Cache it
+   private String jmsType;
+
+   private boolean individualAck;
+
+   private long jmsDeliveryTime;
+
+   // Constructors --------------------------------------------------
+
+   /*
+    * Create a new message prior to sending
+    */
+   protected ActiveMQMessage(final byte type, final ClientSession session)
+   {
+      message = session.createMessage(type, true, 0, System.currentTimeMillis(), (byte)4);
+
+   }
+
+   protected ActiveMQMessage(final ClientSession session)
+   {
+      this(ActiveMQMessage.TYPE, session);
+   }
+
+   /**
+    * Constructor for when receiving a message from the server
+    */
+   public ActiveMQMessage(final ClientMessage message, final ClientSession session)
+   {
+      this.message = message;
+
+      readOnly = true;
+
+      propertiesReadOnly = true;
+
+      this.session = session;
+   }
+
+   /*
+    * A constructor that takes a foreign message
+    */
+   public ActiveMQMessage(final Message foreign, final ClientSession session) throws JMSException
+   {
+      this(foreign, ActiveMQMessage.TYPE, session);
+   }
+
+   public ActiveMQMessage()
+   {
+   }
+
+   protected ActiveMQMessage(final Message foreign, final byte type, final ClientSession session) throws JMSException
+   {
+      this(type, session);
+
+      setJMSTimestamp(foreign.getJMSTimestamp());
+
+      String value = System.getProperty(ActiveMQJMSConstants.JMS_ACTIVEMQ_ENABLE_BYTE_ARRAY_JMS_CORRELATION_ID_PROPERTY_NAME);
+
+      boolean supportBytesId = !"false".equals(value);
+
+      if (supportBytesId)
+      {
+         try
+         {
+            byte[] corrIDBytes = foreign.getJMSCorrelationIDAsBytes();
+            setJMSCorrelationIDAsBytes(corrIDBytes);
+         }
+         catch (JMSException e)
+         {
+            // specified as String
+            String corrIDString = foreign.getJMSCorrelationID();
+            if (corrIDString != null)
+            {
+               setJMSCorrelationID(corrIDString);
+            }
+         }
+      }
+      else
+      {
+         // Some providers, like WSMQ do automatic conversions between native byte[] correlation id
+         // and String correlation id. This makes it impossible for ActiveMQ to guarantee to return the correct
+         // type as set by the user
+         // So we allow the behaviour to be overridden by a system property
+         // https://jira.jboss.org/jira/browse/HORNETQ-356
+         // https://jira.jboss.org/jira/browse/HORNETQ-332
+         String corrIDString = foreign.getJMSCorrelationID();
+         if (corrIDString != null)
+         {
+            setJMSCorrelationID(corrIDString);
+         }
+      }
+
+      setJMSReplyTo(foreign.getJMSReplyTo());
+      setJMSDestination(foreign.getJMSDestination());
+      setJMSDeliveryMode(foreign.getJMSDeliveryMode());
+      setJMSExpiration(foreign.getJMSExpiration());
+      setJMSPriority(foreign.getJMSPriority());
+      setJMSType(foreign.getJMSType());
+
+      // We can't avoid a cast warning here since getPropertyNames() is on the JMS API
+      for (Enumeration<String> props = foreign.getPropertyNames(); props.hasMoreElements();)
+      {
+         String name = props.nextElement();
+
+         Object prop = foreign.getObjectProperty(name);
+
+         setObjectProperty(name, prop);
+      }
+   }
+
+   // javax.jmx.Message implementation ------------------------------
+
+   public String getJMSMessageID()
+   {
+      if (msgID == null)
+      {
+         UUID uid = message.getUserID();
+
+         msgID = uid == null ? null : "ID:" + uid.toString();
+      }
+      return msgID;
+   }
+
+   public void setJMSMessageID(final String jmsMessageID) throws JMSException
+   {
+      if (jmsMessageID != null && !jmsMessageID.startsWith("ID:"))
+      {
+         throw new JMSException("JMSMessageID must start with ID:");
+      }
+
+      message.setUserID(null);
+
+      msgID = jmsMessageID;
+   }
+
+   public long getJMSTimestamp() throws JMSException
+   {
+      return message.getTimestamp();
+   }
+
+   public void setJMSTimestamp(final long timestamp) throws JMSException
+   {
+      message.setTimestamp(timestamp);
+   }
+
+   public byte[] getJMSCorrelationIDAsBytes() throws JMSException
+   {
+      return MessageUtil.getJMSCorrelationIDAsBytes(message);
+   }
+
+   public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException
+   {
+      try
+      {
+         MessageUtil.setJMSCorrelationIDAsBytes(message, correlationID);
+      }
+      catch (ActiveMQException e)
+      {
+         JMSException ex = new JMSException(e.getMessage());
+         ex.initCause(e);
+         throw ex;
+      }
+   }
+
+   public void setJMSCorrelationID(final String correlationID) throws JMSException
+   {
+      MessageUtil.setJMSCorrelationID(message, correlationID);
+      jmsCorrelationID = correlationID;
+   }
+
+   public String getJMSCorrelationID() throws JMSException
+   {
+      if (jmsCorrelationID == null)
+      {
+         jmsCorrelationID = MessageUtil.getJMSCorrelationID(message);
+      }
+
+      return jmsCorrelationID;
+   }
+
+   public Destination getJMSReplyTo() throws JMSException
+   {
+      if (replyTo == null)
+      {
+
+         SimpleString repl = MessageUtil.getJMSReplyTo(message);
+
+         if (repl != null)
+         {
+            replyTo = ActiveMQDestination.fromAddress(repl.toString());
+         }
+      }
+      return replyTo;
+   }
+
+   public void setJMSReplyTo(final Destination dest) throws JMSException
+   {
+
+      if (dest == null)
+      {
+         MessageUtil.setJMSReplyTo(message, null);
+         replyTo = null;
+      }
+      else
+      {
+         if (dest instanceof ActiveMQDestination == false)
+         {
+            throw new InvalidDestinationException("Not a ActiveMQ destination " + dest);
+         }
+
+         ActiveMQDestination jbd = (ActiveMQDestination)dest;
+
+         MessageUtil.setJMSReplyTo(message, jbd.getSimpleAddress());
+
+         replyTo = jbd;
+      }
+   }
+
+   public Destination getJMSDestination() throws JMSException
+   {
+      if (dest == null)
+      {
+         SimpleString sdest = message.getAddress();
+
+         dest = sdest == null ? null : ActiveMQDestination.fromAddress(sdest.toString());
+      }
+
+      return dest;
+   }
+
+   public void setJMSDestination(final Destination destination) throws JMSException
+   {
+      dest = destination;
+   }
+
+   public int getJMSDeliveryMode() throws JMSException
+   {
+      return message.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
+   }
+
+   public void setJMSDeliveryMode(final int deliveryMode) throws JMSException
+   {
+      if (deliveryMode == DeliveryMode.PERSISTENT)
+      {
+         message.setDurable(true);
+      }
+      else if (deliveryMode == DeliveryMode.NON_PERSISTENT)
+      {
+         message.setDurable(false);
+      }
+      else
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.illegalDeliveryMode(deliveryMode);
+      }
+   }
+
+   public boolean getJMSRedelivered() throws JMSException
+   {
+      return message.getDeliveryCount() > 1;
+   }
+
+   public void setJMSRedelivered(final boolean redelivered) throws JMSException
+   {
+      if (!redelivered)
+      {
+         message.setDeliveryCount(1);
+      }
+      else
+      {
+         if (message.getDeliveryCount() > 1)
+         {
+            // do nothing
+         }
+         else
+         {
+            message.setDeliveryCount(2);
+         }
+      }
+   }
+
+   public void setJMSType(final String type) throws JMSException
+   {
+      if (type != null)
+      {
+         MessageUtil.setJMSType(message, type);
+
+         jmsType = type;
+      }
+   }
+
+   public String getJMSType() throws JMSException
+   {
+      if (jmsType == null)
+      {
+         jmsType = MessageUtil.getJMSType(message);
+      }
+      return jmsType;
+   }
+
+   public long getJMSExpiration() throws JMSException
+   {
+      return message.getExpiration();
+   }
+
+   public void setJMSExpiration(final long expiration) throws JMSException
+   {
+      message.setExpiration(expiration);
+   }
+
+   public int getJMSPriority() throws JMSException
+   {
+      return message.getPriority();
+   }
+
+   public void setJMSPriority(final int priority) throws JMSException
+   {
+      checkPriority(priority);
+
+      message.setPriority((byte)priority);
+   }
+
+   public void clearProperties() throws JMSException
+   {
+
+      MessageUtil.clearProperties(message);
+
+      propertiesReadOnly = false;
+   }
+
+   public void clearBody() throws JMSException
+   {
+      readOnly = false;
+   }
+
+   public boolean propertyExists(final String name) throws JMSException
+   {
+      return MessageUtil.propertyExists(message, name);
+   }
+
+   public boolean getBooleanProperty(final String name) throws JMSException
+   {
+      try
+      {
+         return message.getBooleanProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public byte getByteProperty(final String name) throws JMSException
+   {
+      try
+      {
+         return message.getByteProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public short getShortProperty(final String name) throws JMSException
+   {
+      try
+      {
+         return message.getShortProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public int getIntProperty(final String name) throws JMSException
+   {
+      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
+      {
+         return message.getDeliveryCount();
+      }
+
+      try
+      {
+         return message.getIntProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public long getLongProperty(final String name) throws JMSException
+   {
+      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
+      {
+         return message.getDeliveryCount();
+      }
+
+      try
+      {
+         return message.getLongProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public float getFloatProperty(final String name) throws JMSException
+   {
+      try
+      {
+         return message.getFloatProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public double getDoubleProperty(final String name) throws JMSException
+   {
+      try
+      {
+         return message.getDoubleProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public String getStringProperty(final String name) throws JMSException
+   {
+      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
+      {
+         return String.valueOf(message.getDeliveryCount());
+      }
+
+      try
+      {
+         if (MessageUtil.JMSXGROUPID.equals(name))
+         {
+            return message.getStringProperty(org.apache.activemq.api.core.Message.HDR_GROUP_ID);
+         }
+         else
+         {
+            return message.getStringProperty(new SimpleString(name));
+         }
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public Object getObjectProperty(final String name) throws JMSException
+   {
+      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
+      {
+         return String.valueOf(message.getDeliveryCount());
+      }
+
+      Object val = message.getObjectProperty(name);
+      if (val instanceof SimpleString)
+      {
+         val = ((SimpleString)val).toString();
+      }
+      return val;
+   }
+
+   @SuppressWarnings("rawtypes")
+   @Override
+   public Enumeration getPropertyNames() throws JMSException
+   {
+      return Collections.enumeration(MessageUtil.getPropertyNames(message));
+   }
+
+   public void setBooleanProperty(final String name, final boolean value) throws JMSException
+   {
+      checkProperty(name);
+
+      message.putBooleanProperty(new SimpleString(name), value);
+   }
+
+   public void setByteProperty(final String name, final byte value) throws JMSException
+   {
+      checkProperty(name);
+      message.putByteProperty(new SimpleString(name), value);
+   }
+
+   public void setShortProperty(final String name, final short value) throws JMSException
+   {
+      checkProperty(name);
+      message.putShortProperty(new SimpleString(name), value);
+   }
+
+   public void setIntProperty(final String name, final int value) throws JMSException
+   {
+      checkProperty(name);
+      message.putIntProperty(new SimpleString(name), value);
+   }
+
+   public void setLongProperty(final String name, final long value) throws JMSException
+   {
+      checkProperty(name);
+      message.putLongProperty(new SimpleString(name), value);
+   }
+
+   public void setFloatProperty(final String name, final float value) throws JMSException
+   {
+      checkProperty(name);
+      message.putFloatProperty(new SimpleString(name), value);
+   }
+
+   public void setDoubleProperty(final String name, final double value) throws JMSException
+   {
+      checkProperty(name);
+      message.putDoubleProperty(new SimpleString(name), value);
+   }
+
+   public void setStringProperty(final String name, final String value) throws JMSException
+   {
+      checkProperty(name);
+
+      if (MessageUtil.JMSXGROUPID.equals(name))
+      {
+         message.putStringProperty(org.apache.activemq.api.core.Message.HDR_GROUP_ID, SimpleString.toSimpleString(value));
+      }
+      else
+      {
+         message.putStringProperty(new SimpleString(name),  SimpleString.toSimpleString(value));
+      }
+   }
+
+   public void setObjectProperty(final String name, final Object value) throws JMSException
+   {
+      if (ActiveMQJMSConstants.JMS_ACTIVEMQ_OUTPUT_STREAM.equals(name))
+      {
+         setOutputStream((OutputStream)value);
+
+         return;
+      }
+      else if (ActiveMQJMSConstants.JMS_ACTIVEMQ_SAVE_STREAM.equals(name))
+      {
+         saveToOutputStream((OutputStream)value);
+
+         return;
+      }
+
+      checkProperty(name);
+
+      if (ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM.equals(name))
+      {
+         setInputStream((InputStream)value);
+
+         return;
+      }
+
+      try
+      {
+         message.putObjectProperty(new SimpleString(name), value);
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public void acknowledge() throws JMSException
+   {
+      if (session != null)
+      {
+         try
+         {
+            if (individualAck)
+            {
+               message.individualAcknowledge();
+            }
+
+            session.commit();
+         }
+         catch (ActiveMQException e)
+         {
+            throw JMSExceptionHelper.convertFromActiveMQException(e);
+         }
+      }
+   }
+
+   @Override
+   public long getJMSDeliveryTime() throws JMSException
+   {
+      Long value;
+      try
+      {
+         value = message.getLongProperty(org.apache.activemq.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME);
+      }
+      catch (Exception e)
+      {
+         return 0;
+      }
+
+      if (value == null)
+      {
+         return 0;
+      }
+      else
+      {
+         return value.longValue();
+      }
+   }
+
+   @Override
+   public void setJMSDeliveryTime(long deliveryTime) throws JMSException
+   {
+      message.putLongProperty(org.apache.activemq.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, deliveryTime);
+   }
+
+   @Override
+   public <T> T getBody(Class<T> c) throws JMSException
+   {
+      if (isBodyAssignableTo(c))
+      {
+         return getBodyInternal(c);
+      }
+      // XXX HORNETQ-1209 Do we need translations here?
+      throw new MessageFormatException("Body not assignable to " + c);
+   }
+
+   @SuppressWarnings("unchecked")
+   protected <T> T getBodyInternal(Class<T> c) throws MessageFormatException
+   {
+      InputStream is = ((MessageInternal)message).getBodyInputStream();
+      try
+      {
+         ObjectInputStream ois = new ObjectInputStream(is);
+         return (T)ois.readObject();
+      }
+      catch (Exception e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class c)
+   {
+      /**
+       * From the specs:
+       * <p>
+       * If the message is a {@code Message} (but not one of its subtypes) then this method will
+       * return true irrespective of the value of this parameter.
+       */
+      return true;
+   }
+
+   /**
+    * Helper method for {@link #isBodyAssignableTo(Class)}.
+    * @return true if the message has no body.
+    */
+   protected boolean hasNoBody()
+   {
+      return message.getBodySize() == 0;
+   }
+
+   // Public --------------------------------------------------------
+
+   public void setIndividualAcknowledge()
+   {
+      this.individualAck = true;
+   }
+
+   public void resetMessageID(final String newMsgID)
+   {
+      this.msgID = newMsgID;
+   }
+
+   public ClientMessage getCoreMessage()
+   {
+      return message;
+   }
+
+   public void doBeforeSend() throws Exception
+   {
+      message.getBodyBuffer().resetReaderIndex();
+   }
+
+   public void checkBuffer()
+   {
+      message.getBodyBuffer();
+   }
+
+   public void doBeforeReceive() throws ActiveMQException
+   {
+      message.checkCompletion();
+
+      ActiveMQBuffer body = message.getBodyBuffer();
+
+      if (body != null)
+      {
+         body.resetReaderIndex();
+      }
+   }
+
+   public byte getType()
+   {
+      return ActiveMQMessage.TYPE;
+   }
+
+   public void setInputStream(final InputStream input) throws JMSException
+   {
+      checkStream();
+      if (readOnly)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.messageNotWritable();
+      }
+
+      message.setBodyInputStream(input);
+   }
+
+   public void setOutputStream(final OutputStream output) throws JMSException
+   {
+      checkStream();
+      if (!readOnly)
+      {
+         throw new IllegalStateException("OutputStream property is only valid on received messages");
+      }
+
+      try
+      {
+         message.setOutputStream(output);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void saveToOutputStream(final OutputStream output) throws JMSException
+   {
+      checkStream();
+      if (!readOnly)
+      {
+         throw new IllegalStateException("OutputStream property is only valid on received messages");
+      }
+
+      try
+      {
+         message.saveToOutputStream(output);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public boolean waitCompletionOnStream(final long timeWait) throws JMSException
+   {
+      checkStream();
+      try
+      {
+         return message.waitOutputStreamCompletion(timeWait);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   @Override
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer("ActiveMQMessage[");
+      sb.append(getJMSMessageID());
+      sb.append("]:");
+      sb.append(message.isDurable() ? "PERSISTENT" : "NON-PERSISTENT");
+      return sb.toString();
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   protected void checkWrite() throws JMSException
+   {
+      if (readOnly)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.messageNotWritable();
+      }
+   }
+
+   protected void checkRead() throws JMSException
+   {
+      if (!readOnly)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.messageNotReadable();
+      }
+   }
+
+   // Private ------------------------------------------------------------
+
+   private void checkStream() throws JMSException
+   {
+      if (!(message.getType() == ActiveMQBytesMessage.TYPE || message.getType() == ActiveMQStreamMessage.TYPE))
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.onlyValidForByteOrStreamMessages();
+      }
+   }
+
+   private void checkProperty(final String name) throws JMSException
+   {
+      if (propertiesReadOnly)
+      {
+         if (name.equals(ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM))
+         {
+            throw new MessageNotWriteableException("You cannot set the Input Stream on received messages. Did you mean " + ActiveMQJMSConstants.JMS_ACTIVEMQ_OUTPUT_STREAM +
+                                                   " or " +
+                                                   ActiveMQJMSConstants.JMS_ACTIVEMQ_SAVE_STREAM +
+                                                   "?");
+         }
+         else
+         {
+            throw ActiveMQJMSClientBundle.BUNDLE.messageNotWritable();
+         }
+      }
+
+      if (name == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nullArgumentNotAllowed("property");
+      }
+
+      if (name.equals(""))
+      {
+         throw new IllegalArgumentException("The name of a property must not be an empty String.");
+      }
+
+      if (!isValidJavaIdentifier(name))
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.invalidJavaIdentifier(name);
+      }
+
+      if (ActiveMQMessage.reservedIdentifiers.contains(name))
+      {
+         throw new JMSRuntimeException("The property name '" + name + "' is reserved due to selector syntax.");
+      }
+
+      if (name.startsWith("JMS_ACTIVEMQ"))
+      {
+         throw new JMSRuntimeException("The property name '" + name + "' is illegal since it starts with JMS_ACTIVEMQ");
+      }
+   }
+
+   private boolean isValidJavaIdentifier(final String s)
+   {
+      if (s == null || s.length() == 0)
+      {
+         return false;
+      }
+
+      char[] c = s.toCharArray();
+
+      if (!Character.isJavaIdentifierStart(c[0]))
+      {
+         return false;
+      }
+
+      for (int i = 1; i < c.length; i++)
+      {
+         if (!Character.isJavaIdentifierPart(c[i]))
+         {
+            return false;
+         }
+      }
+
+      return true;
+   }
+
+   private void checkPriority(final int priority) throws JMSException
+   {
+      if (priority < 0 || priority > 9)
+      {
+         throw new JMSException(priority + " is not valid: priority must be between 0 and 9");
+      }
+   }
+
+   // Inner classes -------------------------------------------------
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageConsumer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageConsumer.java
new file mode 100644
index 0000000..e721b3c
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageConsumer.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.QueueReceiver;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientConsumer;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.MessageHandler;
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
+
+/**
+ * ActiveMQ implementation of a JMS MessageConsumer.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ */
+public final class ActiveMQMessageConsumer implements QueueReceiver, TopicSubscriber
+{
+   private final ClientConsumer consumer;
+
+   private MessageListener listener;
+
+   private MessageHandler coreListener;
+
+   private final ActiveMQConnection connection;
+
+   private final ActiveMQSession session;
+
+   private final int ackMode;
+
+   private final boolean noLocal;
+
+   private final ActiveMQDestination destination;
+
+   private final String selector;
+
+   private final SimpleString autoDeleteQueueName;
+
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQMessageConsumer(final ActiveMQConnection connection,
+                                     final ActiveMQSession session,
+                                     final ClientConsumer consumer,
+                                     final boolean noLocal,
+                                     final ActiveMQDestination destination,
+                                     final String selector,
+                                     final SimpleString autoDeleteQueueName) throws JMSException
+   {
+      this.connection = connection;
+
+      this.session = session;
+
+      this.consumer = consumer;
+
+      ackMode = session.getAcknowledgeMode();
+
+      this.noLocal = noLocal;
+
+      this.destination = destination;
+
+      this.selector = selector;
+
+      this.autoDeleteQueueName = autoDeleteQueueName;
+   }
+
+   // MessageConsumer implementation --------------------------------
+
+   public String getMessageSelector() throws JMSException
+   {
+      checkClosed();
+
+      return selector;
+   }
+
+   public MessageListener getMessageListener() throws JMSException
+   {
+      checkClosed();
+
+      return listener;
+   }
+
+   public void setMessageListener(final MessageListener listener) throws JMSException
+   {
+      this.listener = listener;
+
+      coreListener = listener == null ? null : new JMSMessageListenerWrapper(connection, session, consumer, listener, ackMode);
+
+      try
+      {
+         consumer.setMessageHandler(coreListener);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public Message receive() throws JMSException
+   {
+      return getMessage(0, false);
+   }
+
+   public Message receive(final long timeout) throws JMSException
+   {
+      return getMessage(timeout, false);
+   }
+
+   public Message receiveNoWait() throws JMSException
+   {
+      return getMessage(0, true);
+   }
+
+   public void close() throws JMSException
+   {
+      try
+      {
+         consumer.close();
+
+         if (autoDeleteQueueName != null)
+         {
+            // If non durable subscriber need to delete subscription too
+            session.deleteQueue(autoDeleteQueueName);
+         }
+
+         session.removeConsumer(this);
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   // QueueReceiver implementation ----------------------------------
+
+   public Queue getQueue() throws JMSException
+   {
+      checkClosed();
+
+      return (Queue)destination;
+   }
+
+   // TopicSubscriber implementation --------------------------------
+
+   public Topic getTopic() throws JMSException
+   {
+      checkClosed();
+
+      return (Topic)destination;
+   }
+
+   public boolean getNoLocal() throws JMSException
+   {
+      checkClosed();
+
+      return noLocal;
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQMessageConsumer[" + consumer + "]";
+   }
+
+   public boolean isClosed()
+   {
+      return consumer.isClosed();
+   }
+
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   private void checkClosed() throws JMSException
+   {
+      if (consumer.isClosed() || session.getCoreSession().isClosed())
+      {
+         throw new IllegalStateException("Consumer is closed");
+      }
+   }
+
+   private ActiveMQMessage getMessage(final long timeout, final boolean noWait) throws JMSException
+   {
+      try
+      {
+         ClientMessage coreMessage;
+
+         if (noWait)
+         {
+            coreMessage = consumer.receiveImmediate();
+         }
+         else
+         {
+            coreMessage = consumer.receive(timeout);
+         }
+
+         ActiveMQMessage jmsMsg = null;
+
+         if (coreMessage != null)
+         {
+            boolean needSession =
+                     ackMode == Session.CLIENT_ACKNOWLEDGE || ackMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE;
+            jmsMsg = ActiveMQMessage.createMessage(coreMessage, needSession ? session.getCoreSession() : null);
+
+            jmsMsg.doBeforeReceive();
+
+            // We Do the ack after doBeforeRecive, as in the case of large messages, this may fail so we don't want messages redelivered
+            // https://issues.jboss.org/browse/JBPAPP-6110
+            if (session.getAcknowledgeMode() == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE)
+            {
+               jmsMsg.setIndividualAcknowledge();
+            }
+            else
+            {
+               coreMessage.acknowledge();
+            }
+         }
+
+         return jmsMsg;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   // Inner classes -------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageProducer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageProducer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageProducer.java
new file mode 100644
index 0000000..00aed53
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMessageProducer.java
@@ -0,0 +1,601 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.BytesMessage;
+import javax.jms.CompletionListener;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueSender;
+import javax.jms.StreamMessage;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientProducer;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
+import org.apache.activemq.utils.UUID;
+import org.apache.activemq.utils.UUIDGenerator;
+/**
+ * ActiveMQ implementation of a JMS MessageProducer.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ */
+public class ActiveMQMessageProducer implements MessageProducer, QueueSender, TopicPublisher
+{
+   private final ActiveMQConnection connection;
+
+   private final SimpleString connID;
+
+   private final ClientProducer clientProducer;
+   private final ClientSession clientSession;
+
+   private boolean disableMessageID = false;
+
+   private boolean disableMessageTimestamp = false;
+
+   private int defaultPriority = Message.DEFAULT_PRIORITY;
+   private long defaultTimeToLive = Message.DEFAULT_TIME_TO_LIVE;
+   private int defaultDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
+   private long defaultDeliveryDelay = Message.DEFAULT_DELIVERY_DELAY;
+
+   private final ActiveMQDestination defaultDestination;
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQMessageProducer(final ActiveMQConnection connection, final ClientProducer producer,
+                                     final ActiveMQDestination defaultDestination, final ClientSession clientSession) throws JMSException
+   {
+      this.connection = connection;
+
+      connID = connection.getClientID() != null ? new SimpleString(connection.getClientID()) : connection.getUID();
+
+      this.clientProducer = producer;
+
+      this.defaultDestination = defaultDestination;
+
+      this.clientSession = clientSession;
+   }
+
+   // MessageProducer implementation --------------------------------
+
+   public void setDisableMessageID(final boolean value) throws JMSException
+   {
+      checkClosed();
+
+      disableMessageID = value;
+   }
+
+   public boolean getDisableMessageID() throws JMSException
+   {
+      checkClosed();
+
+      return disableMessageID;
+   }
+
+   public void setDisableMessageTimestamp(final boolean value) throws JMSException
+   {
+      checkClosed();
+
+      disableMessageTimestamp = value;
+   }
+
+   public boolean getDisableMessageTimestamp() throws JMSException
+   {
+      checkClosed();
+
+      return disableMessageTimestamp;
+   }
+
+   public void setDeliveryMode(final int deliveryMode) throws JMSException
+   {
+      checkClosed();
+      if (deliveryMode != DeliveryMode.NON_PERSISTENT && deliveryMode != DeliveryMode.PERSISTENT)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.illegalDeliveryMode(deliveryMode);
+      }
+
+      defaultDeliveryMode = deliveryMode;
+   }
+
+   public int getDeliveryMode() throws JMSException
+   {
+      checkClosed();
+
+      return defaultDeliveryMode;
+   }
+
+   public void setPriority(final int defaultPriority) throws JMSException
+   {
+      checkClosed();
+
+      if (defaultPriority < 0 || defaultPriority > 9)
+      {
+         throw new JMSException("Illegal priority value: " + defaultPriority);
+      }
+
+      this.defaultPriority = defaultPriority;
+   }
+
+   public int getPriority() throws JMSException
+   {
+      checkClosed();
+
+      return defaultPriority;
+   }
+
+   public void setTimeToLive(final long timeToLive) throws JMSException
+   {
+      checkClosed();
+
+      defaultTimeToLive = timeToLive;
+   }
+
+   public long getTimeToLive() throws JMSException
+   {
+      checkClosed();
+
+      return defaultTimeToLive;
+   }
+
+   public Destination getDestination() throws JMSException
+   {
+      checkClosed();
+
+      return defaultDestination;
+   }
+
+   public void close() throws JMSException
+   {
+      connection.getThreadAwareContext().assertNotCompletionListenerThread();
+      try
+      {
+         clientProducer.close();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public void send(final Message message) throws JMSException
+   {
+      checkDefaultDestination();
+      doSendx(defaultDestination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, null);
+   }
+
+   public void send(final Message message,
+                    final int deliveryMode,
+                    final int priority, final long timeToLive) throws JMSException
+   {
+      checkDefaultDestination();
+      doSendx(defaultDestination, message, deliveryMode, priority, timeToLive, null);
+   }
+
+   public void send(final Destination destination, final Message message) throws JMSException
+   {
+      send(destination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive);
+   }
+
+   public void send(final Destination destination, final Message message, final int deliveryMode, final int priority,
+                    final long timeToLive) throws JMSException
+   {
+      checkClosed();
+
+      checkDestination(destination);
+
+      doSendx((ActiveMQDestination)destination, message, deliveryMode, priority, timeToLive, null);
+   }
+
+   @Override
+   public void setDeliveryDelay(long deliveryDelay) throws JMSException
+   {
+      this.defaultDeliveryDelay = deliveryDelay;
+   }
+
+   @Override
+   public long getDeliveryDelay() throws JMSException
+   {
+      return defaultDeliveryDelay;
+   }
+
+   @Override
+   public void send(Message message, CompletionListener completionListener) throws JMSException
+   {
+      send(message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, completionListener);
+   }
+
+   @Override
+   public void send(Message message, int deliveryMode, int priority, long timeToLive,
+                    CompletionListener completionListener) throws JMSException
+   {
+      checkCompletionListener(completionListener);
+      checkDefaultDestination();
+      doSendx(defaultDestination, message, deliveryMode, priority, timeToLive, completionListener);
+   }
+
+   @Override
+   public void send(Destination destination, Message message, CompletionListener completionListener) throws JMSException
+   {
+      send(destination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, completionListener);
+   }
+
+   @Override
+   public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
+                    CompletionListener completionListener) throws JMSException
+   {
+      checkClosed();
+
+      checkCompletionListener(completionListener);
+
+      checkDestination(destination);
+
+      doSendx((ActiveMQDestination)destination, message, deliveryMode, priority, timeToLive, completionListener);
+   }
+
+   // TopicPublisher Implementation ---------------------------------
+
+   public Topic getTopic() throws JMSException
+   {
+      return (Topic)getDestination();
+   }
+
+   public void publish(final Message message) throws JMSException
+   {
+      send(message);
+   }
+
+   public void publish(final Topic topic, final Message message) throws JMSException
+   {
+      send(topic, message);
+   }
+
+   public void publish(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
+   {
+      send(message, deliveryMode, priority, timeToLive);
+   }
+
+   public void publish(final Topic topic, final Message message, final int deliveryMode, final int priority,
+                       final long timeToLive) throws JMSException
+   {
+      checkDestination(topic);
+      doSendx((ActiveMQDestination)topic, message, deliveryMode, priority, timeToLive, null);
+   }
+
+   // QueueSender Implementation ------------------------------------
+
+   public void send(final Queue queue, final Message message) throws JMSException
+   {
+      send((Destination)queue, message);
+   }
+
+   public void send(final Queue queue, final Message message, final int deliveryMode, final int priority,
+                    final long timeToLive) throws JMSException
+   {
+      checkDestination(queue);
+      doSendx((ActiveMQDestination)queue, message, deliveryMode, priority, timeToLive, null);
+   }
+
+   public Queue getQueue() throws JMSException
+   {
+      return (Queue)getDestination();
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQMessageProducer->" + clientProducer;
+   }
+
+   /**
+    * Check if the default destination has been set
+    */
+   private void checkDefaultDestination()
+   {
+      if (defaultDestination == null)
+      {
+         throw new UnsupportedOperationException("Cannot specify destination if producer has a default destination");
+      }
+   }
+
+   /**
+    * Check if the destination is sent correctly
+    */
+   private void checkDestination(Destination destination) throws InvalidDestinationException
+   {
+      if (destination != null && !(destination instanceof ActiveMQDestination))
+      {
+         throw new InvalidDestinationException("Not a ActiveMQ Destination:" + destination);
+      }
+      if (destination != null && defaultDestination != null)
+      {
+         throw new UnsupportedOperationException("Cannot specify destination if producer has a default destination");
+      }
+      if (destination == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nullTopic();
+      }
+   }
+
+   private void checkCompletionListener(CompletionListener completionListener)
+   {
+      if (completionListener == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nullArgumentNotAllowed("CompletionListener");
+      }
+   }
+
+
+   private void doSendx(ActiveMQDestination destination, final Message jmsMessage, final int deliveryMode,
+                        final int priority, final long timeToLive,
+                        CompletionListener completionListener) throws JMSException
+   {
+
+      jmsMessage.setJMSDeliveryMode(deliveryMode);
+
+      jmsMessage.setJMSPriority(priority);
+
+
+      if (timeToLive == 0)
+      {
+         jmsMessage.setJMSExpiration(0);
+      }
+      else
+      {
+         jmsMessage.setJMSExpiration(System.currentTimeMillis() + timeToLive);
+      }
+
+      if (!disableMessageTimestamp)
+      {
+         jmsMessage.setJMSTimestamp(System.currentTimeMillis());
+      }
+      else
+      {
+         jmsMessage.setJMSTimestamp(0);
+      }
+
+      SimpleString address = null;
+
+      if (destination == null)
+      {
+         if (defaultDestination == null)
+         {
+            throw new UnsupportedOperationException("Destination must be specified on send with an anonymous producer");
+         }
+
+         destination = defaultDestination;
+      }
+      else
+      {
+         if (defaultDestination != null)
+         {
+            if (!destination.equals(defaultDestination))
+            {
+               throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is "
+                                                          + "specified in the arguments to the send, "
+                                                          + "these destinations must be equal");
+            }
+         }
+
+         address = destination.getSimpleAddress();
+
+         if (!connection.containsKnownDestination(address))
+         {
+            try
+            {
+               ClientSession.AddressQuery query = clientSession.addressQuery(address);
+               if (!query.isExists())
+               {
+                  throw new InvalidDestinationException("Destination " + address + " does not exist");
+               }
+               else
+               {
+                  connection.addKnownDestination(address);
+               }
+            }
+            catch (ActiveMQException e)
+            {
+               throw JMSExceptionHelper.convertFromActiveMQException(e);
+            }
+         }
+      }
+
+      ActiveMQMessage activeMQJmsMessage;
+
+      boolean foreign = false;
+
+      // First convert from foreign message if appropriate
+      if (!(jmsMessage instanceof ActiveMQMessage))
+      {
+         // JMS 1.1 Sect. 3.11.4: A provider must be prepared to accept, from a client,
+         // a message whose implementation is not one of its own.
+
+         if (jmsMessage instanceof BytesMessage)
+         {
+            activeMQJmsMessage = new ActiveMQBytesMessage((BytesMessage)jmsMessage, clientSession);
+         }
+         else if (jmsMessage instanceof MapMessage)
+         {
+            activeMQJmsMessage = new ActiveMQMapMessage((MapMessage)jmsMessage, clientSession);
+         }
+         else if (jmsMessage instanceof ObjectMessage)
+         {
+            activeMQJmsMessage = new ActiveMQObjectMessage((ObjectMessage)jmsMessage, clientSession);
+         }
+         else if (jmsMessage instanceof StreamMessage)
+         {
+            activeMQJmsMessage = new ActiveMQStreamMessage((StreamMessage)jmsMessage, clientSession);
+         }
+         else if (jmsMessage instanceof TextMessage)
+         {
+            activeMQJmsMessage = new ActiveMQTextMessage((TextMessage)jmsMessage, clientSession);
+         }
+         else
+         {
+            activeMQJmsMessage = new ActiveMQMessage(jmsMessage, clientSession);
+         }
+
+         // Set the destination on the original message
+         jmsMessage.setJMSDestination(destination);
+
+         foreign = true;
+      }
+      else
+      {
+         activeMQJmsMessage = (ActiveMQMessage)jmsMessage;
+      }
+
+      if (!disableMessageID)
+      {
+         // Generate a JMS id
+
+         UUID uid = UUIDGenerator.getInstance().generateUUID();
+
+         activeMQJmsMessage.getCoreMessage().setUserID(uid);
+
+         activeMQJmsMessage.resetMessageID(null);
+      }
+
+      if (foreign)
+      {
+         jmsMessage.setJMSMessageID(activeMQJmsMessage.getJMSMessageID());
+      }
+
+      activeMQJmsMessage.setJMSDestination(destination);
+
+      try
+      {
+         activeMQJmsMessage.doBeforeSend();
+      }
+      catch (Exception e)
+      {
+         JMSException je = new JMSException(e.getMessage());
+
+         je.initCause(e);
+
+         throw je;
+      }
+
+      if (defaultDeliveryDelay > 0)
+      {
+         activeMQJmsMessage.setJMSDeliveryTime(System.currentTimeMillis() + defaultDeliveryDelay);
+      }
+
+      ClientMessage coreMessage = activeMQJmsMessage.getCoreMessage();
+      coreMessage.putStringProperty(ActiveMQConnection.CONNECTION_ID_PROPERTY_NAME, connID);
+
+      try
+      {
+         /**
+          * Using a completionListener requires wrapping using a {@link CompletionListenerWrapper},
+          * so we avoid it if we can.
+          */
+         if (completionListener != null)
+         {
+            clientProducer.send(address, coreMessage, new CompletionListenerWrapper(completionListener, jmsMessage, this));
+         }
+         else
+         {
+            clientProducer.send(address, coreMessage);
+         }
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   private void checkClosed() throws JMSException
+   {
+      if (clientProducer.isClosed() || clientSession.isClosed())
+      {
+         throw new IllegalStateException("Producer is closed");
+      }
+   }
+
+   private static final class CompletionListenerWrapper implements SendAcknowledgementHandler
+   {
+      private final CompletionListener completionListener;
+      private final Message jmsMessage;
+      private final ActiveMQMessageProducer producer;
+
+      /**
+       * @param jmsMessage
+       * @param producer
+       */
+      public CompletionListenerWrapper(CompletionListener listener, Message jmsMessage, ActiveMQMessageProducer producer)
+      {
+         this.completionListener = listener;
+         this.jmsMessage = jmsMessage;
+         this.producer = producer;
+      }
+
+      @Override
+      public void sendAcknowledged(org.apache.activemq.api.core.Message clientMessage)
+      {
+         if (jmsMessage instanceof StreamMessage)
+         {
+            try
+            {
+               ((StreamMessage)jmsMessage).reset();
+            }
+            catch (JMSException e)
+            {
+               // HORNETQ-1209 XXX ignore?
+            }
+         }
+         if (jmsMessage instanceof BytesMessage)
+         {
+            try
+            {
+               ((BytesMessage)jmsMessage).reset();
+            }
+            catch (JMSException e)
+            {
+               // HORNETQ-1209 XXX ignore?
+            }
+         }
+
+         try
+         {
+            producer.connection.getThreadAwareContext().setCurrentThread(true);
+            completionListener.onCompletion(jmsMessage);
+         }
+         finally
+         {
+            producer.connection.getThreadAwareContext().clearCurrentThread(true);
+         }
+      }
+
+      @Override
+      public String toString()
+      {
+         return CompletionListenerWrapper.class.getSimpleName() + "( completionListener=" + completionListener + ")";
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQObjectMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQObjectMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQObjectMessage.java
new file mode 100644
index 0000000..8e7a1aa
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQObjectMessage.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSException;
+import javax.jms.MessageFormatException;
+import javax.jms.ObjectMessage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+
+/**
+ * ActiveMQ implementation of a JMS ObjectMessage.
+ * <br>
+ * Don't used ObjectMessage if you want good performance!
+ * <p>
+ * Serialization is slooooow!
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ */
+public class ActiveMQObjectMessage extends ActiveMQMessage implements ObjectMessage
+{
+   // Constants -----------------------------------------------------
+
+   public static final byte TYPE = Message.OBJECT_TYPE;
+
+   // Attributes ----------------------------------------------------
+
+   // keep a snapshot of the Serializable Object as a byte[] to provide Object isolation
+   private byte[] data;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQObjectMessage(final ClientSession session)
+   {
+      super(ActiveMQObjectMessage.TYPE, session);
+   }
+
+   protected ActiveMQObjectMessage(final ClientMessage message, final ClientSession session)
+   {
+      super(message, session);
+   }
+
+   /**
+    * A copy constructor for foreign JMS ObjectMessages.
+    */
+   public ActiveMQObjectMessage(final ObjectMessage foreign, final ClientSession session) throws JMSException
+   {
+      super(foreign, ActiveMQObjectMessage.TYPE, session);
+
+      setObject(foreign.getObject());
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public byte getType()
+   {
+      return ActiveMQObjectMessage.TYPE;
+   }
+
+   @Override
+   public void doBeforeSend() throws Exception
+   {
+      message.getBodyBuffer().clear();
+      if (data != null)
+      {
+         message.getBodyBuffer().writeInt(data.length);
+         message.getBodyBuffer().writeBytes(data);
+      }
+
+      super.doBeforeSend();
+   }
+
+   @Override
+   public void doBeforeReceive() throws ActiveMQException
+   {
+      super.doBeforeReceive();
+      try
+      {
+         int len = message.getBodyBuffer().readInt();
+         data = new byte[len];
+         message.getBodyBuffer().readBytes(data);
+      }
+      catch (Exception e)
+      {
+         data = null;
+      }
+
+   }
+
+   // ObjectMessage implementation ----------------------------------
+
+   public void setObject(final Serializable object) throws JMSException
+   {
+      checkWrite();
+
+      if (object != null)
+      {
+         try
+         {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+
+            ObjectOutputStream oos = new ObjectOutputStream(baos);
+
+            oos.writeObject(object);
+
+            oos.flush();
+
+            data = baos.toByteArray();
+         }
+         catch (Exception e)
+         {
+            JMSException je = new JMSException("Failed to serialize object");
+            je.setLinkedException(e);
+            je.initCause(e);
+            throw je;
+         }
+      }
+   }
+
+   // lazy deserialize the Object the first time the client requests it
+   public Serializable getObject() throws JMSException
+   {
+      if (data == null || data.length == 0)
+      {
+         return null;
+      }
+
+      try
+      {
+         ByteArrayInputStream bais = new ByteArrayInputStream(data);
+         ObjectInputStream ois = new org.apache.activemq.utils.ObjectInputStreamWithClassLoader(bais);
+         Serializable object = (Serializable)ois.readObject();
+         return object;
+      }
+      catch (Exception e)
+      {
+         JMSException je = new JMSException(e.getMessage());
+         je.setStackTrace(e.getStackTrace());
+         throw je;
+      }
+   }
+
+   @Override
+   public void clearBody() throws JMSException
+   {
+      super.clearBody();
+
+      data = null;
+   }
+
+   @Override
+   protected <T> T getBodyInternal(Class<T> c) throws MessageFormatException
+   {
+      try
+      {
+         return (T)getObject();
+      }
+      catch (JMSException e)
+      {
+         throw new MessageFormatException("Deserialization error on ActiveMQObjectMessage");
+      }
+   }
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
+                                     Class c)
+   {
+      if (data == null) // we have no body
+         return true;
+      try
+      {
+         return Serializable.class == c || Object.class == c || c.isInstance(getObject());
+      }
+      catch (JMSException e)
+      {
+         return false;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueue.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueue.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueue.java
new file mode 100644
index 0000000..6bb32bd
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueue.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.Queue;
+
+import org.apache.activemq.api.core.SimpleString;
+
+/**
+ * ActiveMQ implementation of a JMS Queue.
+ * <br>
+ * This class can be instantiated directly.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 8737 $</tt>
+ *
+ */
+public class ActiveMQQueue extends ActiveMQDestination implements Queue
+{
+   // Constants -----------------------------------------------------
+   private static final long serialVersionUID = -1106092883162295462L;
+
+   // Static --------------------------------------------------------
+
+   public static SimpleString createAddressFromName(final String name)
+   {
+      return new SimpleString(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX + name);
+   }
+
+   // Attributes ----------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQQueue(final String name)
+   {
+      super(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX + name, name, false, true, null);
+   }
+
+
+
+   /**
+    * @param address
+    * @param name
+    * @param temporary
+    * @param session
+    */
+   public ActiveMQQueue(String address, String name, boolean temporary, ActiveMQSession session)
+   {
+      super(address, name, temporary, true, session);
+   }
+
+   public ActiveMQQueue(final String address, final String name)
+   {
+      super(address, name, false, true, null);
+   }
+
+   // Queue implementation ------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public String getQueueName()
+   {
+      return name;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQQueue[" + name + "]";
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueBrowser.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueBrowser.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueBrowser.java
new file mode 100644
index 0000000..eacff5f
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueBrowser.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientConsumer;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+
+/**
+ * ActiveMQ implementation of a JMS QueueBrowser.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *
+ */
+public final class ActiveMQQueueBrowser implements QueueBrowser
+{
+   // Constants ------------------------------------------------------------------------------------
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   private final ClientSession session;
+
+   private ClientConsumer consumer;
+
+   private final ActiveMQQueue queue;
+
+   private SimpleString filterString;
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   protected ActiveMQQueueBrowser(final ActiveMQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
+   {
+      this.session = session;
+      this.queue = queue;
+      if (messageSelector != null)
+      {
+         filterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(messageSelector));
+      }
+   }
+
+   // QueueBrowser implementation -------------------------------------------------------------------
+
+   public void close() throws JMSException
+   {
+      if (consumer != null)
+      {
+         try
+         {
+            consumer.close();
+         }
+         catch (ActiveMQException e)
+         {
+            throw JMSExceptionHelper.convertFromActiveMQException(e);
+         }
+      }
+   }
+
+   public Enumeration getEnumeration() throws JMSException
+   {
+      try
+      {
+         close();
+
+         consumer = session.createConsumer(queue.getSimpleAddress(), filterString, true);
+
+         return new BrowserEnumeration();
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+
+   }
+
+   public String getMessageSelector() throws JMSException
+   {
+      return filterString == null ? null : filterString.toString();
+   }
+
+   public Queue getQueue() throws JMSException
+   {
+      return queue;
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQQueueBrowser->" + consumer;
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+   private final class BrowserEnumeration implements Enumeration<ActiveMQMessage>
+   {
+      ClientMessage current = null;
+
+      public boolean hasMoreElements()
+      {
+         if (current == null)
+         {
+            try
+            {
+               current = consumer.receiveImmediate();
+            }
+            catch (ActiveMQException e)
+            {
+               return false;
+            }
+         }
+         return current != null;
+      }
+
+      public ActiveMQMessage nextElement()
+      {
+         ActiveMQMessage msg;
+         if (hasMoreElements())
+         {
+            ClientMessage next = current;
+            current = null;
+            msg = ActiveMQMessage.createMessage(next, session);
+            try
+            {
+               msg.doBeforeReceive();
+            }
+            catch (Exception e)
+            {
+               ActiveMQJMSClientLogger.LOGGER.errorCreatingMessage(e);
+
+               return null;
+            }
+            return msg;
+         }
+         else
+         {
+            throw new NoSuchElementException();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueConnectionFactory.java
new file mode 100644
index 0000000..84f5fa9
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQQueueConnectionFactory.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.QueueConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+
+/**
+ * A class that represents a QueueConnectionFactory.
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQQueueConnectionFactory extends ActiveMQConnectionFactory implements QueueConnectionFactory
+{
+   private static final long serialVersionUID = 5312455021322463546L;
+
+   /**
+    *
+    */
+   public ActiveMQQueueConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQQueueConnectionFactory(ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQQueueConnectionFactory(boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQQueueConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+   public int getFactoryType()
+   {
+      return JMSFactoryType.QUEUE_CF.intValue();
+   }
+}


[51/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/034adfbf
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/034adfbf
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/034adfbf

Branch: refs/heads/master
Commit: 034adfbf9b0dd217dba6bfdccfdb0488565fc189
Parents: e7a3e7d
Author: jbertram <jb...@redhat.com>
Authored: Tue Nov 18 10:03:42 2014 -0600
Committer: jbertram <jb...@redhat.com>
Committed: Tue Nov 18 16:53:09 2014 -0600

----------------------------------------------------------------------
 .../org/apache/activemq/cli/commands/Run.java   |   16 +-
 .../factory/SecurityManagerFactory.java         |    6 +-
 .../bootstrap/ActiveMQBootstrapBundle.java      |   31 +
 .../bootstrap/ActiveMQBootstrapLogger.java      |   71 +
 .../bootstrap/HornetQBootstrapBundle.java       |   31 -
 .../bootstrap/HornetQBootstrapLogger.java       |   71 -
 .../activemq/api/core/ActiveMQBuffer.java       |    2 +-
 .../activemq/api/core/ActiveMQBuffers.java      |   24 +-
 .../ActiveMQConnectionTimedOutException.java    |    2 +-
 .../api/core/ActiveMQDisconnectedException.java |    2 +-
 .../api/core/ActiveMQIllegalStateException.java |    2 +-
 .../core/ActiveMQInternalErrorException.java    |    2 +-
 .../api/core/ActiveMQNativeIOError.java         |    2 +-
 .../api/core/ActiveMQNotConnectedException.java |    2 +-
 .../ActiveMQUnsupportedPacketException.java     |    2 +-
 .../apache/activemq/api/core/SimpleString.java  |    2 +-
 .../activemq/core/server/ActiveMQComponent.java |   31 +
 .../activemq/core/server/HornetQComponent.java  |   31 -
 .../activemq/utils/ActiveMQThreadFactory.java   |   68 +
 .../activemq/utils/ActiveMQUtilBundle.java      |   48 +
 .../activemq/utils/ActiveMQUtilLogger.java      |   50 +
 .../apache/activemq/utils/ClassloadingUtil.java |    2 +-
 .../activemq/utils/HornetQThreadFactory.java    |   68 -
 .../activemq/utils/HornetQUtilBundle.java       |   48 -
 .../activemq/utils/HornetQUtilLogger.java       |   50 -
 .../activemq/utils/PasswordMaskingUtil.java     |    4 +-
 .../apache/activemq/utils/ReusableLatch.java    |    2 +-
 .../apache/activemq/utils/TypedProperties.java  |    2 +-
 .../org/apache/activemq/utils/UTF8Util.java     |   10 +-
 .../apache/activemq/utils/UUIDGenerator.java    |    8 +-
 .../api/core/DiscoveryGroupConfiguration.java   |    6 +-
 .../activemq/api/core/FilterConstants.java      |   30 +-
 .../apache/activemq/api/core/Interceptor.java   |    6 +-
 .../JGroupsBroadcastGroupConfiguration.java     |    8 +-
 .../org/apache/activemq/api/core/Message.java   |   10 +-
 .../api/core/TransportConfiguration.java        |   10 +-
 .../core/UDPBroadcastGroupConfiguration.java    |    8 +-
 .../api/core/client/ActiveMQClient.java         |  209 ++
 .../api/core/client/ClientConsumer.java         |    6 +-
 .../activemq/api/core/client/ClientMessage.java |    4 +-
 .../api/core/client/ClientSessionFactory.java   |    2 +-
 .../activemq/api/core/client/HornetQClient.java |  209 --
 .../activemq/api/core/client/ServerLocator.java |   54 +-
 .../core/client/loadbalance/package-info.java   |    4 +-
 .../activemq/api/core/client/package-info.java  |    2 +-
 .../api/core/management/AcceptorControl.java    |    2 +-
 .../management/ActiveMQComponentControl.java    |   36 +
 .../core/management/ActiveMQServerControl.java  |  621 +++++
 .../api/core/management/BridgeControl.java      |    2 +-
 .../core/management/BroadcastGroupControl.java  |    2 +-
 .../management/ClusterConnectionControl.java    |    2 +-
 .../management/HornetQComponentControl.java     |   36 -
 .../core/management/HornetQServerControl.java   |  621 -----
 .../api/core/management/ManagementHelper.java   |   14 +-
 .../api/core/management/NotificationType.java   |    6 +-
 .../api/core/management/ObjectNameBuilder.java  |    8 +-
 .../api/core/management/package-info.java       |    4 +-
 .../apache/activemq/api/core/package-info.java  |    2 +-
 .../impl/ResetLimitWrappedActiveMQBuffer.java   |  392 +++
 .../impl/ResetLimitWrappedHornetQBuffer.java    |  392 ---
 .../core/client/ActiveMQClientLogger.java       |  415 +++
 .../client/ActiveMQClientMessageBundle.java     |  247 ++
 .../core/client/HornetQClientLogger.java        |  415 ---
 .../core/client/HornetQClientMessageBundle.java |  247 --
 .../core/client/impl/ActiveMQXAResource.java    |   20 +
 .../core/client/impl/ClientConsumerImpl.java    |   50 +-
 .../client/impl/ClientLargeMessageImpl.java     |   10 +-
 .../core/client/impl/ClientMessageImpl.java     |    4 +-
 .../client/impl/ClientProducerCreditsImpl.java  |    8 +-
 .../core/client/impl/ClientProducerImpl.java    |   14 +-
 .../client/impl/ClientSessionFactoryImpl.java   |   96 +-
 .../core/client/impl/ClientSessionImpl.java     |   94 +-
 .../CompressedLargeMessageControllerImpl.java   |    8 +-
 .../core/client/impl/DelegatingSession.java     |    8 +-
 .../core/client/impl/HornetQXAResource.java     |   20 -
 .../client/impl/LargeMessageControllerImpl.java |   36 +-
 .../core/client/impl/ServerLocatorImpl.java     |  150 +-
 .../activemq/core/client/impl/Topology.java     |   66 +-
 .../activemq/core/cluster/DiscoveryGroup.java   |   32 +-
 .../core/exception/ActiveMQXAException.java     |   39 +
 .../core/exception/HornetQXAException.java      |   39 -
 .../activemq/core/message/BodyEncoder.java      |   10 +-
 .../activemq/core/message/impl/MessageImpl.java |   12 +-
 .../protocol/core/CoreRemotingConnection.java   |    6 +-
 .../impl/ActiveMQClientProtocolManager.java     |  613 +++++
 .../ActiveMQClientProtocolManagerFactory.java   |   42 +
 .../core/impl/ActiveMQConsumerContext.java      |   54 +
 .../core/impl/ActiveMQSessionContext.java       |  940 +++++++
 .../core/protocol/core/impl/ChannelImpl.java    |   40 +-
 .../core/impl/HornetQClientProtocolManager.java |  613 -----
 .../HornetQClientProtocolManagerFactory.java    |   42 -
 .../core/impl/HornetQConsumerContext.java       |   54 -
 .../core/impl/HornetQSessionContext.java        |  940 -------
 .../core/protocol/core/impl/PacketDecoder.java  |    8 +-
 .../core/impl/RemotingConnectionImpl.java       |   20 +-
 .../wireformat/ActiveMQExceptionMessage.java    |  118 +
 .../wireformat/HornetQExceptionMessage.java     |  118 -
 .../impl/netty/ActiveMQAMQPFrameDecoder.java    |   41 +
 .../impl/netty/ActiveMQChannelHandler.java      |  122 +
 .../impl/netty/ActiveMQFrameDecoder2.java       |   39 +
 .../impl/netty/HornetQAMQPFrameDecoder.java     |   41 -
 .../impl/netty/HornetQChannelHandler.java       |  122 -
 .../impl/netty/HornetQFrameDecoder2.java        |   39 -
 .../remoting/impl/netty/NettyConnection.java    |   14 +-
 .../remoting/impl/netty/NettyConnector.java     |  118 +-
 .../impl/netty/SharedNioEventLoopGroup.java     |    4 +-
 .../remoting/impl/netty/TransportConstants.java |    2 +-
 .../core/remoting/impl/ssl/SSLSupport.java      |    2 +-
 .../activemq/core/remoting/package-info.java    |    2 +-
 .../core/security/ActiveMQPrincipal.java        |   41 +
 .../core/security/HornetQPrincipal.java         |   41 -
 .../protocol/AbstractRemotingConnection.java    |   18 +-
 .../spi/core/protocol/RemotingConnection.java   |    2 +-
 .../activemq/spi/core/remoting/Connection.java  |    6 +-
 .../remoting/ConnectionLifeCycleListener.java   |    6 +-
 .../spi/core/remoting/package-info.java         |    2 +-
 .../utils/ActiveMQBufferInputStream.java        |  181 ++
 .../org/apache/activemq/utils/BufferHelper.java |    2 +-
 .../activemq/utils/ConfigurationHelper.java     |   16 +-
 .../utils/HornetQBufferInputStream.java         |  181 --
 .../org/apache/activemq/utils/MemorySize.java   |    4 +-
 .../activemq/utils/OrderedExecutorFactory.java  |    6 +-
 .../apache/activemq/utils/SoftValueHashMap.java |    6 +-
 .../apache/activemq/utils/VersionLoader.java    |   26 +-
 .../java/org/apache/activemq/utils/XMLUtil.java |   32 +-
 .../org/apache/activemq/utils/package-info.java |    2 +-
 .../main/resources/activemq-version.properties  |    9 +
 .../main/resources/hornetq-version.properties   |    9 -
 .../apache/activemq/tests/CoreUnitTestCase.java |    4 +-
 .../java/org/apache/activemq/dto/XmlUtil.java   |    2 +-
 .../org/apache/activemq/dto/package-info.java   |    4 +-
 .../activemq/api/jms/ActiveMQJMSClient.java     |  234 ++
 .../activemq/api/jms/ActiveMQJMSConstants.java  |   38 +
 .../activemq/api/jms/HornetQJMSClient.java      |  234 --
 .../activemq/api/jms/HornetQJMSConstants.java   |   38 -
 .../management/ConnectionFactoryControl.java    |    2 +-
 .../api/jms/management/DestinationControl.java  |    2 +-
 .../api/jms/management/JMSManagementHelper.java |   10 +-
 .../api/jms/management/JMSServerControl.java    |    6 +-
 .../api/jms/management/SubscriptionInfo.java    |    2 +-
 .../api/jms/management/package-info.java        |    4 +-
 .../apache/activemq/api/jms/package-info.java   |    4 +-
 .../jms/client/ActiveMQBytesMessage.java        |  436 ++++
 .../activemq/jms/client/ActiveMQConnection.java |  862 +++++++
 .../jms/client/ActiveMQConnectionFactory.java   |  821 ++++++
 .../client/ActiveMQConnectionForContext.java    |   34 +
 .../ActiveMQConnectionForContextImpl.java       |   91 +
 .../jms/client/ActiveMQConnectionMetaData.java  |   97 +
 .../jms/client/ActiveMQDestination.java         |  376 +++
 .../jms/client/ActiveMQJMSClientBundle.java     |   97 +
 .../jms/client/ActiveMQJMSClientLogger.java     |   79 +
 .../client/ActiveMQJMSConnectionFactory.java    |   67 +
 .../jms/client/ActiveMQJMSConsumer.java         |  198 ++
 .../activemq/jms/client/ActiveMQJMSContext.java |  769 ++++++
 .../jms/client/ActiveMQJMSProducer.java         |  800 ++++++
 .../activemq/jms/client/ActiveMQMapMessage.java |  450 ++++
 .../activemq/jms/client/ActiveMQMessage.java    | 1089 ++++++++
 .../jms/client/ActiveMQMessageConsumer.java     |  253 ++
 .../jms/client/ActiveMQMessageProducer.java     |  601 +++++
 .../jms/client/ActiveMQObjectMessage.java       |  202 ++
 .../activemq/jms/client/ActiveMQQueue.java      |   90 +
 .../jms/client/ActiveMQQueueBrowser.java        |  169 ++
 .../client/ActiveMQQueueConnectionFactory.java  |   69 +
 .../activemq/jms/client/ActiveMQSession.java    | 1276 +++++++++
 .../jms/client/ActiveMQStreamMessage.java       |  466 ++++
 .../jms/client/ActiveMQTemporaryQueue.java      |   67 +
 .../jms/client/ActiveMQTemporaryTopic.java      |   53 +
 .../jms/client/ActiveMQTextMessage.java         |  146 ++
 .../activemq/jms/client/ActiveMQTopic.java      |   85 +
 .../client/ActiveMQTopicConnectionFactory.java  |   70 +
 .../jms/client/ActiveMQXAConnection.java        |   70 +
 .../jms/client/ActiveMQXAConnectionFactory.java |   76 +
 .../jms/client/ActiveMQXAJMSContext.java        |   23 +
 .../ActiveMQXAQueueConnectionFactory.java       |   71 +
 .../activemq/jms/client/ActiveMQXASession.java  |   47 +
 .../ActiveMQXATopicConnectionFactory.java       |   69 +
 .../jms/client/HornetQBytesMessage.java         |  436 ----
 .../activemq/jms/client/HornetQConnection.java  |  862 -------
 .../jms/client/HornetQConnectionFactory.java    |  821 ------
 .../jms/client/HornetQConnectionForContext.java |   34 -
 .../client/HornetQConnectionForContextImpl.java |   91 -
 .../jms/client/HornetQConnectionMetaData.java   |   97 -
 .../activemq/jms/client/HornetQDestination.java |  376 ---
 .../jms/client/HornetQJMSClientBundle.java      |   97 -
 .../jms/client/HornetQJMSClientLogger.java      |   79 -
 .../jms/client/HornetQJMSConnectionFactory.java |   67 -
 .../activemq/jms/client/HornetQJMSConsumer.java |  198 --
 .../activemq/jms/client/HornetQJMSContext.java  |  769 ------
 .../activemq/jms/client/HornetQJMSProducer.java |  800 ------
 .../activemq/jms/client/HornetQMapMessage.java  |  450 ----
 .../activemq/jms/client/HornetQMessage.java     | 1089 --------
 .../jms/client/HornetQMessageConsumer.java      |  253 --
 .../jms/client/HornetQMessageProducer.java      |  601 -----
 .../jms/client/HornetQObjectMessage.java        |  202 --
 .../activemq/jms/client/HornetQQueue.java       |   90 -
 .../jms/client/HornetQQueueBrowser.java         |  169 --
 .../client/HornetQQueueConnectionFactory.java   |   69 -
 .../activemq/jms/client/HornetQSession.java     | 1276 ---------
 .../jms/client/HornetQStreamMessage.java        |  466 ----
 .../jms/client/HornetQTemporaryQueue.java       |   67 -
 .../jms/client/HornetQTemporaryTopic.java       |   53 -
 .../activemq/jms/client/HornetQTextMessage.java |  146 --
 .../activemq/jms/client/HornetQTopic.java       |   85 -
 .../client/HornetQTopicConnectionFactory.java   |   70 -
 .../jms/client/HornetQXAConnection.java         |   70 -
 .../jms/client/HornetQXAConnectionFactory.java  |   76 -
 .../jms/client/HornetQXAJMSContext.java         |   23 -
 .../client/HornetQXAQueueConnectionFactory.java |   71 -
 .../activemq/jms/client/HornetQXASession.java   |   47 -
 .../client/HornetQXATopicConnectionFactory.java |   69 -
 .../activemq/jms/client/JMSExceptionHelper.java |    2 +-
 .../jms/client/JMSMessageListenerWrapper.java   |   24 +-
 .../activemq/jms/client/SelectorTranslator.java |    8 +-
 .../activemq/jms/client/ThreadAwareContext.java |    8 +-
 .../activemq/jms/client/package-info.java       |    2 +-
 .../ConnectionFactoryObjectFactory.java         |    4 +-
 .../referenceable/DestinationObjectFactory.java |    4 +-
 .../jms/bridge/ActiveMQJMSBridgeLogger.java     |  101 +
 .../jms/bridge/HornetQJMSBridgeLogger.java      |  101 -
 .../apache/activemq/jms/bridge/JMSBridge.java   |    4 +-
 .../activemq/jms/bridge/JMSBridgeControl.java   |    4 +-
 .../jms/bridge/QualityOfServiceMode.java        |    2 +-
 .../activemq/jms/bridge/impl/JMSBridgeImpl.java |  236 +-
 .../impl/JMSConnectionFactoryControlImpl.java   |    6 +-
 .../management/impl/JMSQueueControlImpl.java    |   18 +-
 .../management/impl/JMSServerControlImpl.java   |   62 +-
 .../management/impl/JMSTopicControlImpl.java    |   34 +-
 .../jms/persistence/JMSStorageManager.java      |    4 +-
 .../journal/JMSJournalStorageManagerImpl.java   |    2 +-
 .../jms/server/ActiveMQJMSServerBundle.java     |   62 +
 .../jms/server/ActiveMQJMSServerLogger.java     |  115 +
 .../jms/server/HornetQJMSServerBundle.java      |   62 -
 .../jms/server/HornetQJMSServerLogger.java      |  115 -
 .../activemq/jms/server/JMSServerManager.java   |   12 +-
 .../ConnectionFactoryConfigurationImpl.java     |   62 +-
 .../jms/server/embedded/EmbeddedJMS.java        |   16 +-
 .../server/impl/JMSServerConfigParserImpl.java  |   72 +-
 .../jms/server/impl/JMSServerDeployer.java      |    6 +-
 .../jms/server/impl/JMSServerManagerImpl.java   |  156 +-
 .../jms/server/impl/StandaloneNamingServer.java |   16 +-
 .../server/management/JMSManagementService.java |   12 +-
 .../impl/JMSManagementServiceImpl.java          |   16 +-
 .../recovery/ActiveMQRecoveryRegistry.java      |  250 ++
 .../server/recovery/ActiveMQRegistryBase.java   |   71 +
 .../recovery/ActiveMQXAResourceRecovery.java    |  231 ++
 .../recovery/ActiveMQXAResourceWrapper.java     |  531 ++++
 .../recovery/HornetQRecoveryRegistry.java       |  250 --
 .../server/recovery/HornetQRegistryBase.java    |   71 -
 .../recovery/HornetQXAResourceRecovery.java     |  231 --
 .../recovery/HornetQXAResourceWrapper.java      |  531 ----
 .../jms/server/recovery/RecoveryDiscovery.java  |   24 +-
 .../jms/server/recovery/XARecoveryConfig.java   |   10 +-
 .../jms/server/recovery/package-info.java       |    4 +-
 .../jms/transaction/JMSTransactionDetail.java   |   26 +-
 .../core/asyncio/impl/ActiveMQFileLock.java     |   47 +
 .../core/asyncio/impl/AsynchronousFileImpl.java |   28 +-
 .../core/asyncio/impl/HornetQFileLock.java      |   47 -
 .../apache/activemq/core/journal/Journal.java   |    4 +-
 .../journal/impl/AIOSequentialFileFactory.java  |   12 +-
 .../journal/impl/AbstractSequentialFile.java    |   16 +-
 .../impl/AbstractSequentialFileFactory.java     |    8 +-
 .../core/journal/impl/CompactJournal.java       |    2 +-
 .../core/journal/impl/DummyCallback.java        |    4 +-
 .../core/journal/impl/ExportJournal.java        |    4 +-
 .../core/journal/impl/ImportJournal.java        |    4 +-
 .../core/journal/impl/JournalCompactor.java     |   12 +-
 .../journal/impl/JournalFilesRepository.java    |   56 +-
 .../activemq/core/journal/impl/JournalImpl.java |   62 +-
 .../core/journal/impl/NIOSequentialFile.java    |   12 +-
 .../activemq/core/journal/impl/Reclaimer.java   |    6 +-
 .../core/journal/impl/SimpleWaitIOCallback.java |    4 +-
 .../core/journal/impl/SyncSpeedTest.java        |    6 +-
 .../activemq/core/journal/impl/TimedBuffer.java |   12 +-
 .../activemq/journal/ActiveMQJournalBundle.java |   48 +
 .../activemq/journal/ActiveMQJournalLogger.java |  271 ++
 .../activemq/journal/HornetQJournalBundle.java  |   48 -
 .../activemq/journal/HornetQJournalLogger.java  |  271 --
 .../ActiveMQProtonRemotingConnection.java       |  146 ++
 .../proton/HornetQProtonRemotingConnection.java |  146 --
 .../protocol/proton/ProtonProtocolManager.java  |   22 +-
 .../proton/ProtonProtocolManagerFactory.java    |    4 +-
 .../proton/converter/ActiveMQJMSVendor.java     |  155 ++
 .../proton/converter/HornetQJMSVendor.java      |  155 --
 .../converter/ProtonMessageConverter.java       |   10 +-
 .../converter/jms/ServerJMSMapMessage.java      |    2 +-
 .../proton/converter/jms/ServerJMSMessage.java  |   14 +-
 .../converter/jms/ServerJMSStreamMessage.java   |    2 +-
 .../converter/jms/ServerJMSTextMessage.java     |    2 +-
 .../proton/converter/jms/package-info.java      |    2 +-
 .../plug/ActiveMQProtonConnectionCallback.java  |  125 +
 .../plug/HornetQProtonConnectionCallback.java   |  125 -
 .../plug/ProtonSessionIntegrationCallback.java  |   10 +-
 .../protocol/proton/sasl/ActiveMQPlainSASL.java |   50 +
 .../protocol/proton/sasl/HornetQPlainSASL.java  |   50 -
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../protocol/openwire/OpenWireConnection.java   |   22 +-
 .../openwire/OpenWireProtocolManager.java       |   22 +-
 .../OpenWireProtocolManagerFactory.java         |    4 +-
 .../core/protocol/openwire/OpenWireUtil.java    |    2 +-
 .../core/protocol/openwire/amq/AMQConsumer.java |   11 +-
 .../core/protocol/openwire/amq/AMQProducer.java |    2 +-
 .../openwire/amq/AMQServerConsumer.java         |    6 +-
 .../protocol/openwire/amq/AMQServerSession.java |   24 +-
 .../openwire/amq/AMQServerSessionFactory.java   |    6 +-
 .../core/protocol/openwire/amq/AMQSession.java  |   14 +-
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../plug/AMQPClientConnectionContext.java       |    4 +-
 .../proton/plug/AMQPClientSessionContext.java   |    6 +-
 .../org/proton/plug/AMQPSessionContext.java     |    4 +-
 .../plug/context/AbstractConnectionContext.java |    6 +-
 .../context/AbstractProtonContextSender.java    |   12 +-
 .../context/AbstractProtonReceiverContext.java  |    6 +-
 .../context/AbstractProtonSessionContext.java   |   10 +-
 .../plug/context/ProtonDeliveryHandler.java     |    6 +-
 .../plug/context/ProtonInitializable.java       |   12 +-
 .../plug/context/ProtonTransactionHandler.java  |   12 +-
 .../client/ProtonClientConnectionContext.java   |    6 +-
 .../context/client/ProtonClientContext.java     |    4 +-
 .../client/ProtonClientReceiverContext.java     |    4 +-
 .../client/ProtonClientSessionContext.java      |    6 +-
 .../server/ProtonServerConnectionContext.java   |    4 +-
 .../server/ProtonServerReceiverContext.java     |   16 +-
 .../server/ProtonServerSenderContext.java       |   38 +-
 .../server/ProtonServerSessionContext.java      |    8 +-
 .../plug/exceptions/ActiveMQAMQPException.java  |   45 +
 .../ActiveMQAMQPIllegalStateException.java      |   28 +
 .../ActiveMQAMQPInternalErrorException.java     |   33 +
 .../ActiveMQAMQPInvalidFieldException.java      |   28 +
 .../ActiveMQAMQPNotImplementedException.java    |   28 +
 .../ActiveMQAMQPTimeoutException.java           |   29 +
 .../plug/exceptions/HornetQAMQPException.java   |   45 -
 .../HornetQAMQPIllegalStateException.java       |   28 -
 .../HornetQAMQPInternalErrorException.java      |   33 -
 .../HornetQAMQPInvalidFieldException.java       |   28 -
 .../HornetQAMQPNotImplementedException.java     |   28 -
 .../exceptions/HornetQAMQPTimeoutException.java |   29 -
 .../ActiveMQAMQPProtocolMessageBundle.java      |   83 +
 .../HornetQAMQPProtocolMessageBundle.java       |   83 -
 .../org/proton/plug/util/ReusableLatch.java     |    2 +-
 .../plug/test/minimalserver/MinimalServer.java  |    4 +-
 .../SimpleServerThreadFactory.java              |    2 +-
 .../protocol/stomp/ActiveMQStompException.java  |  134 +
 .../stomp/ActiveMQStompProtocolLogger.java      |   54 +
 .../ActiveMQStompProtocolMessageBundle.java     |  152 ++
 .../protocol/stomp/HornetQStompException.java   |  134 -
 .../stomp/HornetQStompProtocolLogger.java       |   54 -
 .../HornetQStompProtocolMessageBundle.java      |  152 --
 .../core/protocol/stomp/StompConnection.java    |   72 +-
 .../core/protocol/stomp/StompDecoder.java       |   20 +-
 .../core/protocol/stomp/StompFrame.java         |    4 +-
 .../protocol/stomp/StompProtocolManager.java    |   58 +-
 .../stomp/StompProtocolManagerFactory.java      |    4 +-
 .../core/protocol/stomp/StompSession.java       |    2 +-
 .../stomp/VersionedStompFrameHandler.java       |   28 +-
 .../stomp/v10/StompFrameHandlerV10.java         |   14 +-
 .../stomp/v11/StompFrameHandlerV11.java         |   30 +-
 .../core/protocol/stomp/v11/StompFrameV11.java  |    2 +-
 .../stomp/v12/StompFrameHandlerV12.java         |   18 +-
 .../core/protocol/stomp/v12/StompFrameV12.java  |    2 +-
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../apache/activemq/ra/ActiveMQRABundle.java    |   70 +
 .../activemq/ra/ActiveMQRABytesMessage.java     |  455 ++++
 .../ra/ActiveMQRAConnectionFactory.java         |   65 +
 .../ra/ActiveMQRAConnectionFactoryImpl.java     |  570 +++++
 .../ra/ActiveMQRAConnectionManager.java         |   90 +
 .../ra/ActiveMQRAConnectionMetaData.java        |  153 ++
 .../ra/ActiveMQRAConnectionRequestInfo.java     |  306 +++
 .../activemq/ra/ActiveMQRACredential.java       |  241 ++
 .../activemq/ra/ActiveMQRAJMSContext.java       |   57 +
 .../activemq/ra/ActiveMQRALocalTransaction.java |  121 +
 .../apache/activemq/ra/ActiveMQRALogger.java    |  122 +
 .../activemq/ra/ActiveMQRAMCFProperties.java    |  204 ++
 .../ra/ActiveMQRAManagedConnection.java         |  921 +++++++
 .../ra/ActiveMQRAManagedConnectionFactory.java  |  805 ++++++
 .../activemq/ra/ActiveMQRAMapMessage.java       |  452 ++++
 .../apache/activemq/ra/ActiveMQRAMessage.java   |  897 +++++++
 .../activemq/ra/ActiveMQRAMessageConsumer.java  |  334 +++
 .../activemq/ra/ActiveMQRAMessageListener.java  |   65 +
 .../activemq/ra/ActiveMQRAMessageProducer.java  |  473 ++++
 .../apache/activemq/ra/ActiveMQRAMetaData.java  |  107 +
 .../activemq/ra/ActiveMQRAObjectMessage.java    |   76 +
 .../activemq/ra/ActiveMQRAProperties.java       |  358 +++
 .../activemq/ra/ActiveMQRAQueueReceiver.java    |   61 +
 .../activemq/ra/ActiveMQRAQueueSender.java      |  138 +
 .../apache/activemq/ra/ActiveMQRAService.java   |   82 +
 .../apache/activemq/ra/ActiveMQRASession.java   | 1903 ++++++++++++++
 .../activemq/ra/ActiveMQRASessionFactory.java   |   51 +
 .../ra/ActiveMQRASessionFactoryImpl.java        | 1046 ++++++++
 .../activemq/ra/ActiveMQRAStreamMessage.java    |  408 +++
 .../activemq/ra/ActiveMQRATextMessage.java      |   74 +
 .../activemq/ra/ActiveMQRATopicPublisher.java   |  211 ++
 .../activemq/ra/ActiveMQRATopicSubscriber.java  |   77 +
 .../activemq/ra/ActiveMQRAXAJMSContext.java     |   26 +
 .../activemq/ra/ActiveMQRAXAResource.java       |  257 ++
 .../org/apache/activemq/ra/ActiveMQRaUtils.java |  354 +++
 .../activemq/ra/ActiveMQResourceAdapter.java    | 2411 ++++++++++++++++++
 .../activemq/ra/ActiveMQXAResourceWrapper.java  |  143 ++
 .../ra/ConnectionFactoryProperties.java         |  122 +-
 .../org/apache/activemq/ra/HornetQRABundle.java |   70 -
 .../activemq/ra/HornetQRABytesMessage.java      |  455 ----
 .../activemq/ra/HornetQRAConnectionFactory.java |   65 -
 .../ra/HornetQRAConnectionFactoryImpl.java      |  570 -----
 .../activemq/ra/HornetQRAConnectionManager.java |   90 -
 .../ra/HornetQRAConnectionMetaData.java         |  153 --
 .../ra/HornetQRAConnectionRequestInfo.java      |  306 ---
 .../apache/activemq/ra/HornetQRACredential.java |  241 --
 .../apache/activemq/ra/HornetQRAJMSContext.java |   57 -
 .../activemq/ra/HornetQRALocalTransaction.java  |  121 -
 .../org/apache/activemq/ra/HornetQRALogger.java |  122 -
 .../activemq/ra/HornetQRAMCFProperties.java     |  204 --
 .../activemq/ra/HornetQRAManagedConnection.java |  921 -------
 .../ra/HornetQRAManagedConnectionFactory.java   |  805 ------
 .../apache/activemq/ra/HornetQRAMapMessage.java |  452 ----
 .../apache/activemq/ra/HornetQRAMessage.java    |  897 -------
 .../activemq/ra/HornetQRAMessageConsumer.java   |  334 ---
 .../activemq/ra/HornetQRAMessageListener.java   |   65 -
 .../activemq/ra/HornetQRAMessageProducer.java   |  473 ----
 .../apache/activemq/ra/HornetQRAMetaData.java   |  107 -
 .../activemq/ra/HornetQRAObjectMessage.java     |   76 -
 .../apache/activemq/ra/HornetQRAProperties.java |  358 ---
 .../activemq/ra/HornetQRAQueueReceiver.java     |   61 -
 .../activemq/ra/HornetQRAQueueSender.java       |  138 -
 .../apache/activemq/ra/HornetQRAService.java    |   82 -
 .../apache/activemq/ra/HornetQRASession.java    | 1903 --------------
 .../activemq/ra/HornetQRASessionFactory.java    |   51 -
 .../ra/HornetQRASessionFactoryImpl.java         | 1046 --------
 .../activemq/ra/HornetQRAStreamMessage.java     |  408 ---
 .../activemq/ra/HornetQRATextMessage.java       |   74 -
 .../activemq/ra/HornetQRATopicPublisher.java    |  211 --
 .../activemq/ra/HornetQRATopicSubscriber.java   |   77 -
 .../activemq/ra/HornetQRAXAJMSContext.java      |   26 -
 .../apache/activemq/ra/HornetQRAXAResource.java |  257 --
 .../org/apache/activemq/ra/HornetQRaUtils.java  |  354 ---
 .../activemq/ra/HornetQResourceAdapter.java     | 2411 ------------------
 .../activemq/ra/HornetQXAResourceWrapper.java   |  143 --
 .../activemq/ra/inflow/ActiveMQActivation.java  |  831 ++++++
 .../ra/inflow/ActiveMQActivationSpec.java       |  945 +++++++
 .../ra/inflow/ActiveMQMessageHandler.java       |  430 ++++
 .../activemq/ra/inflow/HornetQActivation.java   |  831 ------
 .../ra/inflow/HornetQActivationSpec.java        |  945 -------
 .../ra/inflow/HornetQMessageHandler.java        |  430 ----
 .../activemq/ra/recovery/RecoveryManager.java   |   20 +-
 .../java/org/apache/activemq/rest/ActiveMQ.java |  191 ++
 .../activemq/rest/ActiveMQRestBundle.java       |   31 +
 .../activemq/rest/ActiveMQRestLogger.java       |   85 +
 .../apache/activemq/rest/HornetQRestBundle.java |   31 -
 .../apache/activemq/rest/HornetQRestLogger.java |   85 -
 .../java/org/apache/activemq/rest/Hornetq.java  |  191 --
 .../activemq/rest/MessageServiceManager.java    |    4 +-
 .../integration/ActiveMQBootstrapListener.java  |   55 +
 .../rest/integration/EmbeddedRestActiveMQ.java  |   92 +
 .../integration/EmbeddedRestActiveMQJMS.java    |   36 +
 .../rest/integration/EmbeddedRestHornetQ.java   |   92 -
 .../integration/EmbeddedRestHornetQJMS.java     |   36 -
 .../integration/HornetqBootstrapListener.java   |   55 -
 .../rest/queue/AcknowledgedQueueConsumer.java   |    6 +-
 .../activemq/rest/queue/ConsumedMessage.java    |    4 +-
 .../activemq/rest/queue/ConsumersResource.java  |   12 +-
 .../rest/queue/DestinationServiceManager.java   |    4 +-
 .../apache/activemq/rest/queue/PostMessage.java |   22 +-
 .../activemq/rest/queue/PostMessageDupsOk.java  |    8 +-
 .../activemq/rest/queue/PostMessageNoDups.java  |    4 +-
 .../activemq/rest/queue/QueueConsumer.java      |   16 +-
 .../rest/queue/QueueDestinationsResource.java   |   16 +-
 .../activemq/rest/queue/QueueResource.java      |    8 +-
 .../rest/queue/push/ActiveMQPushStrategy.java   |   87 +
 .../activemq/rest/queue/push/FilePushStore.java |    8 +-
 .../rest/queue/push/HornetQPushStrategy.java    |   87 -
 .../activemq/rest/queue/push/PushConsumer.java  |   10 +-
 .../queue/push/PushConsumerMessageHandler.java  |   12 +-
 .../rest/queue/push/PushConsumerResource.java   |    8 +-
 .../activemq/rest/queue/push/PushStrategy.java  |    2 +-
 .../activemq/rest/queue/push/UriStrategy.java   |   16 +-
 .../activemq/rest/topic/PushSubscription.java   |    4 +-
 .../rest/topic/PushSubscriptionsResource.java   |    8 +-
 .../rest/topic/SubscriptionsResource.java       |   18 +-
 .../rest/topic/TopicDestinationsResource.java   |   16 +-
 .../activemq/rest/topic/TopicResource.java      |    8 +-
 .../activemq/rest/util/HttpMessageHelper.java   |   12 +-
 .../apache/activemq/rest/util/TimeoutTask.java  |    6 +-
 .../rest/test/CreateDestinationTest.java        |    4 +-
 .../org/apache/activemq/rest/test/Embedded.java |   22 +-
 .../apache/activemq/rest/test/EmbeddedTest.java |    8 +-
 .../activemq/rest/test/FindDestinationTest.java |    4 +-
 .../org/apache/activemq/rest/test/JMSTest.java  |   12 +-
 .../activemq/rest/test/MessageTestBase.java     |    4 +-
 .../test/PersistentPushQueueConsumerTest.java   |   14 +-
 .../test/PersistentPushTopicConsumerTest.java   |    8 +-
 .../rest/test/PushQueueConsumerTest.java        |    4 +-
 .../rest/test/PushTopicConsumerTest.java        |    4 +-
 .../apache/activemq/rest/test/RawAckTest.java   |   16 +-
 .../apache/activemq/rest/test/SelectorTest.java |   10 +-
 .../activemq/rest/test/TransformTest.java       |    8 +-
 .../core/config/BridgeConfiguration.java        |   18 +-
 .../config/ClusterConnectionConfiguration.java  |    4 +-
 .../activemq/core/config/Configuration.java     |   14 +-
 .../core/config/ConfigurationUtils.java         |    4 +-
 .../core/config/impl/ConfigurationImpl.java     |    2 +-
 .../core/config/impl/FileConfiguration.java     |    6 +-
 .../activemq/core/config/impl/Validators.java   |   22 +-
 .../activemq/core/deployers/Deployer.java       |    4 +-
 .../core/deployers/DeploymentManager.java       |    4 +-
 .../impl/BasicUserCredentialsDeployer.java      |   18 +-
 .../deployers/impl/FileConfigurationParser.java |   84 +-
 .../deployers/impl/FileDeploymentManager.java   |   24 +-
 .../core/deployers/impl/QueueDeployer.java      |    6 +-
 .../core/deployers/impl/SecurityDeployer.java   |    2 +-
 .../core/deployers/impl/XmlDeployer.java        |    6 +-
 .../activemq/core/filter/impl/FilterImpl.java   |   28 +-
 .../impl/ActiveMQServerControlImpl.java         | 2187 ++++++++++++++++
 .../impl/HornetQServerControlImpl.java          | 2187 ----------------
 .../core/management/impl/QueueControlImpl.java  |   12 +-
 .../impl/MessageCounterHelper.java              |    4 +-
 .../activemq/core/paging/PagingManager.java     |    4 +-
 .../activemq/core/paging/PagingStore.java       |    6 +-
 .../core/paging/cursor/PagedReferenceImpl.java  |    8 +-
 .../cursor/impl/PageCursorProviderImpl.java     |   52 +-
 .../impl/PageSubscriptionCounterImpl.java       |    8 +-
 .../cursor/impl/PageSubscriptionImpl.java       |   30 +-
 .../apache/activemq/core/paging/impl/Page.java  |   24 +-
 .../paging/impl/PageTransactionInfoImpl.java    |    4 +-
 .../core/paging/impl/PagingManagerImpl.java     |   10 +-
 .../core/paging/impl/PagingStoreFactoryNIO.java |    4 +-
 .../core/paging/impl/PagingStoreImpl.java       |   24 +-
 .../core/persistence/StorageManager.java        |    6 +-
 .../impl/journal/BatchingIDGenerator.java       |    4 +-
 .../impl/journal/DescribeJournal.java           |    6 +-
 .../impl/journal/JournalStorageManager.java     |   98 +-
 .../impl/journal/LargeServerMessageImpl.java    |   16 +-
 .../impl/journal/LargeServerMessageInSync.java  |    4 +-
 .../impl/journal/OperationContextImpl.java      |    4 +-
 .../activemq/core/postoffice/BindingType.java   |    4 +-
 .../activemq/core/postoffice/PostOffice.java    |    4 +-
 .../activemq/core/postoffice/QueueInfo.java     |    8 +-
 .../core/postoffice/impl/BindingsImpl.java      |   20 +-
 .../postoffice/impl/DuplicateIDCacheImpl.java   |    4 +-
 .../core/postoffice/impl/PostOfficeImpl.java    |   64 +-
 .../postoffice/impl/SimpleAddressManager.java   |   10 +-
 .../activemq/core/protocol/ProtocolHandler.java |    6 +-
 .../core/ServerSessionPacketHandler.java        |   46 +-
 .../core/impl/ActiveMQPacketHandler.java        |  298 +++
 .../protocol/core/impl/CoreProtocolManager.java |   39 +-
 .../core/impl/CoreProtocolManagerFactory.java   |    8 +-
 .../protocol/core/impl/CoreSessionCallback.java |    6 +-
 .../core/impl/HornetQPacketHandler.java         |  298 ---
 .../wireformat/BackupRegistrationMessage.java   |    2 +-
 .../protocol/stomp/WebSocketServerHandler.java  |    2 +-
 .../core/remoting/impl/invm/InVMAcceptor.java   |   22 +-
 .../core/remoting/impl/invm/InVMConnection.java |   24 +-
 .../core/remoting/impl/invm/InVMConnector.java  |   12 +-
 .../core/remoting/impl/invm/InVMRegistry.java   |    6 +-
 .../core/remoting/impl/netty/NettyAcceptor.java |   50 +-
 .../core/remoting/server/RemotingService.java   |    4 +-
 .../server/impl/RemotingServiceImpl.java        |   88 +-
 .../core/replication/ReplicatedJournal.java     |    4 +-
 .../core/replication/ReplicationEndpoint.java   |   62 +-
 .../core/replication/ReplicationManager.java    |   22 +-
 .../core/security/impl/SecurityStoreImpl.java   |   24 +-
 .../core/server/ActiveMQMessageBundle.java      |  371 +++
 .../activemq/core/server/ActiveMQServer.java    |  249 ++
 .../core/server/ActiveMQServerLogger.java       | 1366 ++++++++++
 .../activemq/core/server/ActiveMQServers.java   |  123 +
 .../activemq/core/server/ConnectorService.java  |    2 +-
 .../core/server/HornetQMessageBundle.java       |  371 ---
 .../activemq/core/server/HornetQServer.java     |  249 --
 .../core/server/HornetQServerLogger.java        | 1366 ----------
 .../activemq/core/server/HornetQServers.java    |  123 -
 .../activemq/core/server/MemoryManager.java     |   12 +-
 .../activemq/core/server/NodeManager.java       |    6 +-
 .../org/apache/activemq/core/server/Queue.java  |    2 +-
 .../core/server/ServerSessionFactory.java       |    4 +-
 ...ctiveMQServerSideProtocolManagerFactory.java |   55 +
 .../core/server/cluster/BackupManager.java      |   30 +-
 .../activemq/core/server/cluster/Bridge.java    |    4 +-
 .../core/server/cluster/BroadcastGroup.java     |    4 +-
 .../cluster/ClusterConfigurationUtil.java       |   12 +-
 .../core/server/cluster/ClusterConnection.java  |    8 +-
 .../core/server/cluster/ClusterControl.java     |   16 +-
 .../core/server/cluster/ClusterController.java  |   34 +-
 .../core/server/cluster/ClusterManager.java     |   76 +-
 ...HornetQServerSideProtocolManagerFactory.java |   55 -
 .../server/cluster/ha/ColocatedHAManager.java   |   30 +-
 .../core/server/cluster/ha/ColocatedPolicy.java |    4 +-
 .../core/server/cluster/ha/HAManager.java       |    8 +-
 .../core/server/cluster/ha/HAPolicy.java        |    4 +-
 .../core/server/cluster/ha/LiveOnlyPolicy.java  |    4 +-
 .../core/server/cluster/ha/ReplicaPolicy.java   |    6 +-
 .../server/cluster/ha/ReplicatedPolicy.java     |    4 +-
 .../core/server/cluster/ha/ScaleDownPolicy.java |   30 +-
 .../cluster/ha/SharedStoreMasterPolicy.java     |    4 +-
 .../cluster/ha/SharedStoreSlavePolicy.java      |    4 +-
 .../server/cluster/ha/StandaloneHAManager.java  |    6 +-
 .../core/server/cluster/impl/BridgeImpl.java    |  116 +-
 .../server/cluster/impl/BroadcastGroupImpl.java |   10 +-
 .../cluster/impl/ClusterConnectionBridge.java   |   38 +-
 .../cluster/impl/ClusterConnectionImpl.java     |  116 +-
 .../core/server/cluster/impl/Redistributor.java |   10 +-
 .../cluster/impl/RemoteQueueBindingImpl.java    |    6 +-
 .../server/cluster/qourum/QuorumManager.java    |    4 +-
 .../qourum/SharedNothingBackupQuorum.java       |    4 +-
 .../core/server/embedded/EmbeddedActiveMQ.java  |  118 +
 .../core/server/embedded/EmbeddedHornetQ.java   |  118 -
 .../core/server/group/GroupingHandler.java      |    4 +-
 .../group/impl/GroupHandlingAbstract.java       |    4 +-
 .../server/group/impl/LocalGroupingHandler.java |   28 +-
 .../group/impl/RemoteGroupingHandler.java       |    8 +-
 .../server/impl/AIOFileLockNodeManager.java     |    2 +-
 .../activemq/core/server/impl/Activation.java   |    4 +-
 .../core/server/impl/ActiveMQServerImpl.java    | 2345 +++++++++++++++++
 .../impl/AnyLiveNodeLocatorForReplication.java  |    4 +-
 .../impl/AnyLiveNodeLocatorForScaleDown.java    |   10 +-
 .../impl/BackupRecoveryJournalLoader.java       |   14 +-
 .../core/server/impl/ColocatedActivation.java   |    6 +-
 .../core/server/impl/ConnectorsService.java     |   14 +-
 .../activemq/core/server/impl/DivertImpl.java   |    6 +-
 .../core/server/impl/FileLockNodeManager.java   |   18 +-
 .../core/server/impl/HornetQServerImpl.java     | 2345 -----------------
 .../core/server/impl/LastValueQueue.java        |    6 +-
 .../core/server/impl/LiveOnlyActivation.java    |   56 +-
 .../impl/NamedLiveNodeLocatorForScaleDown.java  |   10 +-
 .../server/impl/PostOfficeJournalLoader.java    |   28 +-
 .../activemq/core/server/impl/QueueImpl.java    |  158 +-
 .../core/server/impl/RefsOperation.java         |   10 +-
 .../core/server/impl/ReplicationError.java      |   14 +-
 .../core/server/impl/ScaleDownHandler.java      |   18 +-
 .../impl/ScheduledDeliveryHandlerImpl.java      |   22 +-
 .../core/server/impl/ServerConsumerImpl.java    |   84 +-
 .../activemq/core/server/impl/ServerInfo.java   |    6 +-
 .../core/server/impl/ServerSessionImpl.java     |  166 +-
 .../core/server/impl/ServiceRegistry.java       |    2 +-
 .../impl/SharedNothingBackupActivation.java     |  126 +-
 .../impl/SharedNothingLiveActivation.java       |   88 +-
 .../impl/SharedStoreBackupActivation.java       |   80 +-
 .../server/impl/SharedStoreLiveActivation.java  |   40 +-
 .../server/impl/TransientQueueManagerImpl.java  |   16 +-
 .../server/management/ManagementService.java    |   12 +-
 .../management/impl/ManagementServiceImpl.java  |   64 +-
 .../impl/HierarchicalObjectRepository.java      |    6 +-
 .../activemq/core/settings/impl/Match.java      |    6 +-
 .../core/transaction/ResourceManager.java       |    4 +-
 .../activemq/core/transaction/Transaction.java  |    2 +-
 .../transaction/impl/ResourceManagerImpl.java   |    8 +-
 .../core/transaction/impl/TransactionImpl.java  |   12 +-
 .../spi/core/protocol/ProtocolManager.java      |    2 +-
 .../core/protocol/ProtocolManagerFactory.java   |    4 +-
 .../activemq/spi/core/remoting/Acceptor.java    |   10 +-
 .../core/security/ActiveMQSecurityManager.java  |   78 +
 .../security/ActiveMQSecurityManagerImpl.java   |  212 ++
 .../core/security/HornetQSecurityManager.java   |   78 -
 .../security/HornetQSecurityManagerImpl.java    |  212 --
 .../spi/core/security/JAASSecurityManager.java  |   14 +-
 .../spi/core/security/package-info.java         |    2 +-
 .../impl/FileConfigurationParserTest.java       |   24 +-
 .../config/impl/HAPolicyConfigurationTest.java  |   30 +-
 .../WrongRoleFileConfigurationParserTest.java   |   24 +-
 .../activemq/core/filter/impl/FilterTest.java   |    2 +-
 .../core/message/impl/MessagePropertyTest.java  |    4 +-
 .../group/impl/ClusteredResetMockTest.java      |    6 +-
 .../core/server/impl/EmbeddedServerTest.java    |    8 +-
 .../impl/ScheduledDeliveryHandlerTest.java      |    4 +-
 .../core/version/impl/VersionImplTest.java      |    8 +-
 .../tests/util/ColocatedActiveMQServer.java     |   96 +
 .../tests/util/ColocatedHornetQServer.java      |   96 -
 .../tests/util/InVMNodeManagerServer.java       |   10 +-
 .../activemq/tests/util/ServiceTestBase.java    |  138 +-
 .../tests/util/SingleServerTestBase.java        |    8 +-
 .../activemq/tests/util/UnitTestCase.java       |   68 +-
 .../activemq/tools/ActiveMQToolsLogger.java     |   42 +
 .../org/apache/activemq/tools/DataTool.java     |    8 +-
 .../activemq/tools/HornetQToolsLogger.java      |   42 -
 .../org/apache/activemq/tools/PrintData.java    |    6 +-
 .../org/apache/activemq/tools/PrintPages.java   |    4 +-
 .../apache/activemq/tools/TransferQueue.java    |    6 +-
 .../apache/activemq/tools/XmlDataConstants.java |    2 +-
 .../apache/activemq/tools/XmlDataExporter.java  |   30 +-
 .../apache/activemq/tools/XmlDataImporter.java  |  118 +-
 docs/user-manual/en/using-jms.xml               |    4 -
 .../core/example/EmbeddedRemoteExample.java     |    6 +-
 .../activemq/core/example/EmbeddedServer.java   |    6 +-
 .../activemq/core/example/EmbeddedExample.java  |   12 +-
 .../apache/activemq/core/example/PerfBase.java  |    4 +-
 .../core/example/TwitterConnectorExample.java   |    6 +-
 .../javaee/example/server/SendMessageBean.java  |    2 +-
 .../javaee/example/server2/MDBQueueB.java       |    2 +-
 .../javaee/example/server2/StatelessSender.java |    8 +-
 .../javaee/example/server/MDBQueue.java         |    6 +-
 .../server/MDBRemoteFailoverStaticExample.java  |    6 +-
 .../server/MDBRemoteFailoverExample.java        |    6 +-
 .../common/example/ActiveMQExample.java         |  234 ++
 .../activemq/common/example/HornetQExample.java |  234 --
 .../activemq/jms/example/AerogearExample.java   |    6 +-
 .../activemq/jms/example/AppletExample.java     |    6 +-
 .../jms/example/HttpStaticFileServer.java       |    4 +-
 .../ApplicationLayerFailoverExample.java        |    4 +-
 .../activemq/jms/example/BridgeExample.java     |    4 +-
 .../jms/example/QueueBrowserExample.java        |    4 +-
 .../jms/example/ClientKickoffExample.java       |   16 +-
 .../ClientSideFailoverListerExample.java        |    8 +-
 .../example/ClientSideLoadBalancingExample.java |   10 +-
 .../ClusteredDurableSubscriptionExample.java    |    4 +-
 .../jms/example/ClusteredGroupingExample.java   |    4 +-
 .../jms/example/ClusteredJgroupsExample.java    |    4 +-
 .../jms/example/ClusteredQueueExample.java      |    4 +-
 .../jms/example/ClusteredStandaloneExample.java |    4 +-
 .../example/StaticClusteredQueueExample.java    |    4 +-
 .../jms/example/ClusterStaticOnewayExample.java |    4 +-
 .../jms/example/ClusteredTopicExample.java      |    4 +-
 .../ColocatedFailoverScaleDownExample.java      |    4 +-
 .../jms/example/ColocatedFailoverExample.java   |    4 +-
 .../jms/example/ConsumerRateLimitExample.java   |    4 +-
 .../activemq/jms/example/DeadLetterExample.java |    6 +-
 .../jms/example/DelayedRedeliveryExample.java   |    6 +-
 .../activemq/jms/example/DivertExample.java     |    6 +-
 .../jms/example/DurableSubscriptionExample.java |    4 +-
 .../activemq/jms/example/EmbeddedExample.java   |    6 +-
 .../activemq/jms/example/EmbeddedExample.java   |   10 +-
 .../activemq/jms/example/ExpiryExample.java     |    6 +-
 .../jms/example/HAPolicyAutoBackupExample.java  |   10 +-
 .../jms/example/HttpTransportExample.java       |    4 +-
 .../InstantiateConnectionFactoryExample.java    |   10 +-
 .../jms/example/InterceptorExample.java         |    6 +-
 .../activemq/jms/example/JAASExample.java       |    6 +-
 .../jms/example/JMSAutoCloseableExample.java    |    4 +-
 .../activemq/jms/example/JMSBridgeExample.java  |    2 +-
 .../example/JMSCompletionListenerExample.java   |    6 +-
 .../activemq/jms/example/JMSContextExample.java |    4 +-
 .../jms/example/JMSSharedConsumerExample.java   |    4 +-
 .../apache/activemq/jms/example/JMXExample.java |    6 +-
 .../jms/example/LargeMessageExample.java        |    6 +-
 .../jms/example/LastValueQueueExample.java      |    4 +-
 .../example/ManagementNotificationExample.java  |    4 +-
 .../activemq/jms/example/ManagementExample.java |   10 +-
 .../jms/example/MessageCounterExample.java      |    4 +-
 .../jms/example/MessageGroupExample.java        |    4 +-
 .../jms/example/MessageGroup2Example.java       |    4 +-
 .../jms/example/MessagePriorityExample.java     |    4 +-
 .../MultipleFailoverFailbackExample.java        |    4 +-
 .../jms/example/MultipleFailoverExample.java    |    4 +-
 .../jms/example/NoConsumerBufferingExample.java |    6 +-
 .../example/NonTransactionFailoverExample.java  |    4 +-
 .../activemq/jms/example/OpenWireExample.java   |    4 +-
 .../activemq/jms/example/PagingExample.java     |    8 +-
 .../jms/example/PreacknowledgeExample.java      |   14 +-
 .../jms/example/ProducerRateLimitExample.java   |    4 +-
 .../activemq/jms/example/ProtonJExample.java    |    4 +-
 .../QueueMessageRedistributionExample.java      |    6 +-
 .../jms/example/QueueRequestorExample.java      |    4 +-
 .../jms/example/QueueSelectorExample.java       |    4 +-
 .../activemq/jms/example/QueueExample.java      |    4 +-
 .../activemq/jms/example/ReattachExample.java   |    8 +-
 .../ReplicatedFailbackStaticExample.java        |    4 +-
 .../jms/example/ReplicatedFailbackExample.java  |    4 +-
 .../ReplicatedMultipleFailoverExample.java      |    4 +-
 .../ReplicatedTransactionFailoverExample.java   |    4 +-
 .../jms/example/RequestReplyExample.java        |    4 +-
 .../rest/dup-send/src/main/java/PostOrder.java  |    2 +-
 .../jms-to-rest/src/main/java/JmsHelper.java    |   10 +-
 .../jms-to-rest/src/main/java/JmsReceive.java   |    6 +-
 .../rest/jms-to-rest/src/main/java/JmsSend.java |    6 +-
 .../jms/rest/push/src/main/java/JmsHelper.java  |   10 +-
 .../jms/rest/push/src/main/java/PostOrder.java  |    6 +-
 .../push/src/main/java/ReceiveShipping.java     |    6 +-
 .../activemq/jms/example/ScaleDownExample.java  |    4 +-
 .../jms/example/ScheduledMessageExample.java    |    4 +-
 .../activemq/jms/example/SecurityExample.java   |   14 +-
 .../example/SendAcknowledgementsExample.java    |   10 +-
 .../apache/activemq/jms/example/SSLExample.java |    4 +-
 .../jms/example/StaticSelectorJMSExample.java   |    4 +-
 .../jms/example/StaticSelectorExample.java      |    4 +-
 .../jms/example/StompWebSocketExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../jms/example/StopServerFailoverExample.java  |    4 +-
 .../jms/example/SymmetricClusterExample.java    |   18 +-
 .../jms/example/TemporaryQueueExample.java      |    4 +-
 .../jms/example/TopicHierarchyExample.java      |   14 +-
 .../jms/example/TopicSelectorExample1.java      |    4 +-
 .../jms/example/TopicSelectorExample2.java      |    4 +-
 .../activemq/jms/example/TopicExample.java      |    4 +-
 .../jms/example/TransactionFailoverExample.java |    4 +-
 .../jms/example/TransactionalExample.java       |    4 +-
 .../jms/example/XAHeuristicExample.java         |    6 +-
 .../activemq/jms/example/XAReceiveExample.java  |    4 +-
 .../activemq/jms/example/XASendExample.java     |    4 +-
 .../activemq/jms/example/XAwithJTAExample.java  |    6 +-
 .../aerogear/ActiveMQAeroGearBundle.java        |   46 +
 .../aerogear/ActiveMQAeroGearLogger.java        |   66 +
 .../aerogear/AeroGearConnectorService.java      |   26 +-
 .../aerogear/HornetQAeroGearBundle.java         |   46 -
 .../aerogear/HornetQAeroGearLogger.java         |   66 -
 .../integration/jboss/ActiveMQJBossBundle.java  |   31 +
 .../integration/jboss/ActiveMQJBossLogger.java  |   58 +
 .../integration/jboss/HornetQJBossBundle.java   |   31 -
 .../integration/jboss/HornetQJBossLogger.java   |   58 -
 .../jboss/security/JBossASSecurityManager.java  |   18 +-
 .../jboss/security/SecurityActions.java         |    6 +-
 .../activemq/spring/ActiveMQSpringBundle.java   |   31 +
 .../activemq/spring/ActiveMQSpringLogger.java   |   37 +
 .../activemq/spring/HornetQSpringBundle.java    |   31 -
 .../activemq/spring/HornetQSpringLogger.java    |   37 -
 .../twitter/impl/IncomingTweetsHandler.java     |   12 +-
 .../twitter/impl/OutgoingTweetsHandler.java     |   18 +-
 .../activemq/twitter/ActiveMQTwitterBundle.java |   31 +
 .../activemq/twitter/ActiveMQTwitterLogger.java |   54 +
 .../activemq/twitter/HornetQTwitterBundle.java  |   31 -
 .../activemq/twitter/HornetQTwitterLogger.java  |   54 -
 .../integration/vertx/ActiveMQVertxLogger.java  |   53 +
 .../integration/vertx/HornetQVertxLogger.java   |   53 -
 .../vertx/IncomingVertxEventHandler.java        |    8 +-
 .../vertx/OutgoingVertxEventHandler.java        |   14 +-
 pom.xml                                         |   22 +-
 .../tests/ActiveMQMessageHandlerTest.java       |  430 ++++
 .../activemq/byteman/tests/BMFailoverTest.java  |    8 +-
 .../BridgeServerLocatorConfigurationTest.java   |   14 +-
 .../byteman/tests/ClusteredGroupingTest.java    |    6 +-
 .../activemq/byteman/tests/GroupingTest.java    |    4 +-
 .../tests/HornetQMessageHandlerTest.java        |  430 ----
 .../tests/JMSBridgeReconnectionTest.java        |    8 +-
 .../activemq/byteman/tests/LatencyTest.java     |    4 +-
 .../byteman/tests/OrphanedConsumerTest.java     |    8 +-
 .../activemq/byteman/tests/PagingLeakTest.java  |    6 +-
 .../byteman/tests/ScaleDownFailoverTest.java    |   12 +-
 .../byteman/tests/StartStopDeadlockTest.java    |   10 +-
 .../byteman/tests/StompInternalStateTest.java   |    4 +-
 .../integration/DuplicateDetectionTest.java     |   76 +-
 .../tests/integration/InterceptorTest.java      |    4 +-
 .../tests/integration/String64KLimitTest.java   |    8 +-
 .../aerogear/AeroGearBasicServerTest.java       |   34 +-
 .../integration/client/AckBatchSizeTest.java    |    6 +-
 .../integration/client/AcknowledgeTest.java     |   16 +-
 .../integration/client/ActiveMQCrashTest.java   |  158 ++
 .../integration/client/AddressSettingsTest.java |   12 +-
 .../integration/client/AutogroupIdTest.java     |    8 +-
 .../integration/client/BlockingSendTest.java    |    4 +-
 .../integration/client/CommitRollbackTest.java  |   12 +-
 .../ConcurrentCreateDeleteProduceTest.java      |    4 +-
 .../integration/client/ConsumerCloseTest.java   |   18 +-
 .../integration/client/ConsumerFilterTest.java  |    4 +-
 .../client/ConsumerRoundRobinTest.java          |    4 +-
 .../integration/client/ConsumerStuckTest.java   |   12 +-
 .../tests/integration/client/ConsumerTest.java  |    4 +-
 .../client/ConsumerWindowSizeTest.java          |   32 +-
 .../integration/client/CoreClientTest.java      |   16 +-
 .../client/CreateQueueIdempotentTest.java       |    8 +-
 .../client/DeadLetterAddressTest.java           |   14 +-
 .../integration/client/DeliveryOrderTest.java   |    4 +-
 .../integration/client/DurableQueueTest.java    |    4 +-
 .../client/ExpireTestOnRestartTest.java         |    4 +-
 .../integration/client/ExpiryAddressTest.java   |   14 +-
 .../client/ExpiryLargeMessageTest.java          |    6 +-
 .../integration/client/FailureDeadlockTest.java |   28 +-
 .../integration/client/HangConsumerTest.java    |   28 +-
 .../integration/client/HeuristicXATest.java     |   30 +-
 .../integration/client/HornetQCrashTest.java    |  158 --
 .../InVMNonPersistentMessageBufferTest.java     |    4 +-
 .../client/IncompatibleVersionTest.java         |   24 +-
 .../client/InterruptedLargeMessageTest.java     |   28 +-
 .../client/JmsNettyNioStressTest.java           |   22 +-
 .../integration/client/JournalCrashTest.java    |    8 +-
 .../LargeMessageAvoidLargeMessagesTest.java     |   16 +-
 .../client/LargeMessageCompressTest.java        |   20 +-
 .../integration/client/LargeMessageTest.java    |   72 +-
 .../client/MessageConcurrencyTest.java          |    4 +-
 .../client/MessageConsumerRollbackTest.java     |    8 +-
 .../integration/client/MessageCounterTest.java  |    4 +-
 .../client/MessageDurabilityTest.java           |    8 +-
 .../client/MessageExpirationTest.java           |    4 +-
 .../MessageGroupingConnectionFactoryTest.java   |   14 +-
 .../integration/client/MessageGroupingTest.java |   22 +-
 .../integration/client/MessageHandlerTest.java  |    4 +-
 .../integration/client/MessagePriorityTest.java |   12 +-
 .../integration/client/MessageRateTest.java     |   10 +-
 .../client/MultipleThreadFilterOneTest.java     |    4 +-
 .../tests/integration/client/NIOvsOIOTest.java  |   10 +-
 .../integration/client/NettyConnectorTest.java  |    8 +-
 .../client/NewDeadLetterAddressTest.java        |   14 +-
 .../tests/integration/client/OrderTest.java     |    4 +-
 .../integration/client/PagingOrderTest.java     |   32 +-
 .../integration/client/PagingSyncTest.java      |    4 +-
 .../tests/integration/client/PagingTest.java    |   16 +-
 .../integration/client/ProducerCloseTest.java   |    6 +-
 .../client/ProducerFlowControlTest.java         |    4 +-
 .../tests/integration/client/ProducerTest.java  |    4 +-
 .../integration/client/QueueBrowserTest.java    |    4 +-
 .../client/ReceiveImmediateTest.java            |    4 +-
 .../tests/integration/client/ReceiveTest.java   |    4 +-
 .../client/RedeliveryConsumerTest.java          |    8 +-
 .../tests/integration/client/RequestorTest.java |   18 +-
 .../tests/integration/client/RoutingTest.java   |    4 +-
 .../client/SelfExpandingBufferTest.java         |    4 +-
 .../client/ServerLocatorConnectTest.java        |   18 +-
 .../client/ServerLocatorSerializationTest.java  |   16 +-
 .../client/SessionCloseOnGCTest.java            |    4 +-
 .../integration/client/SessionCloseTest.java    |   46 +-
 ...onClosedOnRemotingConnectionFailureTest.java |    4 +-
 .../client/SessionCreateAndDeleteQueueTest.java |    4 +-
 .../client/SessionCreateConsumerTest.java       |    4 +-
 .../client/SessionCreateProducerTest.java       |    4 +-
 .../integration/client/SessionFactoryTest.java  |  100 +-
 .../SessionSendAcknowledgementHandlerTest.java  |    4 +-
 .../client/SessionStopStartTest.java            |    4 +-
 .../tests/integration/client/SessionTest.java   |    4 +-
 .../client/SimpleSendMultipleQueuesTest.java    |    4 +-
 .../integration/client/SlowConsumerTest.java    |    4 +-
 .../integration/client/TemporaryQueueTest.java  |    6 +-
 .../client/TransactionDurabilityTest.java       |   10 +-
 .../client/TransactionalSendTest.java           |    6 +-
 .../integration/client/WildCardRoutingTest.java |   12 +-
 .../clientcrash/ClientCrashTest.java            |    6 +-
 .../integration/clientcrash/ClientExitTest.java |    6 +-
 .../integration/clientcrash/ClientTestBase.java |    8 +-
 .../integration/clientcrash/CrashClient.java    |    8 +-
 .../integration/clientcrash/CrashClient2.java   |    4 +-
 .../integration/clientcrash/GracefulClient.java |    8 +-
 .../cluster/ClusterControllerTest.java          |   16 +-
 .../cluster/bridge/BridgeFailoverTest.java      |    8 +-
 .../cluster/bridge/BridgeReconnectTest.java     |   48 +-
 .../cluster/bridge/BridgeStartTest.java         |   28 +-
 .../integration/cluster/bridge/BridgeTest.java  |   44 +-
 .../cluster/bridge/BridgeTestBase.java          |   40 +-
 .../BridgeWithDiscoveryGroupStartTest.java      |   10 +-
 .../cluster/distribution/ClusterTestBase.java   |   96 +-
 .../distribution/OnewayTwoNodeClusterTest.java  |    4 +-
 .../AutomaticColocatedQuorumVoteTest.java       |   64 +-
 .../cluster/failover/BackupSyncPagingTest.java  |    4 +-
 .../ClusterWithBackupFailoverTestBase.java      |    8 +-
 .../cluster/failover/FailBackAutoTest.java      |    4 +-
 .../cluster/failover/FailBackManualTest.java    |    4 +-
 .../cluster/failover/FailoverListenerTest.java  |    4 +-
 .../cluster/failover/FailoverTest.java          |    4 +-
 .../cluster/failover/FailoverTestBase.java      |   14 +-
 .../failover/LiveToLiveFailoverTest.java        |    6 +-
 .../MultipleBackupsFailoverTestBase.java        |    8 +-
 ...ultipleLivesMultipleBackupsFailoverTest.java |    6 +-
 .../MultipleServerFailoverTestBase.java         |   28 +-
 .../cluster/failover/NettyFailoverTest.java     |    4 +-
 .../failover/NettyReplicatedFailoverTest.java   |    4 +-
 .../cluster/failover/PagingFailoverTest.java    |    8 +-
 .../failover/ReplicatedPagedFailoverTest.java   |    4 +-
 .../cluster/failover/SecurityFailoverTest.java  |    8 +-
 .../SingleLiveMultipleBackupsFailoverTest.java  |    6 +-
 .../remote/FailoverWithSharedStoreTest.java     |    4 +-
 .../ha/HAAutomaticBackupSharedStore.java        |    4 +-
 .../MultiThreadRandomReattachTestBase.java      |   16 +-
 .../cluster/reattach/OrderReattachTest.java     |    8 +-
 .../cluster/reattach/RandomReattachTest.java    |   44 +-
 .../cluster/reattach/ReattachTest.java          |   24 +-
 .../cluster/topology/HAClientTopologyTest.java  |    4 +-
 .../HAClientTopologyWithDiscoveryTest.java      |   10 +-
 .../cluster/topology/IsolatedTopologyTest.java  |   12 +-
 .../cluster/topology/NonHATopologyTest.java     |    4 +-
 .../topology/TopologyClusterTestBase.java       |    6 +-
 .../cluster/util/BackupSyncDelay.java           |    8 +-
 .../cluster/util/MultiServerTestBase.java       |   42 +-
 .../cluster/util/SameProcessActiveMQServer.java |  111 +
 .../cluster/util/SameProcessHornetQServer.java  |  111 -
 .../cluster/util/TestableServer.java            |    8 +-
 .../core/deployers/impl/QueueDeployerTest.java  |    6 +-
 .../integration/discovery/DiscoveryTest.java    |    6 +-
 .../tests/integration/divert/DivertTest.java    |   26 +-
 .../divert/PersistentDivertTest.java            |   12 +-
 .../integration/embedded/ValidateAIOTest.java   |    6 +-
 .../http/CoreClientOverHttpTest.java            |   18 +-
 .../jms/ActiveMQConnectionFactoryTest.java      |  746 ++++++
 .../tests/integration/jms/FloodServerTest.java  |   52 +-
 .../jms/HornetQConnectionFactoryTest.java       |  746 ------
 .../tests/integration/jms/JmsProducerTest.java  |    6 +-
 .../ManualReconnectionToSingleServerTest.java   |    4 +-
 .../integration/jms/bridge/BridgeTestBase.java  |   66 +-
 .../jms/bridge/ClusteredBridgeTestBase.java     |   26 +-
 .../jms/bridge/JMSBridgeReconnectionTest.java   |   22 +-
 .../integration/jms/bridge/JMSBridgeTest.java   |   16 +-
 .../jms/client/AutoGroupingTest.java            |   12 +-
 .../integration/jms/client/CreateQueueTest.java |   10 +-
 .../integration/jms/client/GroupIDTest.java     |    6 +-
 .../integration/jms/client/GroupingTest.java    |   18 +-
 .../integration/jms/client/MessageTest.java     |   14 +-
 .../integration/jms/client/PreACKJMSTest.java   |   48 +-
 .../jms/client/ReSendMessageTest.java           |   54 +-
 .../jms/client/RemoteConnectionStressTest.java  |   14 +-
 ...onClosedOnRemotingConnectionFailureTest.java |   60 +-
 .../integration/jms/client/SessionTest.java     |    6 +-
 .../integration/jms/client/TextMessageTest.java |   48 +-
 .../jms/client/TopicCleanupTest.java            |    4 +-
 .../jms/cluster/BindingsClusterTest.java        |   44 +-
 .../jms/cluster/JMSFailoverListenerTest.java    |   50 +-
 .../jms/cluster/JMSFailoverTest.java            |   56 +-
 .../jms/cluster/JMSReconnectTest.java           |   40 +-
 .../jms/cluster/LargeMessageOverBridgeTest.java |    6 +-
 .../jms/cluster/MultipleThreadsOpeningTest.java |    6 +-
 .../jms/cluster/ReplicatedJMSFailoverTest.java  |    6 +-
 .../CloseConnectionFactoryOnGCest.java          |    8 +-
 .../jms/connection/CloseConnectionOnGCTest.java |    8 +-
 .../CloseDestroyedConnectionTest.java           |   28 +-
 .../connection/ConcurrentSessionCloseTest.java  |   10 +-
 .../ConnectionFactorySerializationTest.java     |   10 +-
 ...tionFactoryWithJGroupsSerializationTest.java |   16 +-
 .../jms/connection/ExceptionListenerTest.java   |   30 +-
 .../jms/connection/InvalidConnectorTest.java    |   54 +-
 .../integration/jms/consumer/ConsumerTest.java  |   76 +-
 .../jms/divert/DivertAndACKClientTest.java      |   48 +-
 .../integration/jms/jms2client/BodyTest.java    |    4 +-
 .../jms/jms2client/NonExistentQueueTest.java    |    8 +-
 .../jms/server/JMSServerDeployerTest.java       |   16 +-
 .../jms/server/JMSServerStartStopTest.java      |   34 +-
 .../jms/server/config/JMSConfigurationTest.java |    6 +-
 .../config/JMSServerConfigParserTest.java       |    2 +-
 .../ConnectionFactoryControlTest.java           |   16 +-
 .../server/management/JMSQueueControlTest.java  |   54 +-
 .../management/JMSQueueControlUsingJMSTest.java |   10 +-
 .../management/JMSServerControl2Test.java       |  100 +-
 .../management/JMSServerControlRestartTest.java |   12 +-
 .../server/management/JMSServerControlTest.java |   92 +-
 .../JMSServerControlUsingJMSTest.java           |   22 +-
 .../jms/server/management/JMSUtil.java          |   36 +-
 .../jms/server/management/TopicControlTest.java |   40 +-
 .../management/TopicControlUsingJMSTest.java    |   40 +-
 .../journal/JournalPerfTuneTest.java            |    4 +-
 .../integration/journal/OldFormatTest.java      |    2 +-
 .../largemessage/LargeMessageTestBase.java      |    4 +-
 .../largemessage/ServerLargeMessageTest.java    |   14 +-
 .../management/AcceptorControlTest.java         |    8 +-
 .../AcceptorControlUsingCoreTest.java           |    4 +-
 .../management/ActiveMQServerControlTest.java   | 1099 ++++++++
 .../ActiveMQServerControlUsingCoreTest.java     |  716 ++++++
 .../management/AddressControlTest.java          |   12 +-
 .../management/AddressControlUsingCoreTest.java |    6 +-
 .../management/BridgeControlTest.java           |   12 +-
 .../management/BridgeControlUsingCoreTest.java  |   18 +-
 .../management/BroadcastGroupControlTest.java   |   10 +-
 .../ClusterConnectionControl2Test.java          |   12 +-
 .../ClusterConnectionControlTest.java           |   12 +-
 .../ClusterConnectionControlUsingCoreTest.java  |    4 +-
 .../management/DivertControlTest.java           |    8 +-
 .../management/DivertControlUsingCoreTest.java  |    4 +-
 .../management/HornetQServerControlTest.java    | 1099 --------
 .../HornetQServerControlUsingCoreTest.java      |  716 ------
 .../integration/management/JMXDomainTest.java   |   34 +-
 .../management/ManagementControlHelper.java     |    8 +-
 .../management/ManagementServiceImplTest.java   |   14 +-
 .../ManagementWithPagingServerTest.java         |    8 +-
 .../management/ManagementWithStompTest.java     |    8 +-
 .../management/NotificationTest.java            |   12 +-
 .../management/QueueControlTest.java            |   28 +-
 .../management/SecurityManagementTestBase.java  |   14 +-
 ...tyManagementWithConfiguredAdminUserTest.java |   12 +-
 ...yManagementWithDefaultConfigurationTest.java |    8 +-
 ...ManagementWithModifiedConfigurationTest.java |    8 +-
 .../management/SecurityNotificationTest.java    |   22 +-
 .../integration/openwire/OpenWireTestBase.java  |    4 +-
 .../paging/PageCountSyncOnNonTXTest.java        |    4 +-
 .../integration/paging/PageCountSyncServer.java |    4 +-
 .../integration/paging/PagingCounterTest.java   |   18 +-
 .../integration/paging/PagingReceiveTest.java   |   12 +-
 .../integration/paging/PagingSendTest.java      |   10 +-
 .../PagingWithFailoverAndCountersTest.java      |    6 +-
 .../paging/PagingWithFailoverServer.java        |    8 +-
 .../paging/SpawnedServerSupport.java            |   16 +-
 .../persistence/DeleteQueueRestartTest.java     |    8 +-
 .../persistence/ExportFormatTest.java           |   22 +-
 .../persistence/StorageManagerTestBase.java     |    2 +-
 .../persistence/XmlImportExportTest.java        |   36 +-
 .../tests/integration/proton/ProtonTest.java    |   18 +-
 .../integration/ra/ActiveMQActivationTest.java  |   67 +
 .../integration/ra/ActiveMQClusteredTest.java   |  111 +
 .../ra/ActiveMQMessageHandlerSecurityTest.java  |   93 +
 .../ra/ActiveMQMessageHandlerTest.java          |  908 +++++++
 .../ra/ActiveMQMessageHandlerXATest.java        |  303 +++
 .../ra/ActiveMQRAClusteredTestBase.java         |   99 +
 .../integration/ra/ActiveMQRATestBase.java      |  235 ++
 .../integration/ra/HornetQActivationTest.java   |   67 -
 .../integration/ra/HornetQClusteredTest.java    |  111 -
 .../ra/HornetQMessageHandlerSecurityTest.java   |   93 -
 .../ra/HornetQMessageHandlerTest.java           |  908 -------
 .../ra/HornetQMessageHandlerXATest.java         |  303 ---
 .../ra/HornetQRAClusteredTestBase.java          |   99 -
 .../tests/integration/ra/HornetQRATestBase.java |  235 --
 .../tests/integration/ra/JMSContextTest.java    |   24 +-
 .../integration/ra/OutgoingConnectionTest.java  |   82 +-
 .../integration/ra/ResourceAdapterTest.java     |  148 +-
 .../integration/remoting/BatchDelayTest.java    |    8 +-
 .../remoting/DestroyConsumerTest.java           |    2 +-
 .../integration/remoting/DirectDeliverTest.java |    8 +-
 .../remoting/NetworkAddressTestBase.java        |    8 +-
 .../tests/integration/remoting/PingTest.java    |   20 +-
 .../integration/remoting/ReconnectTest.java     |    6 +-
 .../remoting/SynchronousCloseTest.java          |   12 +-
 .../replication/ReplicationOrderTest.java       |    6 +-
 .../replication/ReplicationTest.java            |   16 +-
 .../scheduling/DelayedMessageTest.java          |    8 +-
 .../MultipliedDelayedMessageTest.java           |    8 +-
 .../scheduling/ScheduledMessageTest.java        |   10 +-
 .../security/NettySecurityClientTest.java       |    4 +-
 .../integration/security/SecurityTest.java      |  146 +-
 .../integration/security/SimpleClient.java      |    8 +-
 .../server/AddressFullLoggingTest.java          |    8 +-
 .../integration/server/ExpiryRunnerTest.java    |   12 +-
 .../integration/server/FileLockTimeoutTest.java |    8 +-
 .../integration/server/LVQRecoveryTest.java     |   10 +-
 .../tests/integration/server/LVQTest.java       |   12 +-
 .../integration/server/PredefinedQueueTest.java |   24 +-
 .../integration/server/ScaleDown3NodeTest.java  |   10 +-
 .../tests/integration/server/ScaleDownTest.java |   10 +-
 .../server/SuppliedThreadPoolTest.java          |   10 +-
 .../spring/SpringIntegrationTest.java           |    4 +-
 .../ssl/CoreClientOverOneWaySSLTest.java        |   50 +-
 .../ssl/CoreClientOverTwoWaySSLTest.java        |   22 +-
 .../tests/integration/stomp/ExtraStompTest.java |   40 +-
 .../stomp/StompConnectionCleanupTest.java       |    6 +-
 .../tests/integration/stomp/StompTestBase.java  |   18 +-
 .../integration/stomp/StompWebSocketTest.java   |    8 +-
 .../integration/stomp/v11/ExtraStompTest.java   |    4 +-
 .../integration/stomp/v11/StompV11Test.java     |    2 +-
 .../integration/stomp/v11/StompV11TestBase.java |   12 +-
 .../integration/stomp/v12/StompV12Test.java     |    2 +-
 .../netty/ActiveMQFrameDecoder2Test.java        |  130 +
 .../netty/HornetQFrameDecoder2Test.java         |  130 -
 .../NettyConnectorWithHTTPUpgradeTest.java      |   30 +-
 .../tests/integration/twitter/TwitterTest.java  |   20 +-
 .../vertx/ActiveMQVertxUnitTest.java            |  866 +++++++
 .../integration/vertx/HornetQVertxUnitTest.java |  866 -------
 .../integration/xa/BasicXaRecoveryTest.java     |   12 +-
 .../tests/integration/xa/BasicXaTest.java       |   42 +-
 .../tests/integration/xa/XaTimeoutTest.java     |   14 +-
 .../largemessage/LargeMessageTestBase.java      |    4 +-
 .../tests/util/JMSClusteredTestBase.java        |   36 +-
 .../apache/activemq/tests/util/JMSTestBase.java |    8 +-
 .../tests/util/ReplicatedBackupUtils.java       |    4 +-
 .../activemq-jms-for-JMSServerDeployerTest.xml  |   53 +
 .../activemq-jms-for-JMSServerDeployerTest2.xml |   53 +
 .../hornetq-jms-for-JMSServerDeployerTest.xml   |   53 -
 .../hornetq-jms-for-JMSServerDeployerTest2.xml  |   53 -
 .../test/resources/spring-activemq-config.xml   |   34 +
 .../src/test/resources/spring-activemq-jms.xml  |   19 +
 .../test/resources/spring-hornetq-config.xml    |   34 -
 .../src/test/resources/spring-hornetq-jms.xml   |   19 -
 .../activemq/jms/tests/AcknowledgementTest.java |   24 +-
 .../jms/tests/ActiveMQServerTestCase.java       |  570 +++++
 .../apache/activemq/jms/tests/BrowserTest.java  |    4 +-
 .../jms/tests/CTSMiscellaneousTest.java         |   60 +-
 .../jms/tests/ConnectionClosedTest.java         |   12 +-
 .../jms/tests/ConnectionFactoryTest.java        |   46 +-
 .../activemq/jms/tests/ConnectionTest.java      |    2 +-
 .../jms/tests/DurableSubscriptionTest.java      |   42 +-
 .../jms/tests/HornetQServerTestCase.java        |  570 -----
 .../apache/activemq/jms/tests/JMSTestCase.java  |  172 +-
 .../activemq/jms/tests/JmsTestLogger.java       |    2 +-
 .../activemq/jms/tests/MessageConsumerTest.java |  130 +-
 .../activemq/jms/tests/MessageProducerTest.java |   50 +-
 .../jms/tests/NonDurableSubscriberTest.java     |    2 +-
 .../activemq/jms/tests/PersistenceTest.java     |   28 +-
 .../apache/activemq/jms/tests/QueueTest.java    |    2 +-
 .../activemq/jms/tests/ReferenceableTest.java   |   30 +-
 .../apache/activemq/jms/tests/SecurityTest.java |    8 +-
 .../apache/activemq/jms/tests/SessionTest.java  |    6 +-
 .../apache/activemq/jms/tests/TopicTest.java    |   16 +-
 .../jms/tests/TransactedSessionTest.java        |   28 +-
 .../activemq/jms/tests/XARecoveryTest.java      |   60 +-
 .../org/apache/activemq/jms/tests/XATest.java   |  178 +-
 .../tests/message/JMSExpirationHeaderTest.java  |    4 +-
 .../tests/message/JMSPriorityHeaderTest.java    |    4 +-
 .../tests/message/JMSXDeliveryCountTest.java    |   12 +-
 .../jms/tests/message/MessageBodyTestCase.java  |    4 +-
 .../jms/tests/message/MessageHeaderTest.java    |   44 +-
 .../tests/message/MessageHeaderTestBase.java    |   40 +-
 .../message/MessagePropertyConversionTest.java  |    4 +-
 .../jms/tests/message/MessageTestBase.java      |    8 +-
 .../message/ObjectMessageDeliveryTest.java      |   14 +-
 .../foreign/ForeignBytesMessageTest.java        |    4 +-
 .../message/foreign/ForeignMessageTest.java     |    6 +-
 .../jms/tests/selector/SelectorTest.java        |   28 +-
 .../tests/stress/ConcurrentCloseStressTest.java |    4 +-
 .../tests/stress/CorruptMessageStressTest.java  |    4 +-
 .../jms/tests/stress/JMSStressTestBase.java     |    4 +-
 .../tests/stress/ManyConnectionsStressTest.java |    4 +-
 .../jms/tests/stress/OpenCloseStressTest.java   |    4 +-
 .../jms/tests/stress/RelayStressTest.java       |    4 +-
 .../tests/stress/SeveralClientsStressTest.java  |    4 +-
 .../jms/tests/tools/ServerManagement.java       |    2 +-
 .../jms/tests/tools/container/Constants.java    |    2 +-
 .../tests/tools/container/LocalTestServer.java  |   88 +-
 .../jms/tests/tools/container/Server.java       |    6 +-
 .../activemq/jms/tests/util/JNDIUtilTest.java   |    4 +-
 .../org/apache/activemq/jms/ActiveMQQAdmin.java |  336 +++
 .../org/apache/activemq/jms/HornetQAdmin.java   |  336 ---
 .../apache/activemq/jms/SpawnedJMSServer.java   |    6 +-
 .../jms/conform/connection/ConnectionTest.java  |    2 +-
 .../src/test/resources/provider.properties      |    2 +-
 .../journal/JournalImplTestUnit.java            |    6 +-
 .../paging/MeasurePagingMultiThreadTest.java    |    4 +-
 .../tests/soak/client/ClientAbstract.java       |    2 +-
 .../soak/client/ClientNonDivertedSoakTest.java  |    4 +-
 .../tests/soak/client/ClientSoakTest.java       |    4 +-
 .../soak/client/SimpleSendReceiveSoakTest.java  |    4 +-
 .../tests/stress/client/SendStressTest.java     |    4 +-
 .../stress/journal/AddAndRemoveStressTest.java  |   22 +-
 .../stress/journal/CompactingStressTest.java    |    4 +-
 .../JournalCleanupCompactStressTest.java        |    8 +-
 .../journal/JournalRestartStressTest.java       |    4 +-
 .../stress/journal/LargeJournalStressTest.java  |    4 +-
 .../journal/MultiThreadConsumerStressTest.java  |    4 +-
 .../NIOMultiThreadCompactorStressTest.java      |    8 +-
 .../journal/XmlImportExportStressTest.java      |    4 +-
 .../paging/MultipleConsumersPageStressTest.java |    4 +-
 .../stress/paging/PageCursorStressTest.java     |    4 +-
 .../tests/stress/paging/PageStressTest.java     |   10 +-
 .../tests/stress/remote/PingStressTest.java     |   10 +-
 .../tests/stress/stomp/StompStressTest.java     |   10 +-
 .../jms/bridge/impl/JMSBridgeImplTest.java      |   48 +-
 .../activemq/tests/unit/UnitTestLogger.java     |    2 +-
 .../unit/core/asyncio/AsynchronousFileTest.java |    4 +-
 .../MultiThreadAsynchronousFileTest.java        |    4 +-
 .../client/impl/LargeMessageBufferTest.java     |   12 +-
 .../impl/ConfigurationValidationTest.java       |    2 +-
 .../impl/AddressSettingsDeployerTest.java       |    2 +-
 .../impl/BasicUserCredentialsDeployerTest.java  |   12 +-
 .../deployers/impl/SecurityDeployerTest.java    |    2 +-
 .../journal/impl/AlignedJournalImplTest.java    |   12 +-
 .../core/journal/impl/JournalImplTestBase.java  |    6 +-
 .../core/journal/impl/JournalImplTestUnit.java  |    4 +-
 .../impl/SequentialFileFactoryTestBase.java     |   34 +-
 .../impl/fakes/FakeSequentialFileFactory.java   |    4 +-
 .../unit/core/postoffice/impl/FakeQueue.java    |    4 +-
 .../core/remoting/ActiveMQBufferTestBase.java   |  357 +++
 .../core/remoting/HornetQBufferTestBase.java    |  357 ---
 .../impl/netty/ChannelBufferWrapper2Test.java   |    4 +-
 .../impl/netty/NettyAcceptorFactoryTest.java    |    4 +-
 .../remoting/impl/netty/NettyAcceptorTest.java  |    6 +-
 .../impl/netty/NettyConnectionTest.java         |    4 +-
 .../remoting/impl/netty/NettyConnectorTest.java |   24 +-
 .../impl/ActiveMQSecurityManagerImplTest.java   |  181 ++
 .../impl/HornetQSecurityManagerImplTest.java    |  181 --
 .../unit/core/server/impl/QueueImplTest.java    |    6 +-
 .../tests/unit/jms/ActiveMQDestinationTest.java |  102 +
 .../tests/unit/jms/HornetQDestinationTest.java  |  102 -
 .../unit/jms/client/ActiveMQMapMessageTest.java |  795 ++++++
 .../jms/client/ActiveMQStreamMessageTest.java   | 1059 ++++++++
 .../unit/jms/client/HornetQMapMessageTest.java  |  795 ------
 .../jms/client/HornetQStreamMessageTest.java    | 1059 --------
 .../unit/jms/client/JMSExceptionHelperTest.java |    2 +-
 .../unit/jms/client/SelectorTranslatorTest.java |   88 +-
 .../tests/unit/jms/misc/ManifestTest.java       |   14 +-
 .../ConnectionFactoryObjectFactoryTest.java     |    6 +-
 .../DestinationObjectFactoryTest.java           |    8 +-
 .../ra/ActiveMQResourceAdapterConfigTest.java   |  489 ++++
 .../ra/ConnectionFactoryPropertiesTest.java     |   14 +-
 .../ra/HornetQResourceAdapterConfigTest.java    |  489 ----
 .../tests/unit/ra/ResourceAdapterTest.java      |  240 +-
 .../util/ActiveMQBufferInputStreamTest.java     |   69 +
 .../unit/util/HornetQBufferInputStreamTest.java |   69 -
 .../tests/unit/util/VersionLoaderTest.java      |   12 +-
 .../tests/unit/xa/XAResourceWrapperTest.java    |    8 +-
 .../activemq/tests/util/CreateMessage.java      |   10 +-
 1257 files changed, 60313 insertions(+), 60315 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
index 8751f77..36f9d08 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
@@ -17,18 +17,18 @@ import io.airlift.command.Command;
 
 import org.apache.activemq.cli.ActiveMQ;
 import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.dto.BrokerDTO;
 import org.apache.activemq.factory.BrokerFactory;
 import org.apache.activemq.factory.CoreFactory;
 import org.apache.activemq.factory.JmsFactory;
 import org.apache.activemq.factory.SecurityManagerFactory;
-import org.apache.activemq.integration.bootstrap.HornetQBootstrapLogger;
+import org.apache.activemq.integration.bootstrap.ActiveMQBootstrapLogger;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.config.JMSConfiguration;
 import org.apache.activemq.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.jms.server.impl.StandaloneNamingServer;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 
 import javax.management.MBeanServer;
 
@@ -67,11 +67,11 @@ public class Run implements Action
 
       JMSConfiguration jms = JmsFactory.create(broker.jms);
 
-      HornetQSecurityManager security = SecurityManagerFactory.create(broker.security);
+      ActiveMQSecurityManager security = SecurityManagerFactory.create(broker.security);
 
       MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
 
-      HornetQServerImpl server = new HornetQServerImpl(core, mBeanServer, security);
+      ActiveMQServerImpl server = new ActiveMQServerImpl(core, mBeanServer, security);
 
       namingServer = new StandaloneNamingServer(server);
 
@@ -85,7 +85,7 @@ public class Run implements Action
 
       namingServer.start();
 
-      HornetQBootstrapLogger.LOGGER.startedNamingService(broker.naming.bindAddress, broker.naming.port, broker.naming.rmiBindAddress, broker.naming.rmiPort);
+      ActiveMQBootstrapLogger.LOGGER.startedNamingService(broker.naming.bindAddress, broker.naming.port, broker.naming.rmiBindAddress, broker.naming.rmiPort);
 
       if (jms != null)
       {
@@ -96,7 +96,7 @@ public class Run implements Action
          jmsServerManager = new JMSServerManagerImpl(server);
       }
 
-      HornetQBootstrapLogger.LOGGER.serverStarting();
+      ActiveMQBootstrapLogger.LOGGER.serverStarting();
 
       jmsServerManager.start();
 
@@ -114,7 +114,7 @@ public class Run implements Action
       {
          if (!file.delete())
          {
-            HornetQBootstrapLogger.LOGGER.errorDeletingFile(file.getAbsolutePath());
+            ActiveMQBootstrapLogger.LOGGER.errorDeletingFile(file.getAbsolutePath());
          }
       }
       final Timer timer = new Timer("ActiveMQ Server Shutdown Timer", true);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/factory/SecurityManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/SecurityManagerFactory.java b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/SecurityManagerFactory.java
index 1432460..23bfcb9 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/SecurityManagerFactory.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/SecurityManagerFactory.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.factory;
 
 import org.apache.activemq.dto.SecurityDTO;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.utils.FactoryFinder;
 
 import javax.xml.bind.annotation.XmlRootElement;
@@ -21,12 +21,12 @@ import javax.xml.bind.annotation.XmlRootElement;
 public class SecurityManagerFactory
 {
 
-   public static HornetQSecurityManager create(SecurityDTO config) throws Exception
+   public static ActiveMQSecurityManager create(SecurityDTO config) throws Exception
    {
       if (config != null)
       {
          FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/security/");
-         HornetQSecurityManager manager = (HornetQSecurityManager)finder.newInstance(config.getClass().getAnnotation(XmlRootElement.class).name());
+         ActiveMQSecurityManager manager = (ActiveMQSecurityManager)finder.newInstance(config.getClass().getAnnotation(XmlRootElement.class).name());
          return manager;
       }
       else

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapBundle.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapBundle.java b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapBundle.java
new file mode 100644
index 0000000..55667e2
--- /dev/null
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapBundle.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.integration.bootstrap;
+
+
+import org.jboss.logging.annotations.MessageBundle;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 10
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
+ *
+ * so 109000 to 109999
+ */
+@MessageBundle(projectCode = "AMQ")
+public class ActiveMQBootstrapBundle
+{
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapLogger.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapLogger.java b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapLogger.java
new file mode 100644
index 0000000..810ffaa
--- /dev/null
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/ActiveMQBootstrapLogger.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.integration.bootstrap;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/15/12
+ *
+ * Logger Code 10
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 101000 to 101999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQBootstrapLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQBootstrapLogger LOGGER = Logger.getMessageLogger(ActiveMQBootstrapLogger.class, ActiveMQBootstrapLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 101000, value = "Starting ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
+   void serverStarting();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 101001, value = "Stopping ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
+   void serverStopping();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 101002, value = "Starting Naming server on {0}:{1,number,#} (rmi {2}:{3,number,#})", format = Message.Format.MESSAGE_FORMAT)
+   void startedNamingService(String bindAddress, int port, String rmiBindAddress, int rmiPort);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 102000, value = "Error during undeployment: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorDuringUndeployment(@Cause Throwable t, String name);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 104000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingFile(String name);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 104001, value = "Failed to start server", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingServer(@Cause Exception e);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapBundle.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapBundle.java b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapBundle.java
deleted file mode 100644
index 8ccdfff..0000000
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapBundle.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.integration.bootstrap;
-
-
-import org.jboss.logging.annotations.MessageBundle;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 10
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
- *
- * so 109000 to 109999
- */
-@MessageBundle(projectCode = "HQ")
-public class HornetQBootstrapBundle
-{
-}


[42/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSClient.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSClient.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSClient.java
deleted file mode 100644
index 974137c..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSClient.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.api.jms;
-
-import javax.jms.Queue;
-import javax.jms.Topic;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQJMSConnectionFactory;
-import org.apache.activemq.jms.client.HornetQQueueConnectionFactory;
-import org.apache.activemq.jms.client.HornetQTopicConnectionFactory;
-import org.apache.activemq.jms.client.HornetQXAConnectionFactory;
-import org.apache.activemq.jms.client.HornetQXAQueueConnectionFactory;
-import org.apache.activemq.jms.client.HornetQXATopicConnectionFactory;
-
-/**
- * A utility class for creating HornetQ client-side JMS managed resources.
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQJMSClient
-{
-
-   /**
-    * Creates a HornetQConnectionFactory that receives cluster topology updates from the cluster as
-    * servers leave or join and new backups are appointed or removed.
-    * <p>
-    * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP
-    * broadcasts which contain connection information for members of the cluster. The broadcasted
-    * connection information is simply used to make an initial connection to the cluster, once that
-    * connection is made, up to date cluster topology information is downloaded and automatically
-    * updated whenever the cluster topology changes. If the topology includes backup servers that
-    * information is also propagated to the client so that it can know which server to failover onto
-    * in case of live server failure.
-    * @param discoveryAddress The UDP group address to listen for updates
-    * @param discoveryPort the UDP port to listen for updates
-    * @return the HornetQConnectionFactory
-    */
-   public static HornetQConnectionFactory createConnectionFactoryWithHA(final DiscoveryGroupConfiguration groupConfiguration, JMSFactoryType jmsFactoryType)
-   {
-      HornetQConnectionFactory factory = null;
-      if (jmsFactoryType.equals(JMSFactoryType.CF))
-      {
-         factory = new HornetQJMSConnectionFactory(true, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
-      {
-         factory = new HornetQQueueConnectionFactory(true, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
-      {
-         factory = new HornetQTopicConnectionFactory(true, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
-      {
-         factory = new HornetQXAConnectionFactory(true, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
-      {
-         factory = new HornetQXAQueueConnectionFactory(true, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
-      {
-         factory = new HornetQXATopicConnectionFactory(true, groupConfiguration);
-      }
-
-      return factory;
-   }
-
-   /**
-    * Create a HornetQConnectionFactory which creates session factories from a set of live servers, no HA backup information is propagated to the client
-    *
-    * The UDP address and port are used to listen for live servers in the cluster
-    *
-    * @param discoveryAddress The UDP group address to listen for updates
-    * @param discoveryPort the UDP port to listen for updates
-    * @return the HornetQConnectionFactory
-    */
-   public static HornetQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration, JMSFactoryType jmsFactoryType)
-   {
-      HornetQConnectionFactory factory = null;
-      if (jmsFactoryType.equals(JMSFactoryType.CF))
-      {
-         factory = new HornetQJMSConnectionFactory(false, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
-      {
-         factory = new HornetQQueueConnectionFactory(false, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
-      {
-         factory = new HornetQTopicConnectionFactory(false, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
-      {
-         factory = new HornetQXAConnectionFactory(false, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
-      {
-         factory = new HornetQXAQueueConnectionFactory(false, groupConfiguration);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
-      {
-         factory = new HornetQXATopicConnectionFactory(false, groupConfiguration);
-      }
-
-      return factory;
-   }
-
-   /**
-    * Create a HornetQConnectionFactory which will receive cluster topology updates from the cluster
-    * as servers leave or join and new backups are appointed or removed.
-    * <p>
-    * The initial list of servers supplied in this method is simply to make an initial connection to
-    * the cluster, once that connection is made, up to date cluster topology information is
-    * downloaded and automatically updated whenever the cluster topology changes. If the topology
-    * includes backup servers that information is also propagated to the client so that it can know
-    * which server to failover onto in case of live server failure.
-    * @param initialServers The initial set of servers used to make a connection to the cluster.
-    *           Each one is tried in turn until a successful connection is made. Once a connection
-    *           is made, the cluster topology is downloaded and the rest of the list is ignored.
-    * @return the HornetQConnectionFactory
-    */
-   public static HornetQConnectionFactory createConnectionFactoryWithHA(JMSFactoryType jmsFactoryType, final TransportConfiguration... initialServers)
-   {
-      HornetQConnectionFactory factory = null;
-      if (jmsFactoryType.equals(JMSFactoryType.CF))
-      {
-         factory = new HornetQJMSConnectionFactory(true, initialServers);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
-      {
-         factory = new HornetQQueueConnectionFactory(true, initialServers);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
-      {
-         factory = new HornetQTopicConnectionFactory(true, initialServers);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
-      {
-         factory = new HornetQXAConnectionFactory(true, initialServers);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
-      {
-         factory = new HornetQXAQueueConnectionFactory(true, initialServers);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
-      {
-         factory = new HornetQXATopicConnectionFactory(true, initialServers);
-      }
-
-      return factory;
-   }
-
-   /**
-    * Create a HornetQConnectionFactory which creates session factories using a static list of
-    * transportConfigurations.
-    * <p>
-    * The HornetQConnectionFactory is not updated automatically as the cluster topology changes, and
-    * no HA backup information is propagated to the client
-    * @param transportConfigurations
-    * @return the HornetQConnectionFactory
-    */
-   public static HornetQConnectionFactory createConnectionFactoryWithoutHA(JMSFactoryType jmsFactoryType, final TransportConfiguration... transportConfigurations)
-   {
-      HornetQConnectionFactory factory = null;
-      if (jmsFactoryType.equals(JMSFactoryType.CF))
-      {
-         factory = new HornetQJMSConnectionFactory(false, transportConfigurations);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF))
-      {
-         factory = new HornetQQueueConnectionFactory(false, transportConfigurations);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF))
-      {
-         factory = new HornetQTopicConnectionFactory(false, transportConfigurations);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.XA_CF))
-      {
-         factory = new HornetQXAConnectionFactory(false, transportConfigurations);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF))
-      {
-         factory = new HornetQXAQueueConnectionFactory(false, transportConfigurations);
-      }
-      else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF))
-      {
-         factory = new HornetQXATopicConnectionFactory(false, transportConfigurations);
-      }
-
-      return factory;
-   }
-
-   /**
-    * Creates a client-side representation of a JMS Topic.
-    *
-    * @param name the name of the topic
-    * @return The Topic
-    */
-   public static Topic createTopic(final String name)
-   {
-      return HornetQDestination.createTopic(name);
-   }
-
-   /**
-    * Creates a client-side representation of a JMS Queue.
-    *
-    * @param name the name of the queue
-    * @return The Queue
-    */
-   public static Queue createQueue(final String name)
-   {
-      return HornetQDestination.createQueue(name);
-   }
-
-   private HornetQJMSClient()
-   {
-      // Utility class
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSConstants.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSConstants.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSConstants.java
deleted file mode 100644
index 2a57bea..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/HornetQJMSConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.api.jms;
-
-/**
- * Constants for HornetQ for property keys used for HornetQ specific extensions to JMS.
- *
- * @author Tim Fox
- *
- *
- */
-public class HornetQJMSConstants
-{
-   public static final String JMS_HORNETQ_INPUT_STREAM = "JMS_HQ_InputStream";
-
-   public static final String JMS_HORNETQ_OUTPUT_STREAM = "JMS_HQ_OutputStream";
-
-   public static final String JMS_HORNETQ_SAVE_STREAM = "JMS_HQ_SaveStream";
-
-   public static final String JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST = "HQ_BRIDGE_MSG_ID_LIST";
-
-   public static final int PRE_ACKNOWLEDGE = 100;
-
-   public static final int INDIVIDUAL_ACKNOWLEDGE = 101;
-
-   public static final String JMS_HORNETQ_ENABLE_BYTE_ARRAY_JMS_CORRELATION_ID_PROPERTY_NAME =
-      "hq.jms.support-bytes-id";
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/ConnectionFactoryControl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/ConnectionFactoryControl.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/ConnectionFactoryControl.java
index 6b482ee..02767e9 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/ConnectionFactoryControl.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/ConnectionFactoryControl.java
@@ -19,7 +19,7 @@ import org.apache.activemq.api.core.management.Parameter;
 
 /**
  * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory. <br>
- * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ
+ * ActiveMQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to ActiveMQ
  * servers. Please refer to the ClientSessionFactory for a detailed description.
  *
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/DestinationControl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/DestinationControl.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/DestinationControl.java
index c775bcf..6964772 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/DestinationControl.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/DestinationControl.java
@@ -32,7 +32,7 @@ public interface DestinationControl
    String getName();
 
    /**
-    * Returns the HornetQ address corresponding to this destination.
+    * Returns the ActiveMQ address corresponding to this destination.
     */
    String getAddress();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSManagementHelper.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSManagementHelper.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSManagementHelper.java
index 4d25f9c..eb6c292 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSManagementHelper.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSManagementHelper.java
@@ -16,10 +16,10 @@ import javax.jms.JMSException;
 import javax.jms.Message;
 
 import org.apache.activemq.api.core.management.ManagementHelper;
-import org.apache.activemq.jms.client.HornetQMessage;
+import org.apache.activemq.jms.client.ActiveMQMessage;
 
 /**
- * Helper class to use JMS messages to manage HornetQ server resources.
+ * Helper class to use JMS messages to manage ActiveMQ server resources.
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */
@@ -27,13 +27,13 @@ public class JMSManagementHelper
 {
    private static org.apache.activemq.api.core.Message getCoreMessage(final Message jmsMessage)
    {
-      if (jmsMessage instanceof HornetQMessage == false)
+      if (jmsMessage instanceof ActiveMQMessage == false)
       {
-         throw new IllegalArgumentException("Cannot send a non HornetQ message as a management message " + jmsMessage.getClass()
+         throw new IllegalArgumentException("Cannot send a non ActiveMQ message as a management message " + jmsMessage.getClass()
                                                                                                                    .getName());
       }
 
-      return ((HornetQMessage)jmsMessage).getCoreMessage();
+      return ((ActiveMQMessage)jmsMessage).getCoreMessage();
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSServerControl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSServerControl.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSServerControl.java
index dea580d..03b3383 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSServerControl.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/JMSServerControl.java
@@ -18,7 +18,7 @@ import org.apache.activemq.api.core.management.Operation;
 import org.apache.activemq.api.core.management.Parameter;
 
 /**
- * A JMSSserverControl is used to manage HornetQ JMS server.
+ * A JMSSserverControl is used to manage ActiveMQ JMS server.
  *
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -270,8 +270,8 @@ public interface JMSServerControl
    /**
     * Closes all the connections on this server for consumers which are consuming from a queue associated with a particular address.
     */
-   @Operation(desc = "Closes all the consumer connections for the given HornetQ address", impact = MBeanOperationInfo.INFO)
-   boolean closeConsumerConnectionsForAddress(@Parameter(desc = "a HornetQ address", name = "address") String address) throws Exception;
+   @Operation(desc = "Closes all the consumer connections for the given ActiveMQ address", impact = MBeanOperationInfo.INFO)
+   boolean closeConsumerConnectionsForAddress(@Parameter(desc = "a ActiveMQ address", name = "address") String address) throws Exception;
 
    /**
     * Closes all the connections on this server for sessions using a particular user name.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/SubscriptionInfo.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/SubscriptionInfo.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/SubscriptionInfo.java
index b6102cb..e27c92b 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/SubscriptionInfo.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/SubscriptionInfo.java
@@ -85,7 +85,7 @@ public class SubscriptionInfo
    // Public --------------------------------------------------------
 
    /**
-    * Returns the name of the HornetQ core queue corresponding to this subscription.
+    * Returns the name of the ActiveMQ core queue corresponding to this subscription.
     */
    public String getQueueName()
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/package-info.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/package-info.java
index 72e8964..95a1d8b 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/package-info.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/management/package-info.java
@@ -11,9 +11,9 @@
  * permissions and limitations under the License.
  */
 /**
- * Management API for HornetQ JMS resources.
+ * Management API for ActiveMQ JMS resources.
  * <br>
- * HornetQ JMS resources can be managed either using JMX or by sending JMS management messages to the
+ * ActiveMQ JMS resources can be managed either using JMX or by sending JMS management messages to the
  * server's special management address. Please refer to the user manual for more information.
  */
 package org.apache.activemq.api.jms.management;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/package-info.java b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/package-info.java
index e638e3e..20b574c 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/package-info.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/api/jms/package-info.java
@@ -11,10 +11,10 @@
  * permissions and limitations under the License.
  */
 /**
- * API to create HornetQ JMS resources.
+ * API to create ActiveMQ JMS resources.
  * <br>
  * This package contains classes to create
- * HornetQ JMS managed resources (ConnectionFactory, Queue and Topic).
+ * ActiveMQ JMS managed resources (ConnectionFactory, Queue and Topic).
  *
  */
 package org.apache.activemq.api.jms;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQBytesMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQBytesMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQBytesMessage.java
new file mode 100644
index 0000000..24b24df
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQBytesMessage.java
@@ -0,0 +1,436 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+import javax.jms.MessageEOFException;
+import javax.jms.MessageFormatException;
+
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.core.message.impl.MessageImpl;
+
+import static org.apache.activemq.reader.BytesMessageUtil.bytesMessageReset;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadBoolean;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadByte;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadBytes;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadChar;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadDouble;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadFloat;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadInt;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadLong;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadShort;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUTF;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUnsignedByte;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesReadUnsignedShort;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteBoolean;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteByte;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteBytes;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteChar;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteDouble;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteFloat;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteInt;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteLong;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteObject;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteShort;
+import static org.apache.activemq.reader.BytesMessageUtil.bytesWriteUTF;
+
+/**
+ * ActiveMQ implementation of a JMS {@link BytesMessage}.
+ *
+ * @author Norbert Lataille (Norbert.Lataille@m4x.org)
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ */
+public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessage
+{
+   // Static -------------------------------------------------------
+   public static final byte TYPE = Message.BYTES_TYPE;
+
+   // Attributes ----------------------------------------------------
+
+   private int bodyLength;
+
+   // Constructor ---------------------------------------------------
+
+   /**
+    * This constructor is used to construct messages prior to sending
+    */
+   protected ActiveMQBytesMessage(final ClientSession session)
+   {
+      super(ActiveMQBytesMessage.TYPE, session);
+   }
+
+   /**
+    * Constructor on receipt at client side
+    */
+   protected ActiveMQBytesMessage(final ClientMessage message, final ClientSession session)
+   {
+      super(message, session);
+   }
+
+   /**
+    * Foreign message constructor
+    */
+   public ActiveMQBytesMessage(final BytesMessage foreign, final ClientSession session) throws JMSException
+   {
+      super(foreign, ActiveMQBytesMessage.TYPE, session);
+
+      foreign.reset();
+
+      byte[] buffer = new byte[1024];
+      int n = foreign.readBytes(buffer);
+      while (n != -1)
+      {
+         writeBytes(buffer, 0, n);
+         n = foreign.readBytes(buffer);
+      }
+   }
+
+   // BytesMessage implementation -----------------------------------
+
+   public boolean readBoolean() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadBoolean(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public byte readByte() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadByte(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public int readUnsignedByte() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadUnsignedByte(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public short readShort() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadShort(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public int readUnsignedShort() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadUnsignedShort(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public char readChar() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadChar(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public int readInt() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadInt(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public long readLong() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadLong(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public float readFloat() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadFloat(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public double readDouble() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadDouble(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+   }
+
+   public String readUTF() throws JMSException
+   {
+      checkRead();
+      try
+      {
+         return bytesReadUTF(message);
+      }
+      catch (IndexOutOfBoundsException e)
+      {
+         throw new MessageEOFException("");
+      }
+      catch (Exception e)
+      {
+         JMSException je = new JMSException("Failed to get UTF");
+         je.setLinkedException(e);
+         je.initCause(e);
+         throw je;
+      }
+   }
+
+   public int readBytes(final byte[] value) throws JMSException
+   {
+      checkRead();
+      return bytesReadBytes(message, value);
+   }
+
+   public int readBytes(final byte[] value, final int length) throws JMSException
+   {
+      checkRead();
+      return bytesReadBytes(message, value, length);
+
+   }
+
+   public void writeBoolean(final boolean value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteBoolean(message, value);
+   }
+
+   public void writeByte(final byte value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteByte(message, value);
+   }
+
+   public void writeShort(final short value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteShort(message, value);
+   }
+
+   public void writeChar(final char value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteChar(message, value);
+   }
+
+   public void writeInt(final int value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteInt(message, value);
+   }
+
+   public void writeLong(final long value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteLong(message, value);
+   }
+
+   public void writeFloat(final float value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteFloat(message, value);
+   }
+
+   public void writeDouble(final double value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteDouble(message, value);
+   }
+
+   public void writeUTF(final String value) throws JMSException
+   {
+      checkWrite();
+      try
+      {
+         bytesWriteUTF(message, value);
+      }
+      catch (Exception e)
+      {
+         JMSException je = new JMSException("Failed to write UTF");
+         je.setLinkedException(e);
+         je.initCause(e);
+         throw je;
+      }
+
+   }
+
+   public void writeBytes(final byte[] value) throws JMSException
+   {
+      checkWrite();
+      bytesWriteBytes(message, value);
+   }
+
+   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
+   {
+      checkWrite();
+      bytesWriteBytes(message, value, offset, length);
+   }
+
+   public void writeObject(final Object value) throws JMSException
+   {
+      checkWrite();
+      if (!bytesWriteObject(message, value))
+      {
+         throw new MessageFormatException("Invalid object for properties");
+      }
+   }
+
+   public void reset() throws JMSException
+   {
+      if (!readOnly)
+      {
+         readOnly = true;
+
+         bodyLength = message.getBodySize();
+      }
+
+      bytesMessageReset(message);
+   }
+
+   @Override
+   public void doBeforeReceive() throws ActiveMQException
+   {
+      bodyLength = message.getBodySize();
+   }
+
+   // ActiveMQRAMessage overrides ----------------------------------------
+
+   @Override
+   public void clearBody() throws JMSException
+   {
+      super.clearBody();
+
+      try
+      {
+         getBuffer().clear();
+      }
+      catch (RuntimeException e)
+      {
+         JMSException e2 = new JMSException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   public long getBodyLength() throws JMSException
+   {
+      checkRead();
+
+      return bodyLength;
+   }
+
+   @Override
+   public void doBeforeSend() throws Exception
+   {
+      reset();
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public byte getType()
+   {
+      return ActiveMQBytesMessage.TYPE;
+   }
+
+   private ActiveMQBuffer getBuffer()
+   {
+      return message.getBodyBuffer();
+   }
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
+                                     Class c)
+   {
+      return c.isAssignableFrom(byte[].class);
+   }
+
+   @Override
+   protected <T> T getBodyInternal(Class<T> c)
+   {
+      if (bodyLength == 0)
+         return null;
+      byte[] dst = new byte[bodyLength];
+      message.getBodyBuffer().getBytes(MessageImpl.BODY_OFFSET, dst);
+      return (T)dst;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnection.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnection.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnection.java
new file mode 100644
index 0000000..83465ba
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnection.java
@@ -0,0 +1,862 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.ConnectionConsumer;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidClientIDException;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.ServerSessionPool;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicSession;
+import java.lang.ref.WeakReference;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.FailoverEventListener;
+import org.apache.activemq.api.core.client.FailoverEventType;
+import org.apache.activemq.api.core.client.SessionFailureListener;
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.core.client.impl.ClientSessionInternal;
+import org.apache.activemq.core.version.Version;
+import org.apache.activemq.reader.MessageUtil;
+import org.apache.activemq.utils.ConcurrentHashSet;
+import org.apache.activemq.utils.UUIDGenerator;
+import org.apache.activemq.utils.VersionLoader;
+
+/**
+ * ActiveMQ implementation of a JMS Connection.
+ * <p>
+ * The flat implementation of {@link TopicConnection} and {@link QueueConnection} is per design,
+ * following the common usage of these as one flat API in JMS 1.1.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ */
+public class ActiveMQConnection extends ActiveMQConnectionForContextImpl implements TopicConnection, QueueConnection
+{
+   // Constants ------------------------------------------------------------------------------------
+   public static final int TYPE_GENERIC_CONNECTION = 0;
+
+   public static final int TYPE_QUEUE_CONNECTION = 1;
+
+   public static final int TYPE_TOPIC_CONNECTION = 2;
+
+   public static final String EXCEPTION_FAILOVER = "FAILOVER";
+
+   public static final String EXCEPTION_DISCONNECT = "DISCONNECT";
+
+   public static final SimpleString CONNECTION_ID_PROPERTY_NAME = MessageUtil.CONNECTION_ID_PROPERTY_NAME;
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   private final int connectionType;
+
+   private final Set<ActiveMQSession> sessions = new org.apache.activemq.utils.ConcurrentHashSet<ActiveMQSession>();
+
+   private final Set<SimpleString> tempQueues = new org.apache.activemq.utils.ConcurrentHashSet<SimpleString>();
+
+   private final Set<SimpleString> knownDestinations = new ConcurrentHashSet<SimpleString>();
+
+   private volatile boolean hasNoLocal;
+
+   private volatile ExceptionListener exceptionListener;
+
+   private volatile FailoverEventListener failoverEventListener;
+
+   private volatile boolean justCreated = true;
+
+   private volatile ConnectionMetaData metaData;
+
+   private volatile boolean closed;
+
+   private volatile boolean started;
+
+   private String clientID;
+
+   private final ClientSessionFactory sessionFactory;
+
+   private final SimpleString uid;
+
+   private final String username;
+
+   private final String password;
+
+   private final SessionFailureListener listener = new JMSFailureListener(this);
+
+   private final FailoverEventListener failoverListener = new FailoverEventListenerImpl(this);
+
+   private final Version thisVersion;
+
+   private final int dupsOKBatchSize;
+
+   private final int transactionBatchSize;
+
+   private ClientSession initialSession;
+
+   private final Exception creationStack;
+
+   private ActiveMQConnectionFactory factoryReference;
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   public ActiveMQConnection(final String username, final String password, final int connectionType,
+                             final String clientID, final int dupsOKBatchSize, final int transactionBatchSize,
+                             final ClientSessionFactory sessionFactory)
+   {
+      this.username = username;
+
+      this.password = password;
+
+      this.connectionType = connectionType;
+
+      this.clientID = clientID;
+
+      this.sessionFactory = sessionFactory;
+
+      uid = UUIDGenerator.getInstance().generateSimpleStringUUID();
+
+      thisVersion = VersionLoader.getVersion();
+
+      this.dupsOKBatchSize = dupsOKBatchSize;
+
+      this.transactionBatchSize = transactionBatchSize;
+
+      creationStack = new Exception();
+   }
+
+   /**
+    * This internal method serves basically the Resource Adapter.
+    * The resource adapter plays with an XASession and a non XASession.
+    * When there is no enlisted transaction, the EE specification mandates that the commit should
+    * be done as if it was a nonXA Session (i.e. SessionTransacted).
+    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
+    * mandates createSession to return a XASession.
+    */
+   public Session createNonXASession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+
+      return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+   }
+
+   /**
+    * This internal method serves basically the Resource Adapter.
+    * The resource adapter plays with an XASession and a non XASession.
+    * When there is no enlisted transaction, the EE specification mandates that the commit should
+    * be done as if it was a nonXA Session (i.e. SessionTransacted).
+    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
+    * mandates createSession to return a XASession.
+    */
+   public Session createNonXATopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+
+      return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_TOPIC_CONNECTION);
+   }
+
+   /**
+    * This internal method serves basically the Resource Adapter.
+    * The resource adapter plays with an XASession and a non XASession.
+    * When there is no enlisted transaction, the EE specification mandates that the commit should
+    * be done as if it was a nonXA Session (i.e. SessionTransacted).
+    * For that reason we have this method to force that nonXASession, since the JMS Javadoc
+    * mandates createSession to return a XASession.
+    */
+   public Session createNonXAQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+
+      return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_QUEUE_CONNECTION);
+   }
+
+
+   // Connection implementation --------------------------------------------------------------------
+
+   public synchronized Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+
+      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+   }
+
+   public String getClientID() throws JMSException
+   {
+      checkClosed();
+
+      return clientID;
+   }
+
+   public void setClientID(final String clientID) throws JMSException
+   {
+      checkClosed();
+
+      if (this.clientID != null)
+      {
+         throw new IllegalStateException("Client id has already been set");
+      }
+
+      if (!justCreated)
+      {
+         throw new IllegalStateException("setClientID can only be called directly after the connection is created");
+      }
+
+      try
+      {
+         initialSession.addUniqueMetaData("jms-client-id", clientID);
+      }
+      catch (ActiveMQException e)
+      {
+         if (e.getType() == ActiveMQExceptionType.DUPLICATE_METADATA)
+         {
+            throw new InvalidClientIDException("clientID=" + clientID + " was already set into another connection");
+         }
+      }
+
+      this.clientID = clientID;
+      try
+      {
+         this.addSessionMetaData(initialSession);
+      }
+      catch (ActiveMQException e)
+      {
+         JMSException ex = new JMSException("Internal error setting metadata jms-client-id");
+         ex.setLinkedException(e);
+         ex.initCause(e);
+         throw ex;
+      }
+
+      justCreated = false;
+   }
+
+   public ConnectionMetaData getMetaData() throws JMSException
+   {
+      checkClosed();
+
+      justCreated = false;
+
+      if (metaData == null)
+      {
+         metaData = new ActiveMQConnectionMetaData(thisVersion);
+      }
+
+      return metaData;
+   }
+
+   public ExceptionListener getExceptionListener() throws JMSException
+   {
+      checkClosed();
+
+      justCreated = false;
+
+      return exceptionListener;
+   }
+
+   public void setExceptionListener(final ExceptionListener listener) throws JMSException
+   {
+      checkClosed();
+
+      exceptionListener = listener;
+      justCreated = false;
+   }
+
+   public synchronized void start() throws JMSException
+   {
+      checkClosed();
+
+      for (ActiveMQSession session : sessions)
+      {
+         session.start();
+      }
+
+      justCreated = false;
+      started = true;
+   }
+
+   public synchronized void signalStopToAllSessions()
+   {
+      for (ActiveMQSession session : sessions)
+      {
+         ClientSession coreSession = session.getCoreSession();
+         if (coreSession instanceof ClientSessionInternal)
+         {
+            ClientSessionInternal internalSession = (ClientSessionInternal) coreSession;
+            internalSession.setStopSignal();
+         }
+      }
+
+   }
+
+   public synchronized void stop() throws JMSException
+   {
+      threadAwareContext.assertNotMessageListenerThread();
+
+      checkClosed();
+
+      for (ActiveMQSession session : sessions)
+      {
+         session.stop();
+      }
+
+      justCreated = false;
+      started = false;
+   }
+
+   public final synchronized void close() throws JMSException
+   {
+      threadAwareContext.assertNotCompletionListenerThread();
+      threadAwareContext.assertNotMessageListenerThread();
+
+      if (closed)
+      {
+         return;
+      }
+
+      sessionFactory.close();
+
+      try
+      {
+         for (ActiveMQSession session : new HashSet<ActiveMQSession>(sessions))
+         {
+            session.close();
+         }
+
+         try
+         {
+            if (!tempQueues.isEmpty())
+            {
+               // Remove any temporary queues
+
+               for (SimpleString queueName : tempQueues)
+               {
+                  if (!initialSession.isClosed())
+                  {
+                     try
+                     {
+                        initialSession.deleteQueue(queueName);
+                     }
+                     catch (ActiveMQException ignore)
+                     {
+                        // Exception on deleting queue shouldn't prevent close from completing
+                     }
+                  }
+               }
+            }
+         }
+         finally
+         {
+            if (initialSession != null)
+            {
+               initialSession.close();
+            }
+         }
+
+         closed = true;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   public ConnectionConsumer
+   createConnectionConsumer(final Destination destination, final String messageSelector,
+                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
+   {
+      checkClosed();
+
+      checkTempQueues(destination);
+
+      // We offer a RA, so no need to implement this for MDBs
+      return null;
+   }
+
+   private void checkTempQueues(Destination destination) throws JMSException
+   {
+      ActiveMQDestination jbdest = (ActiveMQDestination) destination;
+
+      if (jbdest.isTemporary() && !containsTemporaryQueue(jbdest.getSimpleAddress()))
+      {
+         throw new JMSException("Can not create consumer for temporary destination " + destination +
+                                   " from another JMS connection");
+      }
+   }
+
+   public ConnectionConsumer
+   createDurableConnectionConsumer(final Topic topic, final String subscriptionName,
+                                   final String messageSelector, final ServerSessionPool sessionPool,
+                                   final int maxMessages) throws JMSException
+   {
+      checkClosed();
+      // As spec. section 4.11
+      if (connectionType == ActiveMQConnection.TYPE_QUEUE_CONNECTION)
+      {
+         String msg = "Cannot create a durable connection consumer on a QueueConnection";
+         throw new javax.jms.IllegalStateException(msg);
+      }
+      checkTempQueues(topic);
+      // We offer RA, so no need for this
+      return null;
+   }
+
+   @Override
+   public Session createSession(int sessionMode) throws JMSException
+   {
+      checkClosed();
+      return createSessionInternal(false, sessionMode == Session.SESSION_TRANSACTED, sessionMode, ActiveMQSession.TYPE_GENERIC_SESSION);
+
+   }
+
+   @Override
+   public Session createSession() throws JMSException
+   {
+      checkClosed();
+      return createSessionInternal(false, false, Session.AUTO_ACKNOWLEDGE, ActiveMQSession.TYPE_GENERIC_SESSION);
+   }
+
+   // QueueConnection implementation ---------------------------------------------------------------
+
+   public QueueSession createQueueSession(final boolean transacted, int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQSession.TYPE_QUEUE_SESSION);
+   }
+
+   /**
+    * I'm keeping this as static as the same check will be done within RA.
+    * This is to conform with TCK Tests where we must return ackMode exactly as they want if transacted=false
+    */
+   public static int checkAck(boolean transacted, int acknowledgeMode)
+   {
+      if (!transacted && acknowledgeMode == Session.SESSION_TRANSACTED)
+      {
+         return Session.AUTO_ACKNOWLEDGE;
+      }
+
+      return acknowledgeMode;
+   }
+
+   public ConnectionConsumer
+   createConnectionConsumer(final Queue queue, final String messageSelector,
+                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
+   {
+      checkClosed();
+      checkTempQueues(queue);
+      return null;
+   }
+
+   // TopicConnection implementation ---------------------------------------------------------------
+
+   public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
+   {
+      checkClosed();
+      return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQSession.TYPE_TOPIC_SESSION);
+   }
+
+   public ConnectionConsumer
+   createConnectionConsumer(final Topic topic, final String messageSelector,
+                            final ServerSessionPool sessionPool, final int maxMessages) throws JMSException
+   {
+      checkClosed();
+      checkTempQueues(topic);
+      return null;
+   }
+
+   @Override
+   public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
+   {
+      return null; // we offer RA
+   }
+
+   @Override
+   public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
+   {
+      return null; // we offer RA
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   /**
+    * Sets a FailureListener for the session which is notified if a failure occurs on the session.
+    *
+    * @param listener the listener to add
+    * @throws JMSException
+    */
+   public void setFailoverListener(final FailoverEventListener listener) throws JMSException
+   {
+      checkClosed();
+
+      justCreated = false;
+
+      this.failoverEventListener = listener;
+
+   }
+
+   /**
+    * @return {@link FailoverEventListener} the current failover event listener for this connection
+    * @throws JMSException
+    */
+   public FailoverEventListener getFailoverListener() throws JMSException
+   {
+      checkClosed();
+
+      justCreated = false;
+
+      return failoverEventListener;
+   }
+
+   public void addTemporaryQueue(final SimpleString queueAddress)
+   {
+      tempQueues.add(queueAddress);
+      knownDestinations.add(queueAddress);
+   }
+
+   public void removeTemporaryQueue(final SimpleString queueAddress)
+   {
+      tempQueues.remove(queueAddress);
+   }
+
+   public void addKnownDestination(final SimpleString address)
+   {
+      knownDestinations.add(address);
+   }
+
+   public boolean containsKnownDestination(final SimpleString address)
+   {
+      return knownDestinations.contains(address);
+   }
+
+   public boolean containsTemporaryQueue(final SimpleString queueAddress)
+   {
+      return tempQueues.contains(queueAddress);
+   }
+
+   public boolean hasNoLocal()
+   {
+      return hasNoLocal;
+   }
+
+   public void setHasNoLocal()
+   {
+      hasNoLocal = true;
+   }
+
+   public SimpleString getUID()
+   {
+      return uid;
+   }
+
+   public void removeSession(final ActiveMQSession session)
+   {
+      sessions.remove(session);
+   }
+
+   public ClientSession getInitialSession()
+   {
+      return initialSession;
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // In case the user forgets to close the connection manually
+
+   @Override
+   protected final void finalize() throws Throwable
+   {
+      if (!closed)
+      {
+         ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack);
+
+         close();
+      }
+   }
+
+   protected boolean isXA()
+   {
+      return false;
+   }
+
+   protected final ActiveMQSession
+   createSessionInternal(final boolean isXA, final boolean transacted, int acknowledgeMode, final int type) throws JMSException
+   {
+      if (transacted)
+      {
+         acknowledgeMode = Session.SESSION_TRANSACTED;
+      }
+
+      try
+      {
+         ClientSession session;
+
+         if (acknowledgeMode == Session.SESSION_TRANSACTED)
+         {
+            session =
+               sessionFactory.createSession(username, password, isXA, false, false,
+                                            sessionFactory.getServerLocator().isPreAcknowledge(),
+                                            transactionBatchSize);
+         }
+         else if (acknowledgeMode == Session.AUTO_ACKNOWLEDGE)
+         {
+            session =
+               sessionFactory.createSession(username, password, isXA, true, true,
+                                            sessionFactory.getServerLocator().isPreAcknowledge(), 0);
+         }
+         else if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE)
+         {
+            session =
+               sessionFactory.createSession(username, password, isXA, true, true,
+                                            sessionFactory.getServerLocator().isPreAcknowledge(), dupsOKBatchSize);
+         }
+         else if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
+         {
+            session =
+               sessionFactory.createSession(username, password, isXA, true, false,
+                                            sessionFactory.getServerLocator().isPreAcknowledge(),
+                                            transactionBatchSize);
+         }
+         else if (acknowledgeMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE)
+         {
+            session =
+               sessionFactory.createSession(username, password, isXA, true, false, false, transactionBatchSize);
+         }
+         else if (acknowledgeMode == ActiveMQJMSConstants.PRE_ACKNOWLEDGE)
+         {
+            session = sessionFactory.createSession(username, password, isXA, true, false, true, transactionBatchSize);
+         }
+         else
+         {
+            throw new JMSRuntimeException("Invalid ackmode: " + acknowledgeMode);
+         }
+
+         justCreated = false;
+
+         // Setting multiple times on different sessions doesn't matter since RemotingConnection
+         // maintains
+         // a set (no duplicates)
+         session.addFailureListener(listener);
+         session.addFailoverListener(failoverListener);
+
+         ActiveMQSession jbs = createAMQSession(isXA, transacted, acknowledgeMode, session, type);
+
+         sessions.add(jbs);
+
+         if (started)
+         {
+            session.start();
+         }
+
+         this.addSessionMetaData(session);
+
+         return jbs;
+      }
+      catch (ActiveMQException e)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(e);
+      }
+   }
+
+   // Private --------------------------------------------------------------------------------------
+
+   /**
+    * @param transacted
+    * @param acknowledgeMode
+    * @param session
+    * @param type
+    * @return
+    */
+   protected ActiveMQSession createAMQSession(boolean isXA, boolean transacted, int acknowledgeMode, ClientSession session, int type)
+   {
+      if (isXA)
+      {
+         return new ActiveMQXASession(this, transacted, true, acknowledgeMode, session, type);
+      }
+      else
+      {
+         return new ActiveMQSession(this, transacted, false, acknowledgeMode, session, type);
+      }
+   }
+
+   protected final void checkClosed() throws JMSException
+   {
+      if (closed)
+      {
+         throw new IllegalStateException("Connection is closed");
+      }
+   }
+
+   public void authorize() throws JMSException
+   {
+      try
+      {
+         initialSession = sessionFactory.createSession(username, password, false, false, false, false, 0);
+
+         addSessionMetaData(initialSession);
+
+         initialSession.addFailureListener(listener);
+         initialSession.addFailoverListener(failoverListener);
+      }
+      catch (ActiveMQException me)
+      {
+         throw JMSExceptionHelper.convertFromActiveMQException(me);
+      }
+   }
+
+   private void addSessionMetaData(ClientSession session) throws ActiveMQException
+   {
+      session.addMetaData("jms-session", "");
+      if (clientID != null)
+      {
+         session.addMetaData("jms-client-id", clientID);
+      }
+   }
+
+   public void setReference(ActiveMQConnectionFactory factory)
+   {
+      this.factoryReference = factory;
+   }
+
+   public boolean isStarted()
+   {
+      return started;
+   }
+
+
+   // Inner classes --------------------------------------------------------------------------------
+
+   private static class JMSFailureListener implements SessionFailureListener
+   {
+      private final WeakReference<ActiveMQConnection> connectionRef;
+
+      JMSFailureListener(final ActiveMQConnection connection)
+      {
+         connectionRef = new WeakReference<ActiveMQConnection>(connection);
+      }
+
+      @Override
+      public synchronized void connectionFailed(final ActiveMQException me, boolean failedOver)
+      {
+         if (me == null)
+         {
+            return;
+         }
+
+         ActiveMQConnection conn = connectionRef.get();
+
+         if (conn != null)
+         {
+            try
+            {
+               final ExceptionListener exceptionListener = conn.getExceptionListener();
+
+               if (exceptionListener != null)
+               {
+                  final JMSException je =
+                     new JMSException(me.toString(), failedOver ? EXCEPTION_FAILOVER : EXCEPTION_DISCONNECT);
+
+                  je.initCause(me);
+
+                  new Thread(new Runnable()
+                  {
+                     public void run()
+                     {
+                        exceptionListener.onException(je);
+                     }
+                  }).start();
+               }
+            }
+            catch (JMSException e)
+            {
+               if (!conn.closed)
+               {
+                  ActiveMQJMSClientLogger.LOGGER.errorCallingExcListener(e);
+               }
+            }
+         }
+      }
+
+      @Override
+      public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
+      {
+         connectionFailed(me, failedOver);
+      }
+
+      public void beforeReconnect(final ActiveMQException me)
+      {
+
+      }
+
+   }
+
+   private static class FailoverEventListenerImpl implements FailoverEventListener
+   {
+      private final WeakReference<ActiveMQConnection> connectionRef;
+
+      FailoverEventListenerImpl(final ActiveMQConnection connection)
+      {
+         connectionRef = new WeakReference<ActiveMQConnection>(connection);
+      }
+
+      @Override
+      public void failoverEvent(final FailoverEventType eventType)
+      {
+         ActiveMQConnection conn = connectionRef.get();
+
+         if (conn != null)
+         {
+            try
+            {
+               final FailoverEventListener failoverListener = conn.getFailoverListener();
+
+               if (failoverListener != null)
+               {
+
+                  new Thread(new Runnable()
+                  {
+                     public void run()
+                     {
+                        failoverListener.failoverEvent(eventType);
+                     }
+                  }).start();
+               }
+            }
+            catch (JMSException e)
+            {
+               if (!conn.closed)
+               {
+                  ActiveMQJMSClientLogger.LOGGER.errorCallingFailoverListener(e);
+               }
+            }
+         }
+
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionFactory.java
new file mode 100644
index 0000000..85498fb
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionFactory.java
@@ -0,0 +1,821 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.JMSSecurityException;
+import javax.jms.JMSSecurityRuntimeException;
+import javax.jms.QueueConnection;
+import javax.jms.TopicConnection;
+import javax.jms.XAConnection;
+import javax.jms.XAConnectionFactory;
+import javax.jms.XAJMSContext;
+import javax.jms.XAQueueConnection;
+import javax.jms.XATopicConnection;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import java.io.Serializable;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.ActiveMQClient;
+import org.apache.activemq.api.core.client.ServerLocator;
+import org.apache.activemq.api.jms.JMSFactoryType;
+import org.apache.activemq.jms.referenceable.ConnectionFactoryObjectFactory;
+import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
+
+/**
+ * ActiveMQ implementation of a JMS ConnectionFactory.
+ *
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public class ActiveMQConnectionFactory implements Serializable, Referenceable, ConnectionFactory, XAConnectionFactory
+{
+   private static final long serialVersionUID = -2810634789345348326L;
+
+   private final ServerLocator serverLocator;
+
+   private String clientID;
+
+   private int dupsOKBatchSize = ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
+
+   private int transactionBatchSize = ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
+
+   private boolean readOnly;
+
+   public ActiveMQConnectionFactory()
+   {
+      serverLocator = null;
+   }
+
+   public ActiveMQConnectionFactory(final ServerLocator serverLocator)
+   {
+      this.serverLocator = serverLocator;
+
+      serverLocator.disableFinalizeCheck();
+   }
+
+   public ActiveMQConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      if (ha)
+      {
+         serverLocator = ActiveMQClient.createServerLocatorWithHA(groupConfiguration);
+      }
+      else
+      {
+         serverLocator = ActiveMQClient.createServerLocatorWithoutHA(groupConfiguration);
+      }
+
+      serverLocator.disableFinalizeCheck();
+   }
+
+   public ActiveMQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
+   {
+      if (ha)
+      {
+         serverLocator = ActiveMQClient.createServerLocatorWithHA(initialConnectors);
+      }
+      else
+      {
+         serverLocator = ActiveMQClient.createServerLocatorWithoutHA(initialConnectors);
+      }
+
+      serverLocator.disableFinalizeCheck();
+   }
+
+   // ConnectionFactory implementation -------------------------------------------------------------
+
+   public Connection createConnection() throws JMSException
+   {
+      return createConnection(null, null);
+   }
+
+   public Connection createConnection(final String username, final String password) throws JMSException
+   {
+      return createConnectionInternal(username, password, false, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+   }
+
+   @Override
+   public JMSContext createContext()
+   {
+      return createContext(null, null);
+   }
+
+   @Override
+   public JMSContext createContext(final int sessionMode)
+   {
+      return createContext(null, null, sessionMode);
+   }
+
+   @Override
+   public JMSContext createContext(final String userName, final String password)
+   {
+      return createContext(userName, password, JMSContext.AUTO_ACKNOWLEDGE);
+   }
+
+   @Override
+   public JMSContext createContext(String userName, String password, int sessionMode)
+   {
+      validateSessionMode(sessionMode);
+      try
+      {
+         ActiveMQConnection connection =
+            createConnectionInternal(userName, password, false, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+         return connection.createContext(sessionMode);
+      }
+      catch (JMSSecurityException e)
+      {
+         throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   /**
+    * @param mode
+    */
+   private static void validateSessionMode(int mode)
+   {
+      switch (mode)
+      {
+         case JMSContext.AUTO_ACKNOWLEDGE:
+         case JMSContext.CLIENT_ACKNOWLEDGE:
+         case JMSContext.DUPS_OK_ACKNOWLEDGE:
+         case JMSContext.SESSION_TRANSACTED:
+         {
+            return;
+         }
+         default:
+            throw new JMSRuntimeException("Invalid Session Mode: " + mode);
+      }
+   }
+
+   // QueueConnectionFactory implementation --------------------------------------------------------
+
+   public QueueConnection createQueueConnection() throws JMSException
+   {
+      return createQueueConnection(null, null);
+   }
+
+   public QueueConnection createQueueConnection(final String username, final String password) throws JMSException
+   {
+      return createConnectionInternal(username, password, false, ActiveMQConnection.TYPE_QUEUE_CONNECTION);
+   }
+
+   // TopicConnectionFactory implementation --------------------------------------------------------
+
+   public TopicConnection createTopicConnection() throws JMSException
+   {
+      return createTopicConnection(null, null);
+   }
+
+   public TopicConnection createTopicConnection(final String username, final String password) throws JMSException
+   {
+      return createConnectionInternal(username, password, false, ActiveMQConnection.TYPE_TOPIC_CONNECTION);
+   }
+
+   // XAConnectionFactory implementation -----------------------------------------------------------
+
+   public XAConnection createXAConnection() throws JMSException
+   {
+      return createXAConnection(null, null);
+   }
+
+   public XAConnection createXAConnection(final String username, final String password) throws JMSException
+   {
+      return (XAConnection) createConnectionInternal(username, password, true, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+   }
+
+   @Override
+   public XAJMSContext createXAContext()
+   {
+      return createXAContext(null, null);
+   }
+
+   @Override
+   public XAJMSContext createXAContext(String userName, String password)
+   {
+      try
+      {
+         ActiveMQConnection connection =
+            createConnectionInternal(userName, password, true, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
+         return connection.createXAContext();
+      }
+      catch (JMSSecurityException e)
+      {
+         throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   // XAQueueConnectionFactory implementation ------------------------------------------------------
+
+   public XAQueueConnection createXAQueueConnection() throws JMSException
+   {
+      return createXAQueueConnection(null, null);
+   }
+
+   public XAQueueConnection createXAQueueConnection(final String username, final String password) throws JMSException
+   {
+      return (XAQueueConnection) createConnectionInternal(username, password, true, ActiveMQConnection.TYPE_QUEUE_CONNECTION);
+   }
+
+   // XATopicConnectionFactory implementation ------------------------------------------------------
+
+   public XATopicConnection createXATopicConnection() throws JMSException
+   {
+      return createXATopicConnection(null, null);
+   }
+
+   public XATopicConnection createXATopicConnection(final String username, final String password) throws JMSException
+   {
+      return (XATopicConnection) createConnectionInternal(username, password, true, ActiveMQConnection.TYPE_TOPIC_CONNECTION);
+   }
+
+   @Override
+   public Reference getReference() throws NamingException
+   {
+      return new Reference(this.getClass().getCanonicalName(),
+                           new SerializableObjectRefAddr("ActiveMQ-CF", this),
+                           ConnectionFactoryObjectFactory.class.getCanonicalName(),
+                           null);
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   public boolean isHA()
+   {
+      return serverLocator.isHA();
+   }
+
+   public synchronized String getConnectionLoadBalancingPolicyClassName()
+   {
+      return serverLocator.getConnectionLoadBalancingPolicyClassName();
+   }
+
+   public synchronized void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
+   {
+      checkWrite();
+      serverLocator.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   public synchronized TransportConfiguration[] getStaticConnectors()
+   {
+      return serverLocator.getStaticTransportConfigurations();
+   }
+
+   public synchronized DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()
+   {
+      return serverLocator.getDiscoveryGroupConfiguration();
+   }
+
+   public synchronized String getClientID()
+   {
+      return clientID;
+   }
+
+   public synchronized void setClientID(final String clientID)
+   {
+      checkWrite();
+      this.clientID = clientID;
+   }
+
+   public synchronized int getDupsOKBatchSize()
+   {
+      return dupsOKBatchSize;
+   }
+
+   public synchronized void setDupsOKBatchSize(final int dupsOKBatchSize)
+   {
+      checkWrite();
+      this.dupsOKBatchSize = dupsOKBatchSize;
+   }
+
+   public synchronized int getTransactionBatchSize()
+   {
+      return transactionBatchSize;
+   }
+
+   public synchronized void setTransactionBatchSize(final int transactionBatchSize)
+   {
+      checkWrite();
+      this.transactionBatchSize = transactionBatchSize;
+   }
+
+   public synchronized long getClientFailureCheckPeriod()
+   {
+      return serverLocator.getClientFailureCheckPeriod();
+   }
+
+   public synchronized void setClientFailureCheckPeriod(final long clientFailureCheckPeriod)
+   {
+      checkWrite();
+      serverLocator.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+   }
+
+   public synchronized long getConnectionTTL()
+   {
+      return serverLocator.getConnectionTTL();
+   }
+
+   public synchronized void setConnectionTTL(final long connectionTTL)
+   {
+      checkWrite();
+      serverLocator.setConnectionTTL(connectionTTL);
+   }
+
+   public synchronized long getCallTimeout()
+   {
+      return serverLocator.getCallTimeout();
+   }
+
+   public synchronized void setCallTimeout(final long callTimeout)
+   {
+      checkWrite();
+      serverLocator.setCallTimeout(callTimeout);
+   }
+
+   public synchronized long getCallFailoverTimeout()
+   {
+      return serverLocator.getCallFailoverTimeout();
+   }
+
+   public synchronized void setCallFailoverTimeout(final long callTimeout)
+   {
+      checkWrite();
+      serverLocator.setCallFailoverTimeout(callTimeout);
+   }
+
+   public synchronized int getConsumerWindowSize()
+   {
+      return serverLocator.getConsumerWindowSize();
+   }
+
+   public synchronized void setConsumerWindowSize(final int consumerWindowSize)
+   {
+      checkWrite();
+      serverLocator.setConsumerWindowSize(consumerWindowSize);
+   }
+
+   public synchronized int getConsumerMaxRate()
+   {
+      return serverLocator.getConsumerMaxRate();
+   }
+
+   public synchronized void setConsumerMaxRate(final int consumerMaxRate)
+   {
+      checkWrite();
+      serverLocator.setConsumerMaxRate(consumerMaxRate);
+   }
+
+   public synchronized int getConfirmationWindowSize()
+   {
+      return serverLocator.getConfirmationWindowSize();
+   }
+
+   public synchronized void setConfirmationWindowSize(final int confirmationWindowSize)
+   {
+      checkWrite();
+      serverLocator.setConfirmationWindowSize(confirmationWindowSize);
+   }
+
+   public synchronized int getProducerMaxRate()
+   {
+      return serverLocator.getProducerMaxRate();
+   }
+
+   public synchronized void setProducerMaxRate(final int producerMaxRate)
+   {
+      checkWrite();
+      serverLocator.setProducerMaxRate(producerMaxRate);
+   }
+
+   public synchronized int getProducerWindowSize()
+   {
+      return serverLocator.getProducerWindowSize();
+   }
+
+   public synchronized void setProducerWindowSize(final int producerWindowSize)
+   {
+      checkWrite();
+      serverLocator.setProducerWindowSize(producerWindowSize);
+   }
+
+   /**
+    * @param cacheLargeMessagesClient
+    */
+   public synchronized void setCacheLargeMessagesClient(final boolean cacheLargeMessagesClient)
+   {
+      checkWrite();
+      serverLocator.setCacheLargeMessagesClient(cacheLargeMessagesClient);
+   }
+
+   public synchronized boolean isCacheLargeMessagesClient()
+   {
+      return serverLocator.isCacheLargeMessagesClient();
+   }
+
+   public synchronized int getMinLargeMessageSize()
+   {
+      return serverLocator.getMinLargeMessageSize();
+   }
+
+   public synchronized void setMinLargeMessageSize(final int minLargeMessageSize)
+   {
+      checkWrite();
+      serverLocator.setMinLargeMessageSize(minLargeMessageSize);
+   }
+
+   public synchronized boolean isBlockOnAcknowledge()
+   {
+      return serverLocator.isBlockOnAcknowledge();
+   }
+
+   public synchronized void setBlockOnAcknowledge(final boolean blockOnAcknowledge)
+   {
+      checkWrite();
+      serverLocator.setBlockOnAcknowledge(blockOnAcknowledge);
+   }
+
+   public synchronized boolean isBlockOnNonDurableSend()
+   {
+      return serverLocator.isBlockOnNonDurableSend();
+   }
+
+   public synchronized void setBlockOnNonDurableSend(final boolean blockOnNonDurableSend)
+   {
+      checkWrite();
+      serverLocator.setBlockOnNonDurableSend(blockOnNonDurableSend);
+   }
+
+   public synchronized boolean isBlockOnDurableSend()
+   {
+      return serverLocator.isBlockOnDurableSend();
+   }
+
+   public synchronized void setBlockOnDurableSend(final boolean blockOnDurableSend)
+   {
+      checkWrite();
+      serverLocator.setBlockOnDurableSend(blockOnDurableSend);
+   }
+
+   public synchronized boolean isAutoGroup()
+   {
+      return serverLocator.isAutoGroup();
+   }
+
+   public synchronized void setAutoGroup(final boolean autoGroup)
+   {
+      checkWrite();
+      serverLocator.setAutoGroup(autoGroup);
+   }
+
+   public synchronized boolean isPreAcknowledge()
+   {
+      return serverLocator.isPreAcknowledge();
+   }
+
+   public synchronized void setPreAcknowledge(final boolean preAcknowledge)
+   {
+      checkWrite();
+      serverLocator.setPreAcknowledge(preAcknowledge);
+   }
+
+   public synchronized long getRetryInterval()
+   {
+      return serverLocator.getRetryInterval();
+   }
+
+   public synchronized void setRetryInterval(final long retryInterval)
+   {
+      checkWrite();
+      serverLocator.setRetryInterval(retryInterval);
+   }
+
+   public synchronized long getMaxRetryInterval()
+   {
+      return serverLocator.getMaxRetryInterval();
+   }
+
+   public synchronized void setMaxRetryInterval(final long retryInterval)
+   {
+      checkWrite();
+      serverLocator.setMaxRetryInterval(retryInterval);
+   }
+
+   public synchronized double getRetryIntervalMultiplier()
+   {
+      return serverLocator.getRetryIntervalMultiplier();
+   }
+
+   public synchronized void setRetryIntervalMultiplier(final double retryIntervalMultiplier)
+   {
+      checkWrite();
+      serverLocator.setRetryIntervalMultiplier(retryIntervalMultiplier);
+   }
+
+   public synchronized int getReconnectAttempts()
+   {
+      return serverLocator.getReconnectAttempts();
+   }
+
+   public synchronized void setReconnectAttempts(final int reconnectAttempts)
+   {
+      checkWrite();
+      serverLocator.setReconnectAttempts(reconnectAttempts);
+   }
+
+   public synchronized void setInitialConnectAttempts(final int reconnectAttempts)
+   {
+      checkWrite();
+      serverLocator.setInitialConnectAttempts(reconnectAttempts);
+   }
+
+   public synchronized int getInitialConnectAttempts()
+   {
+      checkWrite();
+      return serverLocator.getInitialConnectAttempts();
+   }
+
+   public synchronized boolean isFailoverOnInitialConnection()
+   {
+      return serverLocator.isFailoverOnInitialConnection();
+   }
+
+   public synchronized void setFailoverOnInitialConnection(final boolean failover)
+   {
+      checkWrite();
+      serverLocator.setFailoverOnInitialConnection(failover);
+   }
+
+   public synchronized boolean isUseGlobalPools()
+   {
+      return serverLocator.isUseGlobalPools();
+   }
+
+   public synchronized void setUseGlobalPools(final boolean useGlobalPools)
+   {
+      checkWrite();
+      serverLocator.setUseGlobalPools(useGlobalPools);
+   }
+
+   public synchronized int getScheduledThreadPoolMaxSize()
+   {
+      return serverLocator.getScheduledThreadPoolMaxSize();
+   }
+
+   public synchronized void setScheduledThreadPoolMaxSize(final int scheduledThreadPoolMaxSize)
+   {
+      checkWrite();
+      serverLocator.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+   }
+
+   public synchronized int getThreadPoolMaxSize()
+   {
+      return serverLocator.getThreadPoolMaxSize();
+   }
+
+   public synchronized void setThreadPoolMaxSize(final int threadPoolMaxSize)
+   {
+      checkWrite();
+      serverLocator.setThreadPoolMaxSize(threadPoolMaxSize);
+   }
+
+   public synchronized int getInitialMessagePacketSize()
+   {
+      return serverLocator.getInitialMessagePacketSize();
+   }
+
+   public synchronized void setInitialMessagePacketSize(final int size)
+   {
+      checkWrite();
+      serverLocator.setInitialMessagePacketSize(size);
+   }
+
+   public void setGroupID(final String groupID)
+   {
+      serverLocator.setGroupID(groupID);
+   }
+
+   public String getGroupID()
+   {
+      return serverLocator.getGroupID();
+   }
+
+   public boolean isCompressLargeMessage()
+   {
+      return serverLocator.isCompressLargeMessage();
+   }
+
+   public void setCompressLargeMessage(boolean avoidLargeMessages)
+   {
+      serverLocator.setCompressLargeMessage(avoidLargeMessages);
+   }
+
+   public void close()
+   {
+      ServerLocator locator0 = serverLocator;
+      if (locator0 != null)
+         locator0.close();
+   }
+
+   public ServerLocator getServerLocator()
+   {
+      return serverLocator;
+   }
+
+   public int getFactoryType()
+   {
+      return JMSFactoryType.CF.intValue();
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   protected synchronized ActiveMQConnection createConnectionInternal(final String username,
+                                                                     final String password,
+                                                                     final boolean isXA,
+                                                                     final int type) throws JMSException
+   {
+      readOnly = true;
+
+      ClientSessionFactory factory;
+
+      try
+      {
+         factory = serverLocator.createSessionFactory();
+      }
+      catch (Exception e)
+      {
+         JMSException jmse = new JMSException("Failed to create session factory");
+
+         jmse.initCause(e);
+         jmse.setLinkedException(e);
+
+         throw jmse;
+      }
+
+      ActiveMQConnection connection = null;
+
+      if (isXA)
+      {
+         if (type == ActiveMQConnection.TYPE_GENERIC_CONNECTION)
+         {
+            connection = new ActiveMQXAConnection(username,
+                                                 password,
+                                                 type,
+                                                 clientID,
+                                                 dupsOKBatchSize,
+                                                 transactionBatchSize,
+                                                 factory);
+         }
+         else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION)
+         {
+            connection =
+               new ActiveMQXAConnection(username,
+                                       password,
+                                       type,
+                                       clientID,
+                                       dupsOKBatchSize,
+                                       transactionBatchSize,
+                                       factory);
+         }
+         else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION)
+         {
+            connection =
+               new ActiveMQXAConnection(username,
+                                       password,
+                                       type,
+                                       clientID,
+                                       dupsOKBatchSize,
+                                       transactionBatchSize,
+                                       factory);
+         }
+      }
+      else
+      {
+         if (type == ActiveMQConnection.TYPE_GENERIC_CONNECTION)
+         {
+            connection = new ActiveMQConnection(username,
+                                               password,
+                                               type,
+                                               clientID,
+                                               dupsOKBatchSize,
+                                               transactionBatchSize,
+                                               factory);
+         }
+         else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION)
+         {
+            connection =
+               new ActiveMQConnection(username,
+                                     password,
+                                     type,
+                                     clientID,
+                                     dupsOKBatchSize,
+                                     transactionBatchSize,
+                                     factory);
+         }
+         else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION)
+         {
+            connection =
+               new ActiveMQConnection(username,
+                                     password,
+                                     type,
+                                     clientID,
+                                     dupsOKBatchSize,
+                                     transactionBatchSize,
+                                     factory);
+         }
+      }
+
+      if (connection == null)
+      {
+         throw new JMSException("Failed to create connection: invalid type " + type);
+      }
+      connection.setReference(this);
+
+      try
+      {
+         connection.authorize();
+      }
+      catch (JMSException e)
+      {
+         try
+         {
+            connection.close();
+         }
+         catch (JMSException me)
+         {
+         }
+         throw e;
+      }
+
+      return connection;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQConnectionFactory [serverLocator=" + serverLocator +
+         ", clientID=" +
+         clientID +
+         ", consumerWindowSize = " +
+         getConsumerWindowSize() +
+         ", dupsOKBatchSize=" +
+         dupsOKBatchSize +
+         ", transactionBatchSize=" +
+         transactionBatchSize +
+         ", readOnly=" +
+         readOnly +
+         "]";
+   }
+
+
+   // Private --------------------------------------------------------------------------------------
+
+   private void checkWrite()
+   {
+      if (readOnly)
+      {
+         throw new IllegalStateException("Cannot set attribute on ActiveMQConnectionFactory after it has been used");
+      }
+   }
+
+   @Override
+   protected void finalize() throws Throwable
+   {
+      try
+      {
+         serverLocator.close();
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         //not much we can do here
+      }
+      super.finalize();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContext.java
new file mode 100644
index 0000000..bd84ab6
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContext.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+/**
+ *
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSContext;
+import javax.jms.XAJMSContext;
+
+/**
+ * Interface created to support reference counting all contexts using it.
+ * <p>
+ * Necessary to support {@code JMSContext.close()} conditions.
+ * @see JMSContext
+ */
+public interface ActiveMQConnectionForContext extends javax.jms.Connection
+{
+   JMSContext createContext(int sessionMode);
+
+   XAJMSContext createXAContext();
+
+   void closeFromContext();
+}


[50/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java
deleted file mode 100644
index eb40644..0000000
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.integration.bootstrap;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/15/12
- *
- * Logger Code 10
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 101000 to 101999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQBootstrapLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQBootstrapLogger LOGGER = Logger.getMessageLogger(HornetQBootstrapLogger.class, HornetQBootstrapLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 101000, value = "Starting ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
-   void serverStarting();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 101001, value = "Stopping ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
-   void serverStopping();
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 101002, value = "Starting Naming server on {0}:{1,number,#} (rmi {2}:{3,number,#})", format = Message.Format.MESSAGE_FORMAT)
-   void startedNamingService(String bindAddress, int port, String rmiBindAddress, int rmiPort);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 102000, value = "Error during undeployment: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorDuringUndeployment(@Cause Throwable t, String name);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 104000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingFile(String name);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 104001, value = "Failed to start server", format = Message.Format.MESSAGE_FORMAT)
-   void errorStartingServer(@Cause Exception e);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java
index b6065cf..4b9f443 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java
@@ -18,7 +18,7 @@ import java.nio.ByteBuffer;
 import io.netty.buffer.ByteBuf;
 
 /**
- * A HornetQBuffer wraps a Netty's ChannelBuffer and is used throughout HornetQ code base.
+ * A ActiveMQBuffer wraps a Netty's ChannelBuffer and is used throughout ActiveMQ code base.
  * <p>
  * Instances of it can be obtained from {@link ActiveMQBuffers} factory.
  * <p>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java
index 482e801..93e798d 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java
@@ -25,10 +25,10 @@ import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
 public final class ActiveMQBuffers
 {
    /**
-    * Creates a <em>self-expanding</em> HornetQBuffer with the given initial size
+    * Creates a <em>self-expanding</em> ActiveMQBuffer with the given initial size
     *
-    * @param size the initial size of the created HornetQBuffer
-    * @return a self-expanding HornetQBuffer starting with the given size
+    * @param size the initial size of the created ActiveMQBuffer
+    * @return a self-expanding ActiveMQBuffer starting with the given size
     */
    public static ActiveMQBuffer dynamicBuffer(final int size)
    {
@@ -36,10 +36,10 @@ public final class ActiveMQBuffers
    }
 
    /**
-    * Creates a <em>self-expanding</em> HornetQBuffer filled with the given byte array
+    * Creates a <em>self-expanding</em> ActiveMQBuffer filled with the given byte array
     *
     * @param bytes the created buffer will be initially filled with this byte array
-    * @return a self-expanding HornetQBuffer filled with the given byte array
+    * @return a self-expanding ActiveMQBuffer filled with the given byte array
     */
    public static ActiveMQBuffer dynamicBuffer(final byte[] bytes)
    {
@@ -51,12 +51,12 @@ public final class ActiveMQBuffers
    }
 
    /**
-    * Creates a HornetQBuffer wrapping an underlying NIO ByteBuffer
+    * Creates a ActiveMQBuffer wrapping an underlying NIO ByteBuffer
     *
     * The position on this buffer won't affect the position on the inner buffer
     *
     * @param underlying the underlying NIO ByteBuffer
-    * @return a HornetQBuffer wrapping the underlying NIO ByteBuffer
+    * @return a ActiveMQBuffer wrapping the underlying NIO ByteBuffer
     */
    public static ActiveMQBuffer wrappedBuffer(final ByteBuffer underlying)
    {
@@ -68,10 +68,10 @@ public final class ActiveMQBuffers
    }
 
    /**
-    * Creates a HornetQBuffer wrapping an underlying byte array
+    * Creates a ActiveMQBuffer wrapping an underlying byte array
     *
     * @param underlying the underlying byte array
-    * @return a HornetQBuffer wrapping the underlying byte array
+    * @return a ActiveMQBuffer wrapping the underlying byte array
     */
    public static ActiveMQBuffer wrappedBuffer(final byte[] underlying)
    {
@@ -79,10 +79,10 @@ public final class ActiveMQBuffers
    }
 
    /**
-    * Creates a <em>fixed</em> HornetQBuffer of the given size
+    * Creates a <em>fixed</em> ActiveMQBuffer of the given size
     *
-    * @param size the size of the created HornetQBuffer
-    * @return a fixed HornetQBuffer with the given size
+    * @param size the size of the created ActiveMQBuffer
+    * @return a fixed ActiveMQBuffer with the given size
     */
    public static ActiveMQBuffer fixedBuffer(final int size)
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java
index 88c39c3..fb691b0 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.CONNECTION_TIMEDOUT;
 
 /**
- * A client timed out will connecting to HornetQ server.
+ * A client timed out will connecting to ActiveMQ server.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
  */
 public final class ActiveMQConnectionTimedOutException extends ActiveMQException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java
index 038472c..44aa176 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.DISCONNECTED;
 
 /**
- * A client was disconnected from HornetQ server when the server has shut down.
+ * A client was disconnected from ActiveMQ server when the server has shut down.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
  */
 public final class ActiveMQDisconnectedException extends ActiveMQException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java
index 2dd437f..123b672 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.ILLEGAL_STATE;
 
 /**
- * A HornetQ resource is not in a legal state (e.g. calling ClientConsumer.receive() if a
+ * A ActiveMQ resource is not in a legal state (e.g. calling ClientConsumer.receive() if a
  * MessageHandler is set).
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
  */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java
index 691b288..f334780 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.INTERNAL_ERROR;
 
 /**
- * Internal error which prevented HornetQ from performing an important operation.
+ * Internal error which prevented ActiveMQ from performing an important operation.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
  */
 public final class ActiveMQInternalErrorException extends ActiveMQException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java
index c1697df..0848626 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java
@@ -15,7 +15,7 @@ package org.apache.activemq.api.core;
 
 
 /**
- * An error has happened at HornetQ's native (non-Java) code used in reading and writing data.
+ * An error has happened at ActiveMQ's native (non-Java) code used in reading and writing data.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/4/12
  */
 // XXX

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java
index 0b6e99c..5fd1d3a 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.NOT_CONNECTED;
 
 /**
- * A client is not able to connect to HornetQ server.
+ * A client is not able to connect to ActiveMQ server.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
  */
 public final class ActiveMQNotConnectedException extends ActiveMQException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java
index 0403bbe..2bb5bfd 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java
@@ -16,7 +16,7 @@ package org.apache.activemq.api.core;
 import static org.apache.activemq.api.core.ActiveMQExceptionType.UNSUPPORTED_PACKET;
 
 /**
- * A packet of unsupported type was received by HornetQ PacketHandler.
+ * A packet of unsupported type was received by ActiveMQ PacketHandler.
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
  */
 public final class ActiveMQUnsupportedPacketException extends ActiveMQException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java
index e1740e8..e0d3087 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java
@@ -23,7 +23,7 @@ import org.apache.activemq.utils.DataConstants;
  * A simple String class that can store all characters, and stores as simple {@code byte[]}, this
  * minimises expensive copying between String objects.
  * <p>
- * This object is used heavily throughout HornetQ for performance reasons.
+ * This object is used heavily throughout ActiveMQ for performance reasons.
  *
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java b/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java
new file mode 100644
index 0000000..f2dd86f
--- /dev/null
+++ b/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.server;
+
+/**
+ * A ActiveMQComponent
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2796 $</tt>
+ *
+ *
+ */
+public interface ActiveMQComponent
+{
+   void start() throws Exception;
+
+   void stop() throws Exception;
+
+   boolean isStarted();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java b/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java
deleted file mode 100644
index 5633bb6..0000000
--- a/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.server;
-
-/**
- * A HornetQComponent
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 2796 $</tt>
- *
- *
- */
-public interface HornetQComponent
-{
-   void start() throws Exception;
-
-   void stop() throws Exception;
-
-   boolean isStarted();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java
new file mode 100644
index 0000000..36e4c64
--- /dev/null
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.utils;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ *
+ * A ActiveMQThreadFactory
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public final class ActiveMQThreadFactory implements ThreadFactory
+{
+   private final ThreadGroup group;
+
+   private final AtomicInteger threadCount = new AtomicInteger(0);
+
+   private final int threadPriority;
+
+   private final boolean daemon;
+
+   private final ClassLoader tccl;
+
+   public ActiveMQThreadFactory(final String groupName, final boolean daemon, final ClassLoader tccl)
+   {
+      group = new ThreadGroup(groupName + "-" + System.identityHashCode(this));
+
+      this.threadPriority = Thread.NORM_PRIORITY;
+
+      this.tccl = tccl;
+
+      this.daemon = daemon;
+   }
+
+   public Thread newThread(final Runnable command)
+   {
+      // always create a thread in a privileged block.
+      return AccessController.doPrivileged(new PrivilegedAction<Thread>()
+      {
+         @Override
+         public Thread run()
+         {
+            final Thread t = new Thread(group, command, "Thread-" + threadCount.getAndIncrement() + " (" + group.getName() + ")");
+            t.setDaemon(daemon);
+            t.setPriority(threadPriority);
+            t.setContextClassLoader(tccl);
+
+            return t;
+         }
+      });
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java
new file mode 100644
index 0000000..45fd45e
--- /dev/null
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.utils;
+
+
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 20
+ *
+ * each message id must be 6 digits long starting with 20, the 3rd digit should be 9
+ *
+ * so 209000 to 209999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQUtilBundle
+{
+   ActiveMQUtilBundle BUNDLE = Messages.getBundle(ActiveMQUtilBundle.class);
+
+   @Message(id = 209000, value = "invalid property: {0}" , format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException invalidProperty(String part);
+
+   @Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException invalidType(Byte type);
+
+   @Message(id = 209002, value = "the specified string is too long ({0})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException stringTooLong(Integer length);
+
+   @Message(id = 209003, value = "Error instantiating codec {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java
new file mode 100644
index 0000000..bb6bb68
--- /dev/null
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.utils;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/15/12
+ *
+ * Logger Code 20
+ *
+ * each message id must be 6 digits long starting with 20, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 201000 to 201999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQUtilLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQUtilLogger LOGGER = Logger.getMessageLogger(ActiveMQUtilLogger.class, ActiveMQUtilLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader",
+            format = Message.Format.MESSAGE_FORMAT)
+   void missingPrivsForClassloader();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java
index dffb37f..bf0442b 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java
@@ -16,7 +16,7 @@ import java.net.URL;
 
 /**
  * This class will be used to perform generic class-loader operations,
- * such as load a class first using TCCL, and then the classLoader used by HornetQ (ClassloadingUtil.getClass().getClassLoader()).
+ * such as load a class first using TCCL, and then the classLoader used by ActiveMQ (ClassloadingUtil.getClass().getClassLoader()).
  * <p>
  * Is't required to use a Security Block on any calls to this class.
  *

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java
deleted file mode 100644
index f9a42df..0000000
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.utils;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- *
- * A HornetQThreadFactory
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public final class HornetQThreadFactory implements ThreadFactory
-{
-   private final ThreadGroup group;
-
-   private final AtomicInteger threadCount = new AtomicInteger(0);
-
-   private final int threadPriority;
-
-   private final boolean daemon;
-
-   private final ClassLoader tccl;
-
-   public HornetQThreadFactory(final String groupName, final boolean daemon, final ClassLoader tccl)
-   {
-      group = new ThreadGroup(groupName + "-" + System.identityHashCode(this));
-
-      this.threadPriority = Thread.NORM_PRIORITY;
-
-      this.tccl = tccl;
-
-      this.daemon = daemon;
-   }
-
-   public Thread newThread(final Runnable command)
-   {
-      // always create a thread in a privileged block.
-      return AccessController.doPrivileged(new PrivilegedAction<Thread>()
-      {
-         @Override
-         public Thread run()
-         {
-            final Thread t = new Thread(group, command, "Thread-" + threadCount.getAndIncrement() + " (" + group.getName() + ")");
-            t.setDaemon(daemon);
-            t.setPriority(threadPriority);
-            t.setContextClassLoader(tccl);
-
-            return t;
-         }
-      });
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java
deleted file mode 100644
index 6fdd103..0000000
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.utils;
-
-
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 20
- *
- * each message id must be 6 digits long starting with 20, the 3rd digit should be 9
- *
- * so 209000 to 209999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQUtilBundle
-{
-   HornetQUtilBundle BUNDLE = Messages.getBundle(HornetQUtilBundle.class);
-
-   @Message(id = 209000, value = "invalid property: {0}" , format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException invalidProperty(String part);
-
-   @Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException invalidType(Byte type);
-
-   @Message(id = 209002, value = "the specified string is too long ({0})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException stringTooLong(Integer length);
-
-   @Message(id = 209003, value = "Error instantiating codec {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java
deleted file mode 100644
index 8d711a6..0000000
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.utils;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/15/12
- *
- * Logger Code 20
- *
- * each message id must be 6 digits long starting with 20, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 201000 to 201999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQUtilLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQUtilLogger LOGGER = Logger.getMessageLogger(HornetQUtilLogger.class, HornetQUtilLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader",
-            format = Message.Format.MESSAGE_FORMAT)
-   void missingPrivsForClassloader();
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java b/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java
index 472d216..8dade13 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java
@@ -63,7 +63,7 @@ public class PasswordMaskingUtil
             }
             catch (Exception e)
             {
-               throw HornetQUtilBundle.BUNDLE.errorCreatingCodec(e, codecClassName);
+               throw ActiveMQUtilBundle.BUNDLE.errorCreatingCodec(e, codecClassName);
             }
          }
       });
@@ -76,7 +76,7 @@ public class PasswordMaskingUtil
          {
             String[] keyVal = parts[i].split("=");
             if (keyVal.length != 2)
-               throw HornetQUtilBundle.BUNDLE.invalidProperty(parts[i]);
+               throw ActiveMQUtilBundle.BUNDLE.invalidProperty(parts[i]);
             props.put(keyVal[0], keyVal[1]);
          }
          codecInstance.init(props);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java
index b1b4b12..04d5dc2 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java
@@ -24,7 +24,7 @@ import java.util.concurrent.locks.AbstractQueuedSynchronizer;
  *
  * <p>It could be used for sync points when one process is feeding the latch while another will wait when everything is done. (e.g. waiting IO completions to finish)</p>
  *
- * <p>On HornetQ we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown.</p>
+ * <p>On ActiveMQ we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown.</p>
  *
  * <p>Note: This latch is reusable. Once it reaches zero, you can call up again, and reuse it on further waits.</p>
  *

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java b/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java
index 8760f5f..c080413 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java
@@ -547,7 +547,7 @@ public final class TypedProperties
                }
                default:
                {
-                  throw HornetQUtilBundle.BUNDLE.invalidType(type);
+                  throw ActiveMQUtilBundle.BUNDLE.invalidType(type);
                }
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java b/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java
index a11b0c2..3f32568 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java
@@ -35,7 +35,7 @@ public final class UTF8Util
       // utility class
    }
 
-   private static final boolean isTrace = HornetQUtilLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQUtilLogger.LOGGER.isTraceEnabled();
 
    private static final ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer =
             new ThreadLocal<SoftReference<StringUtilBuffer>>();
@@ -46,14 +46,14 @@ public final class UTF8Util
 
       if (str.length() > 0xffff)
       {
-         throw HornetQUtilBundle.BUNDLE.stringTooLong(str.length());
+         throw ActiveMQUtilBundle.BUNDLE.stringTooLong(str.length());
       }
 
       final int len = UTF8Util.calculateUTFSize(str, buffer);
 
       if (len > 0xffff)
       {
-         throw HornetQUtilBundle.BUNDLE.stringTooLong(len);
+         throw ActiveMQUtilBundle.BUNDLE.stringTooLong(len);
       }
 
       out.writeShort((short)len);
@@ -76,7 +76,7 @@ public final class UTF8Util
          if (UTF8Util.isTrace)
          {
             // This message is too verbose for debug, that's why we are using trace here
-            HornetQUtilLogger.LOGGER.trace("Saving string with utfSize=" + len + " stringSize=" + str.length());
+            ActiveMQUtilLogger.LOGGER.trace("Saving string with utfSize=" + len + " stringSize=" + str.length());
          }
 
          int stringLength = str.length();
@@ -125,7 +125,7 @@ public final class UTF8Util
       if (UTF8Util.isTrace)
       {
          // This message is too verbose for debug, that's why we are using trace here
-         HornetQUtilLogger.LOGGER.trace("Reading string with utfSize=" + size);
+         ActiveMQUtilLogger.LOGGER.trace("Reading string with utfSize=" + size);
       }
 
       int count = 0;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java b/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java
index 693b821..0bfc218 100644
--- a/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java
+++ b/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java
@@ -124,9 +124,9 @@ public final class UUIDGenerator
        */
       dummy[0] |= (byte) 0x01;
 
-      if (HornetQUtilLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQUtilLogger.LOGGER.isDebugEnabled())
       {
-         HornetQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy));
+         ActiveMQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy));
       }
       return dummy;
    }
@@ -173,9 +173,9 @@ public final class UUIDGenerator
                                                            isVirtualMethod);
          if (address != null)
          {
-            if (HornetQUtilLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQUtilLogger.LOGGER.isDebugEnabled())
             {
-               HornetQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address));
+               ActiveMQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address));
             }
             return address;
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java
index 053760c..02361ea 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java
@@ -17,7 +17,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.utils.UUIDGenerator;
 
 /**
@@ -39,9 +39,9 @@ public final class DiscoveryGroupConfiguration implements Serializable
 
    private String name = UUIDGenerator.getInstance().generateStringUUID();
 
-   private long refreshTimeout = HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
+   private long refreshTimeout = ActiveMQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
 
-   private long discoveryInitialWaitTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
+   private long discoveryInitialWaitTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT;
 
    /*
    * The localBindAddress is needed so we can be backward compatible with 2.2 clients

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java
index 3571e10..3cd2cb8 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java
@@ -13,26 +13,26 @@
 package org.apache.activemq.api.core;
 
 /**
- * Constants representing pre-defined message attributes that can be referenced in HornetQ core
+ * Constants representing pre-defined message attributes that can be referenced in ActiveMQ core
  * filter expressions.
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  */
 public final class FilterConstants
 {
    /**
-    * Name of the HornetQ UserID header.
+    * Name of the ActiveMQ UserID header.
     */
-   public static final SimpleString HORNETQ_USERID = new SimpleString("HQUserID");
+   public static final SimpleString ACTIVEMQ_USERID = new SimpleString("HQUserID");
 
    /**
-    * Name of the HornetQ Message expiration header.
+    * Name of the ActiveMQ Message expiration header.
     */
-   public static final SimpleString HORNETQ_EXPIRATION = new SimpleString("HQExpiration");
+   public static final SimpleString ACTIVEMQ_EXPIRATION = new SimpleString("HQExpiration");
 
    /**
-    * Name of the HornetQ Message durable header.
+    * Name of the ActiveMQ Message durable header.
     */
-   public static final SimpleString HORNETQ_DURABLE = new SimpleString("HQDurable");
+   public static final SimpleString ACTIVEMQ_DURABLE = new SimpleString("HQDurable");
 
    /**
     * Value for the Durable header when the message is non-durable.
@@ -45,24 +45,24 @@ public final class FilterConstants
    public static final SimpleString DURABLE = new SimpleString("DURABLE");
 
    /**
-    * Name of the HornetQ Message timestamp header.
+    * Name of the ActiveMQ Message timestamp header.
     */
-   public static final SimpleString HORNETQ_TIMESTAMP = new SimpleString("HQTimestamp");
+   public static final SimpleString ACTIVEMQ_TIMESTAMP = new SimpleString("HQTimestamp");
 
    /**
-    * Name of the HornetQ Message priority header.
+    * Name of the ActiveMQ Message priority header.
     */
-   public static final SimpleString HORNETQ_PRIORITY = new SimpleString("HQPriority");
+   public static final SimpleString ACTIVEMQ_PRIORITY = new SimpleString("HQPriority");
 
    /**
-    * Name of the HornetQ Message size header.
+    * Name of the ActiveMQ Message size header.
     */
-   public static final SimpleString HORNETQ_SIZE = new SimpleString("HQSize");
+   public static final SimpleString ACTIVEMQ_SIZE = new SimpleString("HQSize");
 
    /**
-    * All HornetQ headers are prepended by this prefix.
+    * All ActiveMQ headers are prepended by this prefix.
     */
-   public static final SimpleString HORNETQ_PREFIX = new SimpleString("HQ");
+   public static final SimpleString ACTIVEMQ_PREFIX = new SimpleString("HQ");
 
    private FilterConstants()
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java
index ca7a72e..e6d0627 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java
@@ -16,10 +16,10 @@ import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 
 /**
- * This is class is a simple way to intercepting calls on HornetQ client and servers.
+ * This is class is a simple way to intercepting calls on ActiveMQ client and servers.
  * <p>
- * To add an interceptor to HornetQ server, you have to modify the server configuration file
- * {@literal hornetq-configuration.xml}.<br>
+ * To add an interceptor to ActiveMQ server, you have to modify the server configuration file
+ * {@literal activemq-configuration.xml}.<br>
  * To add it to a client, use {@link org.apache.activemq.api.core.client.ServerLocator#addIncomingInterceptor(Interceptor)}
  *
  * @author clebert.suconic@jboss.com

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java
index 19cd7cf..5a6a709 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java
@@ -31,11 +31,11 @@ import org.jgroups.conf.PlainConfigurator;
  * There are two ways to constructing a JGroups channel (JChannel):
  * <ol>
  * <li> by passing in a JGroups configuration file<br>
- * The file must exists in the hornetq classpath. HornetQ creates a JChannel with the
+ * The file must exists in the activemq classpath. ActiveMQ creates a JChannel with the
  * configuration file and use it for broadcasting and discovery. In standalone server
- * mode HornetQ uses this way for constructing JChannels.</li>
+ * mode ActiveMQ uses this way for constructing JChannels.</li>
  * <li> by passing in a JChannel instance<br>
- * This is useful when HornetQ needs to get a JChannel from a running JGroups service as in the
+ * This is useful when ActiveMQ needs to get a JChannel from a running JGroups service as in the
  * case of AS7 integration.</li>
  * </ol>
  * <p>
@@ -118,7 +118,7 @@ public final class JGroupsBroadcastGroupConfiguration implements BroadcastEndpoi
    }
 
    /**
-    * This class is the implementation of HornetQ members discovery that will use JGroups.
+    * This class is the implementation of ActiveMQ members discovery that will use JGroups.
     *
     * @author Howard Gao
     */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java
index cfabd21..7c83187 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java
@@ -158,7 +158,7 @@ public interface Message
     * Returns the message timestamp.
     * <br>
     * The timestamp corresponds to the time this message
-    * was handled by a HornetQ server.
+    * was handled by a ActiveMQ server.
     */
    long getTimestamp();
 
@@ -196,22 +196,22 @@ public interface Message
    boolean isLargeMessage();
 
    /**
-    * Returns the message body as a HornetQBuffer
+    * Returns the message body as a ActiveMQBuffer
     */
    ActiveMQBuffer getBodyBuffer();
 
    /**
-    * Writes the input byte array to the message body HornetQBuffer
+    * Writes the input byte array to the message body ActiveMQBuffer
     */
    Message writeBodyBufferBytes(byte[] bytes);
 
    /**
-    * Writes the input String to the message body HornetQBuffer
+    * Writes the input String to the message body ActiveMQBuffer
     */
    Message writeBodyBufferString(String string);
 
    /**
-    * Returns a <em>copy</em> of the message body as a HornetQBuffer. Any modification
+    * Returns a <em>copy</em> of the message body as a ActiveMQBuffer. Any modification
     * of this buffer should not impact the underlying buffer.
     */
    ActiveMQBuffer getBodyBufferCopy();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java
index 812e2d0..0fc578e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java
@@ -16,7 +16,7 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.remoting.impl.TransportConfigurationUtil;
 import org.apache.activemq.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.utils.UUIDGenerator;
@@ -290,7 +290,7 @@ public class TransportConfiguration implements Serializable
    /**
     * Encodes this TransportConfiguration into a buffer.
     * <p>
-    * Note that this is only used internally HornetQ.
+    * Note that this is only used internally ActiveMQ.
     *
     * @param buffer the buffer to encode into
     */
@@ -331,7 +331,7 @@ public class TransportConfiguration implements Serializable
             }
             else
             {
-               throw HornetQClientMessageBundle.BUNDLE.invalidEncodeType(val);
+               throw ActiveMQClientMessageBundle.BUNDLE.invalidEncodeType(val);
             }
          }
       }
@@ -340,7 +340,7 @@ public class TransportConfiguration implements Serializable
    /**
     * Decodes this TransportConfiguration from a buffer.
     * <p>
-    * Note this is only used internally by HornetQ
+    * Note this is only used internally by ActiveMQ
     *
     * @param buffer the buffer to decode from
     */
@@ -399,7 +399,7 @@ public class TransportConfiguration implements Serializable
             }
             default:
             {
-               throw HornetQClientMessageBundle.BUNDLE.invalidType(type);
+               throw ActiveMQClientMessageBundle.BUNDLE.invalidType(type);
             }
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java
index 6c16ab6..1b00b2c 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java
@@ -22,7 +22,7 @@ import java.net.InetSocketAddress;
 import java.net.MulticastSocket;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 
 
 /**
@@ -189,7 +189,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa
             {
                if (open)
                {
-                  HornetQClientLogger.LOGGER.warn(this + " getting exception when receiving broadcasting.", e);
+                  ActiveMQClientLogger.LOGGER.warn(this + " getting exception when receiving broadcasting.", e);
                }
             }
             break;
@@ -214,7 +214,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa
          {
             if (localAddress != null)
             {
-               HornetQClientLogger.LOGGER.broadcastGroupBindError();
+               ActiveMQClientLogger.LOGGER.broadcastGroupBindError();
             }
             broadcastingSocket = new DatagramSocket();
          }
@@ -233,7 +233,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa
             }
             catch (IOException e)
             {
-               HornetQClientLogger.LOGGER.ioDiscoveryError(groupAddress.getHostAddress(), groupAddress instanceof Inet4Address ? "IPv4" : "IPv6");
+               ActiveMQClientLogger.LOGGER.ioDiscoveryError(groupAddress.getHostAddress(), groupAddress instanceof Inet4Address ? "IPv4" : "IPv6");
 
                receivingSocket = new MulticastSocket(groupPort);
             }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java
new file mode 100644
index 0000000..14a2bcb
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.api.core.client;
+
+import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy;
+import org.apache.activemq.core.client.impl.ServerLocatorImpl;
+
+/**
+ * Utility class for creating ActiveMQ {@link ClientSessionFactory} objects.
+ * <p>
+ * Once a {@link ClientSessionFactory} has been created, it can be further configured using its
+ * setter methods before creating the sessions. Once a session is created, the factory can no longer
+ * be modified (its setter methods will throw a {@link IllegalStateException}.
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public final class ActiveMQClient
+{
+   public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = RoundRobinConnectionLoadBalancingPolicy.class.getCanonicalName();
+
+   public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = ActiveMQDefaultConfiguration.getDefaultClientFailureCheckPeriod();
+
+   public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM = -1;
+
+   // 1 minute - this should be higher than ping period
+
+   public static final long DEFAULT_CONNECTION_TTL = ActiveMQDefaultConfiguration.getDefaultConnectionTtl();
+
+   public static final long DEFAULT_CONNECTION_TTL_INVM = -1;
+
+   // Any message beyond this size is considered a large message (to be sent in chunks)
+
+   public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024;
+
+   public static final boolean DEFAULT_COMPRESS_LARGE_MESSAGES = false;
+
+   public static final int DEFAULT_CONSUMER_WINDOW_SIZE = 1024 * 1024;
+
+   public static final int DEFAULT_CONSUMER_MAX_RATE = -1;
+
+   public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE = -1;
+
+   public static final int DEFAULT_PRODUCER_WINDOW_SIZE = 64 * 1024;
+
+   public static final int DEFAULT_PRODUCER_MAX_RATE = -1;
+
+   public static final boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE = false;
+
+   public static final boolean DEFAULT_BLOCK_ON_DURABLE_SEND = true;
+
+   public static final boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND = false;
+
+   public static final boolean DEFAULT_AUTO_GROUP = false;
+
+   public static final long DEFAULT_CALL_TIMEOUT = 30000;
+
+   public static final long DEFAULT_CALL_FAILOVER_TIMEOUT = -1;
+
+   public static final int DEFAULT_ACK_BATCH_SIZE = 1024 * 1024;
+
+   public static final boolean DEFAULT_PRE_ACKNOWLEDGE = false;
+
+   public static final long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT = 10000;
+
+   public static final long DEFAULT_DISCOVERY_REFRESH_TIMEOUT = 10000;
+
+   public static final int DEFAULT_DISCOVERY_PORT = 9876;
+
+   public static final long DEFAULT_RETRY_INTERVAL = 2000;
+
+   public static final double DEFAULT_RETRY_INTERVAL_MULTIPLIER = ActiveMQDefaultConfiguration.getDefaultRetryIntervalMultiplier();
+
+   public static final long DEFAULT_MAX_RETRY_INTERVAL = ActiveMQDefaultConfiguration.getDefaultMaxRetryInterval();
+
+   public static final int DEFAULT_RECONNECT_ATTEMPTS = 0;
+
+   public static final int INITIAL_CONNECT_ATTEMPTS = 1;
+
+   public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false;
+
+   public static final boolean DEFAULT_IS_HA = false;
+
+   public static final boolean DEFAULT_USE_GLOBAL_POOLS = true;
+
+   public static final int DEFAULT_THREAD_POOL_MAX_SIZE = -1;
+
+   public static final int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE = 5;
+
+   public static final boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT = false;
+
+   public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE = 1500;
+
+   public static final boolean DEFAULT_XA = false;
+
+   public static final boolean DEFAULT_HA = false;
+
+   public static final String DEFAULT_CORE_PROTOCOL = "CORE";
+
+   /**
+    * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically
+    * as the cluster topology changes, and no HA backup information is propagated to the client
+    *
+    * @param transportConfigurations
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration... transportConfigurations)
+   {
+      return new ServerLocatorImpl(false, transportConfigurations);
+   }
+
+   /**
+    * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically
+    * as the cluster topology changes, and no HA backup information is propagated to the client
+    *
+    * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise the first connection will timeout)
+    * @param transportConfigurations
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocator(final boolean ha, TransportConfiguration... transportConfigurations)
+   {
+      return new ServerLocatorImpl(ha, transportConfigurations);
+   }
+
+   /**
+    * Create a ServerLocator which creates session factories from a set of live servers, no HA
+    * backup information is propagated to the client
+    * <p>
+    * The UDP address and port are used to listen for live servers in the cluster
+    * @param groupConfiguration
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      return new ServerLocatorImpl(false, groupConfiguration);
+   }
+
+
+   /**
+    * Create a ServerLocator which creates session factories from a set of live servers, no HA
+    * backup information is propagated to the client The UDP address and port are used to listen for
+    * live servers in the cluster
+    * @param ha The Locator will support topology updates and ha (this required the server to be
+    *           clustered, otherwise the first connection will timeout)
+    * @param groupConfiguration
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocator(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      return new ServerLocatorImpl(ha, groupConfiguration);
+   }
+
+   /**
+    * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
+    * leave or join and new backups are appointed or removed.
+    * <p>
+    * The initial list of servers supplied in this method is simply to make an initial connection to
+    * the cluster, once that connection is made, up to date cluster topology information is
+    * downloaded and automatically updated whenever the cluster topology changes.
+    * <p>
+    * If the topology includes backup servers that information is also propagated to the client so
+    * that it can know which server to failover onto in case of live server failure.
+    * @param initialServers The initial set of servers used to make a connection to the cluster.
+    *           Each one is tried in turn until a successful connection is made. Once a connection
+    *           is made, the cluster topology is downloaded and the rest of the list is ignored.
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers)
+   {
+      return new ServerLocatorImpl(true, initialServers);
+   }
+
+   /**
+    * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
+    * leave or join and new backups are appointed or removed.
+    * <p>
+    * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP
+    * broadcasts which contain connection information for members of the cluster. The broadcasted
+    * connection information is simply used to make an initial connection to the cluster, once that
+    * connection is made, up to date cluster topology information is downloaded and automatically
+    * updated whenever the cluster topology changes.
+    * <p>
+    * If the topology includes backup servers that information is also propagated to the client so
+    * that it can know which server to failover onto in case of live server failure.
+    * @param groupConfiguration
+    * @return the ServerLocator
+    */
+   public static ServerLocator createServerLocatorWithHA(final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      return new ServerLocatorImpl(true, groupConfiguration);
+   }
+
+
+   private ActiveMQClient()
+   {
+      // Utility class
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java
index e652579..f3cf549 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java
@@ -16,7 +16,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.spi.core.remoting.ConsumerContext;
 
 /**
- * A ClientConsumer receives messages from HornetQ queues.
+ * A ClientConsumer receives messages from ActiveMQ queues.
  * <br>
  * Messages can be consumed synchronously by using the <code>receive()</code> methods
  * which will block until a message is received (or a timeout expires) or asynchronously
@@ -36,7 +36,7 @@ public interface ClientConsumer extends AutoCloseable
 
    /**
     * The server's ID associated with this consumer.
-    * HornetQ implements this as a long but this could be protocol dependent.
+    * ActiveMQ implements this as a long but this could be protocol dependent.
     * @return
     */
    ConsumerContext getConsumerContext();
@@ -65,7 +65,7 @@ public interface ClientConsumer extends AutoCloseable
    ClientMessage receive(long timeout) throws ActiveMQException;
 
    /**
-    * Receives a message from a queue. This call will force a network trip to HornetQ server to
+    * Receives a message from a queue. This call will force a network trip to ActiveMQ server to
     * ensure that there are no messages in the queue which can be delivered to this consumer.
     * <p>
     * This call will never wait indefinitely for a message, it will return {@code null} if no

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java
index bdfabd6..90bfa6d 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java
@@ -21,7 +21,7 @@ import org.apache.activemq.api.core.SimpleString;
 
 /**
  *
- * A ClientMessage represents a message sent and/or received by HornetQ.
+ * A ClientMessage represents a message sent and/or received by ActiveMQ.
  *
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
@@ -37,7 +37,7 @@ public interface ClientMessage extends Message
    /**
     * Sets the delivery count for this message.
     * <p>
-    * This method is not meant to be called by HornetQ clients.
+    * This method is not meant to be called by ActiveMQ clients.
     * @param deliveryCount message delivery count
     * @return this ClientMessage
     */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java
index f15061f..5983b7a 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java
@@ -18,7 +18,7 @@ import org.apache.activemq.spi.core.protocol.RemotingConnection;
 
 
 /**
- * A ClientSessionFactory is the entry point to create and configure HornetQ resources to produce and consume messages.
+ * A ClientSessionFactory is the entry point to create and configure ActiveMQ resources to produce and consume messages.
  * <br>
  * It is possible to configure a factory using the setter methods only if no session has been created.
  * Once a session is created, the configuration is fixed and any call to a setter method will throw a IllegalStateException.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java
deleted file mode 100644
index 1eef77f..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.api.core.client;
-
-import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy;
-import org.apache.activemq.core.client.impl.ServerLocatorImpl;
-
-/**
- * Utility class for creating HornetQ {@link ClientSessionFactory} objects.
- * <p>
- * Once a {@link ClientSessionFactory} has been created, it can be further configured using its
- * setter methods before creating the sessions. Once a session is created, the factory can no longer
- * be modified (its setter methods will throw a {@link IllegalStateException}.
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public final class HornetQClient
-{
-   public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = RoundRobinConnectionLoadBalancingPolicy.class.getCanonicalName();
-
-   public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = ActiveMQDefaultConfiguration.getDefaultClientFailureCheckPeriod();
-
-   public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM = -1;
-
-   // 1 minute - this should be higher than ping period
-
-   public static final long DEFAULT_CONNECTION_TTL = ActiveMQDefaultConfiguration.getDefaultConnectionTtl();
-
-   public static final long DEFAULT_CONNECTION_TTL_INVM = -1;
-
-   // Any message beyond this size is considered a large message (to be sent in chunks)
-
-   public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024;
-
-   public static final boolean DEFAULT_COMPRESS_LARGE_MESSAGES = false;
-
-   public static final int DEFAULT_CONSUMER_WINDOW_SIZE = 1024 * 1024;
-
-   public static final int DEFAULT_CONSUMER_MAX_RATE = -1;
-
-   public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE = -1;
-
-   public static final int DEFAULT_PRODUCER_WINDOW_SIZE = 64 * 1024;
-
-   public static final int DEFAULT_PRODUCER_MAX_RATE = -1;
-
-   public static final boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE = false;
-
-   public static final boolean DEFAULT_BLOCK_ON_DURABLE_SEND = true;
-
-   public static final boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND = false;
-
-   public static final boolean DEFAULT_AUTO_GROUP = false;
-
-   public static final long DEFAULT_CALL_TIMEOUT = 30000;
-
-   public static final long DEFAULT_CALL_FAILOVER_TIMEOUT = -1;
-
-   public static final int DEFAULT_ACK_BATCH_SIZE = 1024 * 1024;
-
-   public static final boolean DEFAULT_PRE_ACKNOWLEDGE = false;
-
-   public static final long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT = 10000;
-
-   public static final long DEFAULT_DISCOVERY_REFRESH_TIMEOUT = 10000;
-
-   public static final int DEFAULT_DISCOVERY_PORT = 9876;
-
-   public static final long DEFAULT_RETRY_INTERVAL = 2000;
-
-   public static final double DEFAULT_RETRY_INTERVAL_MULTIPLIER = ActiveMQDefaultConfiguration.getDefaultRetryIntervalMultiplier();
-
-   public static final long DEFAULT_MAX_RETRY_INTERVAL = ActiveMQDefaultConfiguration.getDefaultMaxRetryInterval();
-
-   public static final int DEFAULT_RECONNECT_ATTEMPTS = 0;
-
-   public static final int INITIAL_CONNECT_ATTEMPTS = 1;
-
-   public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false;
-
-   public static final boolean DEFAULT_IS_HA = false;
-
-   public static final boolean DEFAULT_USE_GLOBAL_POOLS = true;
-
-   public static final int DEFAULT_THREAD_POOL_MAX_SIZE = -1;
-
-   public static final int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE = 5;
-
-   public static final boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT = false;
-
-   public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE = 1500;
-
-   public static final boolean DEFAULT_XA = false;
-
-   public static final boolean DEFAULT_HA = false;
-
-   public static final String DEFAULT_CORE_PROTOCOL = "CORE";
-
-   /**
-    * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically
-    * as the cluster topology changes, and no HA backup information is propagated to the client
-    *
-    * @param transportConfigurations
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration... transportConfigurations)
-   {
-      return new ServerLocatorImpl(false, transportConfigurations);
-   }
-
-   /**
-    * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically
-    * as the cluster topology changes, and no HA backup information is propagated to the client
-    *
-    * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise the first connection will timeout)
-    * @param transportConfigurations
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocator(final boolean ha, TransportConfiguration... transportConfigurations)
-   {
-      return new ServerLocatorImpl(ha, transportConfigurations);
-   }
-
-   /**
-    * Create a ServerLocator which creates session factories from a set of live servers, no HA
-    * backup information is propagated to the client
-    * <p>
-    * The UDP address and port are used to listen for live servers in the cluster
-    * @param groupConfiguration
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      return new ServerLocatorImpl(false, groupConfiguration);
-   }
-
-
-   /**
-    * Create a ServerLocator which creates session factories from a set of live servers, no HA
-    * backup information is propagated to the client The UDP address and port are used to listen for
-    * live servers in the cluster
-    * @param ha The Locator will support topology updates and ha (this required the server to be
-    *           clustered, otherwise the first connection will timeout)
-    * @param groupConfiguration
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocator(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      return new ServerLocatorImpl(ha, groupConfiguration);
-   }
-
-   /**
-    * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
-    * leave or join and new backups are appointed or removed.
-    * <p>
-    * The initial list of servers supplied in this method is simply to make an initial connection to
-    * the cluster, once that connection is made, up to date cluster topology information is
-    * downloaded and automatically updated whenever the cluster topology changes.
-    * <p>
-    * If the topology includes backup servers that information is also propagated to the client so
-    * that it can know which server to failover onto in case of live server failure.
-    * @param initialServers The initial set of servers used to make a connection to the cluster.
-    *           Each one is tried in turn until a successful connection is made. Once a connection
-    *           is made, the cluster topology is downloaded and the rest of the list is ignored.
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers)
-   {
-      return new ServerLocatorImpl(true, initialServers);
-   }
-
-   /**
-    * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
-    * leave or join and new backups are appointed or removed.
-    * <p>
-    * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP
-    * broadcasts which contain connection information for members of the cluster. The broadcasted
-    * connection information is simply used to make an initial connection to the cluster, once that
-    * connection is made, up to date cluster topology information is downloaded and automatically
-    * updated whenever the cluster topology changes.
-    * <p>
-    * If the topology includes backup servers that information is also propagated to the client so
-    * that it can know which server to failover onto in case of live server failure.
-    * @param groupConfiguration
-    * @return the ServerLocator
-    */
-   public static ServerLocator createServerLocatorWithHA(final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      return new ServerLocatorImpl(true, groupConfiguration);
-   }
-
-
-   private HornetQClient()
-   {
-      // Utility class
-   }
-}


[25/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageConsumer.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageConsumer.java
new file mode 100644
index 0000000..19c74b7
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageConsumer.java
@@ -0,0 +1,334 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.jms.StreamMessage;
+import javax.jms.TextMessage;
+
+
+/**
+ * A wrapper for a message consumer
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAMessageConsumer implements MessageConsumer
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The wrapped message consumer */
+   protected MessageConsumer consumer;
+
+   /** The session for this consumer */
+   protected ActiveMQRASession session;
+
+   /**
+    * Create a new wrapper
+    * @param consumer the consumer
+    * @param session the session
+    */
+   public ActiveMQRAMessageConsumer(final MessageConsumer consumer, final ActiveMQRASession session)
+   {
+      this.consumer = consumer;
+      this.session = session;
+
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("new ActiveMQMessageConsumer " + this +
+                                            " consumer=" +
+                                            consumer +
+                                            " session=" +
+                                            session);
+      }
+   }
+
+   /**
+    * Close
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void close() throws JMSException
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("close " + this);
+      }
+      try
+      {
+         closeConsumer();
+      }
+      finally
+      {
+         session.removeConsumer(this);
+      }
+   }
+
+   /**
+    * Check state
+    * @exception JMSException Thrown if an error occurs
+    */
+   void checkState() throws JMSException
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("checkState()");
+      }
+      session.checkState();
+   }
+
+   /**
+    * Get message listener
+    * @return The listener
+    * @exception JMSException Thrown if an error occurs
+    */
+   public MessageListener getMessageListener() throws JMSException
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageListener()");
+      }
+
+      checkState();
+      session.checkStrict();
+      return consumer.getMessageListener();
+   }
+
+   /**
+    * Set message listener
+    * @param listener The listener
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setMessageListener(final MessageListener listener) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         checkState();
+         session.checkStrict();
+         if (listener == null)
+         {
+            consumer.setMessageListener(null);
+         }
+         else
+         {
+            consumer.setMessageListener(wrapMessageListener(listener));
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Get message selector
+    * @return The selector
+    * @exception JMSException Thrown if an error occurs
+    */
+   public String getMessageSelector() throws JMSException
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageSelector()");
+      }
+
+      checkState();
+      return consumer.getMessageSelector();
+   }
+
+   /**
+    * Receive
+    * @return The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Message receive() throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("receive " + this);
+         }
+
+         checkState();
+         Message message = consumer.receive();
+
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("received " + this + " result=" + message);
+         }
+
+         if (message == null)
+         {
+            return null;
+         }
+         else
+         {
+            return wrapMessage(message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Receive
+    * @param timeout The timeout value
+    * @return The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Message receive(final long timeout) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("receive " + this + " timeout=" + timeout);
+         }
+
+         checkState();
+         Message message = consumer.receive(timeout);
+
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("received " + this + " result=" + message);
+         }
+
+         if (message == null)
+         {
+            return null;
+         }
+         else
+         {
+            return wrapMessage(message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Receive
+    * @return The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Message receiveNoWait() throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("receiveNoWait " + this);
+         }
+
+         checkState();
+         Message message = consumer.receiveNoWait();
+
+         if (ActiveMQRAMessageConsumer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("received " + this + " result=" + message);
+         }
+
+         if (message == null)
+         {
+            return null;
+         }
+         else
+         {
+            return wrapMessage(message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Close consumer
+    * @exception JMSException Thrown if an error occurs
+    */
+   void closeConsumer() throws JMSException
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("closeConsumer()");
+      }
+
+      consumer.close();
+   }
+
+   /**
+    * Wrap message
+    * @param message The message to be wrapped
+    * @return The wrapped message
+    */
+   Message wrapMessage(final Message message)
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("wrapMessage(" + message + ")");
+      }
+
+      if (message instanceof BytesMessage)
+      {
+         return new ActiveMQRABytesMessage((BytesMessage)message, session);
+      }
+      else if (message instanceof MapMessage)
+      {
+         return new ActiveMQRAMapMessage((MapMessage)message, session);
+      }
+      else if (message instanceof ObjectMessage)
+      {
+         return new ActiveMQRAObjectMessage((ObjectMessage)message, session);
+      }
+      else if (message instanceof StreamMessage)
+      {
+         return new ActiveMQRAStreamMessage((StreamMessage)message, session);
+      }
+      else if (message instanceof TextMessage)
+      {
+         return new ActiveMQRATextMessage((TextMessage)message, session);
+      }
+      return new ActiveMQRAMessage(message, session);
+   }
+
+   /**
+    * Wrap message listener
+    * @param listener The listener to be wrapped
+    * @return The wrapped listener
+    */
+   MessageListener wrapMessageListener(final MessageListener listener)
+   {
+      if (ActiveMQRAMessageConsumer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMessageSelector()");
+      }
+
+      return new ActiveMQRAMessageListener(listener, this);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageListener.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageListener.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageListener.java
new file mode 100644
index 0000000..42f0a42
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageListener.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+
+/**
+ * A wrapper for a message listener
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAMessageListener implements MessageListener
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The message listener */
+   private final MessageListener listener;
+
+   /** The consumer */
+   private final ActiveMQRAMessageConsumer consumer;
+
+   /**
+    * Create a new wrapper
+    * @param listener the listener
+    * @param consumer the consumer
+    */
+   public ActiveMQRAMessageListener(final MessageListener listener, final ActiveMQRAMessageConsumer consumer)
+   {
+      if (ActiveMQRAMessageListener.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + listener + ", " + consumer + ")");
+      }
+
+      this.listener = listener;
+      this.consumer = consumer;
+   }
+
+   /**
+    * On message
+    * @param message The message
+    */
+   public void onMessage(Message message)
+   {
+      if (ActiveMQRAMessageListener.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("onMessage(" + message + ")");
+      }
+
+      message = consumer.wrapMessage(message);
+      listener.onMessage(message);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageProducer.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageProducer.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageProducer.java
new file mode 100644
index 0000000..4ba4271
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessageProducer.java
@@ -0,0 +1,473 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.CompletionListener;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+
+
+/**
+ * ActiveMQMessageProducer.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAMessageProducer implements MessageProducer
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The wrapped message producer */
+   protected MessageProducer producer;
+
+   /** The session for this consumer */
+   protected ActiveMQRASession session;
+
+   /**
+    * Create a new wrapper
+    * @param producer the producer
+    * @param session the session
+    */
+   public ActiveMQRAMessageProducer(final MessageProducer producer, final ActiveMQRASession session)
+   {
+      this.producer = producer;
+      this.session = session;
+
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("new ActiveMQMessageProducer " + this +
+                                            " producer=" +
+                                            producer +
+                                            " session=" +
+                                            session);
+      }
+   }
+
+   /**
+    * Close
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void close() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("close " + this);
+      }
+      try
+      {
+         closeProducer();
+      }
+      finally
+      {
+         session.removeProducer(this);
+      }
+   }
+
+   /**
+    * Send message
+    * @param destination The destination
+    * @param message The message
+    * @param deliveryMode The delivery mode
+    * @param priority The priority
+    * @param timeToLive The time to live
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Destination destination,
+                    final Message message,
+                    final int deliveryMode,
+                    final int priority,
+                    final long timeToLive) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this +
+                                               " destination=" +
+                                               destination +
+                                               " message=" +
+                                               message +
+                                               " deliveryMode=" +
+                                               deliveryMode +
+                                               " priority=" +
+                                               priority +
+                                               " ttl=" +
+                                               timeToLive);
+         }
+
+         checkState();
+
+         producer.send(destination, message, deliveryMode, priority, timeToLive);
+
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Send message
+    * @param destination The destination
+    * @param message The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Destination destination, final Message message) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
+         }
+
+         checkState();
+
+         producer.send(destination, message);
+
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Send message
+    * @param message The message
+    * @param deliveryMode The delivery mode
+    * @param priority The priority
+    * @param timeToLive The time to live
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this +
+                                               " message=" +
+                                               message +
+                                               " deliveryMode=" +
+                                               deliveryMode +
+                                               " priority=" +
+                                               priority +
+                                               " ttl=" +
+                                               timeToLive);
+         }
+
+         checkState();
+
+         producer.send(message, deliveryMode, priority, timeToLive);
+
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Send message
+    * @param message The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Message message) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this + " message=" + message);
+         }
+
+         checkState();
+
+         producer.send(message);
+
+         if (ActiveMQRAMessageProducer.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Get the delivery mode
+    * @return The mode
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int getDeliveryMode() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDeliveryMode()");
+      }
+
+      return producer.getDeliveryMode();
+   }
+
+   /**
+    * Get the destination
+    * @return The destination
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Destination getDestination() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDestination()");
+      }
+
+      return producer.getDestination();
+   }
+
+   /**
+    * Disable message id
+    * @return True if disable
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean getDisableMessageID() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDisableMessageID()");
+      }
+
+      return producer.getDisableMessageID();
+   }
+
+   /**
+    * Disable message timestamp
+    * @return True if disable
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean getDisableMessageTimestamp() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDisableMessageTimestamp()");
+      }
+
+      return producer.getDisableMessageTimestamp();
+   }
+
+   /**
+    * Get the priority
+    * @return The priority
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int getPriority() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPriority()");
+      }
+
+      return producer.getPriority();
+   }
+
+   /**
+    * Get the time to live
+    * @return The ttl
+    * @exception JMSException Thrown if an error occurs
+    */
+   public long getTimeToLive() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTimeToLive()");
+      }
+
+      return producer.getTimeToLive();
+   }
+
+   /**
+    * Set the delivery mode
+    * @param deliveryMode The mode
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setDeliveryMode(final int deliveryMode) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDeliveryMode(" + deliveryMode + ")");
+      }
+
+      producer.setDeliveryMode(deliveryMode);
+   }
+
+   /**
+    * Set disable message id
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setDisableMessageID(final boolean value) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDisableMessageID(" + value + ")");
+      }
+
+      producer.setDisableMessageID(value);
+   }
+
+   /**
+    * Set disable message timestamp
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setDisableMessageTimestamp(final boolean value) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDisableMessageTimestamp(" + value + ")");
+      }
+
+      producer.setDisableMessageTimestamp(value);
+   }
+
+   /**
+    * Set the priority
+    * @param defaultPriority The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setPriority(final int defaultPriority) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPriority(" + defaultPriority + ")");
+      }
+
+      producer.setPriority(defaultPriority);
+   }
+
+   /**
+    * Set the ttl
+    * @param timeToLive The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setTimeToLive(final long timeToLive) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setTimeToLive(" + timeToLive + ")");
+      }
+
+      producer.setTimeToLive(timeToLive);
+   }
+
+   @Override
+   public void setDeliveryDelay(long deliveryDelay) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDeliveryDelay(" + deliveryDelay + ")");
+      }
+      producer.setDeliveryDelay(deliveryDelay);
+   }
+
+   @Override
+   public long getDeliveryDelay() throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDeliveryDelay()");
+      }
+      return producer.getDeliveryDelay();
+   }
+
+   @Override
+   public void send(Message message, CompletionListener completionListener) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("send(" + message + ", " + completionListener + ")");
+      }
+      producer.send(message, completionListener);
+   }
+
+   @Override
+   public void send(Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("send(" + message + ", " + deliveryMode + ", " + priority + ", " + timeToLive +
+                  ", " + completionListener + ")");
+      }
+      producer.send(message, deliveryMode, priority, timeToLive, completionListener);
+   }
+
+   @Override
+   public void send(Destination destination, Message message, CompletionListener completionListener) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("send(" + destination + ", " + message + ", " + completionListener + ")");
+      }
+      producer.send(destination, message, completionListener);
+   }
+
+   @Override
+   public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener) throws JMSException
+   {
+      if (ActiveMQRAMessageProducer.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("send(" + destination + ", " + message + ", " + deliveryMode + ", " + priority +
+                  ", " + timeToLive + ", " + completionListener + ")");
+      }
+      producer.send(destination, message, deliveryMode, priority, timeToLive, completionListener);
+   }
+
+    /**
+    * Check state
+    * @exception JMSException Thrown if an error occurs
+    */
+   void checkState() throws JMSException
+   {
+      session.checkState();
+   }
+
+   /**
+    * Close producer
+    * @exception JMSException Thrown if an error occurs
+    */
+   void closeProducer() throws JMSException
+   {
+      producer.close();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMetaData.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMetaData.java
new file mode 100644
index 0000000..d30c44d
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMetaData.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ManagedConnectionMetaData;
+
+
+/**
+ * Managed connection meta data
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAMetaData implements ManagedConnectionMetaData
+{
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The managed connection */
+   private final ActiveMQRAManagedConnection mc;
+
+   /**
+    * Constructor
+    * @param mc The managed connection
+    */
+   public ActiveMQRAMetaData(final ActiveMQRAManagedConnection mc)
+   {
+      if (ActiveMQRAMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mc + ")");
+      }
+
+      this.mc = mc;
+   }
+
+   /**
+    * Get the EIS product name
+    * @return The name
+    * @exception ResourceException Thrown if operation fails
+    */
+   public String getEISProductName() throws ResourceException
+   {
+      if (ActiveMQRAMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getEISProductName()");
+      }
+
+      return "ActiveMQ";
+   }
+
+   /**
+    * Get the EIS product version
+    * @return The version
+    * @exception ResourceException Thrown if operation fails
+    */
+   public String getEISProductVersion() throws ResourceException
+   {
+      if (ActiveMQRAMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getEISProductVersion()");
+      }
+
+      return "2.0";
+   }
+
+   /**
+    * Get the user name
+    * @return The user name
+    * @exception ResourceException Thrown if operation fails
+    */
+   public String getUserName() throws ResourceException
+   {
+      if (ActiveMQRAMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return mc.getUserName();
+   }
+
+   /**
+     * Get the maximum number of connections -- RETURNS 0
+     * @return The number
+     * @exception ResourceException Thrown if operation fails
+     */
+   public int getMaxConnections() throws ResourceException
+   {
+      if (ActiveMQRAMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMaxConnections()");
+      }
+
+      return 0;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAObjectMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAObjectMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAObjectMessage.java
new file mode 100644
index 0000000..3fc843e
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAObjectMessage.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.io.Serializable;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAObjectMessage extends ActiveMQRAMessage implements ObjectMessage
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRAObjectMessage(final ObjectMessage message, final ActiveMQRASession session)
+   {
+      super(message, session);
+
+      if (ActiveMQRAObjectMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get the object
+    * @return The object
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Serializable getObject() throws JMSException
+   {
+      if (ActiveMQRAObjectMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getObject()");
+      }
+
+      return ((ObjectMessage)message).getObject();
+   }
+
+   /**
+    * Set the object
+    * @param object The object
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setObject(final Serializable object) throws JMSException
+   {
+      if (ActiveMQRAObjectMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setObject(" + object + ")");
+      }
+
+      ((ObjectMessage)message).setObject(object);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java
new file mode 100644
index 0000000..c796271
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.io.Serializable;
+import java.util.Hashtable;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.utils.DefaultSensitiveStringCodec;
+import org.apache.activemq.utils.PasswordMaskingUtil;
+import org.apache.activemq.utils.SensitiveDataCodec;
+
+
+/**
+ * The RA default properties - these are set in the ra.xml file
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ActiveMQRAProperties extends ConnectionFactoryProperties implements Serializable
+{
+   /**
+    * Serial version UID
+    */
+   static final long serialVersionUID = -2772367477755473248L;
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The user name
+    */
+   private String userName;
+
+   /**
+    * The password
+    */
+   private String password = null;
+
+   /**
+    * Use Local TX instead of XA
+    */
+   private Boolean localTx = false;
+
+
+   /**
+    * Class used to locate the Transaction Manager.
+    * Using JBoss5 as the default locator
+    */
+   private String transactionManagerLocatorClass = "org.apache.activemq.integration.jboss.tm.JBoss5TransactionManagerLocator;org.apache.activemq.integration.jboss.tm.JBoss4TransactionManagerLocator";
+
+   /**
+    * Method used to locate the TM
+    */
+   private String transactionManagerLocatorMethod = "getTm;getTM";
+
+   private static final int DEFAULT_SETUP_ATTEMPTS = -1;
+
+   private static final long DEFAULT_SETUP_INTERVAL = 2 * 1000;
+
+   private int setupAttempts = DEFAULT_SETUP_ATTEMPTS;
+
+   private long setupInterval = DEFAULT_SETUP_INTERVAL;
+
+   private Hashtable<?, ?> jndiParams;
+
+   private boolean useJNDI;
+
+   private boolean useMaskedPassword = false;
+
+   private String passwordCodec;
+
+   private boolean initialized = false;
+
+   private transient SensitiveDataCodec<String> codecInstance;
+
+   /**
+    * Class used to get a JChannel
+    */
+   private String jgroupsChannelLocatorClass;
+
+   /**
+    * Name used to locate a JChannel
+    */
+   private String jgroupsChannelRefName;
+
+   /**
+    * Constructor
+    */
+   public ActiveMQRAProperties()
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+   }
+
+   /**
+    * Get the user name
+    *
+    * @return The value
+    */
+   public String getUserName()
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return userName;
+   }
+
+   /**
+    * Set the user name
+    *
+    * @param userName The value
+    */
+   public void setUserName(final String userName)
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUserName(" + userName + ")");
+      }
+
+      this.userName = userName;
+   }
+
+   /**
+    * Get the password
+    *
+    * @return The value
+    */
+   public String getPassword()
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPassword()");
+      }
+
+      return password;
+   }
+
+   /**
+    * Set the password
+    * Based on UseMaskedPassword property, the password can be
+    * plain text or encoded string. However we cannot decide
+    * which is the case at this moment, because we don't know
+    * when the UseMaskedPassword and PasswordCodec are loaded. So for the moment
+    * we just save the password.
+    *
+    * @param password The value
+    */
+   public void setPassword(final String password)
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      this.password = password;
+   }
+
+   /**
+    * @return the useJNDI
+    */
+   public boolean isUseJNDI()
+   {
+      return useJNDI;
+   }
+
+   /**
+    * @param value the useJNDI to set
+    */
+   public void setUseJNDI(final Boolean value)
+   {
+      useJNDI = value;
+   }
+
+   /**
+    * @return return the jndi params to use
+    */
+   public Hashtable<?, ?> getParsedJndiParams()
+   {
+      return jndiParams;
+   }
+
+
+   public void setParsedJndiParams(Hashtable<?, ?> params)
+   {
+      jndiParams = params;
+   }
+
+   /**
+    * Get the use XA flag
+    *
+    * @return The value
+    */
+   public Boolean getUseLocalTx()
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUseLocalTx()");
+      }
+
+      return localTx;
+   }
+
+   /**
+    * Set the use XA flag
+    *
+    * @param localTx The value
+    */
+   public void setUseLocalTx(final Boolean localTx)
+   {
+      if (ActiveMQRAProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUseLocalTx(" + localTx + ")");
+      }
+
+      this.localTx = localTx;
+   }
+
+
+   public void setTransactionManagerLocatorClass(final String transactionManagerLocatorClass)
+   {
+      this.transactionManagerLocatorClass = transactionManagerLocatorClass;
+   }
+
+   public String getTransactionManagerLocatorClass()
+   {
+      return transactionManagerLocatorClass;
+   }
+
+   public String getTransactionManagerLocatorMethod()
+   {
+      return transactionManagerLocatorMethod;
+   }
+
+   public void setTransactionManagerLocatorMethod(final String transactionManagerLocatorMethod)
+   {
+      this.transactionManagerLocatorMethod = transactionManagerLocatorMethod;
+   }
+
+   public int getSetupAttempts()
+   {
+      return setupAttempts;
+   }
+
+   public void setSetupAttempts(Integer setupAttempts)
+   {
+      this.setupAttempts = setupAttempts;
+   }
+
+   public long getSetupInterval()
+   {
+      return setupInterval;
+   }
+
+   public void setSetupInterval(Long setupInterval)
+   {
+      this.setupInterval = setupInterval;
+   }
+
+   public boolean isUseMaskedPassword()
+   {
+      return useMaskedPassword;
+   }
+
+   public void setUseMaskedPassword(boolean useMaskedPassword)
+   {
+      this.useMaskedPassword = useMaskedPassword;
+   }
+
+   public String getPasswordCodec()
+   {
+      return passwordCodec;
+   }
+
+   public void setPasswordCodec(String codecs)
+   {
+      passwordCodec = codecs;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQRAProperties[localTx=" + localTx +
+         ", userName=" + userName + ", password=****]";
+   }
+
+   public synchronized void init() throws ActiveMQException
+   {
+      if (initialized)
+         return;
+
+      if (useMaskedPassword)
+      {
+         codecInstance = new DefaultSensitiveStringCodec();
+
+         if (passwordCodec != null)
+         {
+            codecInstance = PasswordMaskingUtil.getCodec(passwordCodec);
+         }
+
+         try
+         {
+            if (password != null)
+            {
+               password = codecInstance.decode(password);
+            }
+         }
+         catch (Exception e)
+         {
+            throw ActiveMQRABundle.BUNDLE.errorDecodingPassword(e);
+         }
+
+      }
+      initialized = true;
+   }
+
+   public SensitiveDataCodec<String> getCodecInstance()
+   {
+      return codecInstance;
+   }
+
+   public String getJgroupsChannelLocatorClass()
+   {
+      return jgroupsChannelLocatorClass;
+   }
+
+   public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass)
+   {
+      this.jgroupsChannelLocatorClass = jgroupsChannelLocatorClass;
+   }
+
+   public String getJgroupsChannelRefName()
+   {
+      return jgroupsChannelRefName;
+   }
+
+   public void setJgroupsChannelRefName(String jgroupsChannelRefName)
+   {
+      this.jgroupsChannelRefName = jgroupsChannelRefName;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueReceiver.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueReceiver.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueReceiver.java
new file mode 100644
index 0000000..43c023e
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueReceiver.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.QueueReceiver;
+
+
+/**
+ * A wrapper for a queue receiver
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAQueueReceiver extends ActiveMQRAMessageConsumer implements QueueReceiver
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param consumer the queue receiver
+    * @param session the session
+    */
+   public ActiveMQRAQueueReceiver(final QueueReceiver consumer, final ActiveMQRASession session)
+   {
+      super(consumer, session);
+
+      if (ActiveMQRAQueueReceiver.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + consumer + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get queue
+    * @return The queue
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Queue getQueue() throws JMSException
+   {
+      if (ActiveMQRAQueueReceiver.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getQueue()");
+      }
+
+      checkState();
+      return ((QueueReceiver)consumer).getQueue();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueSender.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueSender.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueSender.java
new file mode 100644
index 0000000..ea72d21
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAQueueSender.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.QueueSender;
+
+
+/**
+ * ActiveMQQueueSender.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAQueueSender extends ActiveMQRAMessageProducer implements QueueSender
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param producer the producer
+    * @param session the session
+    */
+   public ActiveMQRAQueueSender(final QueueSender producer, final ActiveMQRASession session)
+   {
+      super(producer, session);
+
+      if (ActiveMQRAQueueSender.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + producer + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get queue
+    * @return The queue
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Queue getQueue() throws JMSException
+   {
+      if (ActiveMQRAQueueSender.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getQueue()");
+      }
+
+      return ((QueueSender)producer).getQueue();
+   }
+
+   /**
+    * Send message
+    * @param destination The destination
+    * @param message The message
+    * @param deliveryMode The delivery mode
+    * @param priority The priority
+    * @param timeToLive The time to live
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Queue destination,
+                    final Message message,
+                    final int deliveryMode,
+                    final int priority,
+                    final long timeToLive) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAQueueSender.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this +
+                                           " destination=" +
+                                           destination +
+                                           " message=" +
+                                           message +
+                                           " deliveryMode=" +
+                                           deliveryMode +
+                                           " priority=" +
+                                           priority +
+                                           " ttl=" +
+                                           timeToLive);
+         }
+
+         checkState();
+         producer.send(destination, message, deliveryMode, priority, timeToLive);
+
+         if (ActiveMQRAQueueSender.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Send message
+    * @param destination The destination
+    * @param message The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void send(final Queue destination, final Message message) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRAQueueSender.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
+         }
+
+         checkState();
+         producer.send(destination, message);
+
+         if (ActiveMQRAQueueSender.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAService.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAService.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAService.java
new file mode 100644
index 0000000..430e855
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAService.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+
+
+/**
+ * A ActiveMQRAService ensures that ActiveMQ Resource Adapter will be stopped *before* the ActiveMQ server.
+ * https://jira.jboss.org/browse/HORNETQ-339
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ *
+ */
+public class ActiveMQRAService
+{
+   // Constants -----------------------------------------------------
+   // Attributes ----------------------------------------------------
+
+   private final MBeanServer mBeanServer;
+
+   private final String resourceAdapterObjectName;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public ActiveMQRAService(final MBeanServer mBeanServer, final String resourceAdapterObjectName)
+   {
+      this.mBeanServer = mBeanServer;
+      this.resourceAdapterObjectName = resourceAdapterObjectName;
+   }
+
+   // Public --------------------------------------------------------
+
+   public void stop()
+   {
+      try
+      {
+         ObjectName objectName = new ObjectName(resourceAdapterObjectName);
+         Set<ObjectInstance> mbeanSet = mBeanServer.queryMBeans(objectName, null);
+
+         for (ObjectInstance mbean : mbeanSet)
+         {
+            String stateString = (String)mBeanServer.getAttribute(mbean.getObjectName(), "StateString");
+
+            if ("Started".equalsIgnoreCase(stateString) || "Starting".equalsIgnoreCase(stateString))
+            {
+               mBeanServer.invoke(mbean.getObjectName(), "stop", new Object[0], new String[0]);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         ActiveMQRALogger.LOGGER.errorStoppingRA(e);
+      }
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}


[17/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAStreamMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAStreamMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAStreamMessage.java
deleted file mode 100644
index 96ac8d9..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAStreamMessage.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import java.util.Arrays;
-
-import javax.jms.JMSException;
-import javax.jms.StreamMessage;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAStreamMessage extends HornetQRAMessage implements StreamMessage
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRAStreamMessage(final StreamMessage message, final HornetQRASession session)
-   {
-      super(message, session);
-
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean readBoolean() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readBoolean()");
-      }
-
-      return ((StreamMessage)message).readBoolean();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public byte readByte() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readByte()");
-      }
-
-      return ((StreamMessage)message).readByte();
-   }
-
-   /**
-    * Read
-    * @param value The value
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readBytes(final byte[] value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ")");
-      }
-
-      return ((StreamMessage)message).readBytes(value);
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public char readChar() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readChar()");
-      }
-
-      return ((StreamMessage)message).readChar();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public double readDouble() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readDouble()");
-      }
-
-      return ((StreamMessage)message).readDouble();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public float readFloat() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readFloat()");
-      }
-
-      return ((StreamMessage)message).readFloat();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public int readInt() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readInt()");
-      }
-
-      return ((StreamMessage)message).readInt();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public long readLong() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readLong()");
-      }
-
-      return ((StreamMessage)message).readLong();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Object readObject() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readObject()");
-      }
-
-      return ((StreamMessage)message).readObject();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public short readShort() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readShort()");
-      }
-
-      return ((StreamMessage)message).readShort();
-   }
-
-   /**
-    * Read
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public String readString() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("readString()");
-      }
-
-      return ((StreamMessage)message).readString();
-   }
-
-   /**
-    * Reset
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void reset() throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("reset()");
-      }
-
-      ((StreamMessage)message).reset();
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBoolean(final boolean value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBoolean(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeBoolean(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeByte(final byte value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeByte(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeByte(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @param offset The offset
-    * @param length The length
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBytes(" + value + ", " + offset + ", " + length + ")");
-      }
-
-      ((StreamMessage)message).writeBytes(value, offset, length);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeBytes(final byte[] value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeBytes(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeBytes(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeChar(final char value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeChar(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeChar(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeDouble(final double value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeDouble(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeDouble(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeFloat(final float value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeFloat(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeFloat(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeInt(final int value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeInt(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeInt(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeLong(final long value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeLong(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeLong(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeObject(final Object value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeObject(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeObject(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeShort(final short value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeShort(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeShort(value);
-   }
-
-   /**
-    * Write
-    * @param value The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void writeString(final String value) throws JMSException
-   {
-      if (HornetQRAStreamMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("writeString(" + value + ")");
-      }
-
-      ((StreamMessage)message).writeString(value);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATextMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATextMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATextMessage.java
deleted file mode 100644
index 2d83d6e..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATextMessage.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.TextMessage;
-
-
-/**
- * A wrapper for a message
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRATextMessage extends HornetQRAMessage implements TextMessage
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param message the message
-    * @param session the session
-    */
-   public HornetQRATextMessage(final TextMessage message, final HornetQRASession session)
-   {
-      super(message, session);
-
-      if (HornetQRATextMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get text
-    * @return The text
-    * @exception JMSException Thrown if an error occurs
-    */
-   public String getText() throws JMSException
-   {
-      if (HornetQRATextMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getText()");
-      }
-
-      return ((TextMessage)message).getText();
-   }
-
-   /**
-    * Set text
-    * @param string The text
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void setText(final String string) throws JMSException
-   {
-      if (HornetQRATextMessage.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setText(" + string + ")");
-      }
-
-      ((TextMessage)message).setText(string);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicPublisher.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicPublisher.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicPublisher.java
deleted file mode 100644
index e732841..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicPublisher.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-
-
-/**
- * HornetQQueueSender.
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRATopicPublisher extends HornetQRAMessageProducer implements TopicPublisher
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param producer the producer
-    * @param session the session
-    */
-   public HornetQRATopicPublisher(final TopicPublisher producer, final HornetQRASession session)
-   {
-      super(producer, session);
-
-      if (HornetQRATopicPublisher.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + producer + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get the topic
-    * @return The topic
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Topic getTopic() throws JMSException
-   {
-      if (HornetQRATopicPublisher.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTopic()");
-      }
-
-      return ((TopicPublisher)producer).getTopic();
-   }
-
-   /**
-    * Publish message
-    * @param message The message
-    * @param deliveryMode The delivery mode
-    * @param priority The priority
-    * @param timeToLive The time to live
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void publish(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this +
-                                              " message=" +
-                                              message +
-                                              " deliveryMode=" +
-                                              deliveryMode +
-                                              " priority=" +
-                                              priority +
-                                              " ttl=" +
-                                              timeToLive);
-         }
-
-         checkState();
-
-         ((TopicPublisher)producer).publish(message, deliveryMode, priority, timeToLive);
-
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Publish message
-    * @param message The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void publish(final Message message) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this + " message=" + message);
-         }
-
-         checkState();
-
-         ((TopicPublisher)producer).publish(message);
-
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Publish message
-    * @param destination The destination
-    * @param message The message
-    * @param deliveryMode The delivery mode
-    * @param priority The priority
-    * @param timeToLive The time to live
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void publish(final Topic destination,
-                       final Message message,
-                       final int deliveryMode,
-                       final int priority,
-                       final long timeToLive) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this +
-                                              " destination=" +
-                                              destination +
-                                              " message=" +
-                                              message +
-                                              " deliveryMode=" +
-                                              deliveryMode +
-                                              " priority=" +
-                                              priority +
-                                              " ttl=" +
-                                              timeToLive);
-         }
-
-         checkState();
-
-         ((TopicPublisher)producer).publish(destination, message, deliveryMode, priority, timeToLive);
-
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-
-   /**
-    * Publish message
-    * @param destination The destination
-    * @param message The message
-    * @exception JMSException Thrown if an error occurs
-    */
-   public void publish(final Topic destination, final Message message) throws JMSException
-   {
-      session.lock();
-      try
-      {
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
-         }
-
-         checkState();
-
-         ((TopicPublisher)producer).publish(destination, message);
-
-         if (HornetQRATopicPublisher.trace)
-         {
-            HornetQRALogger.LOGGER.trace("sent " + this + " result=" + message);
-         }
-      }
-      finally
-      {
-         session.unlock();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicSubscriber.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicSubscriber.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicSubscriber.java
deleted file mode 100644
index 5383df7..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRATopicSubscriber.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.jms.JMSException;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-
-
-/**
- * A wrapper for a topic subscriber
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRATopicSubscriber extends HornetQRAMessageConsumer implements TopicSubscriber
-{
-   /** Whether trace is enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /**
-    * Create a new wrapper
-    * @param consumer the topic subscriber
-    * @param session the session
-    */
-   public HornetQRATopicSubscriber(final TopicSubscriber consumer, final HornetQRASession session)
-   {
-      super(consumer, session);
-
-      if (HornetQRATopicSubscriber.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + consumer + ", " + session + ")");
-      }
-   }
-
-   /**
-    * Get the no local value
-    * @return The value
-    * @exception JMSException Thrown if an error occurs
-    */
-   public boolean getNoLocal() throws JMSException
-   {
-      if (HornetQRATopicSubscriber.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getNoLocal()");
-      }
-
-      checkState();
-      return ((TopicSubscriber)consumer).getNoLocal();
-   }
-
-   /**
-    * Get the topic
-    * @return The topic
-    * @exception JMSException Thrown if an error occurs
-    */
-   public Topic getTopic() throws JMSException
-   {
-      if (HornetQRATopicSubscriber.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTopic()");
-      }
-
-      checkState();
-      return ((TopicSubscriber)consumer).getTopic();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAJMSContext.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAJMSContext.java
deleted file mode 100644
index bbdd116..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAJMSContext.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import org.apache.activemq.jms.client.HornetQConnectionForContext;
-import org.apache.activemq.jms.client.ThreadAwareContext;
-
-import javax.jms.XAJMSContext;
-
-public class HornetQRAXAJMSContext extends HornetQRAJMSContext implements XAJMSContext
-{
-   public HornetQRAXAJMSContext(HornetQConnectionForContext connection, ThreadAwareContext threadAwareContext)
-   {
-      super(connection, threadAwareContext);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAResource.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAResource.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAResource.java
deleted file mode 100644
index 773d065..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRAXAResource.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.core.client.impl.HornetQXAResource;
-
-/**
- * HornetQXAResource.
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public class HornetQRAXAResource implements HornetQXAResource
-{
-   /** Trace enabled */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   /** The managed connection */
-   private final HornetQRAManagedConnection managedConnection;
-
-   /** The resource */
-   private final XAResource xaResource;
-
-   /**
-    * Create a new HornetQXAResource.
-    * @param managedConnection the managed connection
-    * @param xaResource the xa resource
-    */
-   public HornetQRAXAResource(final HornetQRAManagedConnection managedConnection, final XAResource xaResource)
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor(" + managedConnection + ", " + xaResource + ")");
-      }
-
-      this.managedConnection = managedConnection;
-      this.xaResource = xaResource;
-   }
-
-   /**
-    * Start
-    * @param xid A global transaction identifier
-    * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME
-    * @exception XAException An error has occurred
-    */
-   public void start(final Xid xid, final int flags) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("start(" + xid + ", " + flags + ")");
-      }
-
-      managedConnection.lock();
-
-      ClientSessionInternal sessionInternal = (ClientSessionInternal) xaResource;
-      try
-      {
-         //this resets any tx stuff, we assume here that the tm and jca layer are well behaved when it comes to this
-         sessionInternal.resetIfNeeded();
-      }
-      catch (ActiveMQException e)
-      {
-         HornetQRALogger.LOGGER.problemResettingXASession();
-      }
-      try
-      {
-         xaResource.start(xid, flags);
-      }
-      finally
-      {
-         managedConnection.setInManagedTx(true);
-         managedConnection.unlock();
-      }
-   }
-
-   /**
-    * End
-    * @param xid A global transaction identifier
-    * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
-    * @exception XAException An error has occurred
-    */
-   public void end(final Xid xid, final int flags) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("end(" + xid + ", " + flags + ")");
-      }
-
-      managedConnection.lock();
-      try
-      {
-         xaResource.end(xid, flags);
-      }
-      finally
-      {
-         managedConnection.setInManagedTx(false);
-         managedConnection.unlock();
-      }
-   }
-
-   /**
-    * Prepare
-    * @param xid A global transaction identifier
-    * @return XA_RDONLY or XA_OK
-    * @exception XAException An error has occurred
-    */
-   public int prepare(final Xid xid) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("prepare(" + xid + ")");
-      }
-
-      return xaResource.prepare(xid);
-   }
-
-   /**
-    * Commit
-    * @param xid A global transaction identifier
-    * @param onePhase If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
-    * @exception XAException An error has occurred
-    */
-   public void commit(final Xid xid, final boolean onePhase) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("commit(" + xid + ", " + onePhase + ")");
-      }
-
-      xaResource.commit(xid, onePhase);
-   }
-
-   /**
-    * Rollback
-    * @param xid A global transaction identifier
-    * @exception XAException An error has occurred
-    */
-   public void rollback(final Xid xid) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("rollback(" + xid + ")");
-      }
-
-      xaResource.rollback(xid);
-   }
-
-   /**
-    * Forget
-    * @param xid A global transaction identifier
-    * @exception XAException An error has occurred
-    */
-   public void forget(final Xid xid) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("forget(" + xid + ")");
-      }
-
-      managedConnection.lock();
-      try
-      {
-         xaResource.forget(xid);
-      }
-      finally
-      {
-         managedConnection.setInManagedTx(true);
-         managedConnection.setInManagedTx(false);
-         managedConnection.unlock();
-      }
-   }
-
-   /**
-    * IsSameRM
-    * @param xaRes An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
-    * @return True if its the same RM instance; otherwise false.
-    * @exception XAException An error has occurred
-    */
-   public boolean isSameRM(final XAResource xaRes) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isSameRM(" + xaRes + ")");
-      }
-
-      return xaResource.isSameRM(xaRes);
-   }
-
-   /**
-    * Recover
-    * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS
-    * @return Zero or more XIDs
-    * @exception XAException An error has occurred
-    */
-   public Xid[] recover(final int flag) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("recover(" + flag + ")");
-      }
-
-      return xaResource.recover(flag);
-   }
-
-   /**
-    * Get the transaction timeout in seconds
-    * @return The transaction timeout
-    * @exception XAException An error has occurred
-    */
-   public int getTransactionTimeout() throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTransactionTimeout()");
-      }
-
-      return xaResource.getTransactionTimeout();
-   }
-
-   /**
-    * Set the transaction timeout
-    * @param seconds The number of seconds
-    * @return True if the transaction timeout value is set successfully; otherwise false.
-    * @exception XAException An error has occurred
-    */
-   public boolean setTransactionTimeout(final int seconds) throws XAException
-   {
-      if (HornetQRAXAResource.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setTransactionTimeout(" + seconds + ")");
-      }
-
-      return xaResource.setTransactionTimeout(seconds);
-   }
-
-   @Override
-   public XAResource getResource()
-   {
-      return xaResource;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRaUtils.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRaUtils.java b/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRaUtils.java
deleted file mode 100644
index e29906a..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/HornetQRaUtils.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra;
-
-import javax.naming.Context;
-import javax.transaction.TransactionManager;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.jgroups.JChannel;
-
-/**
- * Various utility functions
- *
- * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- */
-public final class HornetQRaUtils
-{
-   /**
-    * Private constructor
-    */
-   private HornetQRaUtils()
-   {
-   }
-
-   /**
-    * Compare two strings.
-    *
-    * @param me  First value
-    * @param you Second value
-    * @return True if object equals else false.
-    */
-   public static boolean compare(final String me, final String you)
-   {
-      // If both null or intern equals
-      if (me == you)
-      {
-         return true;
-      }
-
-      // if me null and you are not
-      if (me == null)
-      {
-         return false;
-      }
-
-      // me will not be null, test for equality
-      return me.equals(you);
-   }
-
-   /**
-    * Compare two integers.
-    *
-    * @param me  First value
-    * @param you Second value
-    * @return True if object equals else false.
-    */
-   public static boolean compare(final Integer me, final Integer you)
-   {
-      // If both null or intern equals
-      if (me == you)
-      {
-         return true;
-      }
-
-      // if me null and you are not
-      if (me == null)
-      {
-         return false;
-      }
-
-      // me will not be null, test for equality
-      return me.equals(you);
-   }
-
-   /**
-    * Compare two longs.
-    *
-    * @param me  First value
-    * @param you Second value
-    * @return True if object equals else false.
-    */
-   public static boolean compare(final Long me, final Long you)
-   {
-      // If both null or intern equals
-      if (me == you)
-      {
-         return true;
-      }
-
-      // if me null and you are not
-      if (me == null)
-      {
-         return false;
-      }
-
-      // me will not be null, test for equality
-      return me.equals(you);
-   }
-
-   /**
-    * Compare two doubles.
-    *
-    * @param me  First value
-    * @param you Second value
-    * @return True if object equals else false.
-    */
-   public static boolean compare(final Double me, final Double you)
-   {
-      // If both null or intern equals
-      if (me == you)
-      {
-         return true;
-      }
-
-      // if me null and you are not
-      if (me == null)
-      {
-         return false;
-      }
-
-      // me will not be null, test for equality
-      return me.equals(you);
-   }
-
-   /**
-    * Compare two booleans.
-    *
-    * @param me  First value
-    * @param you Second value
-    * @return True if object equals else false.
-    */
-   public static boolean compare(final Boolean me, final Boolean you)
-   {
-      // If both null or intern equals
-      if (me == you)
-      {
-         return true;
-      }
-
-      // if me null and you are not
-      if (me == null)
-      {
-         return false;
-      }
-
-      // me will not be null, test for equality
-      return me.equals(you);
-   }
-
-   /**
-    * Lookup an object in the default initial context
-    *
-    * @param context The context to use
-    * @param name    the name to lookup
-    * @param clazz   the expected type
-    * @return the object
-    * @throws Exception for any error
-    */
-   public static Object lookup(final Context context, final String name, final Class<?> clazz) throws Exception
-   {
-      return context.lookup(name);
-   }
-
-   /**
-    * Used on parsing JNDI Configuration
-    *
-    * @param config
-    * @return hash-table with configuration option pairs
-    */
-   public static Hashtable<String, String> parseHashtableConfig(final String config)
-   {
-      Hashtable<String, String> hashtable = new Hashtable<String, String>();
-
-      String[] topElements = config.split(";");
-
-      for (String element : topElements)
-      {
-         String[] expression = element.split("=");
-
-         if (expression.length != 2)
-         {
-            throw new IllegalArgumentException("Invalid expression " + element + " at " + config);
-         }
-
-         hashtable.put(expression[0].trim(), expression[1].trim());
-      }
-
-      return hashtable;
-   }
-
-   public static List<Map<String, Object>> parseConfig(final String config)
-   {
-      List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-
-      String[] topElements = config.split(",");
-
-      for (String topElement : topElements)
-      {
-         HashMap<String, Object> map = new HashMap<String, Object>();
-         result.add(map);
-
-         String[] elements = topElement.split(";");
-
-         for (String element : elements)
-         {
-            String[] expression = element.split("=");
-
-            if (expression.length != 2)
-            {
-               throw new IllegalArgumentException("Invalid expression " + element + " at " + config);
-            }
-
-            map.put(expression[0].trim(), expression[1].trim());
-         }
-      }
-
-
-      return result;
-   }
-
-   public static List<String> parseConnectorConnectorConfig(String config)
-   {
-      List<String> res = new ArrayList<String>();
-
-      String[] elements = config.split(",");
-
-      for (String element : elements)
-      {
-         res.add(element.trim());
-      }
-
-      return res;
-   }
-
-
-   /**
-    * The Resource adapter can't depend on any provider's specific library. Because of that we use reflection to locate the
-    * transaction manager during startup.
-    * <p/>
-    * <p/>
-    * TODO: https://jira.jboss.org/browse/HORNETQ-417
-    * We should use a proper SPI instead of reflection
-    * We would need to define a proper SPI package for this.
-    */
-   public static TransactionManager locateTM(final String locatorClass, final String locatorMethod)
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<TransactionManager>()
-      {
-         public TransactionManager run()
-         {
-            try
-            {
-               ClassLoader loader = Thread.currentThread().getContextClassLoader();
-               Class<?> aClass = loader.loadClass(locatorClass);
-               Object o = aClass.newInstance();
-               Method m = aClass.getMethod(locatorMethod);
-               return (TransactionManager) m.invoke(o);
-            }
-            catch (Throwable e)
-            {
-               HornetQRALogger.LOGGER.debug(e.getMessage(), e);
-               return null;
-            }
-         }
-      });
-   }
-
-   /**
-    * Within AS7 the RA is loaded by JCA. properties can only be passed in String form. However if
-    * RA is configured using jgroups stack, we need to pass a Channel object. As is impossible with
-    * JCA, we use this method to allow a JChannel object to be located.
-    */
-   public static JChannel locateJGroupsChannel(final String locatorClass, final String name)
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<JChannel>()
-      {
-         public JChannel run()
-         {
-            try
-            {
-               ClassLoader loader = Thread.currentThread().getContextClassLoader();
-               Class<?> aClass = loader.loadClass(locatorClass);
-               Object o = aClass.newInstance();
-               Method m = aClass.getMethod("locateChannel", new Class[]{String.class});
-               return (JChannel) m.invoke(o, name);
-            }
-            catch (Throwable e)
-            {
-               HornetQRALogger.LOGGER.debug(e.getMessage(), e);
-               return null;
-            }
-         }
-      });
-   }
-
-   /**
-    * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
-    * utility class, as it would be a door to load anything you like in a safe VM.
-    * For that reason any class trying to do a privileged block should do with the AccessController directly.
-    */
-   private static Object safeInitNewInstance(final String className)
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<Object>()
-      {
-         public Object run()
-         {
-            ClassLoader loader = getClass().getClassLoader();
-            try
-            {
-               Class<?> clazz = loader.loadClass(className);
-               return clazz.newInstance();
-            }
-            catch (Throwable t)
-            {
-               try
-               {
-                  loader = Thread.currentThread().getContextClassLoader();
-                  if (loader != null)
-                     return loader.loadClass(className).newInstance();
-               }
-               catch (RuntimeException e)
-               {
-                  throw e;
-               }
-               catch (Exception e)
-               {
-               }
-
-               throw new IllegalArgumentException("Could not find class " + className);
-            }
-         }
-      });
-   }
-
-
-}


[05/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQMessageBundle.java b/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQMessageBundle.java
deleted file mode 100644
index cd530c3..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQMessageBundle.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.core.server;
-
-import org.apache.activemq.api.core.ActiveMQAddressFullException;
-import org.apache.activemq.api.core.ActiveMQClusterSecurityException;
-import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
-import org.apache.activemq.api.core.ActiveMQDisconnectedException;
-import org.apache.activemq.api.core.ActiveMQDuplicateMetaDataException;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQIOErrorException;
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.apache.activemq.api.core.ActiveMQIncompatibleClientServerException;
-import org.apache.activemq.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.api.core.ActiveMQInvalidFilterExpressionException;
-import org.apache.activemq.api.core.ActiveMQInvalidTransientQueueUseException;
-import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
-import org.apache.activemq.api.core.ActiveMQQueueExistsException;
-import org.apache.activemq.api.core.ActiveMQSecurityException;
-import org.apache.activemq.api.core.ActiveMQSessionCreationException;
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.postoffice.Binding;
-import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
-import org.apache.activemq.core.security.CheckType;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-import java.io.File;
-
-/**
- * Logger Code 11
- * <p/>
- * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
- * is from 119000 to 119999.
- * <p/>
- * Once released, methods should not be deleted as they may be referenced by knowledge base
- * articles. Unused methods should be marked as deprecated.
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQMessageBundle
-{
-   HornetQMessageBundle BUNDLE = Messages.getBundle(HornetQMessageBundle.class);
-
-   @Message(id = 119000, value = "Activation for server {0}", format = Message.Format.MESSAGE_FORMAT)
-   String activationForServer(HornetQServer server);
-
-   @Message(id = 119001, value = "Generating thread dump because - {0}", format = Message.Format.MESSAGE_FORMAT)
-   String generatingThreadDump(String reason);
-
-   @Message(id = 119002, value = "Thread {0} name = {1} id = {2} group = {3}", format = Message.Format.MESSAGE_FORMAT)
-   String threadDump(Thread key, String name, Long id, ThreadGroup threadGroup);
-
-   @Message(id = 119003, value = "End Thread dump", format = Message.Format.MESSAGE_FORMAT)
-   String endThreadDump();
-
-   @Message(id = 119004, value = "Information about server {0}\nCluster Connection:{1}", format = Message.Format.MESSAGE_FORMAT)
-   String serverDescribe(String identity, String describe);
-
-   @Message(id = 119005, value = "connections for {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException connectionsClosedByManagement(String ipAddress);
-
-   @Message(id = 119006, value = "journals are not JournalImpl. You can''t set a replicator!", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException notJournalImpl();
-
-   @Message(id = 119007, value = "unhandled error during replication", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException replicationUnhandledError(@Cause Exception e);
-
-   @Message(id = 119008, value = "Live Node contains more journals than the backup node. Probably a version match error", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException replicationTooManyJournals();
-
-   @Message(id = 119009, value = "Unhandled file type {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException replicationUnhandledFileType(ReplicationSyncFileMessage.FileType fileType);
-
-   @Message(id = 119010, value = "Remote Backup can not be up-to-date!", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException replicationBackupUpToDate();
-
-   @Message(id = 119011, value = "unhandled data type!", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException replicationUnhandledDataType();
-
-   @Message(id = 119012, value = "No binding for divert {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException noBindingForDivert(SimpleString name);
-
-   @Message(id = 119013, value = "Binding {0} is not a divert", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException bindingNotDivert(SimpleString name);
-
-   @Message(id = 119014,
-            value = "Did not receive data from {0}. It is likely the client has exited or crashed without "
-               +
-               "closing its connection, or the network between the server and client has failed. " +
-               "You also might have configured connection-ttl and client-failure-check-period incorrectly. " +
-               "Please check user manual for more information." +
-               " The connection will now be closed.", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQConnectionTimedOutException clientExited(String remoteAddress);
-
-   @Message(id = 119015, value = "Timeout on waiting I/O completion", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIOErrorException ioTimeout();
-
-   @Message(id = 119016, value = "queue {0} has been removed cannot deliver message, queues should not be removed when grouping is used", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNonExistentQueueException groupingQueueRemoved(SimpleString chosenClusterName);
-
-   @Message(id = 119017, value = "Queue {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNonExistentQueueException noSuchQueue(SimpleString queueName);
-
-   @Message(id = 119018, value = "Binding already exists {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQQueueExistsException bindingAlreadyExists(Binding binding);
-
-   @Message(id = 119019, value = "Queue already exists {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQQueueExistsException queueAlreadyExists(SimpleString queueName);
-
-   @Message(id = 119020, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
-
-   @Message(id = 119021, value = "MessageId was not assigned to Message", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException messageIdNotAssigned();
-
-   @Message(id = 119022, value = "Cannot compare journals if not in sync!", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException journalsNotInSync();
-
-   @Message(id = 119023, value = "Connected server is not a backup server", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException serverNotBackupServer();
-
-   @Message(id = 119024, value = "Backup replication server is already connected to another server", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException alreadyHaveReplicationServer();
-
-   @Message(id = 119025, value = "Cannot delete queue {0} on binding {1} - it has consumers = {2}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException cannotDeleteQueue(SimpleString name, SimpleString queueName, String s);
-
-   @Message(id = 119026, value = "Backup Server was not yet in sync with live", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException backupServerNotInSync();
-
-   @Message(id = 119027, value = "Could not find reference on consumer ID={0}, messageId = {1} queue = {2}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException consumerNoReference(Long id, Long messageID, SimpleString name);
-
-   @Message(id = 119028, value = "Consumer {0} doesn''t exist on the server", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException consumerDoesntExist(long consumerID);
-
-   @Message(id = 119029, value = "No address configured on the Server''s Session", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException noAddress();
-
-   @Message(id = 119030, value = "large-message not initialized on server", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException largeMessageNotInitialised();
-
-   @Message(id = 119031, value = "Unable to validate user: {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQSecurityException unableToValidateUser(String user);
-
-   @Message(id = 119032, value = "User: {0} does not have permission=''{1}'' on address {2}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQSecurityException userNoPermissions(String username, CheckType checkType, String saddress);
-
-   @Message(id = 119033, value = "Server and client versions incompatible", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIncompatibleClientServerException incompatibleClientServer();
-
-   @Message(id = 119034, value = "Server not started", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQSessionCreationException serverNotStarted();
-
-   @Message(id = 119035, value = "Metadata {0}={1} had been set already", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQDuplicateMetaDataException duplicateMetadata(String key, String data);
-
-   @Message(id = 119036, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidType(Object type);
-
-   @Message(id = 119037, value = "retry interval must be positive, was {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidRetryInterval(Long size);
-
-   @Message(id = 119038, value = "{0} must neither be null nor empty", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException emptyOrNull(String name);
-
-   @Message(id = 119039, value = "{0}  must be greater than 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException greaterThanZero(String name, Number val);
-
-   @Message(id = 119040, value = "{0} must be a valid percentual value between 0 and 100 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException notPercent(String name, Number val);
-
-   @Message(id = 119041, value = "{0}  must be equals to -1 or greater than 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException greaterThanMinusOne(String name, Number val);
-
-   @Message(id = 119042, value = "{0}  must be equals to -1 or greater or equals to 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException greaterThanZeroOrMinusOne(String name, Number val);
-
-   @Message(id = 119043, value = "{0} must be between {1} and {2} inclusive (actual value: {3})", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException mustbeBetween(String name, Integer minPriority, Integer maxPriority, Object value);
-
-   @Message(id = 119044, value = "Invalid journal type {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidJournalType(String val);
-
-   @Message(id = 119045, value = "Invalid address full message policy type {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidAddressFullPolicyType(String val);
-
-   @Message(id = 119046, value = "invalid value: {0} count must be greater than 0", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException greaterThanZero(Integer count);
-
-   @Message(id = 119047, value = "Cannot set Message Counter Sample Period < {0}ms", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidMessageCounterPeriod(Long period);
-
-   @Message(id = 119048, value = "invalid new Priority value: {0}. It must be between 0 and 9 (both included)", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidNewPriority(Integer period);
-
-   @Message(id = 119049, value = "No queue found for {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noQueueFound(String otherQueueName);
-
-   @Message(id = 119050, value = "Only NIO and AsyncIO are supported journals", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidJournal();
-
-   @Message(id = 119051, value = "Invalid journal type {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidJournalType2(JournalType journalType);
-
-   @Message(id = 119052, value = "Directory {0} does not exist and cannot be created", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException cannotCreateDir(String dir);
-
-   @Message(id = 119053, value = "Invalid index {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidIndex(Integer index);
-
-   @Message(id = 119054, value = "Cannot convert to int", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException cannotConvertToInt();
-
-   @Message(id = 119055, value = "Routing name is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException routeNameIsNull();
-
-   @Message(id = 119056, value = "Cluster name is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException clusterNameIsNull();
-
-   @Message(id = 119057, value = "Address is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException addressIsNull();
-
-   @Message(id = 119058, value = "Binding type not specified", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException bindingTypeNotSpecified();
-
-   @Message(id = 119059, value = "Binding ID is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException bindingIdNotSpecified();
-
-   @Message(id = 119060, value = "Distance is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException distancenotSpecified();
-
-   @Message(id = 119061, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException connectionExists(Object id);
-
-   @Message(id = 119062, value = "Acceptor with id {0} already registered", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException acceptorExists(Integer id);
-
-   @Message(id = 119063, value = "Acceptor with id {0} not registered", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException acceptorNotExists(Integer id);
-
-   @Message(id = 119064, value = "Unknown protocol {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException unknownProtocol(String protocol);
-
-   @Message(id = 119065, value = "node id is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nodeIdNull();
-
-   @Message(id = 119066, value = "Queue name is null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException queueNameIsNull();
-
-   @Message(id = 119067, value = "Cannot find resource with name {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException cannotFindResource(String resourceName);
-
-   @Message(id = 119068, value = "no getter method for {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noGetterMethod(String resourceName);
-
-   @Message(id = 119069, value = "no operation {0}/{1}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException noOperation(String operation, Integer length);
-
-   @Message(id = 119070, value = "match can not be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullMatch();
-
-   @Message(id = 119071, value = "# can only be at end of match", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidMatch();
-
-   @Message(id = 119072, value = "User cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullUser();
-
-   @Message(id = 119073, value = "Password cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullPassword();
-
-   @Message(id = 119074, value = "Error instantiating transformer class {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException errorCreatingTransformerClass(@Cause Exception e, String transformerClassName);
-
-   @Message(id = 119075, value = "method autoEncode doesn''t know how to convert {0} yet", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException autoConvertError(Class<? extends Object> aClass);
-
-   /**
-    * Message used on on {@link org.apache.activemq.core.server.impl.HornetQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
-    */
-   @Message(id = 119076, value = "Executing destroyConnection with {0}={1} through management''s request", format = Message.Format.MESSAGE_FORMAT)
-   String destroyConnectionWithSessionMetadataHeader(String key, String value);
-
-   /**
-    * Message used on on {@link org.apache.activemq.core.server.impl.HornetQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
-    */
-   @Message(id = 119077, value = "Closing connection {0}", format = Message.Format.MESSAGE_FORMAT)
-   String destroyConnectionWithSessionMetadataClosingConnection(String serverSessionString);
-
-   /**
-    * Exception used on on {@link org.apache.activemq.core.server.impl.HornetQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
-    */
-   @Message(id = 119078, value = "Disconnected per admin''s request on {0}={1}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQDisconnectedException destroyConnectionWithSessionMetadataSendException(String key, String value);
-
-   /**
-    * Message used on on {@link org.apache.activemq.core.server.impl.HornetQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
-    */
-   @Message(id = 119079, value = "No session found with {0}={1}", format = Message.Format.MESSAGE_FORMAT)
-   String destroyConnectionWithSessionMetadataNoSessionFound(String key, String value);
-
-   @Message(id = 119080, value = "Invalid Page IO, PagingManager was stopped or closed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException invalidPageIO();
-
-   @Message(id = 119081, value = "No Discovery Group configuration named {0} found", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQException noDiscoveryGroupFound(DiscoveryGroupConfiguration dg);
-
-   @Message(id = 119082, value = "Queue {0} already exists on another subscription", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInvalidTransientQueueUseException queueSubscriptionBelongsToDifferentAddress(SimpleString queueName);
-
-   @Message(id = 119083, value = "Queue {0} has a different filter than requested", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInvalidTransientQueueUseException queueSubscriptionBelongsToDifferentFilter(SimpleString queueName);
-
-   @Message(id = 119085, value = "Classpath lacks a protocol-manager for protocol {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQException noProtocolManagerFound(String protocol);
-
-   // this code has to match with version 2.3.x as it's used on integration tests at Wildfly and JBoss EAP
-   @Message(id = 119099, value = "Unable to authenticate cluster user: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQClusterSecurityException unableToValidateClusterUser(String user);
-
-
-   @Message(id = 119100, value = "Trying to move a journal file that refers to a file instead of a directory: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException journalDirIsFile(File fDir);
-
-   @Message(id = 119101, value = "error trying to backup journal files at directory: {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException couldNotMoveJournal(File dir);
-
-   @Message(id = 119102, value = "Address \"{0}\" is full.", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQAddressFullException addressIsFull(String addressName);
-
-   @Message(id = 119103, value = "No Connectors or Discovery Groups configured for Scale Down", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQException noConfigurationFoundForScaleDown();
-
-   @Message(id = 119104, value = "Server is stopping. Message grouping not allowed", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQException groupWhileStopping();
-
-   @Message(id = 119105, value = "Server will not accept create session request since scale down has not occurred", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQSessionCreationException sessionNotFailedOver();
-
-   @Message(id = 119106, value = "Invalid slow consumer policy type {0}", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException invalidSlowConsumerPolicyType(String val);
-
-   @Message(id = 119107, value = "consumer connections for address {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException consumerConnectionsClosedByManagement(String address);
-
-   @Message(id = 119108, value = "connections for user {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInternalErrorException connectionsForUserClosedByManagement(String userName);
-
-   @Message(id = 119109, value = "unsupported HA Policy Configuration {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException unsupportedHAPolicyConfiguration(Object o);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServer.java b/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServer.java
deleted file mode 100644
index fa493ae..0000000
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/HornetQServer.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.server;
-
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.config.BridgeConfiguration;
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.config.DivertConfiguration;
-import org.apache.activemq.core.management.impl.HornetQServerControlImpl;
-import org.apache.activemq.core.paging.PagingManager;
-import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.remoting.server.RemotingService;
-import org.apache.activemq.core.replication.ReplicationManager;
-import org.apache.activemq.core.security.Role;
-import org.apache.activemq.core.security.SecurityStore;
-import org.apache.activemq.core.server.cluster.ClusterManager;
-import org.apache.activemq.core.server.cluster.ha.HAPolicy;
-import org.apache.activemq.core.server.group.GroupingHandler;
-import org.apache.activemq.core.server.impl.Activation;
-import org.apache.activemq.core.server.impl.ConnectorsService;
-import org.apache.activemq.core.server.management.ManagementService;
-import org.apache.activemq.core.settings.HierarchicalRepository;
-import org.apache.activemq.core.settings.impl.AddressSettings;
-import org.apache.activemq.core.transaction.ResourceManager;
-import org.apache.activemq.core.version.Version;
-import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
-import org.apache.activemq.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.spi.core.protocol.SessionCallback;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
-import org.apache.activemq.utils.ExecutorFactory;
-
-/**
- * This interface defines the internal interface of the HornetQ Server exposed to other components
- * of the server.
- * <p>
- * This is not part of our public API.
- * @author <a href="tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="ataylor@redhat.com">Andy Taylor</a>
- */
-public interface HornetQServer extends HornetQComponent
-{
-
-   /**
-    * Sets the server identity.
-    * <p>
-    * The identity will be exposed on logs. It may help to debug issues on the log traces and
-    * debugs.
-    * <p>
-    * This method was created mainly for testing but it may be used in scenarios where you need to
-    * have more than one Server inside the same VM.
-    */
-   void setIdentity(String identity);
-
-   String getIdentity();
-
-   String describe();
-
-   void addActivationParam(String key, Object val);
-
-   Configuration getConfiguration();
-
-   RemotingService getRemotingService();
-
-   StorageManager getStorageManager();
-
-   PagingManager getPagingManager();
-
-   ManagementService getManagementService();
-
-   HornetQSecurityManager getSecurityManager();
-
-   Version getVersion();
-
-   NodeManager getNodeManager();
-
-   /**
-    * Returns the resource to manage this HornetQ server.
-    * @throws IllegalStateException if the server is not properly started.
-    */
-   HornetQServerControlImpl getHornetQServerControl();
-
-   void registerActivateCallback(ActivateCallback callback);
-
-   void unregisterActivateCallback(ActivateCallback callback);
-
-   ServerSession createSession(String name,
-                               String username,
-                               String password,
-                               int minLargeMessageSize,
-                               RemotingConnection remotingConnection,
-                               boolean autoCommitSends,
-                               boolean autoCommitAcks,
-                               boolean preAcknowledge,
-                               boolean xa,
-                               String defaultAddress,
-                               SessionCallback callback,
-                               ServerSessionFactory sessionFactory) throws Exception;
-
-   SecurityStore getSecurityStore();
-
-   void removeSession(String name) throws Exception;
-
-   Set<ServerSession> getSessions();
-
-   HierarchicalRepository<Set<Role>> getSecurityRepository();
-
-   HierarchicalRepository<AddressSettings> getAddressSettingsRepository();
-
-   int getConnectionCount();
-
-   PostOffice getPostOffice();
-
-   QueueFactory getQueueFactory();
-
-   ResourceManager getResourceManager();
-
-   List<ServerSession> getSessions(String connectionID);
-
-   /** @return a session containing the meta-key and meata-value */
-   ServerSession lookupSession(String metakey, String metavalue);
-
-   ClusterManager getClusterManager();
-
-   SimpleString getNodeID();
-
-   boolean isActive();
-
-   /**
-    * Wait for server initialization.
-    * @param timeout
-    * @param unit
-    * @see CountDownLatch#await(long, TimeUnit)
-    * @return {@code true} if the server was already initialized or if it was initialized within the
-    *         timeout period, {@code false} otherwise.
-    * @throws InterruptedException
-    */
-   boolean waitForActivation(long timeout, TimeUnit unit) throws InterruptedException;
-
-   /**
-    * Creates a shared queue. if non durable it will exist as long as there are consumers.
-    *
-    * Notice: the queue won't be deleted until the first consumer arrives.
-    *
-    * @param address
-    * @param name
-    * @param filterString
-    * @param durable
-    * @throws Exception
-    */
-   void createSharedQueue(final SimpleString address,
-                           final SimpleString name,
-                           final SimpleString filterString,
-                           boolean durable) throws Exception;
-
-   Queue createQueue(SimpleString address,
-                     SimpleString queueName,
-                     SimpleString filter,
-                     boolean durable,
-                     boolean temporary) throws Exception;
-
-   Queue deployQueue(SimpleString address,
-                     SimpleString queueName,
-                     SimpleString filterString,
-                     boolean durable,
-                     boolean temporary) throws Exception;
-
-   Queue locateQueue(SimpleString queueName) throws Exception;
-
-   void destroyQueue(SimpleString queueName) throws Exception;
-
-   void destroyQueue(SimpleString queueName, ServerSession session) throws Exception;
-
-   void destroyQueue(SimpleString queueName, ServerSession session, boolean checkConsumerCount) throws Exception;
-
-   void destroyQueue(SimpleString queueName, ServerSession session, boolean checkConsumerCount, boolean removeConsumers) throws Exception;
-
-   String destroyConnectionWithSessionMetadata(String metaKey, String metaValue) throws Exception;
-
-   ScheduledExecutorService getScheduledPool();
-
-   ExecutorFactory getExecutorFactory();
-
-   void setGroupingHandler(GroupingHandler groupingHandler);
-
-   GroupingHandler getGroupingHandler();
-
-   ReplicationManager getReplicationManager();
-
-   void deployDivert(DivertConfiguration config) throws Exception;
-
-   void destroyDivert(SimpleString name) throws Exception;
-
-   ConnectorsService getConnectorsService();
-
-   void deployBridge(BridgeConfiguration config) throws Exception;
-
-   void destroyBridge(String name) throws Exception;
-
-   ServerSession getSessionByID(String sessionID);
-
-   void threadDump(String reason);
-
-   /**
-    * return true if there is a binding for this address (i.e. if there is a created queue)
-    * @param address
-    * @return
-    */
-   boolean isAddressBound(String address) throws Exception;
-
-   void stop(boolean failoverOnServerShutdown) throws Exception;
-
-   /*
-   * add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will
-   * replace any factories with the same protocol
-   * */
-   void addProtocolManagerFactory(ProtocolManagerFactory factory);
-
-   /*
-   * add a ProtocolManagerFactory to be used.
-   * */
-   void removeProtocolManagerFactory(ProtocolManagerFactory factory);
-
-   HornetQServer createBackupServer(Configuration configuration);
-
-   void addScaledDownNode(SimpleString scaledDownNodeId);
-
-   boolean hasScaledDown(SimpleString scaledDownNodeId);
-
-   Activation getActivation();
-
-   HAPolicy getHAPolicy();
-
-   void setHAPolicy(HAPolicy haPolicy);
-}


[41/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContextImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContextImpl.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContextImpl.java
new file mode 100644
index 0000000..e7f3546
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionForContextImpl.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+/**
+ *
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.Session;
+import javax.jms.XAJMSContext;
+
+import org.apache.activemq.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.utils.ReferenceCounter;
+import org.apache.activemq.utils.ReferenceCounterUtil;
+
+public abstract class ActiveMQConnectionForContextImpl implements ActiveMQConnectionForContext
+{
+
+   final Runnable closeRunnable = new Runnable()
+   {
+      public void run()
+      {
+         try
+         {
+            close();
+         }
+         catch (JMSException e)
+         {
+            throw JmsExceptionUtils.convertToRuntimeException(e);
+         }
+      }
+   };
+
+   final ReferenceCounter refCounter = new ReferenceCounterUtil(closeRunnable);
+
+   protected final ThreadAwareContext threadAwareContext = new ThreadAwareContext();
+
+   public JMSContext createContext(int sessionMode)
+   {
+      switch (sessionMode)
+      {
+         case Session.AUTO_ACKNOWLEDGE:
+         case Session.CLIENT_ACKNOWLEDGE:
+         case Session.DUPS_OK_ACKNOWLEDGE:
+         case Session.SESSION_TRANSACTED:
+         case ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE:
+         case ActiveMQJMSConstants.PRE_ACKNOWLEDGE:
+            break;
+         default:
+            throw new JMSRuntimeException("Invalid ackmode: " + sessionMode);
+      }
+      refCounter.increment();
+
+      return new ActiveMQJMSContext(this, sessionMode, threadAwareContext);
+   }
+
+   public XAJMSContext createXAContext()
+   {
+      refCounter.increment();
+
+      return new ActiveMQXAJMSContext(this, threadAwareContext);
+   }
+
+   @Override
+   public void closeFromContext()
+   {
+      refCounter.decrement();
+   }
+
+   protected void incrementRefCounter()
+   {
+      refCounter.increment();
+   }
+
+   public ThreadAwareContext getThreadAwareContext()
+   {
+      return threadAwareContext;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionMetaData.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionMetaData.java
new file mode 100644
index 0000000..1bbcf19
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQConnectionMetaData.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import javax.jms.ConnectionMetaData;
+import javax.jms.JMSException;
+
+import org.apache.activemq.core.version.Version;
+
+/**
+ * ActiveMQ implementation of a JMS ConnectionMetaData.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ *
+ */
+public class ActiveMQConnectionMetaData implements ConnectionMetaData
+{
+   // Constants -----------------------------------------------------
+
+   private static final String ACTIVEMQ = "ActiveMQ";
+
+   // Static --------------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final Version serverVersion;
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Create a new ActiveMQConnectionMetaData object.
+    */
+   public ActiveMQConnectionMetaData(final Version serverVersion)
+   {
+      this.serverVersion = serverVersion;
+   }
+
+   // ConnectionMetaData implementation -----------------------------
+
+   public String getJMSVersion() throws JMSException
+   {
+      return "2.0";
+   }
+
+   public int getJMSMajorVersion() throws JMSException
+   {
+      return 2;
+   }
+
+   public int getJMSMinorVersion() throws JMSException
+   {
+      return 0;
+   }
+
+   public String getJMSProviderName() throws JMSException
+   {
+      return ActiveMQConnectionMetaData.ACTIVEMQ;
+   }
+
+   public String getProviderVersion() throws JMSException
+   {
+      return serverVersion.getFullVersion();
+   }
+
+   public int getProviderMajorVersion() throws JMSException
+   {
+      return serverVersion.getMajorVersion();
+   }
+
+   public int getProviderMinorVersion() throws JMSException
+   {
+      return serverVersion.getMinorVersion();
+   }
+
+   public Enumeration getJMSXPropertyNames() throws JMSException
+   {
+      Vector<Object> v = new Vector<Object>();
+      v.add("JMSXGroupID");
+      v.add("JMSXGroupSeq");
+      v.add("JMSXDeliveryCount");
+      return v.elements();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQDestination.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQDestination.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQDestination.java
new file mode 100644
index 0000000..49e8ba2
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQDestination.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import java.io.Serializable;
+import java.util.UUID;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.jms.referenceable.DestinationObjectFactory;
+import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
+
+/**
+ * ActiveMQ implementation of a JMS Destination.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class ActiveMQDestination implements Destination, Serializable, Referenceable
+{
+   // Constants -----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   /**
+    *
+    */
+   private static final long serialVersionUID = 5027962425462382883L;
+
+   public static final String JMS_QUEUE_ADDRESS_PREFIX = "jms.queue.";
+
+   public static final String JMS_TEMP_QUEUE_ADDRESS_PREFIX = "jms.tempqueue.";
+
+   public static final String JMS_TOPIC_ADDRESS_PREFIX = "jms.topic.";
+
+   public static final String JMS_TEMP_TOPIC_ADDRESS_PREFIX = "jms.temptopic.";
+
+   private static final char SEPARATOR = '.';
+
+   private static String escape(final String input)
+   {
+      if (input == null)
+      {
+         return "";
+      }
+      return input.replace("\\", "\\\\").replace(".", "\\.");
+   }
+
+   public static Destination fromAddress(final String address)
+   {
+      if (address.startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX))
+      {
+         String name = address.substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length());
+
+         return createQueue(name);
+      }
+      else if (address.startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX))
+      {
+         String name = address.substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length());
+
+         return createTopic(name);
+      }
+      else if (address.startsWith(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX))
+      {
+         String name = address.substring(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
+
+         return new ActiveMQTemporaryQueue(address, name, null);
+      }
+      else if (address.startsWith(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX))
+      {
+         String name = address.substring(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
+
+         return new ActiveMQTemporaryTopic(address, name, null);
+      }
+      else
+      {
+         throw new JMSRuntimeException("Invalid address " + address);
+      }
+   }
+
+   public static String createQueueNameForDurableSubscription(final boolean isDurable, final String clientID, final String subscriptionName)
+   {
+      if (clientID != null)
+      {
+         if (isDurable)
+         {
+            return ActiveMQDestination.escape(clientID) + SEPARATOR +
+               ActiveMQDestination.escape(subscriptionName);
+         }
+         else
+         {
+            return "nonDurable" + SEPARATOR +
+               ActiveMQDestination.escape(clientID) + SEPARATOR +
+               ActiveMQDestination.escape(subscriptionName);
+         }
+      }
+      else
+      {
+         if (isDurable)
+         {
+            return ActiveMQDestination.escape(subscriptionName);
+         }
+         else
+         {
+            return "nonDurable" + SEPARATOR +
+               ActiveMQDestination.escape(subscriptionName);
+         }
+      }
+   }
+
+   public static String createQueueNameForSharedSubscription(final boolean isDurable, final String clientID, final String subscriptionName)
+   {
+      if (clientID != null)
+      {
+         return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
+            ActiveMQDestination.escape(clientID) + SEPARATOR +
+            ActiveMQDestination.escape(subscriptionName);
+      }
+      else
+      {
+         return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
+            ActiveMQDestination.escape(subscriptionName);
+      }
+   }
+
+   public static Pair<String, String> decomposeQueueNameForDurableSubscription(final String queueName)
+   {
+      StringBuffer[] parts = new StringBuffer[2];
+      int currentPart = 0;
+
+      parts[0] = new StringBuffer();
+      parts[1] = new StringBuffer();
+
+      int pos = 0;
+      while (pos < queueName.length())
+      {
+         char ch = queueName.charAt(pos);
+         pos++;
+
+         if (ch == SEPARATOR)
+         {
+            currentPart++;
+            if (currentPart >= parts.length)
+            {
+               throw new JMSRuntimeException("Invalid message queue name: " + queueName);
+            }
+
+            continue;
+         }
+
+         if (ch == '\\')
+         {
+            if (pos >= queueName.length())
+            {
+               throw new JMSRuntimeException("Invalid message queue name: " + queueName);
+            }
+            ch = queueName.charAt(pos);
+            pos++;
+         }
+
+         parts[currentPart].append(ch);
+      }
+
+      if (currentPart != 1)
+      {
+         throw new JMSRuntimeException("Invalid message queue name: " + queueName);
+      }
+
+      Pair<String, String> pair = new Pair<String, String>(parts[0].toString(), parts[1].toString());
+
+      return pair;
+   }
+
+   public static SimpleString createQueueAddressFromName(final String name)
+   {
+      return new SimpleString(JMS_QUEUE_ADDRESS_PREFIX + name);
+   }
+
+   public static SimpleString createTopicAddressFromName(final String name)
+   {
+      return new SimpleString(JMS_TOPIC_ADDRESS_PREFIX + name);
+   }
+
+   public static ActiveMQQueue createQueue(final String name)
+   {
+      return new ActiveMQQueue(name);
+   }
+
+   public static ActiveMQTopic createTopic(final String name)
+   {
+      return new ActiveMQTopic(name);
+   }
+
+   public static ActiveMQTemporaryQueue createTemporaryQueue(final String name, final ActiveMQSession session)
+   {
+      return new ActiveMQTemporaryQueue(JMS_TEMP_QUEUE_ADDRESS_PREFIX.concat(name), name, session);
+   }
+
+   public static ActiveMQTemporaryQueue createTemporaryQueue(final String name)
+   {
+      return createTemporaryQueue(name, null);
+   }
+
+   public static ActiveMQTemporaryQueue createTemporaryQueue(final ActiveMQSession session)
+   {
+      String name = UUID.randomUUID().toString();
+
+      return createTemporaryQueue(name, session);
+   }
+
+   public static ActiveMQTemporaryTopic createTemporaryTopic(final ActiveMQSession session)
+   {
+      String name = UUID.randomUUID().toString();
+
+      return createTemporaryTopic(name, session);
+   }
+
+   public static ActiveMQTemporaryTopic createTemporaryTopic(String name, final ActiveMQSession session)
+   {
+      return new ActiveMQTemporaryTopic(JMS_TEMP_TOPIC_ADDRESS_PREFIX.concat(name), name, session);
+   }
+
+   public static ActiveMQTemporaryTopic createTemporaryTopic(String name)
+   {
+      return createTemporaryTopic(name, null);
+   }
+
+   // Attributes ----------------------------------------------------
+
+   /**
+    * The JMS name
+    */
+   protected final String name;
+
+   /**
+    * The core address
+    */
+   private final String address;
+
+   /**
+    * SimpleString version of address
+    */
+   private final SimpleString simpleAddress;
+
+   private final boolean temporary;
+
+   private final boolean queue;
+
+   private final transient ActiveMQSession session;
+
+   // Constructors --------------------------------------------------
+
+   protected ActiveMQDestination(final String address, final String name,
+                                 final boolean temporary,
+                                 final boolean queue,
+                                 final ActiveMQSession session)
+   {
+      this.address = address;
+
+      this.name = name;
+
+      simpleAddress = new SimpleString(address);
+
+      this.temporary = temporary;
+
+      this.queue = queue;
+
+      this.session = session;
+   }
+
+   // Referenceable implementation ---------------------------------------
+
+   public Reference getReference() throws NamingException
+   {
+      return new Reference(this.getClass().getCanonicalName(),
+                           new SerializableObjectRefAddr("ActiveMQ-DEST", this),
+                           DestinationObjectFactory.class.getCanonicalName(),
+                           null);
+   }
+
+   public void delete() throws JMSException
+   {
+      if (session != null)
+      {
+         if (session.getCoreSession().isClosed())
+         {
+            // Temporary queues will be deleted when the connection is closed.. nothing to be done then!
+            return;
+         }
+         if (queue)
+         {
+            session.deleteTemporaryQueue(this);
+         }
+         else
+         {
+            session.deleteTemporaryTopic(this);
+         }
+      }
+   }
+
+   public boolean isQueue()
+   {
+      return queue;
+   }
+
+   // Public --------------------------------------------------------
+
+   public String getAddress()
+   {
+      return address;
+   }
+
+   public SimpleString getSimpleAddress()
+   {
+      return simpleAddress;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public boolean isTemporary()
+   {
+      return temporary;
+   }
+
+   @Override
+   public boolean equals(final Object o)
+   {
+      if (this == o)
+      {
+         return true;
+      }
+
+      if (!(o instanceof ActiveMQDestination))
+      {
+         return false;
+      }
+
+      ActiveMQDestination that = (ActiveMQDestination)o;
+
+      return address.equals(that.address);
+   }
+
+   @Override
+   public int hashCode()
+   {
+      return address.hashCode();
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientBundle.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientBundle.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientBundle.java
new file mode 100644
index 0000000..2b4a76b
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientBundle.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+
+import javax.jms.IllegalStateException;
+import javax.jms.IllegalStateRuntimeException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.MessageNotReadableException;
+import javax.jms.MessageNotWriteableException;
+
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.apache.activemq.api.core.ActiveMQInvalidFilterExpressionException;
+import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
+import org.apache.activemq.api.core.SimpleString;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 12
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
+ *
+ * so 129000 to 129999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQJMSClientBundle
+{
+   ActiveMQJMSClientBundle BUNDLE = Messages.getBundle(ActiveMQJMSClientBundle.class);
+
+   @Message(id = 129000, value =  "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
+
+   @Message(id = 129001, value =  "Invalid Subscription Name. It is required to set the subscription name", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException invalidSubscriptionName();
+
+   @Message(id = 129002, value =  "Destination {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNonExistentQueueException destinationDoesNotExist(SimpleString destination);
+
+   @Message(id = 129003, value =  "name cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nameCannotBeNull();
+
+   @Message(id = 129004, value =  "name cannot be empty", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nameCannotBeEmpty();
+
+   @Message(id = 129005, value =  "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateRuntimeException callingMethodFromListenerRuntime();
+
+   @Message(id = 129006, value =  "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException callingMethodFromListener();
+
+   @Message(id = 129007, value =  "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateRuntimeException callingMethodFromCompletionListenerRuntime();
+
+   @Message(id = 129008, value =  "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException callingMethodFromCompletionListener();
+
+   @Message(id = 129009, value = "Null {0} is not allowed", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullArgumentNotAllowed(String type);
+
+   @Message(id = 129010, value = "Topic (Destination) cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   InvalidDestinationException nullTopic();
+
+   @Message(id = 129011, value = "LargeMessage streaming is only possible on ByteMessage or StreamMessage",
+            format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException onlyValidForByteOrStreamMessages();
+
+   @Message(id = 129012, value = "The property name ''{0}'' is not a valid java identifier.",
+            format = Message.Format.MESSAGE_FORMAT)
+   JMSRuntimeException invalidJavaIdentifier(String propertyName);
+
+   @Message(id = 129013, value = "Message is read-only", format = Message.Format.MESSAGE_FORMAT)
+   MessageNotWriteableException messageNotWritable();
+
+   @Message(id = 129014, value = "Message is write-only", format = Message.Format.MESSAGE_FORMAT)
+   MessageNotReadableException messageNotReadable();
+
+   @Message(id = 129015, value = "Illegal deliveryMode value: {0}", format = Message.Format.MESSAGE_FORMAT)
+   JMSException illegalDeliveryMode(int deliveryMode);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientLogger.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientLogger.java
new file mode 100644
index 0000000..f044e4c
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSClientLogger.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/15/12
+ *
+ * Logger Code 12
+ *
+ * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 121000 to 121999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQJMSClientLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQJMSClientLogger LOGGER = Logger.getMessageLogger(ActiveMQJMSClientLogger.class, ActiveMQJMSClientLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122000, value = "I''m closing a JMS connection you left open. Please make sure you close all JMS connections explicitly before letting them go out of scope! see stacktrace to find out where it was created" , format = Message.Format.MESSAGE_FORMAT)
+   void connectionLeftOpen(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 122001, value = "Unhandled exception thrown from onMessage" , format = Message.Format.MESSAGE_FORMAT)
+   void onMessageError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124000, value = "Failed to call JMS exception listener" , format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingExcListener(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124002, value = "Queue Browser failed to create message" , format = Message.Format.MESSAGE_FORMAT)
+   void errorCreatingMessage(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124003, value = "Message Listener failed to prepare message for receipt" , format = Message.Format.MESSAGE_FORMAT)
+   void errorPreparingMessageForReceipt(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124004, value = "Message Listener failed to process message" , format = Message.Format.MESSAGE_FORMAT)
+   void errorProcessingMessage(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124005, value = "Message Listener failed to recover session" , format = Message.Format.MESSAGE_FORMAT)
+   void errorRecoveringSession(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 124006, value = "Failed to call Failover listener" , format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingFailoverListener(@Cause Exception e);
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConnectionFactory.java
new file mode 100644
index 0000000..cb7f01a
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConnectionFactory.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.QueueConnectionFactory;
+import javax.jms.TopicConnectionFactory;
+
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ServerLocator;
+
+
+/**
+ * A class that represents a ConnectionFactory.
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public class ActiveMQJMSConnectionFactory extends ActiveMQConnectionFactory implements TopicConnectionFactory, QueueConnectionFactory
+{
+
+   private static final long serialVersionUID = -2810634789345348326L;
+
+   /**
+    *
+    */
+   public ActiveMQJMSConnectionFactory()
+   {
+      super();
+   }
+
+   /**
+    * @param serverLocator
+    */
+   public ActiveMQJMSConnectionFactory(ServerLocator serverLocator)
+   {
+      super(serverLocator);
+   }
+
+   /**
+    * @param ha
+    * @param groupConfiguration
+    */
+   public ActiveMQJMSConnectionFactory(boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
+   {
+      super(ha, groupConfiguration);
+   }
+
+   /**
+    * @param ha
+    * @param initialConnectors
+    */
+   public ActiveMQJMSConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)
+   {
+      super(ha, initialConnectors);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConsumer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConsumer.java
new file mode 100644
index 0000000..1039758
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSConsumer.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSConsumer;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+
+/**
+ * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc.
+ */
+public class ActiveMQJMSConsumer implements JMSConsumer
+{
+
+   private final ActiveMQJMSContext context;
+   private final MessageConsumer consumer;
+
+   ActiveMQJMSConsumer(ActiveMQJMSContext context, MessageConsumer consumer)
+   {
+      this.context = context;
+      this.consumer = consumer;
+   }
+
+   @Override
+   public String getMessageSelector()
+   {
+      try
+      {
+         return consumer.getMessageSelector();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public MessageListener getMessageListener() throws JMSRuntimeException
+   {
+      try
+      {
+         return consumer.getMessageListener();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void setMessageListener(MessageListener listener) throws JMSRuntimeException
+   {
+      try
+      {
+         consumer.setMessageListener(new MessageListenerWrapper(listener));
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Message receive()
+   {
+      try
+      {
+         return context.setLastMessage(this, consumer.receive());
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Message receive(long timeout)
+   {
+      try
+      {
+         return context.setLastMessage(this, consumer.receive(timeout));
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Message receiveNoWait()
+   {
+      try
+      {
+         return context.setLastMessage(this, consumer.receiveNoWait());
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void close()
+   {
+      try
+      {
+         consumer.close();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public <T> T receiveBody(Class<T> c)
+   {
+      try
+      {
+         Message message = consumer.receive();
+         context.setLastMessage(ActiveMQJMSConsumer.this, message);
+         return message == null ? null : message.getBody(c);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public <T> T receiveBody(Class<T> c, long timeout)
+   {
+      try
+      {
+         Message message = consumer.receive(timeout);
+         context.setLastMessage(ActiveMQJMSConsumer.this, message);
+         return message == null ? null : message.getBody(c);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public <T> T receiveBodyNoWait(Class<T> c)
+   {
+      try
+      {
+         Message message = consumer.receiveNoWait();
+         context.setLastMessage(ActiveMQJMSConsumer.this, message);
+         return message == null ? null : message.getBody(c);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   final class MessageListenerWrapper implements MessageListener
+   {
+      private final MessageListener wrapped;
+
+      public MessageListenerWrapper(MessageListener wrapped)
+      {
+         this.wrapped = wrapped;
+      }
+
+      @Override
+      public void onMessage(Message message)
+      {
+         context.setLastMessage(ActiveMQJMSConsumer.this, message);
+
+         context.getThreadAwareContext().setCurrentThread(false);
+         try
+         {
+            wrapped.onMessage(message);
+         }
+         finally
+         {
+            context.getThreadAwareContext().clearCurrentThread(false);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSContext.java
new file mode 100644
index 0000000..e864347
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSContext.java
@@ -0,0 +1,769 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.BytesMessage;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateRuntimeException;
+import javax.jms.JMSConsumer;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.XAConnection;
+import javax.jms.XASession;
+import javax.transaction.xa.XAResource;
+import java.io.Serializable;
+
+/**
+ * ActiveMQ implementation of a JMSContext.
+ *
+ * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc
+ */
+public class ActiveMQJMSContext implements JMSContext
+{
+   private static final boolean DEFAULT_AUTO_START = true;
+   private final int sessionMode;
+
+   private final ThreadAwareContext threadAwareContext;
+
+   /**
+    * Client ACK needs to hold last acked messages, so context.ack calls will be respected.
+    */
+   private volatile Message lastMessagesWaitingAck;
+
+   private final ActiveMQConnectionForContext connection;
+   private Session session;
+   private boolean autoStart = ActiveMQJMSContext.DEFAULT_AUTO_START;
+   private MessageProducer innerProducer;
+   private boolean xa;
+   private boolean closed;
+
+   ActiveMQJMSContext(final ActiveMQConnectionForContext connection, final int ackMode, final boolean xa, ThreadAwareContext threadAwareContext)
+   {
+      this.connection = connection;
+      this.sessionMode = ackMode;
+      this.xa = xa;
+      this.threadAwareContext = threadAwareContext;
+   }
+
+   public ActiveMQJMSContext(ActiveMQConnectionForContext connection, int ackMode, ThreadAwareContext threadAwareContext)
+   {
+      this(connection, ackMode, false, threadAwareContext);
+   }
+
+   public ActiveMQJMSContext(ActiveMQConnectionForContext connection, ThreadAwareContext threadAwareContext)
+   {
+      this(connection, SESSION_TRANSACTED, true, threadAwareContext);
+   }
+
+   // XAJMSContext implementation -------------------------------------
+
+   public JMSContext getContext()
+   {
+      return this;
+   }
+
+   public Session getSession()
+   {
+      return session;
+   }
+
+   public XAResource getXAResource()
+   {
+      checkSession();
+      return ((XASession) session).getXAResource();
+   }
+
+   // JMSContext implementation -------------------------------------
+
+   @Override
+   public JMSContext createContext(int sessionMode)
+   {
+      return connection.createContext(sessionMode);
+   }
+
+   @Override
+   public JMSProducer createProducer()
+   {
+      checkSession();
+      try
+      {
+         return new ActiveMQJMSProducer(this, getInnerProducer());
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   private synchronized MessageProducer getInnerProducer() throws JMSException
+   {
+      if (innerProducer == null)
+      {
+         innerProducer = session.createProducer(null);
+      }
+
+      return innerProducer;
+   }
+
+   /**
+    *
+    */
+   private void checkSession()
+   {
+      if (session == null)
+      {
+         synchronized (this)
+         {
+            if (closed)
+               throw new IllegalStateRuntimeException("Context is closed");
+            if (session == null)
+            {
+               try
+               {
+                  if (xa)
+                  {
+                     session = ((XAConnection) connection).createXASession();
+                  }
+                  else
+                  {
+                     session = connection.createSession(sessionMode);
+                  }
+               }
+               catch (JMSException e)
+               {
+                  throw JmsExceptionUtils.convertToRuntimeException(e);
+               }
+            }
+         }
+      }
+   }
+
+   @Override
+   public String getClientID()
+   {
+      try
+      {
+         return connection.getClientID();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void setClientID(String clientID)
+   {
+      try
+      {
+         connection.setClientID(clientID);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public ConnectionMetaData getMetaData()
+   {
+      try
+      {
+         return connection.getMetaData();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public ExceptionListener getExceptionListener()
+   {
+      try
+      {
+         return connection.getExceptionListener();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void setExceptionListener(ExceptionListener listener)
+   {
+      try
+      {
+         connection.setExceptionListener(listener);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void start()
+   {
+      try
+      {
+         connection.start();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void stop()
+   {
+      threadAwareContext.assertNotMessageListenerThreadRuntime();
+      try
+      {
+         connection.stop();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void setAutoStart(boolean autoStart)
+   {
+      this.autoStart = autoStart;
+   }
+
+   @Override
+   public boolean getAutoStart()
+   {
+      return autoStart;
+   }
+
+   @Override
+   public void close()
+   {
+      threadAwareContext.assertNotCompletionListenerThreadRuntime();
+      threadAwareContext.assertNotMessageListenerThreadRuntime();
+      try
+      {
+         synchronized (this)
+         {
+            if (session != null)
+               session.close();
+            connection.closeFromContext();
+            closed = true;
+         }
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public BytesMessage createBytesMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createBytesMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public MapMessage createMapMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createMapMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Message createMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public ObjectMessage createObjectMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createObjectMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public ObjectMessage createObjectMessage(Serializable object)
+   {
+      checkSession();
+      try
+      {
+         return session.createObjectMessage(object);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public StreamMessage createStreamMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createStreamMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public TextMessage createTextMessage()
+   {
+      checkSession();
+      try
+      {
+         return session.createTextMessage();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public TextMessage createTextMessage(String text)
+   {
+      checkSession();
+      try
+      {
+         return session.createTextMessage(text);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public boolean getTransacted()
+   {
+      checkSession();
+      try
+      {
+         return session.getTransacted();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public int getSessionMode()
+   {
+      return sessionMode;
+   }
+
+   @Override
+   public void commit()
+   {
+      threadAwareContext.assertNotCompletionListenerThreadRuntime();
+      checkSession();
+      try
+      {
+         session.commit();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void rollback()
+   {
+      threadAwareContext.assertNotCompletionListenerThreadRuntime();
+      checkSession();
+      try
+      {
+         session.rollback();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void recover()
+   {
+      checkSession();
+      try
+      {
+         session.recover();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createConsumer(Destination destination)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createConsumer(Destination destination, String messageSelector)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination, messageSelector));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination, messageSelector, noLocal));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Queue createQueue(String queueName)
+   {
+      checkSession();
+      try
+      {
+         return session.createQueue(queueName);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public Topic createTopic(String topicName)
+   {
+      checkSession();
+      try
+      {
+         return session.createTopic(topicName);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createDurableConsumer(Topic topic, String name)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createDurableConsumer(topic, name));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createDurableConsumer(topic, name, messageSelector, noLocal));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createSharedDurableConsumer(Topic topic, String name)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedDurableConsumer(topic, name));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedDurableConsumer(topic, name, messageSelector));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector)
+   {
+      checkSession();
+      try
+      {
+         ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector));
+         checkAutoStart();
+         return consumer;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public QueueBrowser createBrowser(Queue queue)
+   {
+      checkSession();
+      try
+      {
+         QueueBrowser browser = session.createBrowser(queue);
+         checkAutoStart();
+         return browser;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public QueueBrowser createBrowser(Queue queue, String messageSelector)
+   {
+      checkSession();
+      try
+      {
+         QueueBrowser browser = session.createBrowser(queue, messageSelector);
+         checkAutoStart();
+         return browser;
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public TemporaryQueue createTemporaryQueue()
+   {
+      checkSession();
+      try
+      {
+         return session.createTemporaryQueue();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public TemporaryTopic createTemporaryTopic()
+   {
+      checkSession();
+      try
+      {
+         return session.createTemporaryTopic();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void unsubscribe(String name)
+   {
+      checkSession();
+      try
+      {
+         session.unsubscribe(name);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public void acknowledge()
+   {
+      checkSession();
+      if (closed)
+         throw new IllegalStateRuntimeException("Context is closed");
+      try
+      {
+         if (lastMessagesWaitingAck != null)
+         {
+            lastMessagesWaitingAck.acknowledge();
+         }
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   /**
+    * This is to be used on tests only. It's not part of the interface and it's not guaranteed to be kept
+    * on the API contract.
+    *
+    * @return
+    */
+   public Session getUsedSession()
+   {
+      return this.session;
+   }
+
+   private synchronized void checkAutoStart() throws JMSException
+   {
+      if (closed)
+         throw new IllegalStateRuntimeException("Context is closed");
+      if (autoStart)
+      {
+         connection.start();
+      }
+   }
+
+   /**
+    * this is to ensure Context.acknowledge would work on ClientACK
+    */
+   Message setLastMessage(final JMSConsumer consumer, final Message lastMessageReceived)
+   {
+      if (sessionMode == CLIENT_ACKNOWLEDGE)
+      {
+         lastMessagesWaitingAck = lastMessageReceived;
+      }
+      return lastMessageReceived;
+   }
+
+   public ThreadAwareContext getThreadAwareContext()
+   {
+      return threadAwareContext;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSProducer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSProducer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSProducer.java
new file mode 100644
index 0000000..44646aa
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQJMSProducer.java
@@ -0,0 +1,800 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.BytesMessage;
+import javax.jms.CompletionListener;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.JMSRuntimeException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageFormatRuntimeException;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.utils.TypedProperties;
+
+/**
+ * NOTE: this class forwards {@link #setDisableMessageID(boolean)} and
+ * {@link #setDisableMessageTimestamp(boolean)} calls their equivalent at the
+ * {@link MessageProducer}. IF the user is using the producer in async mode, this may lead to races.
+ * We allow/tolerate this because these are just optional optimizations.
+ *
+ * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc.
+ */
+public final class ActiveMQJMSProducer implements JMSProducer
+{
+   private final ActiveMQJMSContext context;
+   private final MessageProducer producer;
+   private final TypedProperties properties = new TypedProperties();
+
+   //we convert Strings to SimpleStrings so if getProperty is called the wrong object is returned, this list let's us return the
+   //correct type
+   private final List<SimpleString> stringPropertyNames = new ArrayList<>();
+
+   private volatile CompletionListener completionListener;
+
+   private Destination jmsHeaderReplyTo;
+   private String jmsHeaderCorrelationID;
+   private byte[] jmsHeaderCorrelationIDAsBytes;
+   private String jmsHeaderType;
+
+   ActiveMQJMSProducer(ActiveMQJMSContext context, MessageProducer producer)
+   {
+      this.context = context;
+      this.producer = producer;
+   }
+
+   @Override
+   public JMSProducer send(Destination destination, Message message)
+   {
+      if (message == null)
+      {
+         throw new MessageFormatRuntimeException("null message");
+      }
+
+      try
+      {
+         if (jmsHeaderCorrelationID != null)
+         {
+            message.setJMSCorrelationID(jmsHeaderCorrelationID);
+         }
+         if (jmsHeaderCorrelationIDAsBytes != null && jmsHeaderCorrelationIDAsBytes.length > 0)
+         {
+            message.setJMSCorrelationIDAsBytes(jmsHeaderCorrelationIDAsBytes);
+         }
+         if (jmsHeaderReplyTo != null)
+         {
+            message.setJMSReplyTo(jmsHeaderReplyTo);
+         }
+         if (jmsHeaderType != null)
+         {
+            message.setJMSType(jmsHeaderType);
+         }
+         // XXX HORNETQ-1209 "JMS 2.0" can this be a foreign msg?
+         // if so, then "SimpleString" properties will trigger an error.
+         setProperties(message);
+         if (completionListener != null)
+         {
+            CompletionListener wrapped = new CompletionListenerWrapper(completionListener);
+            producer.send(destination, message, wrapped);
+         }
+         else
+         {
+            producer.send(destination, message);
+         }
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+      return this;
+   }
+
+   /**
+    * Sets all properties we carry onto the message.
+    *
+    * @param message
+    * @throws JMSException
+    */
+   private void setProperties(Message message) throws JMSException
+   {
+      for (SimpleString name : properties.getPropertyNames())
+      {
+         message.setObjectProperty(name.toString(), properties.getProperty(name));
+      }
+   }
+
+   @Override
+   public JMSProducer send(Destination destination, String body)
+   {
+      TextMessage message = context.createTextMessage(body);
+      send(destination, message);
+      return this;
+   }
+
+   @Override
+   public JMSProducer send(Destination destination, Map<String, Object> body)
+   {
+      MapMessage message = context.createMapMessage();
+      if (body != null)
+      {
+         try
+         {
+            for (Entry<String, Object> entry : body.entrySet())
+            {
+               final String name = entry.getKey();
+               final Object v = entry.getValue();
+               if (v instanceof String)
+               {
+                  message.setString(name, (String) v);
+               }
+               else if (v instanceof Long)
+               {
+                  message.setLong(name, (Long) v);
+               }
+               else if (v instanceof Double)
+               {
+                  message.setDouble(name, (Double) v);
+               }
+               else if (v instanceof Integer)
+               {
+                  message.setInt(name, (Integer) v);
+               }
+               else if (v instanceof Character)
+               {
+                  message.setChar(name, (Character) v);
+               }
+               else if (v instanceof Short)
+               {
+                  message.setShort(name, (Short) v);
+               }
+               else if (v instanceof Boolean)
+               {
+                  message.setBoolean(name, (Boolean) v);
+               }
+               else if (v instanceof Float)
+               {
+                  message.setFloat(name, (Float) v);
+               }
+               else if (v instanceof Byte)
+               {
+                  message.setByte(name, (Byte) v);
+               }
+               else if (v instanceof byte[])
+               {
+                  byte[] array = (byte[]) v;
+                  message.setBytes(name, array, 0, array.length);
+               }
+               else
+               {
+                  message.setObject(name, v);
+               }
+            }
+         }
+         catch (JMSException e)
+         {
+            throw new MessageFormatRuntimeException(e.getMessage());
+         }
+      }
+      send(destination, message);
+      return this;
+   }
+
+   @Override
+   public JMSProducer send(Destination destination, byte[] body)
+   {
+      BytesMessage message = context.createBytesMessage();
+      if (body != null)
+      {
+         try
+         {
+            message.writeBytes(body);
+         }
+         catch (JMSException e)
+         {
+            throw new MessageFormatRuntimeException(e.getMessage());
+         }
+      }
+      send(destination, message);
+      return this;
+   }
+
+   @Override
+   public JMSProducer send(Destination destination, Serializable body)
+   {
+      ObjectMessage message = context.createObjectMessage(body);
+      send(destination, message);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setDisableMessageID(boolean value)
+   {
+      try
+      {
+         producer.setDisableMessageID(value);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+      return this;
+   }
+
+   @Override
+   public boolean getDisableMessageID()
+   {
+      try
+      {
+         return producer.getDisableMessageID();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSProducer setDisableMessageTimestamp(boolean value)
+   {
+      try
+      {
+         producer.setDisableMessageTimestamp(value);
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+      return this;
+   }
+
+   @Override
+   public boolean getDisableMessageTimestamp()
+   {
+      try
+      {
+         return producer.getDisableMessageTimestamp();
+      }
+      catch (JMSException e)
+      {
+         throw JmsExceptionUtils.convertToRuntimeException(e);
+      }
+   }
+
+   @Override
+   public JMSProducer setDeliveryMode(int deliveryMode)
+   {
+      try
+      {
+         producer.setDeliveryMode(deliveryMode);
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      return this;
+   }
+
+   @Override
+   public int getDeliveryMode()
+   {
+      try
+      {
+         return producer.getDeliveryMode();
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   @Override
+   public JMSProducer setPriority(int priority)
+   {
+      try
+      {
+         producer.setPriority(priority);
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      return this;
+   }
+
+   @Override
+   public int getPriority()
+   {
+      try
+      {
+         return producer.getPriority();
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   @Override
+   public JMSProducer setTimeToLive(long timeToLive)
+   {
+      try
+      {
+         producer.setTimeToLive(timeToLive);
+         return this;
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   @Override
+   public long getTimeToLive()
+   {
+      long timeToLive = 0;
+      try
+      {
+         timeToLive = producer.getTimeToLive();
+         return timeToLive;
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   @Override
+   public JMSProducer setDeliveryDelay(long deliveryDelay)
+   {
+      try
+      {
+         producer.setDeliveryDelay(deliveryDelay);
+         return this;
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+   }
+
+   @Override
+   public long getDeliveryDelay()
+   {
+      long deliveryDelay = 0;
+      try
+      {
+         deliveryDelay = producer.getDeliveryDelay();
+      }
+      catch (Exception ignored)
+      {
+      }
+      return deliveryDelay;
+   }
+
+   @Override
+   public JMSProducer setAsync(CompletionListener completionListener)
+   {
+      this.completionListener = completionListener;
+      return this;
+   }
+
+   @Override
+   public CompletionListener getAsync()
+   {
+      return completionListener;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, boolean value)
+   {
+      checkName(name);
+      properties.putBooleanProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, byte value)
+   {
+      checkName(name);
+      properties.putByteProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, short value)
+   {
+      checkName(name);
+      properties.putShortProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, int value)
+   {
+      checkName(name);
+      properties.putIntProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, long value)
+   {
+      checkName(name);
+      properties.putLongProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, float value)
+   {
+      checkName(name);
+      properties.putFloatProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, double value)
+   {
+      checkName(name);
+      properties.putDoubleProperty(new SimpleString(name), value);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, String value)
+   {
+      checkName(name);
+      SimpleString key = new SimpleString(name);
+      properties.putSimpleStringProperty(key, new SimpleString(value));
+      stringPropertyNames.add(key);
+      return this;
+   }
+
+   @Override
+   public JMSProducer setProperty(String name, Object value)
+   {
+      checkName(name);
+      try
+      {
+         TypedProperties.setObjectProperty(new SimpleString(name), value, properties);
+      }
+      catch (ActiveMQPropertyConversionException amqe)
+      {
+         throw new MessageFormatRuntimeException(amqe.getMessage());
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+      return this;
+   }
+
+   @Override
+   public JMSProducer clearProperties()
+   {
+      try
+      {
+         stringPropertyNames.clear();
+         properties.clear();
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+      return this;
+   }
+
+   @Override
+   public boolean propertyExists(String name)
+   {
+      return properties.containsProperty(new SimpleString(name));
+   }
+
+   @Override
+   public boolean getBooleanProperty(String name)
+   {
+      try
+      {
+         return properties.getBooleanProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+   }
+
+   @Override
+   public byte getByteProperty(String name)
+   {
+      try
+      {
+         return properties.getByteProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public short getShortProperty(String name)
+   {
+      try
+      {
+         return properties.getShortProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public int getIntProperty(String name)
+   {
+      try
+      {
+         return properties.getIntProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public long getLongProperty(String name)
+   {
+      try
+      {
+         return properties.getLongProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public float getFloatProperty(String name)
+   {
+      try
+      {
+         return properties.getFloatProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public double getDoubleProperty(String name)
+   {
+      try
+      {
+         return properties.getDoubleProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+   }
+
+   @Override
+   public String getStringProperty(String name)
+   {
+      try
+      {
+         SimpleString prop = properties.getSimpleStringProperty(new SimpleString(name));
+         if (prop == null)
+            return null;
+         return prop.toString();
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+   }
+
+   @Override
+   public Object getObjectProperty(String name)
+   {
+      try
+      {
+         SimpleString key = new SimpleString(name);
+         Object property = properties.getProperty(key);
+         if (stringPropertyNames.contains(key))
+         {
+            property = property.toString();
+         }
+         return property;
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+   }
+
+   @Override
+   public Set<String> getPropertyNames()
+   {
+      try
+      {
+         Set<SimpleString> simplePropNames = properties.getPropertyNames();
+         Set<String> propNames = new HashSet<String>(simplePropNames.size());
+
+         for (SimpleString str : simplePropNames)
+         {
+            propNames.add(str.toString());
+         }
+         return propNames;
+      }
+      catch (ActiveMQPropertyConversionException ce)
+      {
+         throw new MessageFormatRuntimeException(ce.getMessage());
+      }
+      catch (RuntimeException e)
+      {
+         throw new JMSRuntimeException(e.getMessage());
+      }
+   }
+
+   @Override
+   public JMSProducer setJMSCorrelationIDAsBytes(byte[] correlationID)
+   {
+      if (correlationID == null || correlationID.length == 0)
+      {
+         throw new JMSRuntimeException("Please specify a non-zero length byte[]");
+      }
+      jmsHeaderCorrelationIDAsBytes = Arrays.copyOf(correlationID, correlationID.length);
+      return this;
+   }
+
+   @Override
+   public byte[] getJMSCorrelationIDAsBytes()
+   {
+      return Arrays.copyOf(jmsHeaderCorrelationIDAsBytes, jmsHeaderCorrelationIDAsBytes.length);
+   }
+
+   @Override
+   public JMSProducer setJMSCorrelationID(String correlationID)
+   {
+      jmsHeaderCorrelationID = correlationID;
+      return this;
+   }
+
+   @Override
+   public String getJMSCorrelationID()
+   {
+      return jmsHeaderCorrelationID;
+   }
+
+   @Override
+   public JMSProducer setJMSType(String type)
+   {
+      jmsHeaderType = type;
+      return this;
+   }
+
+   @Override
+   public String getJMSType()
+   {
+      return jmsHeaderType;
+   }
+
+   @Override
+   public JMSProducer setJMSReplyTo(Destination replyTo)
+   {
+      jmsHeaderReplyTo = replyTo;
+      return this;
+   }
+
+   @Override
+   public Destination getJMSReplyTo()
+   {
+      return jmsHeaderReplyTo;
+   }
+
+   private void checkName(String name)
+   {
+      if (name == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nameCannotBeNull();
+      }
+      if (name.equals(""))
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nameCannotBeEmpty();
+      }
+   }
+
+   final class CompletionListenerWrapper implements CompletionListener
+   {
+
+      private final CompletionListener wrapped;
+
+      public CompletionListenerWrapper(CompletionListener wrapped)
+      {
+         this.wrapped = wrapped;
+      }
+
+      @Override
+      public void onCompletion(Message message)
+      {
+         context.getThreadAwareContext().setCurrentThread(true);
+         try
+         {
+            wrapped.onCompletion(message);
+         }
+         finally
+         {
+            context.getThreadAwareContext().clearCurrentThread(true);
+         }
+      }
+
+      @Override
+      public void onException(Message message, Exception exception)
+      {
+         context.getThreadAwareContext().setCurrentThread(true);
+         try
+         {
+            wrapped.onException(message, exception);
+         }
+         finally
+         {
+            context.getThreadAwareContext().clearCurrentThread(true);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMapMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMapMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMapMessage.java
new file mode 100644
index 0000000..58e86ad
--- /dev/null
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/ActiveMQMapMessage.java
@@ -0,0 +1,450 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.jms.client;
+
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.MessageFormatException;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
+import org.apache.activemq.api.core.Message;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.api.core.client.ClientSession;
+import org.apache.activemq.utils.TypedProperties;
+
+
+import static org.apache.activemq.reader.MapMessageUtil.writeBodyMap;
+import static org.apache.activemq.reader.MapMessageUtil.readBodyMap;
+
+/**
+ * ActiveMQ implementation of a JMS MapMessage.
+ *
+ * @author Norbert Lataille (Norbert.Lataille@m4x.org)
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ * @version $Revision: 3412 $
+ */
+public final class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage
+{
+   // Constants -----------------------------------------------------
+
+   public static final byte TYPE = Message.MAP_TYPE;
+
+   // Attributes ----------------------------------------------------
+
+   private final TypedProperties map = new TypedProperties();
+
+   private boolean invalid;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   /*
+    * This constructor is used to construct messages prior to sending
+    */
+   protected ActiveMQMapMessage(final ClientSession session)
+   {
+      super(ActiveMQMapMessage.TYPE, session);
+
+      invalid = true;
+   }
+
+   /*
+    * This constructor is used during reading
+    */
+   protected ActiveMQMapMessage(final ClientMessage message, final ClientSession session)
+   {
+      super(message, session);
+
+      invalid = false;
+   }
+
+   public ActiveMQMapMessage()
+   {
+      invalid = false;
+   }
+
+   /**
+    * Constructor for a foreign MapMessage
+    *
+    * @param foreign
+    * @throws JMSException
+    */
+   public ActiveMQMapMessage(final MapMessage foreign, final ClientSession session) throws JMSException
+   {
+      super(foreign, ActiveMQMapMessage.TYPE, session);
+      Enumeration<?> names = foreign.getMapNames();
+      while (names.hasMoreElements())
+      {
+         String name = (String) names.nextElement();
+         Object obj = foreign.getObject(name);
+         setObject(name, obj);
+      }
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public byte getType()
+   {
+      return ActiveMQMapMessage.TYPE;
+   }
+
+   // MapMessage implementation -------------------------------------
+
+   public void setBoolean(final String name, final boolean value) throws JMSException
+   {
+      checkName(name);
+      map.putBooleanProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setByte(final String name, final byte value) throws JMSException
+   {
+      checkName(name);
+      map.putByteProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setShort(final String name, final short value) throws JMSException
+   {
+      checkName(name);
+      map.putShortProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setChar(final String name, final char value) throws JMSException
+   {
+      checkName(name);
+      map.putCharProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setInt(final String name, final int value) throws JMSException
+   {
+      checkName(name);
+      map.putIntProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setLong(final String name, final long value) throws JMSException
+   {
+      checkName(name);
+      map.putLongProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setFloat(final String name, final float value) throws JMSException
+   {
+      checkName(name);
+      map.putFloatProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setDouble(final String name, final double value) throws JMSException
+   {
+      checkName(name);
+      map.putDoubleProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setString(final String name, final String value) throws JMSException
+   {
+      checkName(name);
+      map.putSimpleStringProperty(new SimpleString(name), value == null ? null : new SimpleString(value));
+      invalid = true;
+   }
+
+   public void setBytes(final String name, final byte[] value) throws JMSException
+   {
+      checkName(name);
+      map.putBytesProperty(new SimpleString(name), value);
+      invalid = true;
+   }
+
+   public void setBytes(final String name, final byte[] value, final int offset, final int length) throws JMSException
+   {
+      checkName(name);
+      if (offset + length > value.length)
+      {
+         throw new JMSException("Invalid offset/length");
+      }
+      byte[] newBytes = new byte[length];
+      System.arraycopy(value, offset, newBytes, 0, length);
+      map.putBytesProperty(new SimpleString(name), newBytes);
+      invalid = true;
+   }
+
+   public void setObject(final String name, final Object value) throws JMSException
+   {
+      checkName(name);
+      try
+      {
+         TypedProperties.setObjectProperty(new SimpleString(name), value, map);
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+      invalid = true;
+   }
+
+   public boolean getBoolean(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getBooleanProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public byte getByte(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getByteProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public short getShort(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getShortProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public char getChar(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getCharProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public int getInt(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getIntProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public long getLong(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getLongProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public float getFloat(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getFloatProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public double getDouble(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getDoubleProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public String getString(final String name) throws JMSException
+   {
+      try
+      {
+         SimpleString str = map.getSimpleStringProperty(new SimpleString(name));
+         if (str == null)
+         {
+            return null;
+         }
+         else
+         {
+            return str.toString();
+         }
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public byte[] getBytes(final String name) throws JMSException
+   {
+      try
+      {
+         return map.getBytesProperty(new SimpleString(name));
+      }
+      catch (ActiveMQPropertyConversionException e)
+      {
+         throw new MessageFormatException(e.getMessage());
+      }
+   }
+
+   public Object getObject(final String name) throws JMSException
+   {
+      Object val = map.getProperty(new SimpleString(name));
+
+      if (val instanceof SimpleString)
+      {
+         val = ((SimpleString) val).toString();
+      }
+
+      return val;
+   }
+
+   public Enumeration getMapNames() throws JMSException
+   {
+      Set<SimpleString> simplePropNames = map.getPropertyNames();
+      Set<String> propNames = new HashSet<String>(simplePropNames.size());
+
+      for (SimpleString str : simplePropNames)
+      {
+         propNames.add(str.toString());
+      }
+
+      return Collections.enumeration(propNames);
+   }
+
+   public boolean itemExists(final String name) throws JMSException
+   {
+      return map.containsProperty(new SimpleString(name));
+   }
+
+
+   // ActiveMQRAMessage overrides ----------------------------------------
+
+   @Override
+   public void clearBody() throws JMSException
+   {
+      super.clearBody();
+
+      map.clear();
+
+      invalid = true;
+   }
+
+   @Override
+   public void doBeforeSend() throws Exception
+   {
+      if (invalid)
+      {
+         writeBodyMap(message, map);
+         invalid = false;
+      }
+
+      super.doBeforeSend();
+   }
+
+   @Override
+   public void doBeforeReceive() throws ActiveMQException
+   {
+      super.doBeforeReceive();
+
+      readBodyMap(message, map);
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   /**
+    * Check the name
+    *
+    * @param name the name
+    */
+   private void checkName(final String name) throws JMSException
+   {
+      checkWrite();
+
+      if (name == null)
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nameCannotBeNull();
+      }
+      if (name.equals(""))
+      {
+         throw ActiveMQJMSClientBundle.BUNDLE.nameCannotBeEmpty();
+      }
+   }
+
+   @Override
+   protected boolean hasNoBody()
+   {
+      return map.isEmpty();
+   }
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
+                                     Class c)
+   {
+      if (hasNoBody())
+      {
+         return true;
+      }
+      return c.isAssignableFrom(java.util.Map.class);
+   }
+
+   @SuppressWarnings("unchecked")
+   @Override
+   protected <T> T getBodyInternal(Class<T> c)
+   {
+      return (T) map.getMap();
+   }
+}


[06/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
new file mode 100644
index 0000000..150628b
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServerLogger.java
@@ -0,0 +1,1366 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.server;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/8/12
+ *
+ * Logger Code 22
+ *
+ * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 101000 to 101999
+ */
+
+import javax.transaction.xa.Xid;
+import java.io.File;
+import java.net.SocketAddress;
+import java.net.URI;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+
+import io.netty.channel.Channel;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.client.impl.ServerLocatorInternal;
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.journal.IOAsyncTask;
+import org.apache.activemq.core.journal.SequentialFile;
+import org.apache.activemq.core.journal.impl.JournalFile;
+import org.apache.activemq.core.paging.cursor.PagePosition;
+import org.apache.activemq.core.paging.cursor.PageSubscription;
+import org.apache.activemq.core.persistence.OperationContext;
+import org.apache.activemq.core.protocol.core.Packet;
+import org.apache.activemq.core.protocol.core.impl.wireformat.BackupReplicationStartFailedMessage;
+import org.apache.activemq.core.server.cluster.Bridge;
+import org.apache.activemq.core.server.cluster.impl.BridgeImpl;
+import org.apache.activemq.core.server.cluster.impl.ClusterConnectionImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
+import org.apache.activemq.core.server.impl.ServerSessionImpl;
+import org.apache.activemq.core.server.management.Notification;
+import org.apache.activemq.utils.FutureLatch;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+import org.w3c.dom.Node;
+
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQServerLogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQServerLogger LOGGER = Logger.getMessageLogger(ActiveMQServerLogger.class, ActiveMQServerLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221000, value = "{0} server is starting with configuration {1}", format = Message.Format.MESSAGE_FORMAT)
+   void serverStarting(String type, Configuration configuration);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221001, value = "ActiveMQ Server version {0} [{1}] {2}", format = Message.Format.MESSAGE_FORMAT)
+   void serverStarted(String fullVersion, SimpleString nodeId, String identity);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221002, value = "ActiveMQ Server version {0} [{1}] stopped", format = Message.Format.MESSAGE_FORMAT)
+   void serverStopped(String version, SimpleString nodeId);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221003, value = "trying to deploy queue {0}", format = Message.Format.MESSAGE_FORMAT)
+   void deployQueue(SimpleString queueName);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221004, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
+   void dumpServerInfo(String serverInfo);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221005, value = "Deleting pending large message as it was not completed: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void deletingPendingMessage(Pair<Long, Long> msgToDelete);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221006, value = "Waiting to obtain live lock", format = Message.Format.MESSAGE_FORMAT)
+   void awaitingLiveLock();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221007, value = "Server is now live", format = Message.Format.MESSAGE_FORMAT)
+   void serverIsLive();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221008, value = "live server wants to restart, restarting server in backup", format = Message.Format.MESSAGE_FORMAT)
+   void awaitFailBack();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221109, value = "ActiveMQ Backup Server version {0} [{1}] started, waiting live to fail before it gets active",
+            format = Message.Format.MESSAGE_FORMAT)
+   void backupServerStarted(String version, SimpleString nodeID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221010, value = "Backup Server is now live", format = Message.Format.MESSAGE_FORMAT)
+   void backupServerIsLive();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221011, value = "Server {0} is now live", format = Message.Format.MESSAGE_FORMAT)
+   void serverIsLive(String identity);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221012, value = "Using AIO Journal", format = Message.Format.MESSAGE_FORMAT)
+   void journalUseAIO();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221013, value = "Using NIO Journal", format = Message.Format.MESSAGE_FORMAT)
+   void journalUseNIO();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221014, value = "{0}% loaded", format = Message.Format.MESSAGE_FORMAT)
+   void percentLoaded(Long percent);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221015, value = "Can not find queue {0} while reloading ACKNOWLEDGE_CURSOR, deleting record now",
+            format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueReloading(Long queueID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221016,
+            value = "Can not find queue {0} while reloading PAGE_CURSOR_COUNTER_VALUE, deleting record now",
+            format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueReloadingPage(Long queueID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221017, value = "Can not find queue {0} while reloading PAGE_CURSOR_COUNTER_INC, deleting record now",
+            format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueReloadingPageCursor(Long queueID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221018, value = "Large message: {0} did not have any associated reference, file will be deleted",
+            format = Message.Format.MESSAGE_FORMAT)
+   void largeMessageWithNoRef(Long messageID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221019, value = "Deleting unreferenced message id={0} from the journal", format = Message.Format.MESSAGE_FORMAT)
+   void journalUnreferencedMessage(Long messageID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221020, value = "Started Netty Acceptor version {0} {1}:{2,number,#}", format = Message.Format.MESSAGE_FORMAT)
+   void startedNettyAcceptor(String id, String host, Integer port);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221021, value = "failed to remove connection", format = Message.Format.MESSAGE_FORMAT)
+   void errorRemovingConnection();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221022, value = "unable to start connector service: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingConnectorService(@Cause Throwable e, String name);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221023, value = "unable to stop connector service: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingConnectorService(@Cause Throwable e, String name);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221024, value = "Backup server {0} is synchronized with live-server.", format = Message.Format.MESSAGE_FORMAT)
+   void backupServerSynched(ActiveMQServerImpl server);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221025, value = "Replication: sending {0} (size={1}) to backup. {2}", format = Message.Format.MESSAGE_FORMAT)
+   void journalSynch(JournalFile jf, Long size, SequentialFile file);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(
+      id = 221026,
+      value = "Bridge {0} connected to fowardingAddress={1}. {2} does not have any bindings what means messages will be ignored until a binding is created.",
+      format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNoBindings(SimpleString name, SimpleString forwardingAddress, SimpleString address);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221027, value = "Bridge {0} is connected", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeConnected(BridgeImpl name);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221028, value = "Bridge is stopping, will not retry", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeStopping();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221029, value = "stopped bridge {0}", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeStopped(SimpleString name);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221030, value = "paused bridge {0}", format = Message.Format.MESSAGE_FORMAT)
+   void bridgePaused(SimpleString name);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221031, value = "backup announced", format = Message.Format.MESSAGE_FORMAT)
+   void backupAnnounced();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221032, value = "Waiting to become backup node", format = Message.Format.MESSAGE_FORMAT)
+   void waitingToBecomeBackup();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221033, value = "** got backup lock", format = Message.Format.MESSAGE_FORMAT)
+   void gotBackupLock();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221034, value = "Waiting {0} to obtain live lock", format = Message.Format.MESSAGE_FORMAT)
+   void waitingToObtainLiveLock(String timeoutMessage);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221035, value = "Live Server Obtained live lock", format = Message.Format.MESSAGE_FORMAT)
+   void obtainedLiveLock();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221036, value = "Message with duplicate ID {0} was already set at {1}. Move from {2} being ignored and message removed from {3}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void messageWithDuplicateID(Object duplicateProperty, SimpleString toAddress, SimpleString address, SimpleString simpleString);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221037, value = "{0} to become ''live''", format = Message.Format.MESSAGE_FORMAT)
+   void becomingLive(ActiveMQServer server);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221038, value = "Configuration option ''{0}'' is deprecated. Consult the manual for details.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void deprecatedConfigurationOption(String deprecatedOption);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221039, value = "Restarting as Replicating backup server after live restart",
+            format = Message.Format.MESSAGE_FORMAT)
+   void restartingReplicatedBackupAfterFailback();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221040, value =  "Remote group coordinators did not start yet", format = Message.Format.MESSAGE_FORMAT)
+   void remoteGroupCoordinatorsNotStarted();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221041, value = "Cannot find queue {0} while reloading PAGE_CURSOR_COMPLETE, deleting record now",
+            format = Message.Format.MESSAGE_FORMAT)
+   void cantFindQueueOnPageComplete(long queueID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221042,
+            value = "Bridge {0} timed out waiting for the completion of {1} messages, we will just shutdown the bridge after 10 seconds wait",
+            format = Message.Format.MESSAGE_FORMAT)
+   void timedOutWaitingCompletions(String bridgeName, long numberOfMessages);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221043, value = "Adding protocol support {0}", format = Message.Format.MESSAGE_FORMAT)
+   void addingProtocolSupport(String protocolKey);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221045, value = "libaio is not available, switching the configuration into NIO", format = Message.Format.MESSAGE_FORMAT)
+   void switchingNIO();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221046, value = "Unblocking message production on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
+   void unblockingMessageProduction(SimpleString addressName, long currentSize, long maxSize);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221047, value = "Backup Server has scaled down to live server", format = Message.Format.MESSAGE_FORMAT)
+   void backupServerScaledDown();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221048, value = "Consumer {0}:{1} attached to queue ''{2}'' from {3} identified as ''slow.'' Expected consumption rate: {4} msgs/second; actual consumption rate: {5} msgs/second.", format = Message.Format.MESSAGE_FORMAT)
+   void slowConsumerDetected(String sessionID, long consumerID, String queueName, String remoteAddress, float slowConsumerThreshold, float consumerRate);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221049, value = "Activating Replica for node: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void activatingReplica(SimpleString nodeID);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 221050, value = "Activating Shared Store Slave", format = Message.Format.MESSAGE_FORMAT)
+   void activatingSharedStoreSlave();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222000, value = "ActiveMQServer is being finalized and has not been stopped. Please remember to stop the server before letting it go out of scope",
+            format = Message.Format.MESSAGE_FORMAT)
+   void serverFinalisedWIthoutBeingSTopped();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222001, value = "Error closing sessions while stopping server", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingSessionsWhileStoppingServer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222002, value = "Timed out waiting for pool to terminate {0}. Interrupting all its threads!", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutStoppingThreadpool(ExecutorService service);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222003, value = "Must specify a name for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void divertWithNoName();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222004, value = "Must specify an address for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void divertWithNoAddress();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222005, value = "Must specify a forwarding address for each divert. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void divertWithNoForwardingAddress();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222006, value = "Binding already exists with name {0}, divert will not be deployed", format = Message.Format.MESSAGE_FORMAT)
+   void divertBindingNotExists(SimpleString bindingName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222007, value = "Security risk! ActiveMQ is running with the default cluster admin user and default password. Please see the cluster chapter in the ActiveMQ User Guide for instructions on how to change this.", format = Message.Format.MESSAGE_FORMAT)
+   void clusterSecurityRisk();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222008, value = "unable to restart server, please kill and restart manually", format = Message.Format.MESSAGE_FORMAT)
+   void serverRestartWarning();
+
+   @LogMessage(level = Logger.Level.WARN)
+   void serverRestartWarning(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222009, value = "Unable to announce backup for replication. Trying to stop the server.", format = Message.Format.MESSAGE_FORMAT)
+   void replicationStartProblem(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222010, value = "Critical IO Error, shutting down the server. file={1}, message={0}", format = Message.Format.MESSAGE_FORMAT)
+   void ioCriticalIOError(String message, String file, @Cause Throwable code);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222011, value = "Error stopping server", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingServer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222012, value = "Timed out waiting for backup activation to exit", format = Message.Format.MESSAGE_FORMAT)
+   void backupActivationProblem();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222013, value = "Error when trying to start replication", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingReplication(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222014, value = "Error when trying to stop replication", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingReplication(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222015, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
+   void warn(String message);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222016, value = "Cannot deploy a connector with no name specified.", format = Message.Format.MESSAGE_FORMAT)
+   void connectorWithNoName();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222017, value = "There is already a connector with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void connectorAlreadyDeployed(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(
+      id = 222018,
+      value = "AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal",
+      format = Message.Format.MESSAGE_FORMAT)
+   void AIONotFound();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222019, value = "There is already a discovery group with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void discoveryGroupAlreadyDeployed(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222020, value = "error scanning for URL''s", format = Message.Format.MESSAGE_FORMAT)
+   void errorScanningURLs(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222021, value = "problem undeploying {0}", format = Message.Format.MESSAGE_FORMAT)
+   void problemUndeployingNode(@Cause Exception e, Node node);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222022, value = "Timed out waiting for paging cursor to stop {0} {1}", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutStoppingPagingCursor(FutureLatch future, Executor executor);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222023, value = "problem cleaning page address {0}", format = Message.Format.MESSAGE_FORMAT)
+   void problemCleaningPageAddress(@Cause Exception e, SimpleString address);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222024, value = "Could not complete operations on IO context {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void problemCompletingOperations(OperationContext e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222025, value = "Problem cleaning page subscription counter", format = Message.Format.MESSAGE_FORMAT)
+   void problemCleaningPagesubscriptionCounter(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222026, value = "Error on cleaning up cursor pages", format = Message.Format.MESSAGE_FORMAT)
+   void problemCleaningCursorPages(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222027, value = "Timed out flushing executors for paging cursor to stop {0}", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutFlushingExecutorsPagingCursor(PageSubscription pageSubscription);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222028, value = "Could not find page cache for page {0} removing it from the journal",
+            format = Message.Format.MESSAGE_FORMAT)
+   void pageNotFound(PagePosition pos);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222029,
+            value = "Could not locate page transaction {0}, ignoring message on position {1} on address={2} queue={3}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void pageSubscriptionCouldntLoad(long transactionID, PagePosition position, SimpleString address, SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222030, value = "File {0} being renamed to {1}.invalidPage as it was loaded partially. Please verify your data.", format = Message.Format.MESSAGE_FORMAT)
+   void pageInvalid(String fileName, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222031, value = "Error while deleting page file", format = Message.Format.MESSAGE_FORMAT)
+   void pageDeleteError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222032, value = "page finalise error", format = Message.Format.MESSAGE_FORMAT)
+   void pageFinaliseError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222033, value = "Page file {0} had incomplete records at position {1} at record number {2}", format = Message.Format.MESSAGE_FORMAT)
+   void pageSuspectFile(String fileName, int position, int msgNumber);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222034, value = "Can not delete page transaction id={0}", format = Message.Format.MESSAGE_FORMAT)
+   void pageTxDeleteError(@Cause Exception e, long recordID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222035, value = "Directory {0} did not have an identification file {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void pageStoreFactoryNoIdFile(String s, String addressFile);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222036, value = "Timed out on waiting PagingStore {0} to shutdown", format = Message.Format.MESSAGE_FORMAT)
+   void pageStoreTimeout(SimpleString address);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222037, value = "IO Error, impossible to start paging", format = Message.Format.MESSAGE_FORMAT)
+   void pageStoreStartIOError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222038, value = "Starting paging on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
+   void pageStoreStart(SimpleString storeName, long addressSize, long maxSize);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222039, value = "Messages sent to address ''{0}'' are being dropped; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
+   void pageStoreDropMessages(SimpleString storeName, long addressSize, long maxSize);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222040, value = "Server is stopped", format = Message.Format.MESSAGE_FORMAT)
+   void serverIsStopped();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222041, value = "Cannot find queue {0} to update delivery count", format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueDelCount(Long queueID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222042, value = "Cannot find message {0} to update delivery count", format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindMessageDelCount(Long msg);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222043, value = "Message for queue {0} which does not exist. This message will be ignored.", format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueForMessage(Long queueID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222044, value = "It was not possible to delete message {0}", format = Message.Format.MESSAGE_FORMAT)
+   void journalErrorDeletingMessage(@Cause Exception e, Long messageID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222045, value = "Message in prepared tx for queue {0} which does not exist. This message will be ignored.", format = Message.Format.MESSAGE_FORMAT)
+   void journalMessageInPreparedTX(Long queueID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222046, value = "Failed to remove reference for {0}", format = Message.Format.MESSAGE_FORMAT)
+   void journalErrorRemovingRef(Long messageID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222047, value = "Can not find queue {0} while reloading ACKNOWLEDGE_CURSOR",
+            format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueReloadingACK(Long queueID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222048, value = "PAGE_CURSOR_COUNTER_VALUE record used on a prepared statement, invalid state", format = Message.Format.MESSAGE_FORMAT)
+   void journalPAGEOnPrepared();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(
+      id = 222049,
+      value = "InternalError: Record type {0} not recognized. Maybe you are using journal files created on a different version",
+      format = Message.Format.MESSAGE_FORMAT)
+   void journalInvalidRecordType(Byte recordType);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222050, value = "Can not locate recordType={0} on loadPreparedTransaction//deleteRecords",
+            format = Message.Format.MESSAGE_FORMAT)
+   void journalInvalidRecordTypeOnPreparedTX(Byte recordType);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222051, value = "Journal Error", format = Message.Format.MESSAGE_FORMAT)
+   void journalError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222052, value = "error incrementing delay detection", format = Message.Format.MESSAGE_FORMAT)
+   void errorIncrementDelayDeletionCount(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222053, value = "Error on copying large message {0} for DLA or Expiry", format = Message.Format.MESSAGE_FORMAT)
+   void lareMessageErrorCopying(@Cause Exception e, LargeServerMessage largeServerMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222054, value = "Error on executing IOAsyncTask", format = Message.Format.MESSAGE_FORMAT)
+   void errorExecutingIOAsyncTask(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222055, value = "Error on deleting duplicate cache", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingDuplicateCache(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222056, value = "Did not route to any bindings for address {0} and sendToDLAOnNoRoute is true but there is no DLA configured for the address, the message will be ignored.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void noDLA(SimpleString address);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222057, value = "It was not possible to add references due to an IO error code {0} message = {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void ioErrorAddingReferences(Integer errorCode, String errorMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222058, value = "Duplicate message detected through the bridge - message will not be routed. Message information:\n{0}", format = Message.Format.MESSAGE_FORMAT)
+   void duplicateMessageDetectedThruBridge(ServerMessage message);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222059, value = "Duplicate message detected - message will not be routed. Message information:\n{0}", format = Message.Format.MESSAGE_FORMAT)
+   void duplicateMessageDetected(ServerMessage message);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222060, value = "Error while confirming large message completion on rollback for recordID={0}", format = Message.Format.MESSAGE_FORMAT)
+   void journalErrorConfirmingLargeMessage(@Cause Throwable e, Long messageID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222061, value = "Client connection failed, clearing up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
+   void clientConnectionFailed(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222062, value = "Cleared up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
+   void clearingUpSession(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222063, value = "Error processing IOCallback code = {0} message = {1}", format = Message.Format.MESSAGE_FORMAT)
+   void errorProcessingIOCallback(Integer errorCode, String errorMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222065, value = "Client is not being consistent on the request versioning. It just sent a version id={0} while it informed {1} previously", format = Message.Format.MESSAGE_FORMAT)
+   void incompatibleVersionAfterConnect(int version, int clientVersion);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222066, value = "Reattach request from {0} failed as there is no confirmationWindowSize configured, which may be ok for your system", format = Message.Format.MESSAGE_FORMAT)
+   void reattachRequestFailed(String remoteAddress);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222067, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT)
+   void connectionFailureDetected(String message, ActiveMQExceptionType type);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222069, value = "error cleaning up stomp connection", format = Message.Format.MESSAGE_FORMAT)
+   void errorCleaningStompConn(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222070, value = "Stomp Transactional acknowledgement is not supported", format = Message.Format.MESSAGE_FORMAT)
+   void stompTXAckNorSupported();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222071, value = "Interrupted while waiting for stomp heart beate to die", format = Message.Format.MESSAGE_FORMAT)
+   void errorOnStompHeartBeat(@Cause InterruptedException e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222072, value = "Timed out flushing channel on InVMConnection", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutFlushingInvmChannel();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212074, value = "channel group did not completely close", format = Message.Format.MESSAGE_FORMAT)
+   void nettyChannelGroupError();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222075, value = "{0} is still connected to {1}", format = Message.Format.MESSAGE_FORMAT)
+   void nettyChannelStillOpen(Channel channel, SocketAddress remoteAddress);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222076, value = "channel group did not completely unbind", format = Message.Format.MESSAGE_FORMAT)
+   void nettyChannelGroupBindError();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222077, value = "{0} is still bound to {1}", format = Message.Format.MESSAGE_FORMAT)
+   void nettyChannelStillBound(Channel channel, SocketAddress remoteAddress);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222078, value = "Error instantiating remoting interceptor {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorCreatingRemotingInterceptor(@Cause Exception e, String interceptorClass);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222079, value = "The following keys are invalid for configuring the acceptor: {0} the acceptor will not be started.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void invalidAcceptorKeys(String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222080, value = "Error instantiating remoting acceptor {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorCreatingAcceptor(@Cause Exception e, String factoryClassName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222081, value = "Timed out waiting for remoting thread pool to terminate", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutRemotingThreadPool();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222082, value = "error on connection failure check", format = Message.Format.MESSAGE_FORMAT)
+   void errorOnFailureCheck(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222083, value = "The following keys are invalid for configuring the connector service: {0} the connector will not be started.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void connectorKeysInvalid(String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222084, value = "The following keys are required for configuring the connector service: {0} the connector will not be started.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void connectorKeysMissing(String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222085, value = "Packet {0} can not be processed by the ReplicationEndpoint",
+            format = Message.Format.MESSAGE_FORMAT)
+   void invalidPacketForReplication(Packet packet);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222086, value = "error handling packet {0} for replication", format = Message.Format.MESSAGE_FORMAT)
+   void errorHandlingReplicationPacket(@Cause Exception e, Packet packet);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222087, value = "Replication Error while closing the page on backup", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingPageOnReplication(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222088, value = "Journal comparison mismatch:\n{0}", format = Message.Format.MESSAGE_FORMAT)
+   void journalcomparisonMismatch(String s);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222089, value = "Replication Error deleting large message ID = {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingLargeMessage(@Cause Exception e, long messageId);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222090, value = "Replication Large MessageID {0}  is not available on backup server. Ignoring replication message", format = Message.Format.MESSAGE_FORMAT)
+   void largeMessageNotAvailable(long messageId);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222091, value = "The backup node has been shut-down, replication will now stop", format = Message.Format.MESSAGE_FORMAT)
+   void replicationStopOnBackupShutdown();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222092, value = "Connection to the backup node failed, removing replication now", format = Message.Format.MESSAGE_FORMAT)
+   void replicationStopOnBackupFail(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222093, value = "Timed out waiting to stop Bridge", format = Message.Format.MESSAGE_FORMAT)
+   void timedOutWaitingToStopBridge();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222094, value = "Bridge unable to send message {0}, will try again once bridge reconnects", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeUnableToSendMessage(@Cause Exception e, MessageReference ref);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222095, value = "Connection failed with failedOver={0}", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeConnectionFailed(@Cause Exception e, Boolean failedOver);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222096, value = "Error on querying binding on bridge {0}. Retrying in 100 milliseconds", format = Message.Format.MESSAGE_FORMAT)
+   void errorQueryingBridge(@Cause Throwable t, SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222097, value = "Address {0} does not have any bindings yet, retry #({1})",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorQueryingBridge(SimpleString address, Integer retryCount);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222098, value = "Server is starting, retry to create the session for bridge {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingBridge(SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222099, value = "Bridge {0} is unable to connect to destination. It will be disabled.", format = Message.Format.MESSAGE_FORMAT)
+   void errorConnectingBridge(@Cause Exception e, Bridge bridge);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222100, value = "ServerLocator was shutdown, can not retry on opening connection for bridge",
+            format = Message.Format.MESSAGE_FORMAT)
+   void bridgeLocatorShutdown();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222101, value = "Bridge {0} achieved {1} maxattempts={2} it will stop retrying to reconnect", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeAbortStart(SimpleString name, Integer retryCount, Integer reconnectAttempts);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222102, value = "Unexpected exception while trying to reconnect", format = Message.Format.MESSAGE_FORMAT)
+   void errorReConnecting(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222103, value = "transaction with xid {0} timed out", format = Message.Format.MESSAGE_FORMAT)
+   void unexpectedXid(Xid xid);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222104, value = "IO Error completing the transaction, code = {0}, message = {1}", format = Message.Format.MESSAGE_FORMAT)
+   void ioErrorOnTX(Integer errorCode, String errorMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222105, value = "Could not finish context execution in 10 seconds",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorCompletingContext(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222106, value = "Replacing incomplete LargeMessage with ID={0}", format = Message.Format.MESSAGE_FORMAT)
+   void replacingIncompleteLargeMessage(Long messageID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222107, value = "Cleared up resources for session {0}", format = Message.Format.MESSAGE_FORMAT)
+   void clientConnectionFailedClearingSession(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222108, value = "unable to send notification when broadcast group is stopped",
+            format = Message.Format.MESSAGE_FORMAT)
+   void broadcastGroupClosed(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222109, value = "NodeID={0} is not available on the topology. Retrying the connection to that node now", format = Message.Format.MESSAGE_FORMAT)
+   void nodeNotAvailable(String targetNodeID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222110, value = "no queue IDs defined!,  originalMessage  = {0}, copiedMessage = {1}, props={2}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void noQueueIdDefined(ServerMessage message, ServerMessage messageCopy, SimpleString idsHeaderName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222111, value = "exception while invoking {0} on {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void managementOperationError(@Cause Exception e, String op, String resourceName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222112, value = "exception while retrieving attribute {0} on {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void managementAttributeError(@Cause Exception e, String att, String resourceName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222113, value = "On ManagementService stop, there are {0} unexpected registered MBeans: {1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void managementStopError(Integer size, List<String> unexpectedResourceNames);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222114, value = "Unable to delete group binding info {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void unableToDeleteGroupBindings(@Cause Exception e, SimpleString groupId);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222115, value = "Error closing serverLocator={0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingServerLocator(@Cause Exception e, ServerLocatorInternal clusterLocator);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222116, value = "unable to start broadcast group {0}", format = Message.Format.MESSAGE_FORMAT)
+   void unableToStartBroadcastGroup(@Cause Exception e, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222117, value = "unable to start cluster connection {0}", format = Message.Format.MESSAGE_FORMAT)
+   void unableToStartClusterConnection(@Cause Exception e, SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222118, value = "unable to start Bridge {0}", format = Message.Format.MESSAGE_FORMAT)
+   void unableToStartBridge(@Cause Exception e, SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222119, value = "No connector with name {0}. backup cannot be announced.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void announceBackupNoConnector(String connectorName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222120, value = "no cluster connections defined, unable to announce backup", format = Message.Format.MESSAGE_FORMAT)
+   void announceBackupNoClusterConnections();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222121, value = "Must specify a unique name for each bridge. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNotUnique();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222122, value = "Must specify a queue name for each bridge. This one {0} will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNoQueue(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222123, value = "Forward address is not specified on bridge {0}. Will use original message address instead", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNoForwardAddress(String bridgeName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222124, value = "There is already a bridge with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeAlreadyDeployed(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222125, value = "No queue found with name {0} bridge {1} will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeQueueNotFound(String queueName, String bridgeName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222126, value = "No discovery group found with name {0} bridge will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNoDiscoveryGroup(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222127, value = "Must specify a unique name for each cluster connection. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void clusterConnectionNotUnique();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222128, value = "Must specify an address for each cluster connection. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void clusterConnectionNoForwardAddress();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222129, value = "No connector with name {0}. The cluster connection will not be deployed.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void clusterConnectionNoConnector(String connectorName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222130,
+            value = "Cluster Configuration  {0} already exists. The cluster connection will not be deployed.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void clusterConnectionAlreadyExists(String connectorName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222131, value = "No discovery group with name {0}. The cluster connection will not be deployed.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void clusterConnectionNoDiscoveryGroup(String discoveryGroupName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222132, value = "There is already a broadcast-group with name {0} deployed. This one will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void broadcastGroupAlreadyExists(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(
+      id = 222133,
+      value = "There is no connector deployed with name {0}. The broadcast group with name {1} will not be deployed.",
+      format = Message.Format.MESSAGE_FORMAT)
+   void broadcastGroupNoConnector(String connectorName, String bgName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222134, value = "No connector defined with name {0}. The bridge will not be deployed.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void bridgeNoConnector(String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222135, value = "Stopping Redistributor, Timed out waiting for tasks to complete", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingRedistributor();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222136, value = "IO Error during redistribution, errorCode = {0} message = {1}", format = Message.Format.MESSAGE_FORMAT)
+   void ioErrorRedistributing(Integer errorCode, String errorMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222137, value = "Unable to announce backup, retrying", format = Message.Format.MESSAGE_FORMAT)
+   void errorAnnouncingBackup();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222138, value = "Local Member is not set at on ClusterConnection {0}", format = Message.Format.MESSAGE_FORMAT)
+   void noLocalMemborOnClusterConnection(ClusterConnectionImpl clusterConnection);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222139, value = "{0}::Remote queue binding {1} has already been bound in the post office. Most likely cause for this is you have a loop in your cluster due to cluster max-hops being too large or you have multiple cluster connections to the same nodes using overlapping addresses",
+            format = Message.Format.MESSAGE_FORMAT)
+   void remoteQueueAlreadyBoundOnClusterConnection(Object messageFlowRecord, SimpleString clusterName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222141, value = "Node Manager can not open file {0}", format = Message.Format.MESSAGE_FORMAT)
+   void nodeManagerCantOpenFile(@Cause Exception e, File file);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222142, value = "Error on resetting large message deliver - {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorResttingLargeMessage(@Cause Throwable e, Object deliverer);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222143, value = "Timed out waiting for executor to complete", format = Message.Format.MESSAGE_FORMAT)
+   void errorTransferringConsumer();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222144, value = "Queue could not finish waiting executors. Try increasing the thread pool size",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorFlushingExecutorsOnQueue();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222145, value = "Error expiring reference {0} 0n queue", format = Message.Format.MESSAGE_FORMAT)
+   void errorExpiringReferencesOnQueue(@Cause Exception e, MessageReference ref);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222146, value = "Message has expired. No bindings for Expiry Address {0} so dropping it", format = Message.Format.MESSAGE_FORMAT)
+   void errorExpiringReferencesNoBindings(SimpleString expiryAddress);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222147, value = "Message has expired. No expiry queue configured for queue {0} so dropping it", format = Message.Format.MESSAGE_FORMAT)
+   void errorExpiringReferencesNoQueue(SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222148, value = "Message {0} has exceeded max delivery attempts. No bindings for Dead Letter Address {1} so dropping it",
+            format = Message.Format.MESSAGE_FORMAT)
+   void messageExceededMaxDelivery(MessageReference ref, SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222149, value = "Message {0} has reached maximum delivery attempts, sending it to Dead Letter Address {1} from {2}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void messageExceededMaxDeliverySendtoDLA(MessageReference ref, SimpleString name, SimpleString simpleString);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222150, value = "Message has exceeded max delivery attempts. No Dead Letter Address configured for queue {0} so dropping it",
+            format = Message.Format.MESSAGE_FORMAT)
+   void messageExceededMaxDeliveryNoDLA(SimpleString name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222151, value = "removing consumer which did not handle a message, consumer={0}, message={1}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void removingBadConsumer(@Cause Throwable e, Consumer consumer, MessageReference reference);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222152, value = "Unable to decrement reference counting on queue",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorDecrementingRefCount(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222153, value = "Unable to remove message id = {0} please remove manually",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorRemovingMessage(@Cause Throwable e, Long messageID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222154, value = "Error checking DLQ",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorCheckingDLQ(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222155, value = "Failed to register as backup. Stopping the server.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorRegisteringBackup();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222156, value = "Less than {0}%\n{1}\nYou are in danger of running out of RAM. Have you set paging parameters on your addresses? (See user manual \"Paging\" chapter)",
+            format = Message.Format.MESSAGE_FORMAT)
+   void memoryError(Integer memoryWarningThreshold, String info);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222157, value = "Error completing callback on replication manager",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorCompletingCallbackOnReplicationManager(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222158, value = "{0} backup activation thread did not finish.", format = Message.Format.MESSAGE_FORMAT)
+   void backupActivationDidntFinish(ActiveMQServer server);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222159, value = "unable to send notification when broadcast group is stopped", format = Message.Format.MESSAGE_FORMAT)
+   void broadcastBridgeStoppedError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222160, value = "unable to send notification when broadcast group is stopped", format = Message.Format.MESSAGE_FORMAT)
+   void notificationBridgeStoppedError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222161, value = "Group Handler timed-out waiting for sendCondition", format = Message.Format.MESSAGE_FORMAT)
+   void groupHandlerSendTimeout();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222162, value = "Moving data directory {0} to {1}", format = Message.Format.MESSAGE_FORMAT)
+   void backupMovingDataAway(String oldPath, String newPath);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222163, value = "Server is being completely stopped, since this was a replicated backup there may be journal files that need cleaning up. The ActiveMQ server will have to be manually restarted.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void stopReplicatedBackupAfterFailback();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222164, value = "Error when trying to start replication {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingReplication(BackupReplicationStartFailedMessage.BackupRegistrationProblem problem);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222165, value = "Error starting naming server", format = Message.Format.MESSAGE_FORMAT)
+   void unableToStartNamingServer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222166, value = "Error stopping naming server", format = Message.Format.MESSAGE_FORMAT)
+   void unableToStopNamingServer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222167, value = "Group Binding not available so deleting {0} groups from {1}, groups will be bound to another node",
+            format = Message.Format.MESSAGE_FORMAT)
+   void groupingQueueRemoved(int size, SimpleString clusterName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222168, value = "The ''protocol'' property is deprecated, if you want this Acceptor to support multiple protocols use the ''protocols'' property, i.e. ''CORE,AMQP,STOMP''",
+            format = Message.Format.MESSAGE_FORMAT)
+   void warnDeprecatedProtocol();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222169, value = "You have old legacy clients connected to the queue {0} and we can''t disconnect them, these clients may just hang",
+            format = Message.Format.MESSAGE_FORMAT)
+   void warnDisconnectOldClient(String queueName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222170, value = "Bridge {0} forwarding address {1} has confirmation-window-size ({2}) greater than address'' max-size-bytes'' ({3})",
+            format = Message.Format.MESSAGE_FORMAT)
+   void bridgeConfirmationWindowTooSmall(String bridgeName, String address, int windowConfirmation, long maxSizeBytes);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222171, value = "Bridge {0} forwarding address {1} could not be resolved on address-settings configuration",
+            format = Message.Format.MESSAGE_FORMAT)
+   void bridgeCantFindAddressConfig(String bridgeName, String forwardingAddress);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222172, value = "Queue {0} was busy for more than {1} milliseconds. There are possibly consumers hanging on a network operation",
+            format = Message.Format.MESSAGE_FORMAT)
+   void queueBusy(String name, long timeout);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222173, value = "Queue {0} is duplicated during reload. This queue will be renamed as {1}", format = Message.Format.MESSAGE_FORMAT)
+   void queueDuplicatedRenaming(String name, String newName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222174, value = "Queue {0}, on address={1}, is taking too long to flush deliveries. Watch out for frozen clients.", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutFlushInTransit(String queueName, String addressName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222175, value = "Bridge {0} could not find configured connectors", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeCantFindConnectors(String bridgeName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222176,
+            value = "A session that was already doing XA work on {0} is replacing the xid by {1} " +
+               ". This was most likely caused from a previous communication timeout",
+            format = Message.Format.MESSAGE_FORMAT)
+   void xidReplacedOnXStart(String xidOriginalToString, String xidReplacedToString);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222177, value = "Wrong configuration for role, {0} is not a valid permission",
+            format = Message.Format.MESSAGE_FORMAT)
+   void rolePermissionConfigurationError(String permission);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222178, value = "Error during recovery of page counters",
+            format = Message.Format.MESSAGE_FORMAT)
+   void errorRecoveringPageCounter(@Cause Throwable error);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222181, value = "Unable to scaleDown messages", format = Message.Format.MESSAGE_FORMAT)
+   void failedToScaleDown(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222182, value = "Missing cluster-configuration for scale-down-clustername {0}", format = Message.Format.MESSAGE_FORMAT)
+   void missingClusterConfigForScaleDown(String scaleDownCluster);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222183, value = "Blocking message production on address ''{0}''; size is currently: {1} bytes; max-size-bytes: {2}", format = Message.Format.MESSAGE_FORMAT)
+   void blockingMessageProduction(SimpleString addressName, long currentSize, long maxSize);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222184,
+         value = "Unable to recover group bindings in SCALE_DOWN mode, only FULL backup server can do this",
+         format = Message.Format.MESSAGE_FORMAT)
+   void groupBindingsOnRecovery();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222185,
+         value = "no cluster connection for specified replication cluster",
+         format = Message.Format.MESSAGE_FORMAT)
+   void noClusterConnectionForReplicationCluster();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222186,
+         value = "unable to authorise cluster control",
+         format = Message.Format.MESSAGE_FORMAT)
+   void clusterControlAuthfailure();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222187,
+          value = "Failed to activate replicata",
+          format = Message.Format.MESSAGE_FORMAT)
+   void activateReplicatedBackupFailed(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222188,
+          value = "Unable to find target queue for node {0}",
+          format = Message.Format.MESSAGE_FORMAT)
+   void unableToFindTargetQueue(String targetNodeID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222189,
+         value = "Failed to activate shared store slave",
+         format = Message.Format.MESSAGE_FORMAT)
+   void activateSharedStoreSlaveFailed(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222190,
+         value = "Disallowing use of vulnerable protocol: {0}. See http://www.oracle.com/technetwork/topics/security/poodlecve-2014-3566-2339408.html for more details.",
+         format = Message.Format.MESSAGE_FORMAT)
+   void disallowedProtocol(String protocol);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
+   void initializationError(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224001, value = "Error deploying URI {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeployingURI(@Cause Throwable e, URI uri);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224002, value = "Error deploying URI", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeployingURI(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224003, value = "Error undeploying URI {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorUnDeployingURI(@Cause Throwable e, URI a);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224005, value = "Unable to deploy node {0}", format = Message.Format.MESSAGE_FORMAT)
+   void unableToDeployNode(@Cause Exception e, Node node);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224006, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidFilter(@Cause Throwable t, SimpleString filter);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224007, value = "page subscription = {0} error={1}", format = Message.Format.MESSAGE_FORMAT)
+   void pageSubscriptionError(IOAsyncTask ioAsyncTask, String error);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224008, value = "Failed to store id", format = Message.Format.MESSAGE_FORMAT)
+   void batchingIdError(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224009, value = "Cannot find message {0}", format = Message.Format.MESSAGE_FORMAT)
+   void cannotFindMessage(Long id);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224010, value = "Cannot find queue messages for queueID={0} on ack for messageID={1}", format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueue(Long queue, Long id);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224011, value = "Cannot find queue messages {0} for message {1} while processing scheduled messages", format = Message.Format.MESSAGE_FORMAT)
+   void journalCannotFindQueueScheduled(Long queue, Long id);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224012, value = "error releasing resources", format = Message.Format.MESSAGE_FORMAT)
+   void largeMessageErrorReleasingResources(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224013, value = "failed to expire messages for queue", format = Message.Format.MESSAGE_FORMAT)
+   void errorExpiringMessages(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224014, value = "Failed to close session", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingSession(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224015, value = "Caught XA exception", format = Message.Format.MESSAGE_FORMAT)
+   void caughtXaException(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224016, value = "Caught exception", format = Message.Format.MESSAGE_FORMAT)
+   void caughtException(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224017, value = "Invalid packet {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidPacket(Packet packet);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224018, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
+   void failedToCreateSession(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224019, value = "Failed to reattach session", format = Message.Format.MESSAGE_FORMAT)
+   void failedToReattachSession(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224020, value = "Failed to handle create queue", format = Message.Format.MESSAGE_FORMAT)
+   void failedToHandleCreateQueue(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224021, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT)
+   void errorDecodingPacket(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224022, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingFailureListener(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224024, value = "Stomp Error, tx already exist! {0}", format = Message.Format.MESSAGE_FORMAT)
+   void stompErrorTXExists(String txID);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224027, value = "Failed to write to handler on invm connector {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorWritingToInvmConnector(@Cause Exception e, Runnable runnable);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224028, value = "Failed to stop acceptor", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingAcceptor();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224029, value = "large message sync: largeMessage instance is incompatible with it, ignoring data", format = Message.Format.MESSAGE_FORMAT)
+   void largeMessageIncompatible();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224030, value = "Could not cancel reference {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorCancellingRefOnBridge(@Cause Exception e, MessageReference ref2);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224031, value = "-------------------------------Stomp begin tx: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void stompBeginTX(String txID);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224032, value = "Failed to pause bridge", format = Message.Format.MESSAGE_FORMAT)
+   void errorPausingBridge(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224033, value = "Failed to broadcast connector configs", format = Message.Format.MESSAGE_FORMAT)
+   void errorBroadcastingConnectorConfigs(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224034, value = "Failed to close consumer", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingConsumer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224035, value = "Failed to close cluster connection flow record", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingFlowRecord(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224036, value = "Failed to update cluster connection topology", format = Message.Format.MESSAGE_FORMAT)
+   void errorUpdatingTopology(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224037, value = "cluster connection Failed to handle message", format = Message.Format.MESSAGE_FORMAT)
+   void errorHandlingMessage(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224038, value = "Failed to ack old reference", format = Message.Format.MESSAGE_FORMAT)
+   void errorAckingOldReference(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224039, value = "Failed to expire message reference", format = Message.Format.MESSAGE_FORMAT)
+   void errorExpiringRef(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224040, value = "Failed to remove consumer", format = Message.Format.MESSAGE_FORMAT)
+   void errorRemovingConsumer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224041, value = "Failed to deliver", format = Message.Format.MESSAGE_FORMAT)
+   void errorDelivering(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224042, value = "Error while restarting the backup server: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorRestartingBackupServer(@Cause Exception e, ActiveMQServer backup);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224043, value = "Failed to send forced delivery message", format = Message.Format.MESSAGE_FORMAT)
+   void errorSendingForcedDelivery(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224044, value = "error acknowledging message", format = Message.Format.MESSAGE_FORMAT)
+   void errorAckingMessage(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224045, value = "Failed to run large message deliverer", format = Message.Format.MESSAGE_FORMAT)
+   void errorRunningLargeMessageDeliverer(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224046, value = "Exception while browser handled from {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorBrowserHandlingMessage(@Cause Exception e, MessageReference current);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224047, value = "Failed to delete large message file", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingLargeMessageFile(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224048, value = "Failed to remove temporary queue {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorRemovingTempQueue(@Cause Exception e, SimpleString bindingName);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224049, value = "Cannot find consumer with id {0}", format = Message.Format.MESSAGE_FORMAT)
+   void cannotFindConsumer(long consumerID);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224050, value = "Failed to close connection {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingConnection(ServerSessionImpl serverSession);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224051, value = "Failed to call notification listener", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingNotifListener(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224052, value = "Unable to call Hierarchical Repository Change Listener", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingRepoListener(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224053, value = "failed to timeout transaction, xid:{0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorTimingOutTX(@Cause Exception e, Xid xid);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224054, value = "exception while stopping the replication manager", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingReplicationManager(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224055, value = "Bridge Failed to ack", format = Message.Format.MESSAGE_FORMAT)
+   void bridgeFailedToAck(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224056, value = "Live server will not fail-back automatically", format = Message.Format.MESSAGE_FORMAT)
+   void autoFailBackDenied();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224057, value = "Backup server that requested fail-back was not announced. Server will not stop for fail-back.",
+            format = Message.Format.MESSAGE_FORMAT)
+   void failbackMissedBackupAnnouncement();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224058, value = "Stopping ClusterManager. As it failed to authenticate with the cluster: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void clusterManagerAuthenticationError(String msg);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224059, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidCipherSuite(String validSuites);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224060, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void invalidProtocol(String validProtocols);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 224069, value = "Could not contact group handler coordinator after 10 retries, message being routed without grouping information",
+            format = Message.Format.MESSAGE_FORMAT)
+   void impossibleToRouteGrouped();
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224061, value = "Setting both <{0}> and <ha-policy> is invalid. Please use <ha-policy> exclusively as <{0}> is deprecated. Ignoring <{0}> value.", format = Message.Format.MESSAGE_FORMAT)
+   void incompatibleWithHAPolicy(String parameter);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224062, value = "Failed to send SLOW_CONSUMER notification: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void failedToSendSlowConsumerNotification(Notification notification, @Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224063, value = "Failed to close consumer connections for address {0}", format = Message.Format.MESSAGE_FORMAT)
+   void failedToCloseConsumerConnectionsForAddress(String address, @Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 224064, value = "Setting <{0}> is invalid with this HA Policy Configuration. Please use <ha-policy> exclusively or remove. Ignoring <{0}> value.", format = Message.Format.MESSAGE_FORMAT)
+   void incompatibleWithHAPolicyChosen(String parameter);
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServers.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServers.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServers.java
new file mode 100644
index 0000000..411f68c
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServers.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.server;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl;
+
+/**
+ * ActiveMQServers is a factory class for instantiating ActiveMQServer instances.
+ * <p>
+ * This class should be used when you want to instantiate a ActiveMQServer instance for embedding in
+ * your own application, as opposed to directly instantiating an implementing instance.
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public final class ActiveMQServers
+{
+
+   private ActiveMQServers()
+   {
+      // Utility class
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config, final boolean enablePersistence)
+   {
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config,
+                                                                ManagementFactory.getPlatformMBeanServer(),
+                                                                securityManager,
+                                                                enablePersistence);
+
+      return server;
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config)
+   {
+      return ActiveMQServers.newActiveMQServer(config, config.isPersistenceEnabled());
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config,
+                                                  final MBeanServer mbeanServer,
+                                                  final boolean enablePersistence)
+   {
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, mbeanServer, securityManager, enablePersistence);
+
+      return server;
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config, final MBeanServer mbeanServer)
+   {
+      return ActiveMQServers.newActiveMQServer(config, mbeanServer, true);
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config,
+                                                  final MBeanServer mbeanServer,
+                                                  final ActiveMQSecurityManager securityManager)
+   {
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, mbeanServer, securityManager, true);
+
+      return server;
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config,
+                                                  final MBeanServer mbeanServer,
+                                                  final ActiveMQSecurityManager securityManager,
+                                                  final boolean enablePersistence)
+   {
+      config.setPersistenceEnabled(enablePersistence);
+
+      ActiveMQServer server = new ActiveMQServerImpl(config, mbeanServer, securityManager);
+
+      return server;
+   }
+
+   public static ActiveMQServer newActiveMQServer(Configuration config,
+                                                  String defUser, String defPass)
+   {
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+
+      securityManager.addUser(defUser, defPass);
+
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config,
+                                                                ManagementFactory.getPlatformMBeanServer(),
+                                                                securityManager,
+                                                                config.isPersistenceEnabled());
+
+      return server;
+   }
+
+   public static ActiveMQServer newActiveMQServer(final Configuration config,
+                                                  final MBeanServer mbeanServer,
+                                                  final boolean enablePersistence,
+                                                  String user,
+                                                  String password)
+   {
+      ActiveMQSecurityManager securityManager = new ActiveMQSecurityManagerImpl();
+
+      securityManager.addUser(user, password);
+
+      ActiveMQServer server = ActiveMQServers.newActiveMQServer(config, mbeanServer, securityManager, enablePersistence);
+
+      return server;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ConnectorService.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ConnectorService.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ConnectorService.java
index 9e76264..96a91b4 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/server/ConnectorService.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ConnectorService.java
@@ -16,7 +16,7 @@ package org.apache.activemq.core.server;
  * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
  *         Created Jun 29, 2010
  */
-public interface ConnectorService extends HornetQComponent
+public interface ConnectorService extends ActiveMQComponent
 {
    String getName();
 }


[52/52] [abbrv] activemq-6 git commit: Merge PR #13 with fixes on classnames and packages from Justin Bertram

Posted by cl...@apache.org.
Merge PR #13 with fixes on classnames and packages from Justin Bertram


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/3d749a43
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/3d749a43
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/3d749a43

Branch: refs/heads/master
Commit: 3d749a431fdf6b8ca77c528f80f453cbd4a84b77
Parents: 8861802 034adfb
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Nov 18 18:36:08 2014 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Nov 18 18:36:08 2014 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/cli/commands/Run.java   |   16 +-
 .../factory/SecurityManagerFactory.java         |    6 +-
 .../bootstrap/ActiveMQBootstrapBundle.java      |   31 +
 .../bootstrap/ActiveMQBootstrapLogger.java      |   71 +
 .../bootstrap/HornetQBootstrapBundle.java       |   31 -
 .../bootstrap/HornetQBootstrapLogger.java       |   71 -
 .../activemq/api/core/ActiveMQBuffer.java       |    2 +-
 .../activemq/api/core/ActiveMQBuffers.java      |   24 +-
 .../ActiveMQConnectionTimedOutException.java    |    2 +-
 .../api/core/ActiveMQDisconnectedException.java |    2 +-
 .../api/core/ActiveMQIllegalStateException.java |    2 +-
 .../core/ActiveMQInternalErrorException.java    |    2 +-
 .../api/core/ActiveMQNativeIOError.java         |    2 +-
 .../api/core/ActiveMQNotConnectedException.java |    2 +-
 .../ActiveMQUnsupportedPacketException.java     |    2 +-
 .../apache/activemq/api/core/SimpleString.java  |    2 +-
 .../activemq/core/server/ActiveMQComponent.java |   31 +
 .../activemq/core/server/HornetQComponent.java  |   31 -
 .../activemq/utils/ActiveMQThreadFactory.java   |   68 +
 .../activemq/utils/ActiveMQUtilBundle.java      |   48 +
 .../activemq/utils/ActiveMQUtilLogger.java      |   50 +
 .../apache/activemq/utils/ClassloadingUtil.java |    2 +-
 .../activemq/utils/HornetQThreadFactory.java    |   68 -
 .../activemq/utils/HornetQUtilBundle.java       |   48 -
 .../activemq/utils/HornetQUtilLogger.java       |   50 -
 .../activemq/utils/PasswordMaskingUtil.java     |    4 +-
 .../apache/activemq/utils/ReusableLatch.java    |    2 +-
 .../apache/activemq/utils/TypedProperties.java  |    2 +-
 .../org/apache/activemq/utils/UTF8Util.java     |   10 +-
 .../apache/activemq/utils/UUIDGenerator.java    |    8 +-
 .../api/core/DiscoveryGroupConfiguration.java   |    6 +-
 .../activemq/api/core/FilterConstants.java      |   30 +-
 .../apache/activemq/api/core/Interceptor.java   |    6 +-
 .../JGroupsBroadcastGroupConfiguration.java     |    8 +-
 .../org/apache/activemq/api/core/Message.java   |   10 +-
 .../api/core/TransportConfiguration.java        |   10 +-
 .../core/UDPBroadcastGroupConfiguration.java    |    8 +-
 .../api/core/client/ActiveMQClient.java         |  209 ++
 .../api/core/client/ClientConsumer.java         |    6 +-
 .../activemq/api/core/client/ClientMessage.java |    4 +-
 .../api/core/client/ClientSessionFactory.java   |    2 +-
 .../activemq/api/core/client/HornetQClient.java |  209 --
 .../activemq/api/core/client/ServerLocator.java |   54 +-
 .../core/client/loadbalance/package-info.java   |    4 +-
 .../activemq/api/core/client/package-info.java  |    2 +-
 .../api/core/management/AcceptorControl.java    |    2 +-
 .../management/ActiveMQComponentControl.java    |   36 +
 .../core/management/ActiveMQServerControl.java  |  621 +++++
 .../api/core/management/BridgeControl.java      |    2 +-
 .../core/management/BroadcastGroupControl.java  |    2 +-
 .../management/ClusterConnectionControl.java    |    2 +-
 .../management/HornetQComponentControl.java     |   36 -
 .../core/management/HornetQServerControl.java   |  621 -----
 .../api/core/management/ManagementHelper.java   |   14 +-
 .../api/core/management/NotificationType.java   |    6 +-
 .../api/core/management/ObjectNameBuilder.java  |    8 +-
 .../api/core/management/package-info.java       |    4 +-
 .../apache/activemq/api/core/package-info.java  |    2 +-
 .../impl/ResetLimitWrappedActiveMQBuffer.java   |  392 +++
 .../impl/ResetLimitWrappedHornetQBuffer.java    |  392 ---
 .../core/client/ActiveMQClientLogger.java       |  415 +++
 .../client/ActiveMQClientMessageBundle.java     |  247 ++
 .../core/client/HornetQClientLogger.java        |  415 ---
 .../core/client/HornetQClientMessageBundle.java |  247 --
 .../core/client/impl/ActiveMQXAResource.java    |   20 +
 .../core/client/impl/ClientConsumerImpl.java    |   50 +-
 .../client/impl/ClientLargeMessageImpl.java     |   10 +-
 .../core/client/impl/ClientMessageImpl.java     |    4 +-
 .../client/impl/ClientProducerCreditsImpl.java  |    8 +-
 .../core/client/impl/ClientProducerImpl.java    |   14 +-
 .../client/impl/ClientSessionFactoryImpl.java   |   96 +-
 .../core/client/impl/ClientSessionImpl.java     |   94 +-
 .../CompressedLargeMessageControllerImpl.java   |    8 +-
 .../core/client/impl/DelegatingSession.java     |    8 +-
 .../core/client/impl/HornetQXAResource.java     |   20 -
 .../client/impl/LargeMessageControllerImpl.java |   36 +-
 .../core/client/impl/ServerLocatorImpl.java     |  150 +-
 .../activemq/core/client/impl/Topology.java     |   66 +-
 .../activemq/core/cluster/DiscoveryGroup.java   |   32 +-
 .../core/exception/ActiveMQXAException.java     |   39 +
 .../core/exception/HornetQXAException.java      |   39 -
 .../activemq/core/message/BodyEncoder.java      |   10 +-
 .../activemq/core/message/impl/MessageImpl.java |   12 +-
 .../protocol/core/CoreRemotingConnection.java   |    6 +-
 .../impl/ActiveMQClientProtocolManager.java     |  613 +++++
 .../ActiveMQClientProtocolManagerFactory.java   |   42 +
 .../core/impl/ActiveMQConsumerContext.java      |   54 +
 .../core/impl/ActiveMQSessionContext.java       |  940 +++++++
 .../core/protocol/core/impl/ChannelImpl.java    |   40 +-
 .../core/impl/HornetQClientProtocolManager.java |  613 -----
 .../HornetQClientProtocolManagerFactory.java    |   42 -
 .../core/impl/HornetQConsumerContext.java       |   54 -
 .../core/impl/HornetQSessionContext.java        |  940 -------
 .../core/protocol/core/impl/PacketDecoder.java  |    8 +-
 .../core/impl/RemotingConnectionImpl.java       |   20 +-
 .../wireformat/ActiveMQExceptionMessage.java    |  118 +
 .../wireformat/HornetQExceptionMessage.java     |  118 -
 .../impl/netty/ActiveMQAMQPFrameDecoder.java    |   41 +
 .../impl/netty/ActiveMQChannelHandler.java      |  122 +
 .../impl/netty/ActiveMQFrameDecoder2.java       |   39 +
 .../impl/netty/HornetQAMQPFrameDecoder.java     |   41 -
 .../impl/netty/HornetQChannelHandler.java       |  122 -
 .../impl/netty/HornetQFrameDecoder2.java        |   39 -
 .../remoting/impl/netty/NettyConnection.java    |   14 +-
 .../remoting/impl/netty/NettyConnector.java     |  118 +-
 .../impl/netty/SharedNioEventLoopGroup.java     |    4 +-
 .../remoting/impl/netty/TransportConstants.java |    2 +-
 .../core/remoting/impl/ssl/SSLSupport.java      |    2 +-
 .../activemq/core/remoting/package-info.java    |    2 +-
 .../core/security/ActiveMQPrincipal.java        |   41 +
 .../core/security/HornetQPrincipal.java         |   41 -
 .../protocol/AbstractRemotingConnection.java    |   18 +-
 .../spi/core/protocol/RemotingConnection.java   |    2 +-
 .../activemq/spi/core/remoting/Connection.java  |    6 +-
 .../remoting/ConnectionLifeCycleListener.java   |    6 +-
 .../spi/core/remoting/package-info.java         |    2 +-
 .../utils/ActiveMQBufferInputStream.java        |  181 ++
 .../org/apache/activemq/utils/BufferHelper.java |    2 +-
 .../activemq/utils/ConfigurationHelper.java     |   16 +-
 .../utils/HornetQBufferInputStream.java         |  181 --
 .../org/apache/activemq/utils/MemorySize.java   |    4 +-
 .../activemq/utils/OrderedExecutorFactory.java  |    6 +-
 .../apache/activemq/utils/SoftValueHashMap.java |    6 +-
 .../apache/activemq/utils/VersionLoader.java    |   26 +-
 .../java/org/apache/activemq/utils/XMLUtil.java |   32 +-
 .../org/apache/activemq/utils/package-info.java |    2 +-
 .../main/resources/activemq-version.properties  |    9 +
 .../main/resources/hornetq-version.properties   |    9 -
 .../apache/activemq/tests/CoreUnitTestCase.java |    4 +-
 .../java/org/apache/activemq/dto/XmlUtil.java   |    2 +-
 .../org/apache/activemq/dto/package-info.java   |    4 +-
 .../activemq/api/jms/ActiveMQJMSClient.java     |  234 ++
 .../activemq/api/jms/ActiveMQJMSConstants.java  |   38 +
 .../activemq/api/jms/HornetQJMSClient.java      |  234 --
 .../activemq/api/jms/HornetQJMSConstants.java   |   38 -
 .../management/ConnectionFactoryControl.java    |    2 +-
 .../api/jms/management/DestinationControl.java  |    2 +-
 .../api/jms/management/JMSManagementHelper.java |   10 +-
 .../api/jms/management/JMSServerControl.java    |    6 +-
 .../api/jms/management/SubscriptionInfo.java    |    2 +-
 .../api/jms/management/package-info.java        |    4 +-
 .../apache/activemq/api/jms/package-info.java   |    4 +-
 .../jms/client/ActiveMQBytesMessage.java        |  436 ++++
 .../activemq/jms/client/ActiveMQConnection.java |  862 +++++++
 .../jms/client/ActiveMQConnectionFactory.java   |  821 ++++++
 .../client/ActiveMQConnectionForContext.java    |   34 +
 .../ActiveMQConnectionForContextImpl.java       |   91 +
 .../jms/client/ActiveMQConnectionMetaData.java  |   97 +
 .../jms/client/ActiveMQDestination.java         |  376 +++
 .../jms/client/ActiveMQJMSClientBundle.java     |   97 +
 .../jms/client/ActiveMQJMSClientLogger.java     |   79 +
 .../client/ActiveMQJMSConnectionFactory.java    |   67 +
 .../jms/client/ActiveMQJMSConsumer.java         |  198 ++
 .../activemq/jms/client/ActiveMQJMSContext.java |  769 ++++++
 .../jms/client/ActiveMQJMSProducer.java         |  800 ++++++
 .../activemq/jms/client/ActiveMQMapMessage.java |  450 ++++
 .../activemq/jms/client/ActiveMQMessage.java    | 1089 ++++++++
 .../jms/client/ActiveMQMessageConsumer.java     |  253 ++
 .../jms/client/ActiveMQMessageProducer.java     |  601 +++++
 .../jms/client/ActiveMQObjectMessage.java       |  202 ++
 .../activemq/jms/client/ActiveMQQueue.java      |   90 +
 .../jms/client/ActiveMQQueueBrowser.java        |  169 ++
 .../client/ActiveMQQueueConnectionFactory.java  |   69 +
 .../activemq/jms/client/ActiveMQSession.java    | 1276 +++++++++
 .../jms/client/ActiveMQStreamMessage.java       |  466 ++++
 .../jms/client/ActiveMQTemporaryQueue.java      |   67 +
 .../jms/client/ActiveMQTemporaryTopic.java      |   53 +
 .../jms/client/ActiveMQTextMessage.java         |  146 ++
 .../activemq/jms/client/ActiveMQTopic.java      |   85 +
 .../client/ActiveMQTopicConnectionFactory.java  |   70 +
 .../jms/client/ActiveMQXAConnection.java        |   70 +
 .../jms/client/ActiveMQXAConnectionFactory.java |   76 +
 .../jms/client/ActiveMQXAJMSContext.java        |   23 +
 .../ActiveMQXAQueueConnectionFactory.java       |   71 +
 .../activemq/jms/client/ActiveMQXASession.java  |   47 +
 .../ActiveMQXATopicConnectionFactory.java       |   69 +
 .../jms/client/HornetQBytesMessage.java         |  436 ----
 .../activemq/jms/client/HornetQConnection.java  |  862 -------
 .../jms/client/HornetQConnectionFactory.java    |  821 ------
 .../jms/client/HornetQConnectionForContext.java |   34 -
 .../client/HornetQConnectionForContextImpl.java |   91 -
 .../jms/client/HornetQConnectionMetaData.java   |   97 -
 .../activemq/jms/client/HornetQDestination.java |  376 ---
 .../jms/client/HornetQJMSClientBundle.java      |   97 -
 .../jms/client/HornetQJMSClientLogger.java      |   79 -
 .../jms/client/HornetQJMSConnectionFactory.java |   67 -
 .../activemq/jms/client/HornetQJMSConsumer.java |  198 --
 .../activemq/jms/client/HornetQJMSContext.java  |  769 ------
 .../activemq/jms/client/HornetQJMSProducer.java |  800 ------
 .../activemq/jms/client/HornetQMapMessage.java  |  450 ----
 .../activemq/jms/client/HornetQMessage.java     | 1089 --------
 .../jms/client/HornetQMessageConsumer.java      |  253 --
 .../jms/client/HornetQMessageProducer.java      |  601 -----
 .../jms/client/HornetQObjectMessage.java        |  202 --
 .../activemq/jms/client/HornetQQueue.java       |   90 -
 .../jms/client/HornetQQueueBrowser.java         |  169 --
 .../client/HornetQQueueConnectionFactory.java   |   69 -
 .../activemq/jms/client/HornetQSession.java     | 1276 ---------
 .../jms/client/HornetQStreamMessage.java        |  466 ----
 .../jms/client/HornetQTemporaryQueue.java       |   67 -
 .../jms/client/HornetQTemporaryTopic.java       |   53 -
 .../activemq/jms/client/HornetQTextMessage.java |  146 --
 .../activemq/jms/client/HornetQTopic.java       |   85 -
 .../client/HornetQTopicConnectionFactory.java   |   70 -
 .../jms/client/HornetQXAConnection.java         |   70 -
 .../jms/client/HornetQXAConnectionFactory.java  |   76 -
 .../jms/client/HornetQXAJMSContext.java         |   23 -
 .../client/HornetQXAQueueConnectionFactory.java |   71 -
 .../activemq/jms/client/HornetQXASession.java   |   47 -
 .../client/HornetQXATopicConnectionFactory.java |   69 -
 .../activemq/jms/client/JMSExceptionHelper.java |    2 +-
 .../jms/client/JMSMessageListenerWrapper.java   |   24 +-
 .../activemq/jms/client/SelectorTranslator.java |    8 +-
 .../activemq/jms/client/ThreadAwareContext.java |    8 +-
 .../activemq/jms/client/package-info.java       |    2 +-
 .../ConnectionFactoryObjectFactory.java         |    4 +-
 .../referenceable/DestinationObjectFactory.java |    4 +-
 .../jms/bridge/ActiveMQJMSBridgeLogger.java     |  101 +
 .../jms/bridge/HornetQJMSBridgeLogger.java      |  101 -
 .../apache/activemq/jms/bridge/JMSBridge.java   |    4 +-
 .../activemq/jms/bridge/JMSBridgeControl.java   |    4 +-
 .../jms/bridge/QualityOfServiceMode.java        |    2 +-
 .../activemq/jms/bridge/impl/JMSBridgeImpl.java |  236 +-
 .../impl/JMSConnectionFactoryControlImpl.java   |    6 +-
 .../management/impl/JMSQueueControlImpl.java    |   18 +-
 .../management/impl/JMSServerControlImpl.java   |   62 +-
 .../management/impl/JMSTopicControlImpl.java    |   34 +-
 .../jms/persistence/JMSStorageManager.java      |    4 +-
 .../journal/JMSJournalStorageManagerImpl.java   |    2 +-
 .../jms/server/ActiveMQJMSServerBundle.java     |   62 +
 .../jms/server/ActiveMQJMSServerLogger.java     |  115 +
 .../jms/server/HornetQJMSServerBundle.java      |   62 -
 .../jms/server/HornetQJMSServerLogger.java      |  115 -
 .../activemq/jms/server/JMSServerManager.java   |   12 +-
 .../ConnectionFactoryConfigurationImpl.java     |   62 +-
 .../jms/server/embedded/EmbeddedJMS.java        |   16 +-
 .../server/impl/JMSServerConfigParserImpl.java  |   72 +-
 .../jms/server/impl/JMSServerDeployer.java      |    6 +-
 .../jms/server/impl/JMSServerManagerImpl.java   |  156 +-
 .../jms/server/impl/StandaloneNamingServer.java |   16 +-
 .../server/management/JMSManagementService.java |   12 +-
 .../impl/JMSManagementServiceImpl.java          |   16 +-
 .../recovery/ActiveMQRecoveryRegistry.java      |  250 ++
 .../server/recovery/ActiveMQRegistryBase.java   |   71 +
 .../recovery/ActiveMQXAResourceRecovery.java    |  231 ++
 .../recovery/ActiveMQXAResourceWrapper.java     |  531 ++++
 .../recovery/HornetQRecoveryRegistry.java       |  250 --
 .../server/recovery/HornetQRegistryBase.java    |   71 -
 .../recovery/HornetQXAResourceRecovery.java     |  231 --
 .../recovery/HornetQXAResourceWrapper.java      |  531 ----
 .../jms/server/recovery/RecoveryDiscovery.java  |   24 +-
 .../jms/server/recovery/XARecoveryConfig.java   |   10 +-
 .../jms/server/recovery/package-info.java       |    4 +-
 .../jms/transaction/JMSTransactionDetail.java   |   26 +-
 .../core/asyncio/impl/ActiveMQFileLock.java     |   47 +
 .../core/asyncio/impl/AsynchronousFileImpl.java |   28 +-
 .../core/asyncio/impl/HornetQFileLock.java      |   47 -
 .../apache/activemq/core/journal/Journal.java   |    4 +-
 .../journal/impl/AIOSequentialFileFactory.java  |   12 +-
 .../journal/impl/AbstractSequentialFile.java    |   16 +-
 .../impl/AbstractSequentialFileFactory.java     |    8 +-
 .../core/journal/impl/CompactJournal.java       |    2 +-
 .../core/journal/impl/DummyCallback.java        |    4 +-
 .../core/journal/impl/ExportJournal.java        |    4 +-
 .../core/journal/impl/ImportJournal.java        |    4 +-
 .../core/journal/impl/JournalCompactor.java     |   12 +-
 .../journal/impl/JournalFilesRepository.java    |   56 +-
 .../activemq/core/journal/impl/JournalImpl.java |   62 +-
 .../core/journal/impl/NIOSequentialFile.java    |   12 +-
 .../activemq/core/journal/impl/Reclaimer.java   |    6 +-
 .../core/journal/impl/SimpleWaitIOCallback.java |    4 +-
 .../core/journal/impl/SyncSpeedTest.java        |    6 +-
 .../activemq/core/journal/impl/TimedBuffer.java |   12 +-
 .../activemq/journal/ActiveMQJournalBundle.java |   48 +
 .../activemq/journal/ActiveMQJournalLogger.java |  271 ++
 .../activemq/journal/HornetQJournalBundle.java  |   48 -
 .../activemq/journal/HornetQJournalLogger.java  |  271 --
 .../ActiveMQProtonRemotingConnection.java       |  146 ++
 .../proton/HornetQProtonRemotingConnection.java |  146 --
 .../protocol/proton/ProtonProtocolManager.java  |   22 +-
 .../proton/ProtonProtocolManagerFactory.java    |    4 +-
 .../proton/converter/ActiveMQJMSVendor.java     |  155 ++
 .../proton/converter/HornetQJMSVendor.java      |  155 --
 .../converter/ProtonMessageConverter.java       |   10 +-
 .../converter/jms/ServerJMSMapMessage.java      |    2 +-
 .../proton/converter/jms/ServerJMSMessage.java  |   14 +-
 .../converter/jms/ServerJMSStreamMessage.java   |    2 +-
 .../converter/jms/ServerJMSTextMessage.java     |    2 +-
 .../proton/converter/jms/package-info.java      |    2 +-
 .../plug/ActiveMQProtonConnectionCallback.java  |  125 +
 .../plug/HornetQProtonConnectionCallback.java   |  125 -
 .../plug/ProtonSessionIntegrationCallback.java  |   10 +-
 .../protocol/proton/sasl/ActiveMQPlainSASL.java |   50 +
 .../protocol/proton/sasl/HornetQPlainSASL.java  |   50 -
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../protocol/openwire/OpenWireConnection.java   |   22 +-
 .../openwire/OpenWireProtocolManager.java       |   22 +-
 .../OpenWireProtocolManagerFactory.java         |    4 +-
 .../core/protocol/openwire/OpenWireUtil.java    |    2 +-
 .../core/protocol/openwire/amq/AMQConsumer.java |   11 +-
 .../core/protocol/openwire/amq/AMQProducer.java |    2 +-
 .../openwire/amq/AMQServerConsumer.java         |    6 +-
 .../protocol/openwire/amq/AMQServerSession.java |   24 +-
 .../openwire/amq/AMQServerSessionFactory.java   |    6 +-
 .../core/protocol/openwire/amq/AMQSession.java  |   14 +-
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../plug/AMQPClientConnectionContext.java       |    4 +-
 .../proton/plug/AMQPClientSessionContext.java   |    6 +-
 .../org/proton/plug/AMQPSessionContext.java     |    4 +-
 .../plug/context/AbstractConnectionContext.java |    6 +-
 .../context/AbstractProtonContextSender.java    |   12 +-
 .../context/AbstractProtonReceiverContext.java  |    6 +-
 .../context/AbstractProtonSessionContext.java   |   10 +-
 .../plug/context/ProtonDeliveryHandler.java     |    6 +-
 .../plug/context/ProtonInitializable.java       |   12 +-
 .../plug/context/ProtonTransactionHandler.java  |   12 +-
 .../client/ProtonClientConnectionContext.java   |    6 +-
 .../context/client/ProtonClientContext.java     |    4 +-
 .../client/ProtonClientReceiverContext.java     |    4 +-
 .../client/ProtonClientSessionContext.java      |    6 +-
 .../server/ProtonServerConnectionContext.java   |    4 +-
 .../server/ProtonServerReceiverContext.java     |   16 +-
 .../server/ProtonServerSenderContext.java       |   38 +-
 .../server/ProtonServerSessionContext.java      |    8 +-
 .../plug/exceptions/ActiveMQAMQPException.java  |   45 +
 .../ActiveMQAMQPIllegalStateException.java      |   28 +
 .../ActiveMQAMQPInternalErrorException.java     |   33 +
 .../ActiveMQAMQPInvalidFieldException.java      |   28 +
 .../ActiveMQAMQPNotImplementedException.java    |   28 +
 .../ActiveMQAMQPTimeoutException.java           |   29 +
 .../plug/exceptions/HornetQAMQPException.java   |   45 -
 .../HornetQAMQPIllegalStateException.java       |   28 -
 .../HornetQAMQPInternalErrorException.java      |   33 -
 .../HornetQAMQPInvalidFieldException.java       |   28 -
 .../HornetQAMQPNotImplementedException.java     |   28 -
 .../exceptions/HornetQAMQPTimeoutException.java |   29 -
 .../ActiveMQAMQPProtocolMessageBundle.java      |   83 +
 .../HornetQAMQPProtocolMessageBundle.java       |   83 -
 .../org/proton/plug/util/ReusableLatch.java     |    2 +-
 .../plug/test/minimalserver/MinimalServer.java  |    4 +-
 .../SimpleServerThreadFactory.java              |    2 +-
 .../protocol/stomp/ActiveMQStompException.java  |  134 +
 .../stomp/ActiveMQStompProtocolLogger.java      |   54 +
 .../ActiveMQStompProtocolMessageBundle.java     |  152 ++
 .../protocol/stomp/HornetQStompException.java   |  134 -
 .../stomp/HornetQStompProtocolLogger.java       |   54 -
 .../HornetQStompProtocolMessageBundle.java      |  152 --
 .../core/protocol/stomp/StompConnection.java    |   72 +-
 .../core/protocol/stomp/StompDecoder.java       |   20 +-
 .../core/protocol/stomp/StompFrame.java         |    4 +-
 .../protocol/stomp/StompProtocolManager.java    |   58 +-
 .../stomp/StompProtocolManagerFactory.java      |    4 +-
 .../core/protocol/stomp/StompSession.java       |    2 +-
 .../stomp/VersionedStompFrameHandler.java       |   28 +-
 .../stomp/v10/StompFrameHandlerV10.java         |   14 +-
 .../stomp/v11/StompFrameHandlerV11.java         |   30 +-
 .../core/protocol/stomp/v11/StompFrameV11.java  |    2 +-
 .../stomp/v12/StompFrameHandlerV12.java         |   18 +-
 .../core/protocol/stomp/v12/StompFrameV12.java  |    2 +-
 ...emq.spi.core.protocol.ProtocolManagerFactory |    1 +
 ...etq.spi.core.protocol.ProtocolManagerFactory |    1 -
 .../apache/activemq/ra/ActiveMQRABundle.java    |   70 +
 .../activemq/ra/ActiveMQRABytesMessage.java     |  455 ++++
 .../ra/ActiveMQRAConnectionFactory.java         |   65 +
 .../ra/ActiveMQRAConnectionFactoryImpl.java     |  570 +++++
 .../ra/ActiveMQRAConnectionManager.java         |   90 +
 .../ra/ActiveMQRAConnectionMetaData.java        |  153 ++
 .../ra/ActiveMQRAConnectionRequestInfo.java     |  306 +++
 .../activemq/ra/ActiveMQRACredential.java       |  241 ++
 .../activemq/ra/ActiveMQRAJMSContext.java       |   57 +
 .../activemq/ra/ActiveMQRALocalTransaction.java |  121 +
 .../apache/activemq/ra/ActiveMQRALogger.java    |  122 +
 .../activemq/ra/ActiveMQRAMCFProperties.java    |  204 ++
 .../ra/ActiveMQRAManagedConnection.java         |  921 +++++++
 .../ra/ActiveMQRAManagedConnectionFactory.java  |  805 ++++++
 .../activemq/ra/ActiveMQRAMapMessage.java       |  452 ++++
 .../apache/activemq/ra/ActiveMQRAMessage.java   |  897 +++++++
 .../activemq/ra/ActiveMQRAMessageConsumer.java  |  334 +++
 .../activemq/ra/ActiveMQRAMessageListener.java  |   65 +
 .../activemq/ra/ActiveMQRAMessageProducer.java  |  473 ++++
 .../apache/activemq/ra/ActiveMQRAMetaData.java  |  107 +
 .../activemq/ra/ActiveMQRAObjectMessage.java    |   76 +
 .../activemq/ra/ActiveMQRAProperties.java       |  358 +++
 .../activemq/ra/ActiveMQRAQueueReceiver.java    |   61 +
 .../activemq/ra/ActiveMQRAQueueSender.java      |  138 +
 .../apache/activemq/ra/ActiveMQRAService.java   |   82 +
 .../apache/activemq/ra/ActiveMQRASession.java   | 1903 ++++++++++++++
 .../activemq/ra/ActiveMQRASessionFactory.java   |   51 +
 .../ra/ActiveMQRASessionFactoryImpl.java        | 1046 ++++++++
 .../activemq/ra/ActiveMQRAStreamMessage.java    |  408 +++
 .../activemq/ra/ActiveMQRATextMessage.java      |   74 +
 .../activemq/ra/ActiveMQRATopicPublisher.java   |  211 ++
 .../activemq/ra/ActiveMQRATopicSubscriber.java  |   77 +
 .../activemq/ra/ActiveMQRAXAJMSContext.java     |   26 +
 .../activemq/ra/ActiveMQRAXAResource.java       |  257 ++
 .../org/apache/activemq/ra/ActiveMQRaUtils.java |  354 +++
 .../activemq/ra/ActiveMQResourceAdapter.java    | 2411 ++++++++++++++++++
 .../activemq/ra/ActiveMQXAResourceWrapper.java  |  143 ++
 .../ra/ConnectionFactoryProperties.java         |  122 +-
 .../org/apache/activemq/ra/HornetQRABundle.java |   70 -
 .../activemq/ra/HornetQRABytesMessage.java      |  455 ----
 .../activemq/ra/HornetQRAConnectionFactory.java |   65 -
 .../ra/HornetQRAConnectionFactoryImpl.java      |  570 -----
 .../activemq/ra/HornetQRAConnectionManager.java |   90 -
 .../ra/HornetQRAConnectionMetaData.java         |  153 --
 .../ra/HornetQRAConnectionRequestInfo.java      |  306 ---
 .../apache/activemq/ra/HornetQRACredential.java |  241 --
 .../apache/activemq/ra/HornetQRAJMSContext.java |   57 -
 .../activemq/ra/HornetQRALocalTransaction.java  |  121 -
 .../org/apache/activemq/ra/HornetQRALogger.java |  122 -
 .../activemq/ra/HornetQRAMCFProperties.java     |  204 --
 .../activemq/ra/HornetQRAManagedConnection.java |  921 -------
 .../ra/HornetQRAManagedConnectionFactory.java   |  805 ------
 .../apache/activemq/ra/HornetQRAMapMessage.java |  452 ----
 .../apache/activemq/ra/HornetQRAMessage.java    |  897 -------
 .../activemq/ra/HornetQRAMessageConsumer.java   |  334 ---
 .../activemq/ra/HornetQRAMessageListener.java   |   65 -
 .../activemq/ra/HornetQRAMessageProducer.java   |  473 ----
 .../apache/activemq/ra/HornetQRAMetaData.java   |  107 -
 .../activemq/ra/HornetQRAObjectMessage.java     |   76 -
 .../apache/activemq/ra/HornetQRAProperties.java |  358 ---
 .../activemq/ra/HornetQRAQueueReceiver.java     |   61 -
 .../activemq/ra/HornetQRAQueueSender.java       |  138 -
 .../apache/activemq/ra/HornetQRAService.java    |   82 -
 .../apache/activemq/ra/HornetQRASession.java    | 1903 --------------
 .../activemq/ra/HornetQRASessionFactory.java    |   51 -
 .../ra/HornetQRASessionFactoryImpl.java         | 1046 --------
 .../activemq/ra/HornetQRAStreamMessage.java     |  408 ---
 .../activemq/ra/HornetQRATextMessage.java       |   74 -
 .../activemq/ra/HornetQRATopicPublisher.java    |  211 --
 .../activemq/ra/HornetQRATopicSubscriber.java   |   77 -
 .../activemq/ra/HornetQRAXAJMSContext.java      |   26 -
 .../apache/activemq/ra/HornetQRAXAResource.java |  257 --
 .../org/apache/activemq/ra/HornetQRaUtils.java  |  354 ---
 .../activemq/ra/HornetQResourceAdapter.java     | 2411 ------------------
 .../activemq/ra/HornetQXAResourceWrapper.java   |  143 --
 .../activemq/ra/inflow/ActiveMQActivation.java  |  831 ++++++
 .../ra/inflow/ActiveMQActivationSpec.java       |  945 +++++++
 .../ra/inflow/ActiveMQMessageHandler.java       |  430 ++++
 .../activemq/ra/inflow/HornetQActivation.java   |  831 ------
 .../ra/inflow/HornetQActivationSpec.java        |  945 -------
 .../ra/inflow/HornetQMessageHandler.java        |  430 ----
 .../activemq/ra/recovery/RecoveryManager.java   |   20 +-
 .../java/org/apache/activemq/rest/ActiveMQ.java |  191 ++
 .../activemq/rest/ActiveMQRestBundle.java       |   31 +
 .../activemq/rest/ActiveMQRestLogger.java       |   85 +
 .../apache/activemq/rest/HornetQRestBundle.java |   31 -
 .../apache/activemq/rest/HornetQRestLogger.java |   85 -
 .../java/org/apache/activemq/rest/Hornetq.java  |  191 --
 .../activemq/rest/MessageServiceManager.java    |    4 +-
 .../integration/ActiveMQBootstrapListener.java  |   55 +
 .../rest/integration/EmbeddedRestActiveMQ.java  |   92 +
 .../integration/EmbeddedRestActiveMQJMS.java    |   36 +
 .../rest/integration/EmbeddedRestHornetQ.java   |   92 -
 .../integration/EmbeddedRestHornetQJMS.java     |   36 -
 .../integration/HornetqBootstrapListener.java   |   55 -
 .../rest/queue/AcknowledgedQueueConsumer.java   |    6 +-
 .../activemq/rest/queue/ConsumedMessage.java    |    4 +-
 .../activemq/rest/queue/ConsumersResource.java  |   12 +-
 .../rest/queue/DestinationServiceManager.java   |    4 +-
 .../apache/activemq/rest/queue/PostMessage.java |   22 +-
 .../activemq/rest/queue/PostMessageDupsOk.java  |    8 +-
 .../activemq/rest/queue/PostMessageNoDups.java  |    4 +-
 .../activemq/rest/queue/QueueConsumer.java      |   16 +-
 .../rest/queue/QueueDestinationsResource.java   |   16 +-
 .../activemq/rest/queue/QueueResource.java      |    8 +-
 .../rest/queue/push/ActiveMQPushStrategy.java   |   87 +
 .../activemq/rest/queue/push/FilePushStore.java |    8 +-
 .../rest/queue/push/HornetQPushStrategy.java    |   87 -
 .../activemq/rest/queue/push/PushConsumer.java  |   10 +-
 .../queue/push/PushConsumerMessageHandler.java  |   12 +-
 .../rest/queue/push/PushConsumerResource.java   |    8 +-
 .../activemq/rest/queue/push/PushStrategy.java  |    2 +-
 .../activemq/rest/queue/push/UriStrategy.java   |   16 +-
 .../activemq/rest/topic/PushSubscription.java   |    4 +-
 .../rest/topic/PushSubscriptionsResource.java   |    8 +-
 .../rest/topic/SubscriptionsResource.java       |   18 +-
 .../rest/topic/TopicDestinationsResource.java   |   16 +-
 .../activemq/rest/topic/TopicResource.java      |    8 +-
 .../activemq/rest/util/HttpMessageHelper.java   |   12 +-
 .../apache/activemq/rest/util/TimeoutTask.java  |    6 +-
 .../rest/test/CreateDestinationTest.java        |    4 +-
 .../org/apache/activemq/rest/test/Embedded.java |   22 +-
 .../apache/activemq/rest/test/EmbeddedTest.java |    8 +-
 .../activemq/rest/test/FindDestinationTest.java |    4 +-
 .../org/apache/activemq/rest/test/JMSTest.java  |   12 +-
 .../activemq/rest/test/MessageTestBase.java     |    4 +-
 .../test/PersistentPushQueueConsumerTest.java   |   14 +-
 .../test/PersistentPushTopicConsumerTest.java   |    8 +-
 .../rest/test/PushQueueConsumerTest.java        |    4 +-
 .../rest/test/PushTopicConsumerTest.java        |    4 +-
 .../apache/activemq/rest/test/RawAckTest.java   |   16 +-
 .../apache/activemq/rest/test/SelectorTest.java |   10 +-
 .../activemq/rest/test/TransformTest.java       |    8 +-
 .../core/config/BridgeConfiguration.java        |   18 +-
 .../config/ClusterConnectionConfiguration.java  |    4 +-
 .../activemq/core/config/Configuration.java     |   16 +-
 .../core/config/ConfigurationUtils.java         |    4 +-
 .../core/config/impl/ConfigurationImpl.java     |    2 +-
 .../core/config/impl/FileConfiguration.java     |    6 +-
 .../activemq/core/config/impl/Validators.java   |   22 +-
 .../activemq/core/deployers/Deployer.java       |    4 +-
 .../core/deployers/DeploymentManager.java       |    4 +-
 .../impl/BasicUserCredentialsDeployer.java      |   18 +-
 .../deployers/impl/FileConfigurationParser.java |   84 +-
 .../deployers/impl/FileDeploymentManager.java   |   24 +-
 .../core/deployers/impl/QueueDeployer.java      |    6 +-
 .../core/deployers/impl/SecurityDeployer.java   |    2 +-
 .../core/deployers/impl/XmlDeployer.java        |    6 +-
 .../activemq/core/filter/impl/FilterImpl.java   |   28 +-
 .../impl/ActiveMQServerControlImpl.java         | 2187 ++++++++++++++++
 .../impl/HornetQServerControlImpl.java          | 2187 ----------------
 .../core/management/impl/QueueControlImpl.java  |   12 +-
 .../impl/MessageCounterHelper.java              |    4 +-
 .../activemq/core/paging/PagingManager.java     |    4 +-
 .../activemq/core/paging/PagingStore.java       |    6 +-
 .../core/paging/cursor/PagedReferenceImpl.java  |    8 +-
 .../cursor/impl/PageCursorProviderImpl.java     |   52 +-
 .../impl/PageSubscriptionCounterImpl.java       |    8 +-
 .../cursor/impl/PageSubscriptionImpl.java       |   30 +-
 .../apache/activemq/core/paging/impl/Page.java  |   24 +-
 .../paging/impl/PageTransactionInfoImpl.java    |    4 +-
 .../core/paging/impl/PagingManagerImpl.java     |   10 +-
 .../core/paging/impl/PagingStoreFactoryNIO.java |    4 +-
 .../core/paging/impl/PagingStoreImpl.java       |   24 +-
 .../core/persistence/StorageManager.java        |    6 +-
 .../impl/journal/BatchingIDGenerator.java       |    4 +-
 .../impl/journal/DescribeJournal.java           |    6 +-
 .../impl/journal/JournalStorageManager.java     |   98 +-
 .../impl/journal/LargeServerMessageImpl.java    |   16 +-
 .../impl/journal/LargeServerMessageInSync.java  |    4 +-
 .../impl/journal/OperationContextImpl.java      |    4 +-
 .../activemq/core/postoffice/BindingType.java   |    4 +-
 .../activemq/core/postoffice/PostOffice.java    |    4 +-
 .../activemq/core/postoffice/QueueInfo.java     |    8 +-
 .../core/postoffice/impl/BindingsImpl.java      |   20 +-
 .../postoffice/impl/DuplicateIDCacheImpl.java   |    4 +-
 .../core/postoffice/impl/PostOfficeImpl.java    |   64 +-
 .../postoffice/impl/SimpleAddressManager.java   |   10 +-
 .../activemq/core/protocol/ProtocolHandler.java |    6 +-
 .../core/ServerSessionPacketHandler.java        |   46 +-
 .../core/impl/ActiveMQPacketHandler.java        |  298 +++
 .../protocol/core/impl/CoreProtocolManager.java |   39 +-
 .../core/impl/CoreProtocolManagerFactory.java   |    8 +-
 .../protocol/core/impl/CoreSessionCallback.java |    6 +-
 .../core/impl/HornetQPacketHandler.java         |  298 ---
 .../wireformat/BackupRegistrationMessage.java   |    2 +-
 .../protocol/stomp/WebSocketServerHandler.java  |    2 +-
 .../core/remoting/impl/invm/InVMAcceptor.java   |   22 +-
 .../core/remoting/impl/invm/InVMConnection.java |   24 +-
 .../core/remoting/impl/invm/InVMConnector.java  |   12 +-
 .../core/remoting/impl/invm/InVMRegistry.java   |    6 +-
 .../core/remoting/impl/netty/NettyAcceptor.java |   50 +-
 .../core/remoting/server/RemotingService.java   |    4 +-
 .../server/impl/RemotingServiceImpl.java        |   88 +-
 .../core/replication/ReplicatedJournal.java     |    4 +-
 .../core/replication/ReplicationEndpoint.java   |   62 +-
 .../core/replication/ReplicationManager.java    |   22 +-
 .../core/security/impl/SecurityStoreImpl.java   |   24 +-
 .../core/server/ActiveMQMessageBundle.java      |  371 +++
 .../activemq/core/server/ActiveMQServer.java    |  249 ++
 .../core/server/ActiveMQServerLogger.java       | 1366 ++++++++++
 .../activemq/core/server/ActiveMQServers.java   |  123 +
 .../activemq/core/server/ConnectorService.java  |    2 +-
 .../core/server/HornetQMessageBundle.java       |  371 ---
 .../activemq/core/server/HornetQServer.java     |  249 --
 .../core/server/HornetQServerLogger.java        | 1366 ----------
 .../activemq/core/server/HornetQServers.java    |  123 -
 .../activemq/core/server/MemoryManager.java     |   12 +-
 .../activemq/core/server/NodeManager.java       |    6 +-
 .../org/apache/activemq/core/server/Queue.java  |    2 +-
 .../core/server/ServerSessionFactory.java       |    4 +-
 ...ctiveMQServerSideProtocolManagerFactory.java |   55 +
 .../core/server/cluster/BackupManager.java      |   30 +-
 .../activemq/core/server/cluster/Bridge.java    |    4 +-
 .../core/server/cluster/BroadcastGroup.java     |    4 +-
 .../cluster/ClusterConfigurationUtil.java       |   12 +-
 .../core/server/cluster/ClusterConnection.java  |    8 +-
 .../core/server/cluster/ClusterControl.java     |   16 +-
 .../core/server/cluster/ClusterController.java  |   34 +-
 .../core/server/cluster/ClusterManager.java     |   76 +-
 ...HornetQServerSideProtocolManagerFactory.java |   55 -
 .../server/cluster/ha/ColocatedHAManager.java   |   30 +-
 .../core/server/cluster/ha/ColocatedPolicy.java |    4 +-
 .../core/server/cluster/ha/HAManager.java       |    8 +-
 .../core/server/cluster/ha/HAPolicy.java        |    4 +-
 .../core/server/cluster/ha/LiveOnlyPolicy.java  |    4 +-
 .../core/server/cluster/ha/ReplicaPolicy.java   |    6 +-
 .../server/cluster/ha/ReplicatedPolicy.java     |    4 +-
 .../core/server/cluster/ha/ScaleDownPolicy.java |   30 +-
 .../cluster/ha/SharedStoreMasterPolicy.java     |    4 +-
 .../cluster/ha/SharedStoreSlavePolicy.java      |    4 +-
 .../server/cluster/ha/StandaloneHAManager.java  |    6 +-
 .../core/server/cluster/impl/BridgeImpl.java    |  116 +-
 .../server/cluster/impl/BroadcastGroupImpl.java |   10 +-
 .../cluster/impl/ClusterConnectionBridge.java   |   38 +-
 .../cluster/impl/ClusterConnectionImpl.java     |  116 +-
 .../core/server/cluster/impl/Redistributor.java |   10 +-
 .../cluster/impl/RemoteQueueBindingImpl.java    |    6 +-
 .../server/cluster/qourum/QuorumManager.java    |    4 +-
 .../qourum/SharedNothingBackupQuorum.java       |    4 +-
 .../core/server/embedded/EmbeddedActiveMQ.java  |  118 +
 .../core/server/embedded/EmbeddedHornetQ.java   |  118 -
 .../core/server/group/GroupingHandler.java      |    4 +-
 .../group/impl/GroupHandlingAbstract.java       |    4 +-
 .../server/group/impl/LocalGroupingHandler.java |   28 +-
 .../group/impl/RemoteGroupingHandler.java       |    8 +-
 .../server/impl/AIOFileLockNodeManager.java     |    2 +-
 .../activemq/core/server/impl/Activation.java   |    4 +-
 .../core/server/impl/ActiveMQServerImpl.java    | 2345 +++++++++++++++++
 .../impl/AnyLiveNodeLocatorForReplication.java  |    4 +-
 .../impl/AnyLiveNodeLocatorForScaleDown.java    |   10 +-
 .../impl/BackupRecoveryJournalLoader.java       |   14 +-
 .../core/server/impl/ColocatedActivation.java   |    6 +-
 .../core/server/impl/ConnectorsService.java     |   14 +-
 .../activemq/core/server/impl/DivertImpl.java   |    6 +-
 .../core/server/impl/FileLockNodeManager.java   |   18 +-
 .../core/server/impl/HornetQServerImpl.java     | 2345 -----------------
 .../core/server/impl/LastValueQueue.java        |    6 +-
 .../core/server/impl/LiveOnlyActivation.java    |   56 +-
 .../impl/NamedLiveNodeLocatorForScaleDown.java  |   10 +-
 .../server/impl/PostOfficeJournalLoader.java    |   28 +-
 .../activemq/core/server/impl/QueueImpl.java    |  158 +-
 .../core/server/impl/RefsOperation.java         |   10 +-
 .../core/server/impl/ReplicationError.java      |   14 +-
 .../core/server/impl/ScaleDownHandler.java      |   18 +-
 .../impl/ScheduledDeliveryHandlerImpl.java      |   22 +-
 .../core/server/impl/ServerConsumerImpl.java    |   84 +-
 .../activemq/core/server/impl/ServerInfo.java   |    6 +-
 .../core/server/impl/ServerSessionImpl.java     |  166 +-
 .../core/server/impl/ServiceRegistry.java       |    2 +-
 .../impl/SharedNothingBackupActivation.java     |  126 +-
 .../impl/SharedNothingLiveActivation.java       |   88 +-
 .../impl/SharedStoreBackupActivation.java       |   80 +-
 .../server/impl/SharedStoreLiveActivation.java  |   40 +-
 .../server/impl/TransientQueueManagerImpl.java  |   16 +-
 .../server/management/ManagementService.java    |   12 +-
 .../management/impl/ManagementServiceImpl.java  |   64 +-
 .../impl/HierarchicalObjectRepository.java      |    6 +-
 .../activemq/core/settings/impl/Match.java      |    6 +-
 .../core/transaction/ResourceManager.java       |    4 +-
 .../activemq/core/transaction/Transaction.java  |    2 +-
 .../transaction/impl/ResourceManagerImpl.java   |    8 +-
 .../core/transaction/impl/TransactionImpl.java  |   12 +-
 .../spi/core/protocol/ProtocolManager.java      |    2 +-
 .../core/protocol/ProtocolManagerFactory.java   |    4 +-
 .../activemq/spi/core/remoting/Acceptor.java    |   10 +-
 .../core/security/ActiveMQSecurityManager.java  |   78 +
 .../security/ActiveMQSecurityManagerImpl.java   |  212 ++
 .../core/security/HornetQSecurityManager.java   |   78 -
 .../security/HornetQSecurityManagerImpl.java    |  212 --
 .../spi/core/security/JAASSecurityManager.java  |   14 +-
 .../spi/core/security/package-info.java         |    2 +-
 .../resources/schema/activemq-configuration.xsd |   12 +-
 .../impl/FileConfigurationParserTest.java       |   24 +-
 .../config/impl/HAPolicyConfigurationTest.java  |   30 +-
 .../WrongRoleFileConfigurationParserTest.java   |   24 +-
 .../activemq/core/filter/impl/FilterTest.java   |    2 +-
 .../core/message/impl/MessagePropertyTest.java  |    4 +-
 .../group/impl/ClusteredResetMockTest.java      |    6 +-
 .../core/server/impl/EmbeddedServerTest.java    |    8 +-
 .../impl/ScheduledDeliveryHandlerTest.java      |    4 +-
 .../core/version/impl/VersionImplTest.java      |    8 +-
 .../tests/util/ColocatedActiveMQServer.java     |   96 +
 .../tests/util/ColocatedHornetQServer.java      |   96 -
 .../tests/util/InVMNodeManagerServer.java       |   10 +-
 .../activemq/tests/util/ServiceTestBase.java    |  138 +-
 .../tests/util/SingleServerTestBase.java        |    8 +-
 .../activemq/tests/util/UnitTestCase.java       |   68 +-
 activemq-service-sar/pom.xml                    |   49 -
 .../HornetQFileConfigurationService.java        |   50 -
 .../HornetQFileConfigurationServiceMBean.java   |   32 -
 .../service/HornetQJMSStarterService.java       |   46 -
 .../service/HornetQJMSStarterServiceMBean.java  |   27 -
 .../activemq/service/HornetQServiceBundle.java  |   31 -
 .../activemq/service/HornetQServiceLogger.java  |   38 -
 .../activemq/service/HornetQStarterService.java |  118 -
 .../service/HornetQStarterServiceMBean.java     |   36 -
 .../service/JBossASSecurityManagerService.java  |   35 -
 .../JBossASSecurityManagerServiceMBean.java     |   26 -
 .../activemq/tools/ActiveMQToolsLogger.java     |   42 +
 .../org/apache/activemq/tools/DataTool.java     |    8 +-
 .../activemq/tools/HornetQToolsLogger.java      |   42 -
 .../org/apache/activemq/tools/PrintData.java    |    6 +-
 .../org/apache/activemq/tools/PrintPages.java   |    4 +-
 .../apache/activemq/tools/TransferQueue.java    |    6 +-
 .../apache/activemq/tools/XmlDataConstants.java |    2 +-
 .../apache/activemq/tools/XmlDataExporter.java  |   30 +-
 .../apache/activemq/tools/XmlDataImporter.java  |  118 +-
 distribution/activemq/pom.xml                   |    5 -
 docs/user-manual/en/ActiveMQ_User_Manual.ent    |   18 +
 docs/user-manual/en/ActiveMQ_User_Manual.xml    |   75 +
 docs/user-manual/en/Author_Group.xml            |    2 +-
 docs/user-manual/en/Book_Info.xml               |   16 +-
 docs/user-manual/en/HornetQ_User_Manual.ent     |   18 -
 docs/user-manual/en/HornetQ_User_Manual.xml     |   75 -
 docs/user-manual/en/aerogear-integration.xml    |    6 +-
 docs/user-manual/en/appserver-integration.xml   |  202 +-
 docs/user-manual/en/architecture.xml            |   54 +-
 docs/user-manual/en/client-classpath.xml        |   20 +-
 docs/user-manual/en/client-reconnection.xml     |   18 +-
 docs/user-manual/en/clusters.xml                |  110 +-
 docs/user-manual/en/configuration-index.xml     |   40 +-
 docs/user-manual/en/configuring-transports.xml  |   58 +-
 docs/user-manual/en/connection-ttl.xml          |   26 +-
 docs/user-manual/en/core-bridges.xml            |   22 +-
 docs/user-manual/en/diverts.xml                 |    8 +-
 docs/user-manual/en/duplicate-detection.xml     |   16 +-
 docs/user-manual/en/embedding-activemq.xml      |  271 ++
 docs/user-manual/en/embedding-hornetq.xml       |  271 --
 docs/user-manual/en/examples.xml                |  154 +-
 docs/user-manual/en/filter-expressions.xml      |   12 +-
 docs/user-manual/en/flow-control.xml            |   44 +-
 docs/user-manual/en/ha.xml                      |   50 +-
 .../en/images/hornetQ-banner_final.png          |  Bin 109633 -> 0 bytes
 .../en/images/hornetQ_logo_600px.png            |  Bin 23866 -> 0 bytes
 docs/user-manual/en/intercepting-operations.xml |    6 +-
 docs/user-manual/en/interoperability.xml        |   74 +-
 docs/user-manual/en/jms-bridge.xml              |   30 +-
 docs/user-manual/en/jms-core-mapping.xml        |    6 +-
 docs/user-manual/en/large-messages.xml          |   28 +-
 docs/user-manual/en/last-value-queues.xml       |    2 +-
 docs/user-manual/en/libaio.xml                  |   16 +-
 docs/user-manual/en/logging.xml                 |   14 +-
 docs/user-manual/en/management.xml              |  114 +-
 docs/user-manual/en/message-expiry.xml          |   10 +-
 docs/user-manual/en/message-grouping.xml        |   14 +-
 docs/user-manual/en/messaging-concepts.xml      |   28 +-
 docs/user-manual/en/notice.xml                  |    2 +-
 docs/user-manual/en/paging.xml                  |   20 +-
 docs/user-manual/en/perf-tuning.xml             |   30 +-
 docs/user-manual/en/persistence.xml             |   64 +-
 docs/user-manual/en/pre-acknowledge.xml         |   16 +-
 docs/user-manual/en/preface.xml                 |   22 +-
 docs/user-manual/en/project-info.xml            |   34 +-
 docs/user-manual/en/queue-attributes.xml        |    8 +-
 docs/user-manual/en/rest.xml                    |  158 +-
 docs/user-manual/en/scheduled-messages.xml      |    2 +-
 docs/user-manual/en/security.xml                |   56 +-
 docs/user-manual/en/send-guarantees.xml         |   24 +-
 docs/user-manual/en/slow-consumers.xml          |    4 +-
 docs/user-manual/en/spring-integration.xml      |   22 +-
 docs/user-manual/en/thread-pooling.xml          |   30 +-
 docs/user-manual/en/tools.xml                   |   18 +-
 docs/user-manual/en/transaction-config.xml      |   10 +-
 docs/user-manual/en/undelivered-messages.xml    |   12 +-
 docs/user-manual/en/using-core.xml              |   14 +-
 docs/user-manual/en/using-jms.xml               |   36 +-
 docs/user-manual/en/using-server.xml            |   70 +-
 docs/user-manual/en/vertx-integration.xml       |   16 +-
 docs/user-manual/en/wildcard-routing.xml        |    6 +-
 docs/user-manual/en/wildcard-syntax.xml         |    8 +-
 docs/user-manual/pom.xml                        |    4 +-
 .../core/example/EmbeddedRemoteExample.java     |    6 +-
 .../activemq/core/example/EmbeddedServer.java   |    6 +-
 .../activemq/core/example/EmbeddedExample.java  |   12 +-
 .../apache/activemq/core/example/PerfBase.java  |    4 +-
 .../core/example/TwitterConnectorExample.java   |    6 +-
 .../javaee/example/server/SendMessageBean.java  |    2 +-
 .../javaee/example/server2/MDBQueueB.java       |    2 +-
 .../javaee/example/server2/StatelessSender.java |    8 +-
 .../javaee/example/server/MDBQueue.java         |    6 +-
 .../server/MDBRemoteFailoverStaticExample.java  |    6 +-
 .../server/MDBRemoteFailoverExample.java        |    6 +-
 .../jms/activemq-jms-examples-common/common.css |    1 -
 .../images/hornetQ-banner_final.png             |  Bin 109633 -> 0 bytes
 .../common/example/ActiveMQExample.java         |  234 ++
 .../activemq/common/example/HornetQExample.java |  234 --
 .../activemq/jms/example/AerogearExample.java   |    6 +-
 .../activemq/jms/example/AppletExample.java     |    6 +-
 .../jms/example/HttpStaticFileServer.java       |    4 +-
 .../ApplicationLayerFailoverExample.java        |    4 +-
 .../activemq/jms/example/BridgeExample.java     |    4 +-
 .../jms/example/QueueBrowserExample.java        |    4 +-
 .../jms/example/ClientKickoffExample.java       |   16 +-
 .../ClientSideFailoverListerExample.java        |    8 +-
 .../example/ClientSideLoadBalancingExample.java |   10 +-
 .../ClusteredDurableSubscriptionExample.java    |    4 +-
 .../jms/example/ClusteredGroupingExample.java   |    4 +-
 .../jms/example/ClusteredJgroupsExample.java    |    4 +-
 .../jms/example/ClusteredQueueExample.java      |    4 +-
 .../jms/example/ClusteredStandaloneExample.java |    4 +-
 .../example/StaticClusteredQueueExample.java    |    4 +-
 .../jms/example/ClusterStaticOnewayExample.java |    4 +-
 .../jms/example/ClusteredTopicExample.java      |    4 +-
 .../ColocatedFailoverScaleDownExample.java      |    4 +-
 .../jms/example/ColocatedFailoverExample.java   |    4 +-
 .../jms/example/ConsumerRateLimitExample.java   |    4 +-
 .../activemq/jms/example/DeadLetterExample.java |    6 +-
 .../jms/example/DelayedRedeliveryExample.java   |    6 +-
 .../activemq/jms/example/DivertExample.java     |    6 +-
 .../jms/example/DurableSubscriptionExample.java |    4 +-
 .../activemq/jms/example/EmbeddedExample.java   |    6 +-
 .../activemq/jms/example/EmbeddedExample.java   |   10 +-
 .../activemq/jms/example/ExpiryExample.java     |    6 +-
 .../jms/example/HAPolicyAutoBackupExample.java  |   10 +-
 .../jms/example/HttpTransportExample.java       |    4 +-
 .../InstantiateConnectionFactoryExample.java    |   10 +-
 .../jms/example/InterceptorExample.java         |    6 +-
 .../activemq/jms/example/JAASExample.java       |    6 +-
 .../jms/example/JMSAutoCloseableExample.java    |    4 +-
 .../activemq/jms/example/JMSBridgeExample.java  |    2 +-
 .../example/JMSCompletionListenerExample.java   |    6 +-
 .../activemq/jms/example/JMSContextExample.java |    4 +-
 .../jms/example/JMSSharedConsumerExample.java   |    4 +-
 .../apache/activemq/jms/example/JMXExample.java |    6 +-
 .../jms/example/LargeMessageExample.java        |    6 +-
 .../jms/example/LastValueQueueExample.java      |    4 +-
 .../example/ManagementNotificationExample.java  |    4 +-
 .../activemq/jms/example/ManagementExample.java |   10 +-
 .../jms/example/MessageCounterExample.java      |    4 +-
 .../jms/example/MessageGroupExample.java        |    4 +-
 .../jms/example/MessageGroup2Example.java       |    4 +-
 .../jms/example/MessagePriorityExample.java     |    4 +-
 .../MultipleFailoverFailbackExample.java        |    4 +-
 .../jms/example/MultipleFailoverExample.java    |    4 +-
 .../jms/example/NoConsumerBufferingExample.java |    6 +-
 .../example/NonTransactionFailoverExample.java  |    4 +-
 .../activemq/jms/example/OpenWireExample.java   |    4 +-
 .../activemq/jms/example/PagingExample.java     |    8 +-
 .../jms/example/PreacknowledgeExample.java      |   14 +-
 .../jms/example/ProducerRateLimitExample.java   |    4 +-
 .../activemq/jms/example/ProtonJExample.java    |    4 +-
 .../QueueMessageRedistributionExample.java      |    6 +-
 .../jms/example/QueueRequestorExample.java      |    4 +-
 .../jms/example/QueueSelectorExample.java       |    4 +-
 .../activemq/jms/example/QueueExample.java      |    4 +-
 .../activemq/jms/example/ReattachExample.java   |    8 +-
 .../ReplicatedFailbackStaticExample.java        |    4 +-
 .../jms/example/ReplicatedFailbackExample.java  |    4 +-
 .../ReplicatedMultipleFailoverExample.java      |    4 +-
 .../ReplicatedTransactionFailoverExample.java   |    4 +-
 .../jms/example/RequestReplyExample.java        |    4 +-
 .../rest/dup-send/src/main/java/PostOrder.java  |    2 +-
 .../jms-to-rest/src/main/java/JmsHelper.java    |   10 +-
 .../jms-to-rest/src/main/java/JmsReceive.java   |    6 +-
 .../rest/jms-to-rest/src/main/java/JmsSend.java |    6 +-
 .../jms/rest/push/src/main/java/JmsHelper.java  |   10 +-
 .../jms/rest/push/src/main/java/PostOrder.java  |    6 +-
 .../push/src/main/java/ReceiveShipping.java     |    6 +-
 .../activemq/jms/example/ScaleDownExample.java  |    4 +-
 .../jms/example/ScheduledMessageExample.java    |    4 +-
 .../activemq/jms/example/SecurityExample.java   |   14 +-
 .../example/SendAcknowledgementsExample.java    |   10 +-
 .../apache/activemq/jms/example/SSLExample.java |    4 +-
 .../jms/example/StaticSelectorJMSExample.java   |    4 +-
 .../jms/example/StaticSelectorExample.java      |    4 +-
 .../jms/example/StompWebSocketExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../activemq/jms/example/StompExample.java      |    4 +-
 .../jms/example/StopServerFailoverExample.java  |    4 +-
 .../jms/example/SymmetricClusterExample.java    |   18 +-
 .../jms/example/TemporaryQueueExample.java      |    4 +-
 .../jms/example/TopicHierarchyExample.java      |   14 +-
 .../jms/example/TopicSelectorExample1.java      |    4 +-
 .../jms/example/TopicSelectorExample2.java      |    4 +-
 .../activemq/jms/example/TopicExample.java      |    4 +-
 .../jms/example/TransactionFailoverExample.java |    4 +-
 .../jms/example/TransactionalExample.java       |    4 +-
 .../jms/example/XAHeuristicExample.java         |    6 +-
 .../activemq/jms/example/XAReceiveExample.java  |    4 +-
 .../activemq/jms/example/XASendExample.java     |    4 +-
 .../activemq/jms/example/XAwithJTAExample.java  |    6 +-
 .../aerogear/ActiveMQAeroGearBundle.java        |   46 +
 .../aerogear/ActiveMQAeroGearLogger.java        |   66 +
 .../aerogear/AeroGearConnectorService.java      |   26 +-
 .../aerogear/HornetQAeroGearBundle.java         |   46 -
 .../aerogear/HornetQAeroGearLogger.java         |   66 -
 .../integration/jboss/ActiveMQJBossBundle.java  |   31 +
 .../integration/jboss/ActiveMQJBossLogger.java  |   58 +
 .../integration/jboss/HornetQJBossBundle.java   |   31 -
 .../integration/jboss/HornetQJBossLogger.java   |   58 -
 .../jboss/security/JBossASSecurityManager.java  |   18 +-
 .../jboss/security/SecurityActions.java         |    6 +-
 .../activemq/spring/ActiveMQSpringBundle.java   |   31 +
 .../activemq/spring/ActiveMQSpringLogger.java   |   37 +
 .../activemq/spring/HornetQSpringBundle.java    |   31 -
 .../activemq/spring/HornetQSpringLogger.java    |   37 -
 .../twitter/impl/IncomingTweetsHandler.java     |   12 +-
 .../twitter/impl/OutgoingTweetsHandler.java     |   18 +-
 .../activemq/twitter/ActiveMQTwitterBundle.java |   31 +
 .../activemq/twitter/ActiveMQTwitterLogger.java |   54 +
 .../activemq/twitter/HornetQTwitterBundle.java  |   31 -
 .../activemq/twitter/HornetQTwitterLogger.java  |   54 -
 .../integration/vertx/ActiveMQVertxLogger.java  |   53 +
 .../integration/vertx/HornetQVertxLogger.java   |   53 -
 .../vertx/IncomingVertxEventHandler.java        |    8 +-
 .../vertx/OutgoingVertxEventHandler.java        |   14 +-
 pom.xml                                         |   28 +-
 .../tests/ActiveMQMessageHandlerTest.java       |  430 ++++
 .../activemq/byteman/tests/BMFailoverTest.java  |    8 +-
 .../BridgeServerLocatorConfigurationTest.java   |   14 +-
 .../byteman/tests/ClusteredGroupingTest.java    |    6 +-
 .../activemq/byteman/tests/GroupingTest.java    |    4 +-
 .../tests/HornetQMessageHandlerTest.java        |  430 ----
 .../tests/JMSBridgeReconnectionTest.java        |    8 +-
 .../activemq/byteman/tests/LatencyTest.java     |    4 +-
 .../byteman/tests/OrphanedConsumerTest.java     |    8 +-
 .../activemq/byteman/tests/PagingLeakTest.java  |    6 +-
 .../byteman/tests/ScaleDownFailoverTest.java    |   12 +-
 .../byteman/tests/StartStopDeadlockTest.java    |   10 +-
 .../byteman/tests/StompInternalStateTest.java   |    4 +-
 .../integration/DuplicateDetectionTest.java     |   76 +-
 .../tests/integration/InterceptorTest.java      |    4 +-
 .../tests/integration/String64KLimitTest.java   |    8 +-
 .../aerogear/AeroGearBasicServerTest.java       |   34 +-
 .../integration/client/AckBatchSizeTest.java    |    6 +-
 .../integration/client/AcknowledgeTest.java     |   16 +-
 .../integration/client/ActiveMQCrashTest.java   |  158 ++
 .../integration/client/AddressSettingsTest.java |   12 +-
 .../integration/client/AutogroupIdTest.java     |    8 +-
 .../integration/client/BlockingSendTest.java    |    4 +-
 .../integration/client/CommitRollbackTest.java  |   12 +-
 .../ConcurrentCreateDeleteProduceTest.java      |    4 +-
 .../integration/client/ConsumerCloseTest.java   |   18 +-
 .../integration/client/ConsumerFilterTest.java  |    4 +-
 .../client/ConsumerRoundRobinTest.java          |    4 +-
 .../integration/client/ConsumerStuckTest.java   |   12 +-
 .../tests/integration/client/ConsumerTest.java  |    4 +-
 .../client/ConsumerWindowSizeTest.java          |   32 +-
 .../integration/client/CoreClientTest.java      |   16 +-
 .../client/CreateQueueIdempotentTest.java       |    8 +-
 .../client/DeadLetterAddressTest.java           |   14 +-
 .../integration/client/DeliveryOrderTest.java   |    4 +-
 .../integration/client/DurableQueueTest.java    |    4 +-
 .../client/ExpireTestOnRestartTest.java         |    4 +-
 .../integration/client/ExpiryAddressTest.java   |   14 +-
 .../client/ExpiryLargeMessageTest.java          |    6 +-
 .../integration/client/FailureDeadlockTest.java |   28 +-
 .../integration/client/HangConsumerTest.java    |   28 +-
 .../integration/client/HeuristicXATest.java     |   30 +-
 .../integration/client/HornetQCrashTest.java    |  158 --
 .../InVMNonPersistentMessageBufferTest.java     |    4 +-
 .../client/IncompatibleVersionTest.java         |   24 +-
 .../client/InterruptedLargeMessageTest.java     |   28 +-
 .../client/JmsNettyNioStressTest.java           |   22 +-
 .../integration/client/JournalCrashTest.java    |    8 +-
 .../LargeMessageAvoidLargeMessagesTest.java     |   16 +-
 .../client/LargeMessageCompressTest.java        |   20 +-
 .../integration/client/LargeMessageTest.java    |   72 +-
 .../client/MessageConcurrencyTest.java          |    4 +-
 .../client/MessageConsumerRollbackTest.java     |    8 +-
 .../integration/client/MessageCounterTest.java  |    4 +-
 .../client/MessageDurabilityTest.java           |    8 +-
 .../client/MessageExpirationTest.java           |    4 +-
 .../MessageGroupingConnectionFactoryTest.java   |   14 +-
 .../integration/client/MessageGroupingTest.java |   22 +-
 .../integration/client/MessageHandlerTest.java  |    4 +-
 .../integration/client/MessagePriorityTest.java |   12 +-
 .../integration/client/MessageRateTest.java     |   10 +-
 .../client/MultipleThreadFilterOneTest.java     |    4 +-
 .../tests/integration/client/NIOvsOIOTest.java  |   10 +-
 .../integration/client/NettyConnectorTest.java  |    8 +-
 .../client/NewDeadLetterAddressTest.java        |   14 +-
 .../tests/integration/client/OrderTest.java     |    4 +-
 .../integration/client/PagingOrderTest.java     |   32 +-
 .../integration/client/PagingSyncTest.java      |    4 +-
 .../tests/integration/client/PagingTest.java    |   16 +-
 .../integration/client/ProducerCloseTest.java   |    6 +-
 .../client/ProducerFlowControlTest.java         |    4 +-
 .../tests/integration/client/ProducerTest.java  |    4 +-
 .../integration/client/QueueBrowserTest.java    |    4 +-
 .../client/ReceiveImmediateTest.java            |    4 +-
 .../tests/integration/client/ReceiveTest.java   |    4 +-
 .../client/RedeliveryConsumerTest.java          |    8 +-
 .../tests/integration/client/RequestorTest.java |   18 +-
 .../tests/integration/client/RoutingTest.java   |    4 +-
 .../client/SelfExpandingBufferTest.java         |    4 +-
 .../client/ServerLocatorConnectTest.java        |   18 +-
 .../client/ServerLocatorSerializationTest.java  |   16 +-
 .../client/SessionCloseOnGCTest.java            |    4 +-
 .../integration/client/SessionCloseTest.java    |   46 +-
 ...onClosedOnRemotingConnectionFailureTest.java |    4 +-
 .../client/SessionCreateAndDeleteQueueTest.java |    4 +-
 .../client/SessionCreateConsumerTest.java       |    4 +-
 .../client/SessionCreateProducerTest.java       |    4 +-
 .../integration/client/SessionFactoryTest.java  |  100 +-
 .../SessionSendAcknowledgementHandlerTest.java  |    4 +-
 .../client/SessionStopStartTest.java            |    4 +-
 .../tests/integration/client/SessionTest.java   |    4 +-
 .../client/SimpleSendMultipleQueuesTest.java    |    4 +-
 .../integration/client/SlowConsumerTest.java    |    4 +-
 .../integration/client/TemporaryQueueTest.java  |    6 +-
 .../client/TransactionDurabilityTest.java       |   10 +-
 .../client/TransactionalSendTest.java           |    6 +-
 .../integration/client/WildCardRoutingTest.java |   12 +-
 .../clientcrash/ClientCrashTest.java            |    6 +-
 .../integration/clientcrash/ClientExitTest.java |    6 +-
 .../integration/clientcrash/ClientTestBase.java |    8 +-
 .../integration/clientcrash/CrashClient.java    |    8 +-
 .../integration/clientcrash/CrashClient2.java   |    4 +-
 .../integration/clientcrash/GracefulClient.java |    8 +-
 .../cluster/ClusterControllerTest.java          |   16 +-
 .../cluster/bridge/BridgeFailoverTest.java      |    8 +-
 .../cluster/bridge/BridgeReconnectTest.java     |   48 +-
 .../cluster/bridge/BridgeStartTest.java         |   28 +-
 .../integration/cluster/bridge/BridgeTest.java  |   44 +-
 .../cluster/bridge/BridgeTestBase.java          |   40 +-
 .../BridgeWithDiscoveryGroupStartTest.java      |   10 +-
 .../cluster/distribution/ClusterTestBase.java   |   96 +-
 .../distribution/OnewayTwoNodeClusterTest.java  |    4 +-
 .../AutomaticColocatedQuorumVoteTest.java       |   64 +-
 .../cluster/failover/BackupSyncPagingTest.java  |    4 +-
 .../ClusterWithBackupFailoverTestBase.java      |    8 +-
 .../cluster/failover/FailBackAutoTest.java      |    4 +-
 .../cluster/failover/FailBackManualTest.java    |    4 +-
 .../cluster/failover/FailoverListenerTest.java  |    4 +-
 .../cluster/failover/FailoverTest.java          |    4 +-
 .../cluster/failover/FailoverTestBase.java      |   14 +-
 .../failover/LiveToLiveFailoverTest.java        |    6 +-
 .../MultipleBackupsFailoverTestBase.java        |    8 +-
 ...ultipleLivesMultipleBackupsFailoverTest.java |    6 +-
 .../MultipleServerFailoverTestBase.java         |   28 +-
 .../cluster/failover/NettyFailoverTest.java     |    4 +-
 .../failover/NettyReplicatedFailoverTest.java   |    4 +-
 .../cluster/failover/PagingFailoverTest.java    |    8 +-
 .../failover/ReplicatedPagedFailoverTest.java   |    4 +-
 .../cluster/failover/SecurityFailoverTest.java  |    8 +-
 .../SingleLiveMultipleBackupsFailoverTest.java  |    6 +-
 .../remote/FailoverWithSharedStoreTest.java     |    4 +-
 .../ha/HAAutomaticBackupSharedStore.java        |    4 +-
 .../MultiThreadRandomReattachTestBase.java      |   16 +-
 .../cluster/reattach/OrderReattachTest.java     |    8 +-
 .../cluster/reattach/RandomReattachTest.java    |   44 +-
 .../cluster/reattach/ReattachTest.java          |   24 +-
 .../cluster/topology/HAClientTopologyTest.java  |    4 +-
 .../HAClientTopologyWithDiscoveryTest.java      |   10 +-
 .../cluster/topology/IsolatedTopologyTest.java  |   12 +-
 .../cluster/topology/NonHATopologyTest.java     |    4 +-
 .../topology/TopologyClusterTestBase.java       |    6 +-
 .../cluster/util/BackupSyncDelay.java           |    8 +-
 .../cluster/util/MultiServerTestBase.java       |   42 +-
 .../cluster/util/SameProcessActiveMQServer.java |  111 +
 .../cluster/util/SameProcessHornetQServer.java  |  111 -
 .../cluster/util/TestableServer.java            |    8 +-
 .../core/deployers/impl/QueueDeployerTest.java  |    6 +-
 .../integration/discovery/DiscoveryTest.java    |    6 +-
 .../tests/integration/divert/DivertTest.java    |   26 +-
 .../divert/PersistentDivertTest.java            |   12 +-
 .../integration/embedded/ValidateAIOTest.java   |    6 +-
 .../http/CoreClientOverHttpTest.java            |   18 +-
 .../jms/ActiveMQConnectionFactoryTest.java      |  746 ++++++
 .../tests/integration/jms/FloodServerTest.java  |   52 +-
 .../jms/HornetQConnectionFactoryTest.java       |  746 ------
 .../tests/integration/jms/JmsProducerTest.java  |    6 +-
 .../ManualReconnectionToSingleServerTest.java   |    4 +-
 .../integration/jms/bridge/BridgeTestBase.java  |   66 +-
 .../jms/bridge/ClusteredBridgeTestBase.java     |   26 +-
 .../jms/bridge/JMSBridgeReconnectionTest.java   |   22 +-
 .../integration/jms/bridge/JMSBridgeTest.java   |   16 +-
 .../jms/client/AutoGroupingTest.java            |   12 +-
 .../integration/jms/client/CreateQueueTest.java |   10 +-
 .../integration/jms/client/GroupIDTest.java     |    6 +-
 .../integration/jms/client/GroupingTest.java    |   18 +-
 .../integration/jms/client/MessageTest.java     |   14 +-
 .../integration/jms/client/PreACKJMSTest.java   |   48 +-
 .../jms/client/ReSendMessageTest.java           |   54 +-
 .../jms/client/RemoteConnectionStressTest.java  |   14 +-
 ...onClosedOnRemotingConnectionFailureTest.java |   60 +-
 .../integration/jms/client/SessionTest.java     |    6 +-
 .../integration/jms/client/TextMessageTest.java |   48 +-
 .../jms/client/TopicCleanupTest.java            |    4 +-
 .../jms/cluster/BindingsClusterTest.java        |   44 +-
 .../jms/cluster/JMSFailoverListenerTest.java    |   50 +-
 .../jms/cluster/JMSFailoverTest.java            |   56 +-
 .../jms/cluster/JMSReconnectTest.java           |   40 +-
 .../jms/cluster/LargeMessageOverBridgeTest.java |    6 +-
 .../jms/cluster/MultipleThreadsOpeningTest.java |    6 +-
 .../jms/cluster/ReplicatedJMSFailoverTest.java  |    6 +-
 .../CloseConnectionFactoryOnGCest.java          |    8 +-
 .../jms/connection/CloseConnectionOnGCTest.java |    8 +-
 .../CloseDestroyedConnectionTest.java           |   28 +-
 .../connection/ConcurrentSessionCloseTest.java  |   10 +-
 .../ConnectionFactorySerializationTest.java     |   10 +-
 ...tionFactoryWithJGroupsSerializationTest.java |   16 +-
 .../jms/connection/ExceptionListenerTest.java   |   30 +-
 .../jms/connection/InvalidConnectorTest.java    |   54 +-
 .../integration/jms/consumer/ConsumerTest.java  |   76 +-
 .../jms/divert/DivertAndACKClientTest.java      |   48 +-
 .../integration/jms/jms2client/BodyTest.java    |    4 +-
 .../jms/jms2client/NonExistentQueueTest.java    |    8 +-
 .../jms/server/JMSServerDeployerTest.java       |   16 +-
 .../jms/server/JMSServerStartStopTest.java      |   34 +-
 .../jms/server/config/JMSConfigurationTest.java |    6 +-
 .../config/JMSServerConfigParserTest.java       |    2 +-
 .../ConnectionFactoryControlTest.java           |   16 +-
 .../server/management/JMSQueueControlTest.java  |   54 +-
 .../management/JMSQueueControlUsingJMSTest.java |   10 +-
 .../management/JMSServerControl2Test.java       |  100 +-
 .../management/JMSServerControlRestartTest.java |   12 +-
 .../server/management/JMSServerControlTest.java |   92 +-
 .../JMSServerControlUsingJMSTest.java           |   22 +-
 .../jms/server/management/JMSUtil.java          |   36 +-
 .../jms/server/management/TopicControlTest.java |   40 +-
 .../management/TopicControlUsingJMSTest.java    |   40 +-
 .../journal/JournalPerfTuneTest.java            |    4 +-
 .../integration/journal/OldFormatTest.java      |    2 +-
 .../largemessage/LargeMessageTestBase.java      |    4 +-
 .../largemessage/ServerLargeMessageTest.java    |   14 +-
 .../management/AcceptorControlTest.java         |    8 +-
 .../AcceptorControlUsingCoreTest.java           |    4 +-
 .../management/ActiveMQServerControlTest.java   | 1099 ++++++++
 .../ActiveMQServerControlUsingCoreTest.java     |  716 ++++++
 .../management/AddressControlTest.java          |   12 +-
 .../management/AddressControlUsingCoreTest.java |    6 +-
 .../management/BridgeControlTest.java           |   12 +-
 .../management/BridgeControlUsingCoreTest.java  |   18 +-
 .../management/BroadcastGroupControlTest.java   |   10 +-
 .../ClusterConnectionControl2Test.java          |   12 +-
 .../ClusterConnectionControlTest.java           |   12 +-
 .../ClusterConnectionControlUsingCoreTest.java  |    4 +-
 .../management/DivertControlTest.java           |    8 +-
 .../management/DivertControlUsingCoreTest.java  |    4 +-
 .../management/HornetQServerControlTest.java    | 1099 --------
 .../HornetQServerControlUsingCoreTest.java      |  716 ------
 .../integration/management/JMXDomainTest.java   |   34 +-
 .../management/ManagementControlHelper.java     |    8 +-
 .../management/ManagementServiceImplTest.java   |   14 +-
 .../ManagementWithPagingServerTest.java         |    8 +-
 .../management/ManagementWithStompTest.java     |    8 +-
 .../management/NotificationTest.java            |   12 +-
 .../management/QueueControlTest.java            |   28 +-
 .../management/SecurityManagementTestBase.java  |   14 +-
 ...tyManagementWithConfiguredAdminUserTest.java |   13 +-
 ...yManagementWithDefaultConfigurationTest.java |    8 +-
 ...ManagementWithModifiedConfigurationTest.java |    8 +-
 .../management/SecurityNotificationTest.java    |   22 +-
 .../integration/openwire/OpenWireTestBase.java  |    4 +-
 .../paging/PageCountSyncOnNonTXTest.java        |    4 +-
 .../integration/paging/PageCountSyncServer.java |    4 +-
 .../integration/paging/PagingCounterTest.java   |   18 +-
 .../integration/paging/PagingReceiveTest.java   |   12 +-
 .../integration/paging/PagingSendTest.java      |   10 +-
 .../PagingWithFailoverAndCountersTest.java      |    6 +-
 .../paging/PagingWithFailoverServer.java        |    8 +-
 .../paging/SpawnedServerSupport.java            |   16 +-
 .../persistence/DeleteQueueRestartTest.java     |    8 +-
 .../persistence/ExportFormatTest.java           |   22 +-
 .../persistence/StorageManagerTestBase.java     |    2 +-
 .../persistence/XmlImportExportTest.java        |   36 +-
 .../tests/integration/proton/ProtonTest.java    |   18 +-
 .../integration/ra/ActiveMQActivationTest.java  |   67 +
 .../integration/ra/ActiveMQClusteredTest.java   |  111 +
 .../ra/ActiveMQMessageHandlerSecurityTest.java  |   93 +
 .../ra/ActiveMQMessageHandlerTest.java          |  908 +++++++
 .../ra/ActiveMQMessageHandlerXATest.java        |  303 +++
 .../ra/ActiveMQRAClusteredTestBase.java         |   99 +
 .../integration/ra/ActiveMQRATestBase.java      |  235 ++
 .../integration/ra/HornetQActivationTest.java   |   67 -
 .../integration/ra/HornetQClusteredTest.java    |  111 -
 .../ra/HornetQMessageHandlerSecurityTest.java   |   93 -
 .../ra/HornetQMessageHandlerTest.java           |  908 -------
 .../ra/HornetQMessageHandlerXATest.java         |  303 ---
 .../ra/HornetQRAClusteredTestBase.java          |   99 -
 .../tests/integration/ra/HornetQRATestBase.java |  235 --
 .../tests/integration/ra/JMSContextTest.java    |   24 +-
 .../integration/ra/OutgoingConnectionTest.java  |   82 +-
 .../integration/ra/ResourceAdapterTest.java     |  148 +-
 .../integration/remoting/BatchDelayTest.java    |    8 +-
 .../remoting/DestroyConsumerTest.java           |    2 +-
 .../integration/remoting/DirectDeliverTest.java |    8 +-
 .../remoting/NetworkAddressTestBase.java        |    8 +-
 .../tests/integration/remoting/PingTest.java    |   20 +-
 .../integration/remoting/ReconnectTest.java     |    6 +-
 .../remoting/SynchronousCloseTest.java          |   12 +-
 .../replication/ReplicationOrderTest.java       |    6 +-
 .../replication/ReplicationTest.java            |   16 +-
 .../scheduling/DelayedMessageTest.java          |    8 +-
 .../MultipliedDelayedMessageTest.java           |    8 +-
 .../scheduling/ScheduledMessageTest.java        |   10 +-
 .../security/NettySecurityClientTest.java       |    4 +-
 .../integration/security/SecurityTest.java      |  146 +-
 .../integration/security/SimpleClient.java      |    8 +-
 .../server/AddressFullLoggingTest.java          |    8 +-
 .../integration/server/ExpiryRunnerTest.java    |   12 +-
 .../integration/server/FileLockTimeoutTest.java |    8 +-
 .../integration/server/LVQRecoveryTest.java     |   10 +-
 .../tests/integration/server/LVQTest.java       |   12 +-
 .../integration/server/PredefinedQueueTest.java |   24 +-
 .../integration/server/ScaleDown3NodeTest.java  |   10 +-
 .../tests/integration/server/ScaleDownTest.java |   10 +-
 .../server/SuppliedThreadPoolTest.java          |   10 +-
 .../spring/SpringIntegrationTest.java           |    4 +-
 .../ssl/CoreClientOverOneWaySSLTest.java        |   50 +-
 .../ssl/CoreClientOverTwoWaySSLTest.java        |   22 +-
 .../tests/integration/stomp/ExtraStompTest.java |   40 +-
 .../stomp/StompConnectionCleanupTest.java       |    6 +-
 .../tests/integration/stomp/StompTestBase.java  |   18 +-
 .../integration/stomp/StompWebSocketTest.java   |    8 +-
 .../integration/stomp/v11/ExtraStompTest.java   |    4 +-
 .../integration/stomp/v11/StompV11Test.java     |    2 +-
 .../integration/stomp/v11/StompV11TestBase.java |   12 +-
 .../integration/stomp/v12/StompV12Test.java     |    2 +-
 .../netty/ActiveMQFrameDecoder2Test.java        |  130 +
 .../netty/HornetQFrameDecoder2Test.java         |  130 -
 .../NettyConnectorWithHTTPUpgradeTest.java      |   30 +-
 .../tests/integration/twitter/TwitterTest.java  |   20 +-
 .../vertx/ActiveMQVertxUnitTest.java            |  866 +++++++
 .../integration/vertx/HornetQVertxUnitTest.java |  866 -------
 .../integration/xa/BasicXaRecoveryTest.java     |   12 +-
 .../tests/integration/xa/BasicXaTest.java       |   42 +-
 .../tests/integration/xa/XaTimeoutTest.java     |   14 +-
 .../largemessage/LargeMessageTestBase.java      |    4 +-
 .../tests/util/JMSClusteredTestBase.java        |   36 +-
 .../apache/activemq/tests/util/JMSTestBase.java |    8 +-
 .../tests/util/ReplicatedBackupUtils.java       |    4 +-
 .../activemq-jms-for-JMSServerDeployerTest.xml  |   53 +
 .../activemq-jms-for-JMSServerDeployerTest2.xml |   53 +
 .../hornetq-jms-for-JMSServerDeployerTest.xml   |   53 -
 .../hornetq-jms-for-JMSServerDeployerTest2.xml  |   53 -
 .../test/resources/spring-activemq-config.xml   |   34 +
 .../src/test/resources/spring-activemq-jms.xml  |   19 +
 .../test/resources/spring-hornetq-config.xml    |   34 -
 .../src/test/resources/spring-hornetq-jms.xml   |   19 -
 .../activemq/jms/tests/AcknowledgementTest.java |   24 +-
 .../jms/tests/ActiveMQServerTestCase.java       |  570 +++++
 .../apache/activemq/jms/tests/BrowserTest.java  |    4 +-
 .../jms/tests/CTSMiscellaneousTest.java         |   60 +-
 .../jms/tests/ConnectionClosedTest.java         |   12 +-
 .../jms/tests/ConnectionFactoryTest.java        |   46 +-
 .../activemq/jms/tests/ConnectionTest.java      |    2 +-
 .../jms/tests/DurableSubscriptionTest.java      |   42 +-
 .../jms/tests/HornetQServerTestCase.java        |  570 -----
 .../apache/activemq/jms/tests/JMSTestCase.java  |  172 +-
 .../activemq/jms/tests/JmsTestLogger.java       |    2 +-
 .../activemq/jms/tests/MessageConsumerTest.java |  130 +-
 .../activemq/jms/tests/MessageProducerTest.java |   50 +-
 .../jms/tests/NonDurableSubscriberTest.java     |    2 +-
 .../activemq/jms/tests/PersistenceTest.java     |   28 +-
 .../apache/activemq/jms/tests/QueueTest.java    |    2 +-
 .../activemq/jms/tests/ReferenceableTest.java   |   30 +-
 .../apache/activemq/jms/tests/SecurityTest.java |    8 +-
 .../apache/activemq/jms/tests/SessionTest.java  |    6 +-
 .../apache/activemq/jms/tests/TopicTest.java    |   16 +-
 .../jms/tests/TransactedSessionTest.java        |   28 +-
 .../activemq/jms/tests/XARecoveryTest.java      |   60 +-
 .../org/apache/activemq/jms/tests/XATest.java   |  178 +-
 .../tests/message/JMSExpirationHeaderTest.java  |    4 +-
 .../tests/message/JMSPriorityHeaderTest.java    |    4 +-
 .../tests/message/JMSXDeliveryCountTest.java    |   12 +-
 .../jms/tests/message/MessageBodyTestCase.java  |    4 +-
 .../jms/tests/message/MessageHeaderTest.java    |   44 +-
 .../tests/message/MessageHeaderTestBase.java    |   40 +-
 .../message/MessagePropertyConversionTest.java  |    4 +-
 .../jms/tests/message/MessageTestBase.java      |    8 +-
 .../message/ObjectMessageDeliveryTest.java      |   14 +-
 .../foreign/ForeignBytesMessageTest.java        |    4 +-
 .../message/foreign/ForeignMessageTest.java     |    6 +-
 .../jms/tests/selector/SelectorTest.java        |   28 +-
 .../tests/stress/ConcurrentCloseStressTest.java |    4 +-
 .../tests/stress/CorruptMessageStressTest.java  |    4 +-
 .../jms/tests/stress/JMSStressTestBase.java     |    4 +-
 .../tests/stress/ManyConnectionsStressTest.java |    4 +-
 .../jms/tests/stress/OpenCloseStressTest.java   |    4 +-
 .../jms/tests/stress/RelayStressTest.java       |    4 +-
 .../tests/stress/SeveralClientsStressTest.java  |    4 +-
 .../jms/tests/tools/ServerManagement.java       |    2 +-
 .../jms/tests/tools/container/Constants.java    |    2 +-
 .../tests/tools/container/LocalTestServer.java  |   88 +-
 .../jms/tests/tools/container/Server.java       |    6 +-
 .../activemq/jms/tests/util/JNDIUtilTest.java   |    4 +-
 .../org/apache/activemq/jms/ActiveMQQAdmin.java |  336 +++
 .../org/apache/activemq/jms/HornetQAdmin.java   |  336 ---
 .../apache/activemq/jms/SpawnedJMSServer.java   |    6 +-
 .../jms/conform/connection/ConnectionTest.java  |    2 +-
 .../src/test/resources/provider.properties      |    2 +-
 .../journal/JournalImplTestUnit.java            |    6 +-
 .../paging/MeasurePagingMultiThreadTest.java    |    4 +-
 .../tests/soak/client/ClientAbstract.java       |    2 +-
 .../soak/client/ClientNonDivertedSoakTest.java  |    4 +-
 .../tests/soak/client/ClientSoakTest.java       |    4 +-
 .../soak/client/SimpleSendReceiveSoakTest.java  |    4 +-
 .../tests/stress/client/SendStressTest.java     |    4 +-
 .../stress/journal/AddAndRemoveStressTest.java  |   22 +-
 .../stress/journal/CompactingStressTest.java    |    4 +-
 .../JournalCleanupCompactStressTest.java        |    8 +-
 .../journal/JournalRestartStressTest.java       |    4 +-
 .../stress/journal/LargeJournalStressTest.java  |    4 +-
 .../journal/MultiThreadConsumerStressTest.java  |    4 +-
 .../NIOMultiThreadCompactorStressTest.java      |    8 +-
 .../journal/XmlImportExportStressTest.java      |    4 +-
 .../paging/MultipleConsumersPageStressTest.java |    4 +-
 .../stress/paging/PageCursorStressTest.java     |    4 +-
 .../tests/stress/paging/PageStressTest.java     |   10 +-
 .../tests/stress/remote/PingStressTest.java     |   10 +-
 .../tests/stress/stomp/StompStressTest.java     |   10 +-
 .../jms/bridge/impl/JMSBridgeImplTest.java      |   48 +-
 .../activemq/tests/unit/UnitTestLogger.java     |    2 +-
 .../unit/core/asyncio/AsynchronousFileTest.java |    4 +-
 .../MultiThreadAsynchronousFileTest.java        |    4 +-
 .../client/impl/LargeMessageBufferTest.java     |   12 +-
 .../impl/ConfigurationValidationTest.java       |    2 +-
 .../impl/AddressSettingsDeployerTest.java       |    2 +-
 .../impl/BasicUserCredentialsDeployerTest.java  |   12 +-
 .../deployers/impl/SecurityDeployerTest.java    |    2 +-
 .../journal/impl/AlignedJournalImplTest.java    |   12 +-
 .../core/journal/impl/JournalImplTestBase.java  |    6 +-
 .../core/journal/impl/JournalImplTestUnit.java  |    4 +-
 .../impl/SequentialFileFactoryTestBase.java     |   34 +-
 .../impl/fakes/FakeSequentialFileFactory.java   |    4 +-
 .../unit/core/postoffice/impl/FakeQueue.java    |    4 +-
 .../core/remoting/ActiveMQBufferTestBase.java   |  357 +++
 .../core/remoting/HornetQBufferTestBase.java    |  357 ---
 .../impl/netty/ChannelBufferWrapper2Test.java   |    4 +-
 .../impl/netty/NettyAcceptorFactoryTest.java    |    4 +-
 .../remoting/impl/netty/NettyAcceptorTest.java  |    6 +-
 .../impl/netty/NettyConnectionTest.java         |    4 +-
 .../remoting/impl/netty/NettyConnectorTest.java |   24 +-
 .../impl/ActiveMQSecurityManagerImplTest.java   |  181 ++
 .../impl/HornetQSecurityManagerImplTest.java    |  181 --
 .../unit/core/server/impl/QueueImplTest.java    |    6 +-
 .../tests/unit/jms/ActiveMQDestinationTest.java |  102 +
 .../tests/unit/jms/HornetQDestinationTest.java  |  102 -
 .../unit/jms/client/ActiveMQMapMessageTest.java |  795 ++++++
 .../jms/client/ActiveMQStreamMessageTest.java   | 1059 ++++++++
 .../unit/jms/client/HornetQMapMessageTest.java  |  795 ------
 .../jms/client/HornetQStreamMessageTest.java    | 1059 --------
 .../unit/jms/client/JMSExceptionHelperTest.java |    2 +-
 .../unit/jms/client/SelectorTranslatorTest.java |   88 +-
 .../tests/unit/jms/misc/ManifestTest.java       |   14 +-
 .../ConnectionFactoryObjectFactoryTest.java     |    6 +-
 .../DestinationObjectFactoryTest.java           |    8 +-
 .../ra/ActiveMQResourceAdapterConfigTest.java   |  489 ++++
 .../ra/ConnectionFactoryPropertiesTest.java     |   14 +-
 .../ra/HornetQResourceAdapterConfigTest.java    |  489 ----
 .../tests/unit/ra/ResourceAdapterTest.java      |  240 +-
 .../util/ActiveMQBufferInputStreamTest.java     |   69 +
 .../unit/util/HornetQBufferInputStreamTest.java |   69 -
 .../tests/unit/util/VersionLoaderTest.java      |   12 +-
 .../tests/unit/xa/XAResourceWrapperTest.java    |    8 +-
 .../activemq/tests/util/CreateMessage.java      |   10 +-
 1334 files changed, 61627 insertions(+), 62126 deletions(-)
----------------------------------------------------------------------



[35/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQSession.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQSession.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQSession.java
deleted file mode 100644
index f37da08..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQSession.java
+++ /dev/null
@@ -1,1276 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.jms.TransactionInProgressException;
-import javax.transaction.xa.XAResource;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQQueueExistsException;
-import org.apache.activemq.selector.filter.FilterException;
-import org.apache.activemq.selector.SelectorParser;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientProducer;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSession.AddressQuery;
-import org.apache.activemq.api.core.client.ClientSession.QueueQuery;
-
-/**
- * HornetQ implementation of a JMS Session.
- * <br>
- * Note that we *do not* support JMS ASF (Application Server Facilities) optional
- * constructs such as ConnectionConsumer
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- *
- *
- */
-public class HornetQSession implements QueueSession, TopicSession
-{
-   public static final int TYPE_GENERIC_SESSION = 0;
-
-   public static final int TYPE_QUEUE_SESSION = 1;
-
-   public static final int TYPE_TOPIC_SESSION = 2;
-
-   private static SimpleString REJECTING_FILTER = new SimpleString("_HQX=-1");
-
-   private final HornetQConnection connection;
-
-   private final ClientSession session;
-
-   private final int sessionType;
-
-   private final int ackMode;
-
-   private final boolean transacted;
-
-   private final boolean xa;
-
-   private boolean recoverCalled;
-
-   private final Set<HornetQMessageConsumer> consumers = new HashSet<HornetQMessageConsumer>();
-
-   // Constructors --------------------------------------------------
-
-   protected HornetQSession(final HornetQConnection connection,
-                            final boolean transacted,
-                            final boolean xa,
-                            final int ackMode,
-                            final ClientSession session,
-                            final int sessionType)
-   {
-      this.connection = connection;
-
-      this.ackMode = ackMode;
-
-      this.session = session;
-
-      this.sessionType = sessionType;
-
-      this.transacted = transacted;
-
-      this.xa = xa;
-   }
-
-   // Session implementation ----------------------------------------
-
-   public BytesMessage createBytesMessage() throws JMSException
-   {
-      checkClosed();
-
-      return new HornetQBytesMessage(session);
-   }
-
-   public MapMessage createMapMessage() throws JMSException
-   {
-      checkClosed();
-
-      return new HornetQMapMessage(session);
-   }
-
-   public Message createMessage() throws JMSException
-   {
-      checkClosed();
-
-      return new HornetQMessage(session);
-   }
-
-   public ObjectMessage createObjectMessage() throws JMSException
-   {
-      checkClosed();
-
-      return new HornetQObjectMessage(session);
-   }
-
-   public ObjectMessage createObjectMessage(final Serializable object) throws JMSException
-   {
-      checkClosed();
-
-      HornetQObjectMessage msg = new HornetQObjectMessage(session);
-
-      msg.setObject(object);
-
-      return msg;
-   }
-
-   public StreamMessage createStreamMessage() throws JMSException
-   {
-      checkClosed();
-
-      return new HornetQStreamMessage(session);
-   }
-
-   public TextMessage createTextMessage() throws JMSException
-   {
-      checkClosed();
-
-      HornetQTextMessage msg = new HornetQTextMessage(session);
-
-      msg.setText(null);
-
-      return msg;
-   }
-
-   public TextMessage createTextMessage(final String text) throws JMSException
-   {
-      checkClosed();
-
-      HornetQTextMessage msg = new HornetQTextMessage(session);
-
-      msg.setText(text);
-
-      return msg;
-   }
-
-   public boolean getTransacted() throws JMSException
-   {
-      checkClosed();
-
-      return transacted;
-   }
-
-   public int getAcknowledgeMode() throws JMSException
-   {
-      checkClosed();
-
-      return ackMode;
-   }
-
-   public boolean isXA()
-   {
-      return xa;
-   }
-
-   public void commit() throws JMSException
-   {
-      if (!transacted)
-      {
-         throw new IllegalStateException("Cannot commit a non-transacted session");
-      }
-      if (xa)
-      {
-         throw new TransactionInProgressException("Cannot call commit on an XA session");
-      }
-      try
-      {
-         session.commit();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void rollback() throws JMSException
-   {
-      if (!transacted)
-      {
-         throw new IllegalStateException("Cannot rollback a non-transacted session");
-      }
-      if (xa)
-      {
-         throw new TransactionInProgressException("Cannot call rollback on an XA session");
-      }
-
-      try
-      {
-         session.rollback();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void close() throws JMSException
-   {
-      connection.getThreadAwareContext().assertNotCompletionListenerThread();
-      connection.getThreadAwareContext().assertNotMessageListenerThread();
-      synchronized (connection)
-      {
-         try
-         {
-            for (HornetQMessageConsumer cons : new HashSet<HornetQMessageConsumer>(consumers))
-            {
-               cons.close();
-            }
-
-            session.close();
-
-            connection.removeSession(this);
-         }
-         catch (ActiveMQException e)
-         {
-            throw JMSExceptionHelper.convertFromHornetQException(e);
-         }
-      }
-   }
-
-   public void recover() throws JMSException
-   {
-      if (transacted)
-      {
-         throw new IllegalStateException("Cannot recover a transacted session");
-      }
-
-      try
-      {
-         session.rollback(true);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-
-      recoverCalled = true;
-   }
-
-   public MessageListener getMessageListener() throws JMSException
-   {
-      checkClosed();
-
-      return null;
-   }
-
-   public void setMessageListener(final MessageListener listener) throws JMSException
-   {
-      checkClosed();
-   }
-
-   public void run()
-   {
-   }
-
-   public MessageProducer createProducer(final Destination destination) throws JMSException
-   {
-      if (destination != null && !(destination instanceof HornetQDestination))
-      {
-         throw new InvalidDestinationException("Not a HornetQ Destination:" + destination);
-      }
-
-      try
-      {
-         HornetQDestination jbd = (HornetQDestination)destination;
-
-         if (jbd != null)
-         {
-            ClientSession.AddressQuery response = session.addressQuery(jbd.getSimpleAddress());
-
-            if (!response.isExists())
-            {
-               throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
-            }
-
-            connection.addKnownDestination(jbd.getSimpleAddress());
-         }
-
-         ClientProducer producer = session.createProducer(jbd == null ? null : jbd.getSimpleAddress());
-
-         return new HornetQMessageProducer(connection, producer, jbd, session);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public MessageConsumer createConsumer(final Destination destination) throws JMSException
-   {
-      return createConsumer(destination, null, false);
-   }
-
-   public MessageConsumer createConsumer(final Destination destination, final String messageSelector) throws JMSException
-   {
-      return createConsumer(destination, messageSelector, false);
-   }
-
-   public MessageConsumer createConsumer(final Destination destination,
-                                         final String messageSelector,
-                                         final boolean noLocal) throws JMSException
-   {
-      if (destination == null)
-      {
-         throw new InvalidDestinationException("Cannot create a consumer with a null destination");
-      }
-
-      if (!(destination instanceof HornetQDestination))
-      {
-         throw new InvalidDestinationException("Not a HornetQDestination:" + destination);
-      }
-
-      HornetQDestination jbdest = (HornetQDestination)destination;
-
-      if (jbdest.isTemporary() && !connection.containsTemporaryQueue(jbdest.getSimpleAddress()))
-      {
-         throw new JMSException("Can not create consumer for temporary destination " + destination +
-                                " from another JMS connection");
-      }
-
-      return createConsumer(jbdest, null, messageSelector, noLocal, ConsumerDurability.NON_DURABLE);
-   }
-
-   public Queue createQueue(final String queueName) throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_TOPIC_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a queue using a TopicSession");
-      }
-
-      try
-      {
-         HornetQQueue queue = lookupQueue(queueName, false);
-
-         if (queue == null)
-         {
-            queue = lookupQueue(queueName, true);
-         }
-
-         if (queue == null)
-         {
-            throw new JMSException("There is no queue with name " + queueName);
-         }
-         else
-         {
-            return queue;
-         }
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public Topic createTopic(final String topicName) throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a topic on a QueueSession");
-      }
-
-      try
-      {
-         HornetQTopic topic = lookupTopic(topicName, false);
-
-         if (topic == null)
-         {
-            topic = lookupTopic(topicName, true);
-         }
-
-         if (topic == null)
-         {
-            throw new JMSException("There is no topic with name " + topicName);
-         }
-         else
-         {
-            return topic;
-         }
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException
-   {
-      return createDurableSubscriber(topic, name, null, false);
-   }
-
-   public TopicSubscriber createDurableSubscriber(final Topic topic,
-                                                  final String name,
-                                                  String messageSelector,
-                                                  final boolean noLocal) throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a durable subscriber on a QueueSession");
-      }
-      checkTopic(topic);
-      if (!(topic instanceof HornetQDestination))
-      {
-         throw new InvalidDestinationException("Not a HornetQTopic:" + topic);
-      }
-      if ("".equals(messageSelector))
-      {
-         messageSelector = null;
-      }
-
-      HornetQDestination jbdest = (HornetQDestination)topic;
-
-      if (jbdest.isQueue())
-      {
-         throw new InvalidDestinationException("Cannot create a subscriber on a queue");
-      }
-
-      return createConsumer(jbdest, name, messageSelector, noLocal, ConsumerDurability.DURABLE);
-   }
-
-   private void checkTopic(Topic topic) throws InvalidDestinationException
-   {
-      if (topic == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nullTopic();
-      }
-   }
-
-   @Override
-   public MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSException
-   {
-      return createSharedConsumer(topic, sharedSubscriptionName, null);
-   }
-
-   /**
-    * Note: Needs to throw an exception if a subscriptionName is already in use by another topic, or if the messageSelector is different
-    *
-    * validate multiple subscriptions on the same session.
-    * validate multiple subscriptions on different sessions
-    * validate failure in one connection while another connection stills fine.
-    * Validate different filters in different possible scenarios
-    *
-    * @param topic
-    * @param name
-    * @param messageSelector
-    * @return
-    * @throws JMSException
-    */
-   @Override
-   public MessageConsumer createSharedConsumer(Topic topic, String name, String messageSelector) throws JMSException
-   {
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a shared consumer on a QueueSession");
-      }
-      checkTopic(topic);
-      HornetQTopic localTopic;
-      if (topic instanceof HornetQTopic)
-      {
-         localTopic = (HornetQTopic)topic;
-      }
-      else
-      {
-         localTopic = new HornetQTopic(topic.getTopicName());
-      }
-      return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.NON_DURABLE, true);
-   }
-
-   @Override
-   public MessageConsumer createDurableConsumer(Topic topic, String name) throws JMSException
-   {
-      return createDurableConsumer(topic, name, null, false);
-   }
-
-   @Override
-   public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
-   {
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a durable consumer on a QueueSession");
-      }
-      checkTopic(topic);
-      HornetQTopic localTopic;
-      if (topic instanceof HornetQTopic)
-      {
-         localTopic = (HornetQTopic)topic;
-      }
-      else
-      {
-         localTopic = new HornetQTopic(topic.getTopicName());
-      }
-      return createConsumer(localTopic, name, messageSelector, noLocal, ConsumerDurability.DURABLE);
-   }
-
-   @Override
-   public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
-   {
-      return createSharedDurableConsumer(topic, name, null);
-   }
-
-   @Override
-   public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException
-   {
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a shared durable consumer on a QueueSession");
-      }
-
-      checkTopic(topic);
-
-      HornetQTopic localTopic;
-
-      if (topic instanceof HornetQTopic)
-      {
-         localTopic = (HornetQTopic)topic;
-      }
-      else
-      {
-         localTopic = new HornetQTopic(topic.getTopicName());
-      }
-      return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.DURABLE, true);
-   }
-
-   enum ConsumerDurability
-   {
-      DURABLE, NON_DURABLE;
-   }
-
-
-   /**
-    * This is an internal method for shared consumers
-    */
-   private HornetQMessageConsumer internalCreateSharedConsumer(final HornetQDestination dest,
-                                                               final String subscriptionName,
-                                                               String selectorString,
-                                                               ConsumerDurability durability,
-                                                               final boolean shared) throws JMSException
-   {
-      try
-      {
-
-         if (dest.isQueue())
-         {
-            // This is not really possible unless someone makes a mistake on code
-            // createSharedConsumer only accpets Topics by declaration
-            throw new RuntimeException("Internal error: createSharedConsumer is only meant for Topics");
-         }
-
-         if (subscriptionName == null)
-         {
-            throw HornetQJMSClientBundle.BUNDLE.invalidSubscriptionName();
-         }
-
-         selectorString = "".equals(selectorString) ? null : selectorString;
-
-         SimpleString coreFilterString = null;
-
-         if (selectorString != null)
-         {
-            coreFilterString = new SimpleString(SelectorTranslator.convertToHornetQFilterString(selectorString));
-         }
-
-         ClientConsumer consumer;
-
-         SimpleString autoDeleteQueueName = null;
-
-         AddressQuery response = session.addressQuery(dest.getSimpleAddress());
-
-         if (!response.isExists())
-         {
-            throw HornetQJMSClientBundle.BUNDLE.destinationDoesNotExist(dest.getSimpleAddress());
-         }
-
-         SimpleString queueName;
-
-         if (dest.isTemporary() && durability == ConsumerDurability.DURABLE)
-         {
-            throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
-         }
-
-         queueName = new SimpleString(HornetQDestination.createQueueNameForDurableSubscription(durability == ConsumerDurability.DURABLE, connection.getClientID(),
-                                                                                               subscriptionName));
-
-         if (durability == ConsumerDurability.DURABLE)
-         {
-            try
-            {
-               session.createSharedQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
-            }
-            catch (ActiveMQQueueExistsException ignored)
-            {
-               // We ignore this because querying and then creating the queue wouldn't be idempotent
-               // we could also add a parameter to ignore existence what would require a bigger work around to avoid
-               // compatibility.
-            }
-         }
-         else
-         {
-            session.createSharedQueue(dest.getSimpleAddress(), queueName, coreFilterString, false);
-         }
-
-         consumer = session.createConsumer(queueName, null, false);
-
-         HornetQMessageConsumer jbc = new HornetQMessageConsumer(connection, this,
-                                                                 consumer,
-                                                                 false,
-                                                                 dest,
-                                                                 selectorString,
-                                                                 autoDeleteQueueName);
-
-         consumers.add(jbc);
-
-         return jbc;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-
-
-   private HornetQMessageConsumer createConsumer(final HornetQDestination dest,
-                                                 final String subscriptionName,
-                                                 String selectorString, final boolean noLocal,
-                                                 ConsumerDurability durability) throws JMSException
-   {
-      try
-      {
-         selectorString = "".equals(selectorString) ? null : selectorString;
-
-         if (noLocal)
-         {
-            connection.setHasNoLocal();
-
-            String filter;
-            if (connection.getClientID() != null)
-            {
-               filter =
-                        HornetQConnection.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'" + connection.getClientID() +
-                                 "'";
-            }
-            else
-            {
-               filter = HornetQConnection.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'" + connection.getUID() + "'";
-            }
-
-            if (selectorString != null)
-            {
-               selectorString += " AND " + filter;
-            }
-            else
-            {
-               selectorString = filter;
-            }
-         }
-
-         SimpleString coreFilterString = null;
-
-         if (selectorString != null)
-         {
-            coreFilterString = new SimpleString(SelectorTranslator.convertToHornetQFilterString(selectorString));
-         }
-
-         ClientConsumer consumer;
-
-         SimpleString autoDeleteQueueName = null;
-
-         if (dest.isQueue())
-         {
-            AddressQuery response = session.addressQuery(dest.getSimpleAddress());
-
-            if (!response.isExists())
-            {
-               throw new InvalidDestinationException("Queue " + dest.getName() + " does not exist");
-            }
-
-            connection.addKnownDestination(dest.getSimpleAddress());
-
-            consumer = session.createConsumer(dest.getSimpleAddress(), coreFilterString, false);
-         }
-         else
-         {
-            AddressQuery response = session.addressQuery(dest.getSimpleAddress());
-
-            if (!response.isExists())
-            {
-               throw new InvalidDestinationException("Topic " + dest.getName() + " does not exist");
-            }
-
-            connection.addKnownDestination(dest.getSimpleAddress());
-
-            SimpleString queueName;
-
-            if (subscriptionName == null)
-            {
-               if (durability != ConsumerDurability.NON_DURABLE)
-                  throw new RuntimeException();
-               // Non durable sub
-
-               queueName = new SimpleString(UUID.randomUUID().toString());
-
-               session.createTemporaryQueue(dest.getSimpleAddress(), queueName, coreFilterString);
-
-               consumer = session.createConsumer(queueName, null, false);
-
-               autoDeleteQueueName = queueName;
-            }
-            else
-            {
-               // Durable sub
-               if (durability != ConsumerDurability.DURABLE)
-                  throw new RuntimeException();
-               if (connection.getClientID() == null)
-               {
-                  throw new IllegalStateException("Cannot create durable subscription - client ID has not been set");
-               }
-
-               if (dest.isTemporary())
-               {
-                  throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
-               }
-
-               queueName = new SimpleString(HornetQDestination.createQueueNameForDurableSubscription(true, connection.getClientID(),
-                                                                                                     subscriptionName));
-
-               QueueQuery subResponse = session.queueQuery(queueName);
-
-               if (!subResponse.isExists())
-               {
-                  session.createQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
-               }
-               else
-               {
-                  // Already exists
-                  if (subResponse.getConsumerCount() > 0)
-                  {
-                     throw new IllegalStateException("Cannot create a subscriber on the durable subscription since it already has subscriber(s)");
-                  }
-
-                  // From javax.jms.Session Javadoc (and also JMS 1.1 6.11.1):
-                  // A client can change an existing durable subscription by
-                  // creating a durable
-                  // TopicSubscriber with the same name and a new topic and/or
-                  // message selector.
-                  // Changing a durable subscriber is equivalent to
-                  // unsubscribing (deleting) the old
-                  // one and creating a new one.
-
-                  SimpleString oldFilterString = subResponse.getFilterString();
-
-                  boolean selectorChanged = coreFilterString == null && oldFilterString != null ||
-                                            oldFilterString == null &&
-                                            coreFilterString != null ||
-                                            oldFilterString != null &&
-                                            coreFilterString != null &&
-                                            !oldFilterString.equals(coreFilterString);
-
-                  SimpleString oldTopicName = subResponse.getAddress();
-
-                  boolean topicChanged = !oldTopicName.equals(dest.getSimpleAddress());
-
-                  if (selectorChanged || topicChanged)
-                  {
-                     // Delete the old durable sub
-                     session.deleteQueue(queueName);
-
-                     // Create the new one
-                     session.createQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
-                  }
-               }
-
-               consumer = session.createConsumer(queueName, null, false);
-            }
-         }
-
-         HornetQMessageConsumer jbc = new HornetQMessageConsumer(connection,
-                                                                 this,
-                                                                 consumer,
-                                                                 noLocal,
-                                                                 dest,
-                                                                 selectorString,
-                                                                 autoDeleteQueueName);
-
-         consumers.add(jbc);
-
-         return jbc;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void ackAllConsumers() throws JMSException
-   {
-      checkClosed();
-   }
-
-   public QueueBrowser createBrowser(final Queue queue) throws JMSException
-   {
-      return createBrowser(queue, null);
-   }
-
-   public QueueBrowser createBrowser(final Queue queue, String filterString) throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_TOPIC_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a browser on a TopicSession");
-      }
-      if (queue == null)
-      {
-         throw new InvalidDestinationException("Cannot create a browser with a null queue");
-      }
-      if (!(queue instanceof HornetQDestination))
-      {
-         throw new InvalidDestinationException("Not a HornetQQueue:" + queue);
-      }
-      if ("".equals(filterString))
-      {
-         filterString = null;
-      }
-
-      // eager test of the filter syntax as required by JMS spec
-      try
-      {
-         if (filterString != null)
-         {
-            SelectorParser.parse(filterString.trim());
-         }
-      }
-      catch (FilterException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(HornetQJMSClientBundle.BUNDLE.invalidFilter(e, new SimpleString(filterString)));
-      }
-
-      HornetQDestination jbq = (HornetQDestination)queue;
-
-      if (!jbq.isQueue())
-      {
-         throw new InvalidDestinationException("Cannot create a browser on a topic");
-      }
-
-      try
-      {
-         AddressQuery message = session.addressQuery(new SimpleString(jbq.getAddress()));
-         if (!message.isExists())
-         {
-            throw new InvalidDestinationException(jbq.getAddress() + " does not exist");
-         }
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-
-      return new HornetQQueueBrowser((HornetQQueue)jbq, filterString, session);
-
-   }
-
-   public TemporaryQueue createTemporaryQueue() throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_TOPIC_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a temporary queue using a TopicSession");
-      }
-
-      try
-      {
-         HornetQTemporaryQueue queue = HornetQDestination.createTemporaryQueue(this);
-
-         SimpleString simpleAddress = queue.getSimpleAddress();
-
-         session.createTemporaryQueue(simpleAddress, simpleAddress);
-
-         connection.addTemporaryQueue(simpleAddress);
-
-         return queue;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public TemporaryTopic createTemporaryTopic() throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot create a temporary topic on a QueueSession");
-      }
-
-      try
-      {
-         HornetQTemporaryTopic topic = HornetQDestination.createTemporaryTopic(this);
-
-         SimpleString simpleAddress = topic.getSimpleAddress();
-
-         // We create a dummy subscription on the topic, that never receives messages - this is so we can perform JMS
-         // checks when routing messages to a topic that
-         // does not exist - otherwise we would not be able to distinguish from a non existent topic and one with no
-         // subscriptions - core has no notion of a topic
-
-         session.createTemporaryQueue(simpleAddress, simpleAddress, HornetQSession.REJECTING_FILTER);
-
-         connection.addTemporaryQueue(simpleAddress);
-
-         return topic;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void unsubscribe(final String name) throws JMSException
-   {
-      // As per spec. section 4.11
-      if (sessionType == HornetQSession.TYPE_QUEUE_SESSION)
-      {
-         throw new IllegalStateException("Cannot unsubscribe using a QueueSession");
-      }
-
-      SimpleString queueName = new SimpleString(HornetQDestination.createQueueNameForDurableSubscription(true, connection.getClientID(),
-                                                                                                         name));
-
-      try
-      {
-         QueueQuery response = session.queueQuery(queueName);
-
-         if (!response.isExists())
-         {
-            throw new InvalidDestinationException("Cannot unsubscribe, subscription with name " + name +
-                                                  " does not exist");
-         }
-
-         if (response.getConsumerCount() != 0)
-         {
-            throw new IllegalStateException("Cannot unsubscribe durable subscription " + name +
-                                            " since it has active subscribers");
-         }
-
-         session.deleteQueue(queueName);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   // XASession implementation
-
-   public Session getSession() throws JMSException
-   {
-      if (!xa)
-      {
-         throw new IllegalStateException("Isn't an XASession");
-      }
-
-      return this;
-   }
-
-   public XAResource getXAResource()
-   {
-      return session.getXAResource();
-   }
-
-   // QueueSession implementation
-
-   public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException
-   {
-      return (QueueReceiver)createConsumer(queue, messageSelector);
-   }
-
-   public QueueReceiver createReceiver(final Queue queue) throws JMSException
-   {
-      return (QueueReceiver)createConsumer(queue);
-   }
-
-   public QueueSender createSender(final Queue queue) throws JMSException
-   {
-      return (QueueSender)createProducer(queue);
-   }
-
-   // XAQueueSession implementation
-
-   public QueueSession getQueueSession() throws JMSException
-   {
-      return (QueueSession)getSession();
-   }
-
-   // TopicSession implementation
-
-   public TopicPublisher createPublisher(final Topic topic) throws JMSException
-   {
-      return (TopicPublisher)createProducer(topic);
-   }
-
-   public TopicSubscriber createSubscriber(final Topic topic, final String messageSelector, final boolean noLocal) throws JMSException
-   {
-      return (TopicSubscriber)createConsumer(topic, messageSelector, noLocal);
-   }
-
-   public TopicSubscriber createSubscriber(final Topic topic) throws JMSException
-   {
-      return (TopicSubscriber)createConsumer(topic);
-   }
-
-   // XATopicSession implementation
-
-   public TopicSession getTopicSession() throws JMSException
-   {
-      return (TopicSession)getSession();
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public String toString()
-   {
-      return "HornetQSession->" + session;
-   }
-
-   public ClientSession getCoreSession()
-   {
-      return session;
-   }
-
-   public boolean isRecoverCalled()
-   {
-      return recoverCalled;
-   }
-
-   public void setRecoverCalled(final boolean recoverCalled)
-   {
-      this.recoverCalled = recoverCalled;
-   }
-
-   public void deleteTemporaryTopic(final HornetQDestination tempTopic) throws JMSException
-   {
-      if (!tempTopic.isTemporary())
-      {
-         throw new InvalidDestinationException("Not a temporary topic " + tempTopic);
-      }
-
-      try
-      {
-         AddressQuery response = session.addressQuery(tempTopic.getSimpleAddress());
-
-         if (!response.isExists())
-         {
-            throw new InvalidDestinationException("Cannot delete temporary topic " + tempTopic.getName() +
-                                                  " does not exist");
-         }
-
-         if (response.getQueueNames().size() > 1)
-         {
-            throw new IllegalStateException("Cannot delete temporary topic " + tempTopic.getName() +
-                                            " since it has subscribers");
-         }
-
-         SimpleString address = tempTopic.getSimpleAddress();
-
-         session.deleteQueue(address);
-
-         connection.removeTemporaryQueue(address);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void deleteTemporaryQueue(final HornetQDestination tempQueue) throws JMSException
-   {
-      if (!tempQueue.isTemporary())
-      {
-         throw new InvalidDestinationException("Not a temporary queue " + tempQueue);
-      }
-      try
-      {
-         QueueQuery response = session.queueQuery(tempQueue.getSimpleAddress());
-
-         if (!response.isExists())
-         {
-            throw new InvalidDestinationException("Cannot delete temporary queue " + tempQueue.getName() +
-                                                  " does not exist");
-         }
-
-         if (response.getConsumerCount() > 0)
-         {
-            throw new IllegalStateException("Cannot delete temporary queue " + tempQueue.getName() +
-                                            " since it has subscribers");
-         }
-
-         SimpleString address = tempQueue.getSimpleAddress();
-
-         session.deleteQueue(address);
-
-         connection.removeTemporaryQueue(address);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void start() throws JMSException
-   {
-      try
-      {
-         session.start();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void stop() throws JMSException
-   {
-      try
-      {
-         session.stop();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void removeConsumer(final HornetQMessageConsumer consumer)
-   {
-      consumers.remove(consumer);
-   }
-
-   // Package protected ---------------------------------------------
-
-   void deleteQueue(final SimpleString queueName) throws JMSException
-   {
-      if (!session.isClosed())
-      {
-         try
-         {
-            session.deleteQueue(queueName);
-         }
-         catch (ActiveMQException ignore)
-         {
-            // Exception on deleting queue shouldn't prevent close from completing
-         }
-      }
-   }
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   private void checkClosed() throws JMSException
-   {
-      if (session.isClosed())
-      {
-         throw new IllegalStateException("Session is closed");
-      }
-   }
-
-   private HornetQQueue lookupQueue(final String queueName, boolean isTemporary) throws ActiveMQException
-   {
-      HornetQQueue queue;
-
-      if (isTemporary)
-      {
-         queue = HornetQDestination.createTemporaryQueue(queueName);
-      }
-      else
-      {
-         queue = HornetQDestination.createQueue(queueName);
-      }
-
-      QueueQuery response = session.queueQuery(queue.getSimpleAddress());
-
-      if (response.isExists())
-      {
-         return queue;
-      }
-      else
-      {
-         return null;
-      }
-   }
-
-   private HornetQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException
-   {
-
-      HornetQTopic topic;
-
-      if (isTemporary)
-      {
-         topic = HornetQDestination.createTemporaryTopic(topicName);
-      }
-      else
-      {
-         topic = HornetQDestination.createTopic(topicName);
-      }
-
-      AddressQuery query = session.addressQuery(topic.getSimpleAddress());
-
-      if (!query.isExists())
-      {
-         return null;
-      }
-      else
-      {
-         return topic;
-      }
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQStreamMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQStreamMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQStreamMessage.java
deleted file mode 100644
index 5274557..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQStreamMessage.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import javax.jms.StreamMessage;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.Pair;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.core.client.impl.ClientMessageImpl;
-import org.apache.activemq.utils.DataConstants;
-
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadBoolean;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadByte;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadBytes;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadChar;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadDouble;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadFloat;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadInteger;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadLong;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadObject;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadShort;
-import static org.apache.activemq.reader.StreamMessageUtil.streamReadString;
-
-/**
- * HornetQ implementation of a JMS StreamMessage.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * Some parts based on JBM 1.x class by:
- *
- * @author Norbert Lataille (Norbert.Lataille@m4x.org)
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- */
-public final class HornetQStreamMessage extends HornetQMessage implements StreamMessage
-{
-   public static final byte TYPE = Message.STREAM_TYPE;
-
-   protected HornetQStreamMessage(final ClientSession session)
-   {
-      super(HornetQStreamMessage.TYPE, session);
-   }
-
-   protected HornetQStreamMessage(final ClientMessage message, final ClientSession session)
-   {
-      super(message, session);
-   }
-
-   public HornetQStreamMessage(final StreamMessage foreign, final ClientSession session) throws JMSException
-   {
-      super(foreign, HornetQStreamMessage.TYPE, session);
-
-      foreign.reset();
-
-      try
-      {
-         while (true)
-         {
-            Object obj = foreign.readObject();
-            writeObject(obj);
-         }
-      }
-      catch (MessageEOFException e)
-      {
-         // Ignore
-      }
-   }
-
-   // For testing only
-   public HornetQStreamMessage()
-   {
-      message = new ClientMessageImpl((byte)0, false, 0, 0, (byte)4, 1500);
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public byte getType()
-   {
-      return HornetQStreamMessage.TYPE;
-   }
-
-   // StreamMessage implementation ----------------------------------
-
-   public boolean readBoolean() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadBoolean(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public byte readByte() throws JMSException
-   {
-      checkRead();
-
-      try
-      {
-         return streamReadByte(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public short readShort() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadShort(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public char readChar() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadChar(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public int readInt() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadInteger(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public long readLong() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadLong(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public float readFloat() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadFloat(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public double readDouble() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadDouble(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public String readString() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadString(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   /**
-    * len here is used to control how many more bytes to read
-    */
-   private int len = 0;
-
-   public int readBytes(final byte[] value) throws JMSException
-   {
-      checkRead();
-      try
-      {
-         Pair<Integer, Integer> pairRead = streamReadBytes(message, len, value);
-
-         len = pairRead.getA();
-         return pairRead.getB();
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public Object readObject() throws JMSException
-   {
-      checkRead();
-      try
-      {
-         return streamReadObject(message);
-      }
-      catch (IllegalStateException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      catch (IndexOutOfBoundsException e)
-      {
-         throw new MessageEOFException("");
-      }
-   }
-
-   public void writeBoolean(final boolean value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.BOOLEAN);
-      getBuffer().writeBoolean(value);
-   }
-
-   public void writeByte(final byte value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.BYTE);
-      getBuffer().writeByte(value);
-   }
-
-   public void writeShort(final short value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.SHORT);
-      getBuffer().writeShort(value);
-   }
-
-   public void writeChar(final char value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.CHAR);
-      getBuffer().writeShort((short)value);
-   }
-
-   public void writeInt(final int value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.INT);
-      getBuffer().writeInt(value);
-   }
-
-   public void writeLong(final long value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.LONG);
-      getBuffer().writeLong(value);
-   }
-
-   public void writeFloat(final float value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.FLOAT);
-      getBuffer().writeInt(Float.floatToIntBits(value));
-   }
-
-   public void writeDouble(final double value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.DOUBLE);
-      getBuffer().writeLong(Double.doubleToLongBits(value));
-   }
-
-   public void writeString(final String value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.STRING);
-      getBuffer().writeNullableString(value);
-   }
-
-   public void writeBytes(final byte[] value) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.BYTES);
-      getBuffer().writeInt(value.length);
-      getBuffer().writeBytes(value);
-   }
-
-   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
-   {
-      checkWrite();
-      getBuffer().writeByte(DataConstants.BYTES);
-      getBuffer().writeInt(length);
-      getBuffer().writeBytes(value, offset, length);
-   }
-
-   public void writeObject(final Object value) throws JMSException
-   {
-      if (value instanceof String)
-      {
-         writeString((String)value);
-      }
-      else if (value instanceof Boolean)
-      {
-         writeBoolean((Boolean)value);
-      }
-      else if (value instanceof Byte)
-      {
-         writeByte((Byte)value);
-      }
-      else if (value instanceof Short)
-      {
-         writeShort((Short)value);
-      }
-      else if (value instanceof Integer)
-      {
-         writeInt((Integer)value);
-      }
-      else if (value instanceof Long)
-      {
-         writeLong((Long)value);
-      }
-      else if (value instanceof Float)
-      {
-         writeFloat((Float)value);
-      }
-      else if (value instanceof Double)
-      {
-         writeDouble((Double)value);
-      }
-      else if (value instanceof byte[])
-      {
-         writeBytes((byte[])value);
-      }
-      else if (value instanceof Character)
-      {
-         writeChar((Character)value);
-      }
-      else if (value == null)
-      {
-         writeString(null);
-      }
-      else
-      {
-         throw new MessageFormatException("Invalid object type: " + value.getClass());
-      }
-   }
-
-   public void reset() throws JMSException
-   {
-      if (!readOnly)
-      {
-         readOnly = true;
-      }
-      getBuffer().resetReaderIndex();
-   }
-
-   // HornetQRAMessage overrides ----------------------------------------
-
-   @Override
-   public void clearBody() throws JMSException
-   {
-      super.clearBody();
-
-      getBuffer().clear();
-   }
-
-   @Override
-   public void doBeforeSend() throws Exception
-   {
-      reset();
-   }
-
-   private ActiveMQBuffer getBuffer()
-   {
-      return message.getBodyBuffer();
-   }
-
-   @SuppressWarnings("rawtypes")
-   @Override
-   public boolean isBodyAssignableTo(Class c)
-   {
-      return false;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryQueue.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryQueue.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryQueue.java
deleted file mode 100644
index 6d06ac5..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryQueue.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.TemporaryQueue;
-
-
-/**
- * HornetQ implementation of a JMS TemporaryQueue.
- * <br>
- * This class can be instantiated directly.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 3569 $</tt>
- *
- */
-public class HornetQTemporaryQueue extends HornetQQueue implements TemporaryQueue
-{
-   // Constants -----------------------------------------------------
-
-   private static final long serialVersionUID = -4624930377557954624L;
-
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-
-   // TemporaryQueue implementation ------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   /**
-    * @param address
-    * @param name
-    * @param session
-    */
-   public HornetQTemporaryQueue(String address, String name, HornetQSession session)
-   {
-      super(address, name, true, session);
-   }
-
-   @Override
-   public String toString()
-   {
-      return "HornetQTemporaryQueue[" + name + "]";
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryTopic.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryTopic.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryTopic.java
deleted file mode 100644
index 103619e..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTemporaryTopic.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.TemporaryTopic;
-
-/**
- * A HornetQTemporaryTopic
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class HornetQTemporaryTopic extends HornetQTopic implements TemporaryTopic
-{
-
-   // Constants -----------------------------------------------------
-
-   private static final long serialVersionUID = 845450764835635266L;
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   protected HornetQTemporaryTopic(final String address, final String name,
-                                final HornetQSession session)
-   {
-      super(address, name, true, session);
-   }
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTextMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTextMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTextMessage.java
deleted file mode 100644
index 65bdb82..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTextMessage.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSException;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-
-import static org.apache.activemq.reader.TextMessageUtil.readBodyText;
-import static org.apache.activemq.reader.TextMessageUtil.writeBodyText;
-
-
-/**
- * HornetQ implementation of a JMS TextMessage.
- * <br>
- * This class was ported from SpyTextMessage in JBossMQ.
- *
- * @author Norbert Lataille (Norbert.Lataille@m4x.org)
- * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- * @version $Revision: 3412 $
- */
-public class HornetQTextMessage extends HornetQMessage implements TextMessage
-{
-   // Constants -----------------------------------------------------
-
-   public static final byte TYPE = Message.TEXT_TYPE;
-
-   // Attributes ----------------------------------------------------
-
-   // We cache it locally - it's more performant to cache as a SimpleString, the AbstractChannelBuffer write
-   // methods are more efficient for a SimpleString
-   private SimpleString text;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQTextMessage(final ClientSession session)
-   {
-      super(HornetQTextMessage.TYPE, session);
-   }
-
-   public HornetQTextMessage(final ClientMessage message, final ClientSession session)
-   {
-      super(message, session);
-   }
-
-   /**
-    * A copy constructor for non-HornetQ JMS TextMessages.
-    */
-   public HornetQTextMessage(final TextMessage foreign, final ClientSession session) throws JMSException
-   {
-      super(foreign, HornetQTextMessage.TYPE, session);
-
-      setText(foreign.getText());
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public byte getType()
-   {
-      return HornetQTextMessage.TYPE;
-   }
-
-   // TextMessage implementation ------------------------------------
-
-   public void setText(final String text) throws JMSException
-   {
-      checkWrite();
-
-      if (text != null)
-      {
-         this.text = new SimpleString(text);
-      }
-      else
-      {
-         this.text = null;
-      }
-
-      writeBodyText(message, this.text);
-   }
-
-   public String getText()
-   {
-      if (text != null)
-      {
-         return text.toString();
-      }
-      else
-      {
-         return null;
-      }
-   }
-
-   @Override
-   public void clearBody() throws JMSException
-   {
-      super.clearBody();
-
-      text = null;
-   }
-
-   // HornetQRAMessage override -----------------------------------------
-
-   @Override
-   public void doBeforeReceive() throws ActiveMQException
-   {
-      super.doBeforeReceive();
-
-      text = readBodyText(message);
-   }
-
-   @Override
-   protected <T> T getBodyInternal(Class<T> c)
-   {
-      return (T) getText();
-   }
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class c)
-   {
-      if (text == null)
-         return true;
-      return c.isAssignableFrom(java.lang.String.class);
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopic.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopic.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopic.java
deleted file mode 100644
index 94408c8..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopic.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.Topic;
-
-import org.apache.activemq.api.core.SimpleString;
-
-/**
- * HornetQ implementation of a JMS Topic.
- * <br>
- * This class can be instantiated directly.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 8737 $</tt>
- *
- */
-public class HornetQTopic extends HornetQDestination implements Topic
-{
-   // Constants -----------------------------------------------------
-
-   private static final long serialVersionUID = 7873614001276404156L;
-   // Static --------------------------------------------------------
-
-   public static SimpleString createAddressFromName(final String name)
-   {
-      return new SimpleString(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX + name);
-   }
-
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQTopic(final String name)
-   {
-      super(HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX + name, name, false, false, null);
-   }
-
-
-   /**
-    * @param address
-    * @param name
-    * @param temporary
-    * @param session
-    */
-   protected HornetQTopic(String address, String name, boolean temporary, HornetQSession session)
-   {
-      super(address, name, temporary, false, session);
-   }
-
-
-   // Topic implementation ------------------------------------------
-
-   public String getTopicName()
-   {
-      return name;
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public String toString()
-   {
-      return "HornetQTopic[" + name + "]";
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopicConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopicConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopicConnectionFactory.java
deleted file mode 100644
index 13e187f..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQTopicConnectionFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.TopicConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-
-/**
- * A class that represents a TopicConnectionFactory.
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQTopicConnectionFactory extends HornetQConnectionFactory implements TopicConnectionFactory
-{
-   private static final long serialVersionUID = 7317051989866548455L;
-
-   /**
-    *
-    */
-   public HornetQTopicConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQTopicConnectionFactory(ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQTopicConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQTopicConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-   public int getFactoryType()
-   {
-      return JMSFactoryType.TOPIC_CF.intValue();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnection.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnection.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnection.java
deleted file mode 100644
index 29b6ec0..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnection.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.jms.XAQueueConnection;
-import javax.jms.XAQueueSession;
-import javax.jms.XASession;
-import javax.jms.XATopicConnection;
-import javax.jms.XATopicSession;
-
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-
-/**
- * HornetQ implementation of a JMS XAConnection.
- * <p>
- * The flat implementation of {@link XATopicConnection} and {@link XAQueueConnection} is per design,
- * following common practices of JMS 1.1.
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public final class HornetQXAConnection extends HornetQConnection implements XATopicConnection, XAQueueConnection
-{
-
-   public HornetQXAConnection(final String username, final String password, final int connectionType,
-                              final String clientID, final int dupsOKBatchSize, final int transactionBatchSize,
-                              final ClientSessionFactory sessionFactory)
-   {
-      super(username, password, connectionType, clientID, dupsOKBatchSize, transactionBatchSize, sessionFactory);
-   }
-
-   @Override
-   public XASession createXASession() throws JMSException
-   {
-      checkClosed();
-      return (XASession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, HornetQSession.TYPE_GENERIC_SESSION);
-   }
-
-   @Override
-   public XAQueueSession createXAQueueSession() throws JMSException
-   {
-      checkClosed();
-      return (XAQueueSession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, HornetQSession.TYPE_QUEUE_SESSION);
-
-   }
-
-   @Override
-   public XATopicSession createXATopicSession() throws JMSException
-   {
-      checkClosed();
-      return (XATopicSession)createSessionInternal(isXA(), true, Session.SESSION_TRANSACTED, HornetQSession.TYPE_TOPIC_SESSION);
-   }
-
-   @Override
-   protected boolean isXA()
-   {
-      return true;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnectionFactory.java
deleted file mode 100644
index 3eae974..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAConnectionFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.XAQueueConnectionFactory;
-import javax.jms.XATopicConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-
-/**
- * A class that represents a XAConnectionFactory.
- * <p>
- * We consider the XAConnectionFactory to be the most complete possible option. It can be casted to any other connection factory since it is fully functional
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQXAConnectionFactory extends HornetQConnectionFactory implements XATopicConnectionFactory,
-   XAQueueConnectionFactory
-{
-   private static final long serialVersionUID = 743611571839154115L;
-
-   /**
-    *
-    */
-   public HornetQXAConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQXAConnectionFactory(ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQXAConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQXAConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-   @Override
-   public int getFactoryType()
-   {
-      return JMSFactoryType.XA_CF.intValue();
-   }
-
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAJMSContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAJMSContext.java
deleted file mode 100644
index 65ab212..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAJMSContext.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.XAJMSContext;
-
-public class HornetQXAJMSContext extends HornetQJMSContext implements XAJMSContext
-{
-   public HornetQXAJMSContext(HornetQConnectionForContext connection, ThreadAwareContext threadAwareContext)
-   {
-      super(connection, threadAwareContext);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAQueueConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAQueueConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAQueueConnectionFactory.java
deleted file mode 100644
index 1d8d622..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXAQueueConnectionFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.XAQueueConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-
-/**
- * A class that represents a XAQueueConnectionFactory.
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- *
- */
-public class HornetQXAQueueConnectionFactory extends HornetQConnectionFactory implements XAQueueConnectionFactory
-{
-   private static final long serialVersionUID = 8612457847251087454L;
-
-   /**
-    *
-    */
-   public HornetQXAQueueConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQXAQueueConnectionFactory(ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQXAQueueConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQXAQueueConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-   public int getFactoryType()
-   {
-      return JMSFactoryType.QUEUE_XA_CF.intValue();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXASession.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXASession.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXASession.java
deleted file mode 100644
index 390fff0..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXASession.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.XAQueueSession;
-import javax.jms.XATopicSession;
-
-import org.apache.activemq.api.core.client.ClientSession;
-
-/**
- * A HornetQXASession
- *
- * @author clebertsuconic
- *
- *
- */
-public class HornetQXASession extends HornetQSession implements XAQueueSession, XATopicSession
-{
-
-   /**
-    * @param connection
-    * @param transacted
-    * @param xa
-    * @param ackMode
-    * @param session
-    * @param sessionType
-    */
-   protected HornetQXASession(HornetQConnection connection,
-                              boolean transacted,
-                              boolean xa,
-                              int ackMode,
-                              ClientSession session,
-                              int sessionType)
-   {
-      super(connection, transacted, xa, ackMode, session, sessionType);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXATopicConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXATopicConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXATopicConnectionFactory.java
deleted file mode 100644
index 462d240..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQXATopicConnectionFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.XATopicConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-
-/**
- * A class that represents a XATopicConnectionFactory.
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQXATopicConnectionFactory extends HornetQConnectionFactory implements XATopicConnectionFactory
-{
-   private static final long serialVersionUID = -7018290426884419693L;
-
-   /**
-    *
-    */
-   public HornetQXATopicConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQXATopicConnectionFactory(final ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQXATopicConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQXATopicConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-   public int getFactoryType()
-   {
-      return JMSFactoryType.TOPIC_XA_CF.intValue();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSExceptionHelper.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSExceptionHelper.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSExceptionHelper.java
index c61f48a..b957801 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSExceptionHelper.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/JMSExceptionHelper.java
@@ -29,7 +29,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 public final class JMSExceptionHelper
 {
 
-   public static JMSException convertFromHornetQException(final ActiveMQException me)
+   public static JMSException convertFromActiveMQException(final ActiveMQException me)
    {
       JMSException je;
       switch (me.getType())


[37/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientBundle.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientBundle.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientBundle.java
deleted file mode 100644
index e5a6c0b..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientBundle.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-
-import javax.jms.IllegalStateException;
-import javax.jms.IllegalStateRuntimeException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-
-import org.apache.activemq.api.core.ActiveMQIllegalStateException;
-import org.apache.activemq.api.core.ActiveMQInvalidFilterExpressionException;
-import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
-import org.apache.activemq.api.core.SimpleString;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 12
- *
- * each message id must be 6 digits long starting with 10, the 3rd digit should be 9
- *
- * so 129000 to 129999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQJMSClientBundle
-{
-   HornetQJMSClientBundle BUNDLE = Messages.getBundle(HornetQJMSClientBundle.class);
-
-   @Message(id = 129000, value =  "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
-
-   @Message(id = 129001, value =  "Invalid Subscription Name. It is required to set the subscription name", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIllegalStateException invalidSubscriptionName();
-
-   @Message(id = 129002, value =  "Destination {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQNonExistentQueueException destinationDoesNotExist(SimpleString destination);
-
-   @Message(id = 129003, value =  "name cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nameCannotBeNull();
-
-   @Message(id = 129004, value =  "name cannot be empty", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nameCannotBeEmpty();
-
-   @Message(id = 129005, value =  "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateRuntimeException callingMethodFromListenerRuntime();
-
-   @Message(id = 129006, value =  "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException callingMethodFromListener();
-
-   @Message(id = 129007, value =  "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateRuntimeException callingMethodFromCompletionListenerRuntime();
-
-   @Message(id = 129008, value =  "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException callingMethodFromCompletionListener();
-
-   @Message(id = 129009, value = "Null {0} is not allowed", format = Message.Format.MESSAGE_FORMAT)
-   IllegalArgumentException nullArgumentNotAllowed(String type);
-
-   @Message(id = 129010, value = "Topic (Destination) cannot be null", format = Message.Format.MESSAGE_FORMAT)
-   InvalidDestinationException nullTopic();
-
-   @Message(id = 129011, value = "LargeMessage streaming is only possible on ByteMessage or StreamMessage",
-            format = Message.Format.MESSAGE_FORMAT)
-   IllegalStateException onlyValidForByteOrStreamMessages();
-
-   @Message(id = 129012, value = "The property name ''{0}'' is not a valid java identifier.",
-            format = Message.Format.MESSAGE_FORMAT)
-   JMSRuntimeException invalidJavaIdentifier(String propertyName);
-
-   @Message(id = 129013, value = "Message is read-only", format = Message.Format.MESSAGE_FORMAT)
-   MessageNotWriteableException messageNotWritable();
-
-   @Message(id = 129014, value = "Message is write-only", format = Message.Format.MESSAGE_FORMAT)
-   MessageNotReadableException messageNotReadable();
-
-   @Message(id = 129015, value = "Illegal deliveryMode value: {0}", format = Message.Format.MESSAGE_FORMAT)
-   JMSException illegalDeliveryMode(int deliveryMode);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientLogger.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientLogger.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientLogger.java
deleted file mode 100644
index 180e8f1..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSClientLogger.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/15/12
- *
- * Logger Code 12
- *
- * each message id must be 6 digits long starting with 12, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 121000 to 121999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQJMSClientLogger extends BasicLogger
-{
-   /**
-    * The default logger.
-    */
-   HornetQJMSClientLogger LOGGER = Logger.getMessageLogger(HornetQJMSClientLogger.class, HornetQJMSClientLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122000, value = "I''m closing a JMS connection you left open. Please make sure you close all JMS connections explicitly before letting them go out of scope! see stacktrace to find out where it was created" , format = Message.Format.MESSAGE_FORMAT)
-   void connectionLeftOpen(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 122001, value = "Unhandled exception thrown from onMessage" , format = Message.Format.MESSAGE_FORMAT)
-   void onMessageError(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124000, value = "Failed to call JMS exception listener" , format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingExcListener(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124002, value = "Queue Browser failed to create message" , format = Message.Format.MESSAGE_FORMAT)
-   void errorCreatingMessage(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124003, value = "Message Listener failed to prepare message for receipt" , format = Message.Format.MESSAGE_FORMAT)
-   void errorPreparingMessageForReceipt(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124004, value = "Message Listener failed to process message" , format = Message.Format.MESSAGE_FORMAT)
-   void errorProcessingMessage(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124005, value = "Message Listener failed to recover session" , format = Message.Format.MESSAGE_FORMAT)
-   void errorRecoveringSession(@Cause Throwable e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 124006, value = "Failed to call Failover listener" , format = Message.Format.MESSAGE_FORMAT)
-   void errorCallingFailoverListener(@Cause Exception e);
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConnectionFactory.java
deleted file mode 100644
index dc76692..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConnectionFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.QueueConnectionFactory;
-import javax.jms.TopicConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-
-
-/**
- * A class that represents a ConnectionFactory.
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQJMSConnectionFactory extends HornetQConnectionFactory implements TopicConnectionFactory, QueueConnectionFactory
-{
-
-   private static final long serialVersionUID = -2810634789345348326L;
-
-   /**
-    *
-    */
-   public HornetQJMSConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQJMSConnectionFactory(ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQJMSConnectionFactory(boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQJMSConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConsumer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConsumer.java
deleted file mode 100644
index b9ba41f..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSConsumer.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSConsumer;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-
-/**
- * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc.
- */
-public class HornetQJMSConsumer implements JMSConsumer
-{
-
-   private final HornetQJMSContext context;
-   private final MessageConsumer consumer;
-
-   HornetQJMSConsumer(HornetQJMSContext context, MessageConsumer consumer)
-   {
-      this.context = context;
-      this.consumer = consumer;
-   }
-
-   @Override
-   public String getMessageSelector()
-   {
-      try
-      {
-         return consumer.getMessageSelector();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public MessageListener getMessageListener() throws JMSRuntimeException
-   {
-      try
-      {
-         return consumer.getMessageListener();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void setMessageListener(MessageListener listener) throws JMSRuntimeException
-   {
-      try
-      {
-         consumer.setMessageListener(new MessageListenerWrapper(listener));
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Message receive()
-   {
-      try
-      {
-         return context.setLastMessage(this, consumer.receive());
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Message receive(long timeout)
-   {
-      try
-      {
-         return context.setLastMessage(this, consumer.receive(timeout));
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Message receiveNoWait()
-   {
-      try
-      {
-         return context.setLastMessage(this, consumer.receiveNoWait());
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void close()
-   {
-      try
-      {
-         consumer.close();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public <T> T receiveBody(Class<T> c)
-   {
-      try
-      {
-         Message message = consumer.receive();
-         context.setLastMessage(HornetQJMSConsumer.this, message);
-         return message == null ? null : message.getBody(c);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public <T> T receiveBody(Class<T> c, long timeout)
-   {
-      try
-      {
-         Message message = consumer.receive(timeout);
-         context.setLastMessage(HornetQJMSConsumer.this, message);
-         return message == null ? null : message.getBody(c);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public <T> T receiveBodyNoWait(Class<T> c)
-   {
-      try
-      {
-         Message message = consumer.receiveNoWait();
-         context.setLastMessage(HornetQJMSConsumer.this, message);
-         return message == null ? null : message.getBody(c);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   final class MessageListenerWrapper implements MessageListener
-   {
-      private final MessageListener wrapped;
-
-      public MessageListenerWrapper(MessageListener wrapped)
-      {
-         this.wrapped = wrapped;
-      }
-
-      @Override
-      public void onMessage(Message message)
-      {
-         context.setLastMessage(HornetQJMSConsumer.this, message);
-
-         context.getThreadAwareContext().setCurrentThread(false);
-         try
-         {
-            wrapped.onMessage(message);
-         }
-         finally
-         {
-            context.getThreadAwareContext().clearCurrentThread(false);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSContext.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSContext.java
deleted file mode 100644
index d314336..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSContext.java
+++ /dev/null
@@ -1,769 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.BytesMessage;
-import javax.jms.ConnectionMetaData;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateRuntimeException;
-import javax.jms.JMSConsumer;
-import javax.jms.JMSContext;
-import javax.jms.JMSException;
-import javax.jms.JMSProducer;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.XAConnection;
-import javax.jms.XASession;
-import javax.transaction.xa.XAResource;
-import java.io.Serializable;
-
-/**
- * HornetQ implementation of a JMSContext.
- *
- * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc
- */
-public class HornetQJMSContext implements JMSContext
-{
-   private static final boolean DEFAULT_AUTO_START = true;
-   private final int sessionMode;
-
-   private final ThreadAwareContext threadAwareContext;
-
-   /**
-    * Client ACK needs to hold last acked messages, so context.ack calls will be respected.
-    */
-   private volatile Message lastMessagesWaitingAck;
-
-   private final HornetQConnectionForContext connection;
-   private Session session;
-   private boolean autoStart = HornetQJMSContext.DEFAULT_AUTO_START;
-   private MessageProducer innerProducer;
-   private boolean xa;
-   private boolean closed;
-
-   HornetQJMSContext(final HornetQConnectionForContext connection, final int ackMode, final boolean xa, ThreadAwareContext threadAwareContext)
-   {
-      this.connection = connection;
-      this.sessionMode = ackMode;
-      this.xa = xa;
-      this.threadAwareContext = threadAwareContext;
-   }
-
-   public HornetQJMSContext(HornetQConnectionForContext connection, int ackMode, ThreadAwareContext threadAwareContext)
-   {
-      this(connection, ackMode, false, threadAwareContext);
-   }
-
-   public HornetQJMSContext(HornetQConnectionForContext connection, ThreadAwareContext threadAwareContext)
-   {
-      this(connection, SESSION_TRANSACTED, true, threadAwareContext);
-   }
-
-   // XAJMSContext implementation -------------------------------------
-
-   public JMSContext getContext()
-   {
-      return this;
-   }
-
-   public Session getSession()
-   {
-      return session;
-   }
-
-   public XAResource getXAResource()
-   {
-      checkSession();
-      return ((XASession) session).getXAResource();
-   }
-
-   // JMSContext implementation -------------------------------------
-
-   @Override
-   public JMSContext createContext(int sessionMode)
-   {
-      return connection.createContext(sessionMode);
-   }
-
-   @Override
-   public JMSProducer createProducer()
-   {
-      checkSession();
-      try
-      {
-         return new HornetQJMSProducer(this, getInnerProducer());
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   private synchronized MessageProducer getInnerProducer() throws JMSException
-   {
-      if (innerProducer == null)
-      {
-         innerProducer = session.createProducer(null);
-      }
-
-      return innerProducer;
-   }
-
-   /**
-    *
-    */
-   private void checkSession()
-   {
-      if (session == null)
-      {
-         synchronized (this)
-         {
-            if (closed)
-               throw new IllegalStateRuntimeException("Context is closed");
-            if (session == null)
-            {
-               try
-               {
-                  if (xa)
-                  {
-                     session = ((XAConnection) connection).createXASession();
-                  }
-                  else
-                  {
-                     session = connection.createSession(sessionMode);
-                  }
-               }
-               catch (JMSException e)
-               {
-                  throw JmsExceptionUtils.convertToRuntimeException(e);
-               }
-            }
-         }
-      }
-   }
-
-   @Override
-   public String getClientID()
-   {
-      try
-      {
-         return connection.getClientID();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void setClientID(String clientID)
-   {
-      try
-      {
-         connection.setClientID(clientID);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public ConnectionMetaData getMetaData()
-   {
-      try
-      {
-         return connection.getMetaData();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public ExceptionListener getExceptionListener()
-   {
-      try
-      {
-         return connection.getExceptionListener();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void setExceptionListener(ExceptionListener listener)
-   {
-      try
-      {
-         connection.setExceptionListener(listener);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void start()
-   {
-      try
-      {
-         connection.start();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void stop()
-   {
-      threadAwareContext.assertNotMessageListenerThreadRuntime();
-      try
-      {
-         connection.stop();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void setAutoStart(boolean autoStart)
-   {
-      this.autoStart = autoStart;
-   }
-
-   @Override
-   public boolean getAutoStart()
-   {
-      return autoStart;
-   }
-
-   @Override
-   public void close()
-   {
-      threadAwareContext.assertNotCompletionListenerThreadRuntime();
-      threadAwareContext.assertNotMessageListenerThreadRuntime();
-      try
-      {
-         synchronized (this)
-         {
-            if (session != null)
-               session.close();
-            connection.closeFromContext();
-            closed = true;
-         }
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public BytesMessage createBytesMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createBytesMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public MapMessage createMapMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createMapMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Message createMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public ObjectMessage createObjectMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createObjectMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public ObjectMessage createObjectMessage(Serializable object)
-   {
-      checkSession();
-      try
-      {
-         return session.createObjectMessage(object);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public StreamMessage createStreamMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createStreamMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public TextMessage createTextMessage()
-   {
-      checkSession();
-      try
-      {
-         return session.createTextMessage();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public TextMessage createTextMessage(String text)
-   {
-      checkSession();
-      try
-      {
-         return session.createTextMessage(text);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public boolean getTransacted()
-   {
-      checkSession();
-      try
-      {
-         return session.getTransacted();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public int getSessionMode()
-   {
-      return sessionMode;
-   }
-
-   @Override
-   public void commit()
-   {
-      threadAwareContext.assertNotCompletionListenerThreadRuntime();
-      checkSession();
-      try
-      {
-         session.commit();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void rollback()
-   {
-      threadAwareContext.assertNotCompletionListenerThreadRuntime();
-      checkSession();
-      try
-      {
-         session.rollback();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void recover()
-   {
-      checkSession();
-      try
-      {
-         session.recover();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createConsumer(Destination destination)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createConsumer(destination));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createConsumer(Destination destination, String messageSelector)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createConsumer(destination, messageSelector));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createConsumer(destination, messageSelector, noLocal));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Queue createQueue(String queueName)
-   {
-      checkSession();
-      try
-      {
-         return session.createQueue(queueName);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public Topic createTopic(String topicName)
-   {
-      checkSession();
-      try
-      {
-         return session.createTopic(topicName);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createDurableConsumer(Topic topic, String name)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createDurableConsumer(topic, name));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createDurableConsumer(topic, name, messageSelector, noLocal));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createSharedDurableConsumer(Topic topic, String name)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createSharedDurableConsumer(topic, name));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createSharedDurableConsumer(topic, name, messageSelector));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector)
-   {
-      checkSession();
-      try
-      {
-         HornetQJMSConsumer consumer = new HornetQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector));
-         checkAutoStart();
-         return consumer;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public QueueBrowser createBrowser(Queue queue)
-   {
-      checkSession();
-      try
-      {
-         QueueBrowser browser = session.createBrowser(queue);
-         checkAutoStart();
-         return browser;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public QueueBrowser createBrowser(Queue queue, String messageSelector)
-   {
-      checkSession();
-      try
-      {
-         QueueBrowser browser = session.createBrowser(queue, messageSelector);
-         checkAutoStart();
-         return browser;
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public TemporaryQueue createTemporaryQueue()
-   {
-      checkSession();
-      try
-      {
-         return session.createTemporaryQueue();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public TemporaryTopic createTemporaryTopic()
-   {
-      checkSession();
-      try
-      {
-         return session.createTemporaryTopic();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void unsubscribe(String name)
-   {
-      checkSession();
-      try
-      {
-         session.unsubscribe(name);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public void acknowledge()
-   {
-      checkSession();
-      if (closed)
-         throw new IllegalStateRuntimeException("Context is closed");
-      try
-      {
-         if (lastMessagesWaitingAck != null)
-         {
-            lastMessagesWaitingAck.acknowledge();
-         }
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   /**
-    * This is to be used on tests only. It's not part of the interface and it's not guaranteed to be kept
-    * on the API contract.
-    *
-    * @return
-    */
-   public Session getUsedSession()
-   {
-      return this.session;
-   }
-
-   private synchronized void checkAutoStart() throws JMSException
-   {
-      if (closed)
-         throw new IllegalStateRuntimeException("Context is closed");
-      if (autoStart)
-      {
-         connection.start();
-      }
-   }
-
-   /**
-    * this is to ensure Context.acknowledge would work on ClientACK
-    */
-   Message setLastMessage(final JMSConsumer consumer, final Message lastMessageReceived)
-   {
-      if (sessionMode == CLIENT_ACKNOWLEDGE)
-      {
-         lastMessagesWaitingAck = lastMessageReceived;
-      }
-      return lastMessageReceived;
-   }
-
-   public ThreadAwareContext getThreadAwareContext()
-   {
-      return threadAwareContext;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSProducer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSProducer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSProducer.java
deleted file mode 100644
index 86a5f7c..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQJMSProducer.java
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.BytesMessage;
-import javax.jms.CompletionListener;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.JMSProducer;
-import javax.jms.JMSRuntimeException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageFormatRuntimeException;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.TextMessage;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.utils.TypedProperties;
-
-/**
- * NOTE: this class forwards {@link #setDisableMessageID(boolean)} and
- * {@link #setDisableMessageTimestamp(boolean)} calls their equivalent at the
- * {@link MessageProducer}. IF the user is using the producer in async mode, this may lead to races.
- * We allow/tolerate this because these are just optional optimizations.
- *
- * @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2013 Red Hat inc.
- */
-public final class HornetQJMSProducer implements JMSProducer
-{
-   private final HornetQJMSContext context;
-   private final MessageProducer producer;
-   private final TypedProperties properties = new TypedProperties();
-
-   //we convert Strings to SimpleStrings so if getProperty is called the wrong object is returned, this list let's us return the
-   //correct type
-   private final List<SimpleString> stringPropertyNames = new ArrayList<>();
-
-   private volatile CompletionListener completionListener;
-
-   private Destination jmsHeaderReplyTo;
-   private String jmsHeaderCorrelationID;
-   private byte[] jmsHeaderCorrelationIDAsBytes;
-   private String jmsHeaderType;
-
-   HornetQJMSProducer(HornetQJMSContext context, MessageProducer producer)
-   {
-      this.context = context;
-      this.producer = producer;
-   }
-
-   @Override
-   public JMSProducer send(Destination destination, Message message)
-   {
-      if (message == null)
-      {
-         throw new MessageFormatRuntimeException("null message");
-      }
-
-      try
-      {
-         if (jmsHeaderCorrelationID != null)
-         {
-            message.setJMSCorrelationID(jmsHeaderCorrelationID);
-         }
-         if (jmsHeaderCorrelationIDAsBytes != null && jmsHeaderCorrelationIDAsBytes.length > 0)
-         {
-            message.setJMSCorrelationIDAsBytes(jmsHeaderCorrelationIDAsBytes);
-         }
-         if (jmsHeaderReplyTo != null)
-         {
-            message.setJMSReplyTo(jmsHeaderReplyTo);
-         }
-         if (jmsHeaderType != null)
-         {
-            message.setJMSType(jmsHeaderType);
-         }
-         // XXX HORNETQ-1209 "JMS 2.0" can this be a foreign msg?
-         // if so, then "SimpleString" properties will trigger an error.
-         setProperties(message);
-         if (completionListener != null)
-         {
-            CompletionListener wrapped = new CompletionListenerWrapper(completionListener);
-            producer.send(destination, message, wrapped);
-         }
-         else
-         {
-            producer.send(destination, message);
-         }
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-      return this;
-   }
-
-   /**
-    * Sets all properties we carry onto the message.
-    *
-    * @param message
-    * @throws JMSException
-    */
-   private void setProperties(Message message) throws JMSException
-   {
-      for (SimpleString name : properties.getPropertyNames())
-      {
-         message.setObjectProperty(name.toString(), properties.getProperty(name));
-      }
-   }
-
-   @Override
-   public JMSProducer send(Destination destination, String body)
-   {
-      TextMessage message = context.createTextMessage(body);
-      send(destination, message);
-      return this;
-   }
-
-   @Override
-   public JMSProducer send(Destination destination, Map<String, Object> body)
-   {
-      MapMessage message = context.createMapMessage();
-      if (body != null)
-      {
-         try
-         {
-            for (Entry<String, Object> entry : body.entrySet())
-            {
-               final String name = entry.getKey();
-               final Object v = entry.getValue();
-               if (v instanceof String)
-               {
-                  message.setString(name, (String) v);
-               }
-               else if (v instanceof Long)
-               {
-                  message.setLong(name, (Long) v);
-               }
-               else if (v instanceof Double)
-               {
-                  message.setDouble(name, (Double) v);
-               }
-               else if (v instanceof Integer)
-               {
-                  message.setInt(name, (Integer) v);
-               }
-               else if (v instanceof Character)
-               {
-                  message.setChar(name, (Character) v);
-               }
-               else if (v instanceof Short)
-               {
-                  message.setShort(name, (Short) v);
-               }
-               else if (v instanceof Boolean)
-               {
-                  message.setBoolean(name, (Boolean) v);
-               }
-               else if (v instanceof Float)
-               {
-                  message.setFloat(name, (Float) v);
-               }
-               else if (v instanceof Byte)
-               {
-                  message.setByte(name, (Byte) v);
-               }
-               else if (v instanceof byte[])
-               {
-                  byte[] array = (byte[]) v;
-                  message.setBytes(name, array, 0, array.length);
-               }
-               else
-               {
-                  message.setObject(name, v);
-               }
-            }
-         }
-         catch (JMSException e)
-         {
-            throw new MessageFormatRuntimeException(e.getMessage());
-         }
-      }
-      send(destination, message);
-      return this;
-   }
-
-   @Override
-   public JMSProducer send(Destination destination, byte[] body)
-   {
-      BytesMessage message = context.createBytesMessage();
-      if (body != null)
-      {
-         try
-         {
-            message.writeBytes(body);
-         }
-         catch (JMSException e)
-         {
-            throw new MessageFormatRuntimeException(e.getMessage());
-         }
-      }
-      send(destination, message);
-      return this;
-   }
-
-   @Override
-   public JMSProducer send(Destination destination, Serializable body)
-   {
-      ObjectMessage message = context.createObjectMessage(body);
-      send(destination, message);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setDisableMessageID(boolean value)
-   {
-      try
-      {
-         producer.setDisableMessageID(value);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-      return this;
-   }
-
-   @Override
-   public boolean getDisableMessageID()
-   {
-      try
-      {
-         return producer.getDisableMessageID();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSProducer setDisableMessageTimestamp(boolean value)
-   {
-      try
-      {
-         producer.setDisableMessageTimestamp(value);
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-      return this;
-   }
-
-   @Override
-   public boolean getDisableMessageTimestamp()
-   {
-      try
-      {
-         return producer.getDisableMessageTimestamp();
-      }
-      catch (JMSException e)
-      {
-         throw JmsExceptionUtils.convertToRuntimeException(e);
-      }
-   }
-
-   @Override
-   public JMSProducer setDeliveryMode(int deliveryMode)
-   {
-      try
-      {
-         producer.setDeliveryMode(deliveryMode);
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      return this;
-   }
-
-   @Override
-   public int getDeliveryMode()
-   {
-      try
-      {
-         return producer.getDeliveryMode();
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   @Override
-   public JMSProducer setPriority(int priority)
-   {
-      try
-      {
-         producer.setPriority(priority);
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-      return this;
-   }
-
-   @Override
-   public int getPriority()
-   {
-      try
-      {
-         return producer.getPriority();
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   @Override
-   public JMSProducer setTimeToLive(long timeToLive)
-   {
-      try
-      {
-         producer.setTimeToLive(timeToLive);
-         return this;
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   @Override
-   public long getTimeToLive()
-   {
-      long timeToLive = 0;
-      try
-      {
-         timeToLive = producer.getTimeToLive();
-         return timeToLive;
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   @Override
-   public JMSProducer setDeliveryDelay(long deliveryDelay)
-   {
-      try
-      {
-         producer.setDeliveryDelay(deliveryDelay);
-         return this;
-      }
-      catch (JMSException e)
-      {
-         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
-         e2.initCause(e);
-         throw e2;
-      }
-   }
-
-   @Override
-   public long getDeliveryDelay()
-   {
-      long deliveryDelay = 0;
-      try
-      {
-         deliveryDelay = producer.getDeliveryDelay();
-      }
-      catch (Exception ignored)
-      {
-      }
-      return deliveryDelay;
-   }
-
-   @Override
-   public JMSProducer setAsync(CompletionListener completionListener)
-   {
-      this.completionListener = completionListener;
-      return this;
-   }
-
-   @Override
-   public CompletionListener getAsync()
-   {
-      return completionListener;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, boolean value)
-   {
-      checkName(name);
-      properties.putBooleanProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, byte value)
-   {
-      checkName(name);
-      properties.putByteProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, short value)
-   {
-      checkName(name);
-      properties.putShortProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, int value)
-   {
-      checkName(name);
-      properties.putIntProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, long value)
-   {
-      checkName(name);
-      properties.putLongProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, float value)
-   {
-      checkName(name);
-      properties.putFloatProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, double value)
-   {
-      checkName(name);
-      properties.putDoubleProperty(new SimpleString(name), value);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, String value)
-   {
-      checkName(name);
-      SimpleString key = new SimpleString(name);
-      properties.putSimpleStringProperty(key, new SimpleString(value));
-      stringPropertyNames.add(key);
-      return this;
-   }
-
-   @Override
-   public JMSProducer setProperty(String name, Object value)
-   {
-      checkName(name);
-      try
-      {
-         TypedProperties.setObjectProperty(new SimpleString(name), value, properties);
-      }
-      catch (ActiveMQPropertyConversionException hqe)
-      {
-         throw new MessageFormatRuntimeException(hqe.getMessage());
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-      return this;
-   }
-
-   @Override
-   public JMSProducer clearProperties()
-   {
-      try
-      {
-         stringPropertyNames.clear();
-         properties.clear();
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-      return this;
-   }
-
-   @Override
-   public boolean propertyExists(String name)
-   {
-      return properties.containsProperty(new SimpleString(name));
-   }
-
-   @Override
-   public boolean getBooleanProperty(String name)
-   {
-      try
-      {
-         return properties.getBooleanProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-   }
-
-   @Override
-   public byte getByteProperty(String name)
-   {
-      try
-      {
-         return properties.getByteProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public short getShortProperty(String name)
-   {
-      try
-      {
-         return properties.getShortProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public int getIntProperty(String name)
-   {
-      try
-      {
-         return properties.getIntProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public long getLongProperty(String name)
-   {
-      try
-      {
-         return properties.getLongProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public float getFloatProperty(String name)
-   {
-      try
-      {
-         return properties.getFloatProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public double getDoubleProperty(String name)
-   {
-      try
-      {
-         return properties.getDoubleProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-   }
-
-   @Override
-   public String getStringProperty(String name)
-   {
-      try
-      {
-         SimpleString prop = properties.getSimpleStringProperty(new SimpleString(name));
-         if (prop == null)
-            return null;
-         return prop.toString();
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-   }
-
-   @Override
-   public Object getObjectProperty(String name)
-   {
-      try
-      {
-         SimpleString key = new SimpleString(name);
-         Object property = properties.getProperty(key);
-         if (stringPropertyNames.contains(key))
-         {
-            property = property.toString();
-         }
-         return property;
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-   }
-
-   @Override
-   public Set<String> getPropertyNames()
-   {
-      try
-      {
-         Set<SimpleString> simplePropNames = properties.getPropertyNames();
-         Set<String> propNames = new HashSet<String>(simplePropNames.size());
-
-         for (SimpleString str : simplePropNames)
-         {
-            propNames.add(str.toString());
-         }
-         return propNames;
-      }
-      catch (ActiveMQPropertyConversionException ce)
-      {
-         throw new MessageFormatRuntimeException(ce.getMessage());
-      }
-      catch (RuntimeException e)
-      {
-         throw new JMSRuntimeException(e.getMessage());
-      }
-   }
-
-   @Override
-   public JMSProducer setJMSCorrelationIDAsBytes(byte[] correlationID)
-   {
-      if (correlationID == null || correlationID.length == 0)
-      {
-         throw new JMSRuntimeException("Please specify a non-zero length byte[]");
-      }
-      jmsHeaderCorrelationIDAsBytes = Arrays.copyOf(correlationID, correlationID.length);
-      return this;
-   }
-
-   @Override
-   public byte[] getJMSCorrelationIDAsBytes()
-   {
-      return Arrays.copyOf(jmsHeaderCorrelationIDAsBytes, jmsHeaderCorrelationIDAsBytes.length);
-   }
-
-   @Override
-   public JMSProducer setJMSCorrelationID(String correlationID)
-   {
-      jmsHeaderCorrelationID = correlationID;
-      return this;
-   }
-
-   @Override
-   public String getJMSCorrelationID()
-   {
-      return jmsHeaderCorrelationID;
-   }
-
-   @Override
-   public JMSProducer setJMSType(String type)
-   {
-      jmsHeaderType = type;
-      return this;
-   }
-
-   @Override
-   public String getJMSType()
-   {
-      return jmsHeaderType;
-   }
-
-   @Override
-   public JMSProducer setJMSReplyTo(Destination replyTo)
-   {
-      jmsHeaderReplyTo = replyTo;
-      return this;
-   }
-
-   @Override
-   public Destination getJMSReplyTo()
-   {
-      return jmsHeaderReplyTo;
-   }
-
-   private void checkName(String name)
-   {
-      if (name == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nameCannotBeNull();
-      }
-      if (name.equals(""))
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nameCannotBeEmpty();
-      }
-   }
-
-   final class CompletionListenerWrapper implements CompletionListener
-   {
-
-      private final CompletionListener wrapped;
-
-      public CompletionListenerWrapper(CompletionListener wrapped)
-      {
-         this.wrapped = wrapped;
-      }
-
-      @Override
-      public void onCompletion(Message message)
-      {
-         context.getThreadAwareContext().setCurrentThread(true);
-         try
-         {
-            wrapped.onCompletion(message);
-         }
-         finally
-         {
-            context.getThreadAwareContext().clearCurrentThread(true);
-         }
-      }
-
-      @Override
-      public void onException(Message message, Exception exception)
-      {
-         context.getThreadAwareContext().setCurrentThread(true);
-         try
-         {
-            wrapped.onException(message, exception);
-         }
-         finally
-         {
-            context.getThreadAwareContext().clearCurrentThread(true);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMapMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMapMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMapMessage.java
deleted file mode 100644
index 635854b..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMapMessage.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.MessageFormatException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.utils.TypedProperties;
-
-
-import static org.apache.activemq.reader.MapMessageUtil.writeBodyMap;
-import static org.apache.activemq.reader.MapMessageUtil.readBodyMap;
-
-/**
- * HornetQ implementation of a JMS MapMessage.
- *
- * @author Norbert Lataille (Norbert.Lataille@m4x.org)
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- * @version $Revision: 3412 $
- */
-public final class HornetQMapMessage extends HornetQMessage implements MapMessage
-{
-   // Constants -----------------------------------------------------
-
-   public static final byte TYPE = Message.MAP_TYPE;
-
-   // Attributes ----------------------------------------------------
-
-   private final TypedProperties map = new TypedProperties();
-
-   private boolean invalid;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   /*
-    * This constructor is used to construct messages prior to sending
-    */
-   protected HornetQMapMessage(final ClientSession session)
-   {
-      super(HornetQMapMessage.TYPE, session);
-
-      invalid = true;
-   }
-
-   /*
-    * This constructor is used during reading
-    */
-   protected HornetQMapMessage(final ClientMessage message, final ClientSession session)
-   {
-      super(message, session);
-
-      invalid = false;
-   }
-
-   public HornetQMapMessage()
-   {
-      invalid = false;
-   }
-
-   /**
-    * Constructor for a foreign MapMessage
-    *
-    * @param foreign
-    * @throws JMSException
-    */
-   public HornetQMapMessage(final MapMessage foreign, final ClientSession session) throws JMSException
-   {
-      super(foreign, HornetQMapMessage.TYPE, session);
-      Enumeration<?> names = foreign.getMapNames();
-      while (names.hasMoreElements())
-      {
-         String name = (String) names.nextElement();
-         Object obj = foreign.getObject(name);
-         setObject(name, obj);
-      }
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public byte getType()
-   {
-      return HornetQMapMessage.TYPE;
-   }
-
-   // MapMessage implementation -------------------------------------
-
-   public void setBoolean(final String name, final boolean value) throws JMSException
-   {
-      checkName(name);
-      map.putBooleanProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setByte(final String name, final byte value) throws JMSException
-   {
-      checkName(name);
-      map.putByteProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setShort(final String name, final short value) throws JMSException
-   {
-      checkName(name);
-      map.putShortProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setChar(final String name, final char value) throws JMSException
-   {
-      checkName(name);
-      map.putCharProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setInt(final String name, final int value) throws JMSException
-   {
-      checkName(name);
-      map.putIntProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setLong(final String name, final long value) throws JMSException
-   {
-      checkName(name);
-      map.putLongProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setFloat(final String name, final float value) throws JMSException
-   {
-      checkName(name);
-      map.putFloatProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setDouble(final String name, final double value) throws JMSException
-   {
-      checkName(name);
-      map.putDoubleProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setString(final String name, final String value) throws JMSException
-   {
-      checkName(name);
-      map.putSimpleStringProperty(new SimpleString(name), value == null ? null : new SimpleString(value));
-      invalid = true;
-   }
-
-   public void setBytes(final String name, final byte[] value) throws JMSException
-   {
-      checkName(name);
-      map.putBytesProperty(new SimpleString(name), value);
-      invalid = true;
-   }
-
-   public void setBytes(final String name, final byte[] value, final int offset, final int length) throws JMSException
-   {
-      checkName(name);
-      if (offset + length > value.length)
-      {
-         throw new JMSException("Invalid offset/length");
-      }
-      byte[] newBytes = new byte[length];
-      System.arraycopy(value, offset, newBytes, 0, length);
-      map.putBytesProperty(new SimpleString(name), newBytes);
-      invalid = true;
-   }
-
-   public void setObject(final String name, final Object value) throws JMSException
-   {
-      checkName(name);
-      try
-      {
-         TypedProperties.setObjectProperty(new SimpleString(name), value, map);
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-      invalid = true;
-   }
-
-   public boolean getBoolean(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getBooleanProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public byte getByte(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getByteProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public short getShort(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getShortProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public char getChar(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getCharProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public int getInt(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getIntProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public long getLong(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getLongProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public float getFloat(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getFloatProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public double getDouble(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getDoubleProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public String getString(final String name) throws JMSException
-   {
-      try
-      {
-         SimpleString str = map.getSimpleStringProperty(new SimpleString(name));
-         if (str == null)
-         {
-            return null;
-         }
-         else
-         {
-            return str.toString();
-         }
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public byte[] getBytes(final String name) throws JMSException
-   {
-      try
-      {
-         return map.getBytesProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public Object getObject(final String name) throws JMSException
-   {
-      Object val = map.getProperty(new SimpleString(name));
-
-      if (val instanceof SimpleString)
-      {
-         val = ((SimpleString) val).toString();
-      }
-
-      return val;
-   }
-
-   public Enumeration getMapNames() throws JMSException
-   {
-      Set<SimpleString> simplePropNames = map.getPropertyNames();
-      Set<String> propNames = new HashSet<String>(simplePropNames.size());
-
-      for (SimpleString str : simplePropNames)
-      {
-         propNames.add(str.toString());
-      }
-
-      return Collections.enumeration(propNames);
-   }
-
-   public boolean itemExists(final String name) throws JMSException
-   {
-      return map.containsProperty(new SimpleString(name));
-   }
-
-
-   // HornetQRAMessage overrides ----------------------------------------
-
-   @Override
-   public void clearBody() throws JMSException
-   {
-      super.clearBody();
-
-      map.clear();
-
-      invalid = true;
-   }
-
-   @Override
-   public void doBeforeSend() throws Exception
-   {
-      if (invalid)
-      {
-         writeBodyMap(message, map);
-         invalid = false;
-      }
-
-      super.doBeforeSend();
-   }
-
-   @Override
-   public void doBeforeReceive() throws ActiveMQException
-   {
-      super.doBeforeReceive();
-
-      readBodyMap(message, map);
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   /**
-    * Check the name
-    *
-    * @param name the name
-    */
-   private void checkName(final String name) throws JMSException
-   {
-      checkWrite();
-
-      if (name == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nameCannotBeNull();
-      }
-      if (name.equals(""))
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nameCannotBeEmpty();
-      }
-   }
-
-   @Override
-   protected boolean hasNoBody()
-   {
-      return map.isEmpty();
-   }
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
-                                     Class c)
-   {
-      if (hasNoBody())
-      {
-         return true;
-      }
-      return c.isAssignableFrom(java.util.Map.class);
-   }
-
-   @SuppressWarnings("unchecked")
-   @Override
-   protected <T> T getBodyInternal(Class<T> c)
-   {
-      return (T) map.getMap();
-   }
-}


[46/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java
index e47ac01..2a04353 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/ServerLocatorImpl.java
@@ -45,21 +45,21 @@ import org.apache.activemq.api.core.Pair;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.api.core.client.HornetQClient;
+import org.apache.activemq.api.core.client.ActiveMQClient;
 import org.apache.activemq.api.core.client.TopologyMember;
 import org.apache.activemq.api.core.client.loadbalance.ConnectionLoadBalancingPolicy;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.core.cluster.DiscoveryEntry;
 import org.apache.activemq.core.cluster.DiscoveryGroup;
 import org.apache.activemq.core.cluster.DiscoveryListener;
-import org.apache.activemq.core.protocol.core.impl.HornetQClientProtocolManagerFactory;
+import org.apache.activemq.core.protocol.core.impl.ActiveMQClientProtocolManagerFactory;
 import org.apache.activemq.core.remoting.FailureListener;
 import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
 import org.apache.activemq.spi.core.remoting.ClientProtocolManagerFactory;
 import org.apache.activemq.spi.core.remoting.Connector;
 import org.apache.activemq.utils.ClassloadingUtil;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 import org.apache.activemq.utils.UUIDGenerator;
 
 /**
@@ -84,7 +84,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
 
 
    // This is the default value
-   private ClientProtocolManagerFactory protocolManagerFactory = HornetQClientProtocolManagerFactory.getInstance();
+   private ClientProtocolManagerFactory protocolManagerFactory = ActiveMQClientProtocolManagerFactory.getInstance();
 
    private final boolean ha;
 
@@ -267,7 +267,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
    {
       if (globalThreadPool == null)
       {
-         ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-threads", true, getThisClassLoader());
+         ThreadFactory factory = new ActiveMQThreadFactory("ActiveMQ-client-global-threads", true, getThisClassLoader());
 
          globalThreadPool = Executors.newCachedThreadPool(factory);
       }
@@ -279,11 +279,11 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
    {
       if (globalScheduledThreadPool == null)
       {
-         ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-scheduled-threads",
+         ThreadFactory factory = new ActiveMQThreadFactory("ActiveMQ-client-global-scheduled-threads",
                                                           true,
                                                           getThisClassLoader());
 
-         globalScheduledThreadPool = Executors.newScheduledThreadPool(HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
+         globalScheduledThreadPool = Executors.newScheduledThreadPool(ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
 
                                                                       factory);
       }
@@ -307,7 +307,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
       {
          this.shutdownPool = true;
 
-         ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-factory-threads-" + System.identityHashCode(this),
+         ThreadFactory factory = new ActiveMQThreadFactory("ActiveMQ-client-factory-threads-" + System.identityHashCode(this),
                                                           true,
                                                           getThisClassLoader());
 
@@ -320,7 +320,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             threadPool = Executors.newFixedThreadPool(threadPoolMaxSize, factory);
          }
 
-         factory = new HornetQThreadFactory("HornetQ-client-factory-pinger-threads-" + System.identityHashCode(this),
+         factory = new ActiveMQThreadFactory("ActiveMQ-client-factory-pinger-threads-" + System.identityHashCode(this),
                                             true,
                                             getThisClassLoader());
 
@@ -386,7 +386,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
          catch (Exception e)
          {
             state = null;
-            throw HornetQClientMessageBundle.BUNDLE.failedToInitialiseSessionFactory(e);
+            throw ActiveMQClientMessageBundle.BUNDLE.failedToInitialiseSessionFactory(e);
          }
       }
    }
@@ -415,65 +415,65 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
 
       this.nodeID = UUIDGenerator.getInstance().generateStringUUID();
 
-      clientFailureCheckPeriod = HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
+      clientFailureCheckPeriod = ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 
-      connectionTTL = HornetQClient.DEFAULT_CONNECTION_TTL;
+      connectionTTL = ActiveMQClient.DEFAULT_CONNECTION_TTL;
 
-      callTimeout = HornetQClient.DEFAULT_CALL_TIMEOUT;
+      callTimeout = ActiveMQClient.DEFAULT_CALL_TIMEOUT;
 
-      callFailoverTimeout = HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT;
+      callFailoverTimeout = ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT;
 
-      minLargeMessageSize = HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
+      minLargeMessageSize = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
 
-      consumerWindowSize = HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE;
+      consumerWindowSize = ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE;
 
-      consumerMaxRate = HornetQClient.DEFAULT_CONSUMER_MAX_RATE;
+      consumerMaxRate = ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE;
 
-      confirmationWindowSize = HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
+      confirmationWindowSize = ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
 
-      producerWindowSize = HornetQClient.DEFAULT_PRODUCER_WINDOW_SIZE;
+      producerWindowSize = ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE;
 
-      producerMaxRate = HornetQClient.DEFAULT_PRODUCER_MAX_RATE;
+      producerMaxRate = ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE;
 
-      blockOnAcknowledge = HornetQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
+      blockOnAcknowledge = ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
 
-      blockOnDurableSend = HornetQClient.DEFAULT_BLOCK_ON_DURABLE_SEND;
+      blockOnDurableSend = ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND;
 
-      blockOnNonDurableSend = HornetQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND;
+      blockOnNonDurableSend = ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND;
 
-      autoGroup = HornetQClient.DEFAULT_AUTO_GROUP;
+      autoGroup = ActiveMQClient.DEFAULT_AUTO_GROUP;
 
-      preAcknowledge = HornetQClient.DEFAULT_PRE_ACKNOWLEDGE;
+      preAcknowledge = ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE;
 
-      ackBatchSize = HornetQClient.DEFAULT_ACK_BATCH_SIZE;
+      ackBatchSize = ActiveMQClient.DEFAULT_ACK_BATCH_SIZE;
 
-      connectionLoadBalancingPolicyClassName = HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
+      connectionLoadBalancingPolicyClassName = ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
 
-      useGlobalPools = HornetQClient.DEFAULT_USE_GLOBAL_POOLS;
+      useGlobalPools = ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS;
 
-      scheduledThreadPoolMaxSize = HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
+      scheduledThreadPoolMaxSize = ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
 
-      threadPoolMaxSize = HornetQClient.DEFAULT_THREAD_POOL_MAX_SIZE;
+      threadPoolMaxSize = ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE;
 
-      retryInterval = HornetQClient.DEFAULT_RETRY_INTERVAL;
+      retryInterval = ActiveMQClient.DEFAULT_RETRY_INTERVAL;
 
-      retryIntervalMultiplier = HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
+      retryIntervalMultiplier = ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
 
-      maxRetryInterval = HornetQClient.DEFAULT_MAX_RETRY_INTERVAL;
+      maxRetryInterval = ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL;
 
-      reconnectAttempts = HornetQClient.DEFAULT_RECONNECT_ATTEMPTS;
+      reconnectAttempts = ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS;
 
-      initialConnectAttempts = HornetQClient.INITIAL_CONNECT_ATTEMPTS;
+      initialConnectAttempts = ActiveMQClient.INITIAL_CONNECT_ATTEMPTS;
 
-      failoverOnInitialConnection = HornetQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
+      failoverOnInitialConnection = ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
 
-      cacheLargeMessagesClient = HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
+      cacheLargeMessagesClient = ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
 
-      initialMessagePacketSize = HornetQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE;
+      initialMessagePacketSize = ActiveMQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE;
 
-      cacheLargeMessagesClient = HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
+      cacheLargeMessagesClient = ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
 
-      compressLargeMessage = HornetQClient.DEFAULT_COMPRESS_LARGE_MESSAGES;
+      compressLargeMessage = ActiveMQClient.DEFAULT_COMPRESS_LARGE_MESSAGES;
 
       clusterConnection = false;
    }
@@ -633,7 +633,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                {
                   if (!isClosed())
                   {
-                     HornetQClientLogger.LOGGER.errorConnectingToNodes(e);
+                     ActiveMQClientLogger.LOGGER.errorConnectingToNodes(e);
                   }
                }
             }
@@ -652,7 +652,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
       if (protocolManagerFactory == null)
       {
          // this could happen over serialization from older versions
-         protocolManagerFactory = HornetQClientProtocolManagerFactory.getInstance();
+         protocolManagerFactory = ActiveMQClientProtocolManagerFactory.getInstance();
       }
       return protocolManagerFactory;
    }
@@ -711,9 +711,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
    {
       TopologyMember topologyMember = topology.getMember(nodeID);
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Creating connection factory towards " + nodeID + " = " + topologyMember + ", topology=" + topology.describe());
+         ActiveMQClientLogger.LOGGER.trace("Creating connection factory towards " + nodeID + " = " + topologyMember + ", topology=" + topology.describe());
       }
 
       if (topologyMember == null)
@@ -856,7 +856,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
 
          if (!ok)
          {
-            throw HornetQClientMessageBundle.BUNDLE.connectionTimedOutInInitialBroadcast();
+            throw ActiveMQClientMessageBundle.BUNDLE.connectionTimedOutInInitialBroadcast();
          }
       }
 
@@ -873,7 +873,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             TransportConfiguration tc = selectConnector();
             if (tc == null)
             {
-               throw HornetQClientMessageBundle.BUNDLE.noTCForSessionFactory();
+               throw ActiveMQClientMessageBundle.BUNDLE.noTCForSessionFactory();
             }
 
             // try each factory in the list until we find one which works
@@ -917,11 +917,11 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
 
                      if (topologyArray != null && attempts == topologyArray.length)
                      {
-                        throw HornetQClientMessageBundle.BUNDLE.cannotConnectToServers();
+                        throw ActiveMQClientMessageBundle.BUNDLE.cannotConnectToServers();
                      }
                      if (topologyArray == null && attempts == this.getNumInitialConnectors())
                      {
-                        throw HornetQClientMessageBundle.BUNDLE.cannotConnectToServers();
+                        throw ActiveMQClientMessageBundle.BUNDLE.cannotConnectToServers();
                      }
                   }
                   retry = true;
@@ -962,7 +962,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
          {
             if (factory != null)
                factory.cleanup();
-            throw HornetQClientMessageBundle.BUNDLE.connectionTimedOutOnReceiveTopology(discoveryGroup);
+            throw ActiveMQClientMessageBundle.BUNDLE.connectionTimedOutOnReceiveTopology(discoveryGroup);
          }
 
          addFactory(factory);
@@ -1465,9 +1465,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
       {
          if (state == STATE.CLOSED)
          {
-            if (HornetQClientLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
             {
-               HornetQClientLogger.LOGGER.debug(this + " is already closed when calling closed");
+               ActiveMQClientLogger.LOGGER.debug(this + " is already closed when calling closed");
             }
             return;
          }
@@ -1495,7 +1495,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             }
             catch (Exception e)
             {
-               HornetQClientLogger.LOGGER.failedToStopDiscovery(e);
+               ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
             }
          }
       }
@@ -1551,7 +1551,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             {
                if (!threadPool.awaitTermination(10000, TimeUnit.MILLISECONDS))
                {
-                  HornetQClientLogger.LOGGER.timedOutWaitingForTermination();
+                  ActiveMQClientLogger.LOGGER.timedOutWaitingForTermination();
                }
             }
             catch (InterruptedException e)
@@ -1568,7 +1568,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             {
                if (!scheduledThreadPool.awaitTermination(10000, TimeUnit.MILLISECONDS))
                {
-                  HornetQClientLogger.LOGGER.timedOutWaitingForScheduledPoolTermination();
+                  ActiveMQClientLogger.LOGGER.timedOutWaitingForScheduledPoolTermination();
                }
             }
             catch (InterruptedException e)
@@ -1598,9 +1598,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
          return;
       }
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("nodeDown " + this + " nodeID=" + nodeID + " as being down", new Exception("trace"));
+         ActiveMQClientLogger.LOGGER.trace("nodeDown " + this + " nodeID=" + nodeID + " as being down", new Exception("trace"));
       }
 
       topology.removeMember(eventTime, nodeID);
@@ -1641,9 +1641,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                             final Pair<TransportConfiguration, TransportConfiguration> connectorPair,
                             final boolean last)
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("NodeUp " + this + "::nodeID=" + nodeID + ", connectorPair=" + connectorPair, new Exception("trace"));
+         ActiveMQClientLogger.LOGGER.trace("NodeUp " + this + "::nodeID=" + nodeID + ", connectorPair=" + connectorPair, new Exception("trace"));
       }
 
       TopologyMemberImpl member = new TopologyMemberImpl(nodeID, backupGroupName, scaleDownGroupName, connectorPair.getA(), connectorPair.getB());
@@ -1757,7 +1757,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                }
                catch (ActiveMQException e)
                {
-                  HornetQClientLogger.LOGGER.errorConnectingToNodes(e);
+                  ActiveMQClientLogger.LOGGER.errorConnectingToNodes(e);
                }
             }
          };
@@ -1879,9 +1879,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                retryNumber++;
                for (Connector conn : connectors)
                {
-                  if (HornetQClientLogger.LOGGER.isDebugEnabled())
+                  if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                   {
-                     HornetQClientLogger.LOGGER.debug(this + "::Submitting connect towards " + conn);
+                     ActiveMQClientLogger.LOGGER.debug(this + "::Submitting connect towards " + conn);
                   }
 
                   csf = conn.tryConnect();
@@ -1904,7 +1904,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                               catch (Exception e)
                               {
                                  // There isn't much to be done if this happens here
-                                 HornetQClientLogger.LOGGER.errorStartingLocator(e);
+                                 ActiveMQClientLogger.LOGGER.errorStartingLocator(e);
                               }
                            }
                         }
@@ -1922,9 +1922,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
                         }
                      });
 
-                     if (HornetQClientLogger.LOGGER.isDebugEnabled())
+                     if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                      {
-                        HornetQClientLogger.LOGGER.debug("Returning " + csf +
+                        ActiveMQClientLogger.LOGGER.debug("Returning " + csf +
                                                             " after " +
                                                             retryNumber +
                                                             " retries on StaticConnector " +
@@ -1949,15 +1949,15 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
          {
             if (isClosed() || skipWarnings)
                return null;
-            HornetQClientLogger.LOGGER.debug("Rejected execution", e);
+            ActiveMQClientLogger.LOGGER.debug("Rejected execution", e);
             throw e;
          }
          catch (Exception e)
          {
             if (isClosed() || skipWarnings)
                return null;
-            HornetQClientLogger.LOGGER.errorConnectingToNodes(e);
-            throw HornetQClientMessageBundle.BUNDLE.cannotConnectToStaticConnectors(e);
+            ActiveMQClientLogger.LOGGER.errorConnectingToNodes(e);
+            throw ActiveMQClientMessageBundle.BUNDLE.cannotConnectToStaticConnectors(e);
          }
 
          if (isClosed() || skipWarnings)
@@ -1965,8 +1965,8 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             return null;
          }
 
-         HornetQClientLogger.LOGGER.errorConnectingToNodes(traceException);
-         throw HornetQClientMessageBundle.BUNDLE.cannotConnectToStaticConnectors2();
+         ActiveMQClientLogger.LOGGER.errorConnectingToNodes(traceException);
+         throw ActiveMQClientMessageBundle.BUNDLE.cannotConnectToStaticConnectors2();
       }
 
       private synchronized void createConnectors()
@@ -2024,7 +2024,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
       {
          if (!isClosed() && finalizeCheck)
          {
-            HornetQClientLogger.LOGGER.serverLocatorNotClosed(traceException, System.identityHashCode(this));
+            ActiveMQClientLogger.LOGGER.serverLocatorNotClosed(traceException, System.identityHashCode(this));
 
             if (ServerLocatorImpl.finalizeCallback != null)
             {
@@ -2051,9 +2051,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
 
          public ClientSessionFactory tryConnect() throws ActiveMQException
          {
-            if (HornetQClientLogger.LOGGER.isDebugEnabled())
+            if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
             {
-               HornetQClientLogger.LOGGER.debug(this + "::Trying to connect to " + factory);
+               ActiveMQClientLogger.LOGGER.debug(this + "::Trying to connect to " + factory);
             }
             try
             {
@@ -2075,7 +2075,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
             }
             catch (ActiveMQException e)
             {
-               HornetQClientLogger.LOGGER.debug(this + "::Exception on establish connector initial connection", e);
+               ActiveMQClientLogger.LOGGER.debug(this + "::Exception on establish connector initial connection", e);
                return null;
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/Topology.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/Topology.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/Topology.java
index 89973e2..caefb41 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/Topology.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/impl/Topology.java
@@ -25,7 +25,7 @@ import java.util.concurrent.Executor;
 
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.core.client.HornetQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
 import org.apache.activemq.spi.core.remoting.Connector;
 
 /**
@@ -64,9 +64,9 @@ public final class Topology implements Serializable
    public Topology(final Object owner)
    {
       this.owner = owner;
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("Topology@" + Integer.toHexString(System.identityHashCode(this)) + " CREATE",
+         ActiveMQClientLogger.LOGGER.trace("Topology@" + Integer.toHexString(System.identityHashCode(this)) + " CREATE",
                             new Exception("trace"));
       }
    }
@@ -86,9 +86,9 @@ public final class Topology implements Serializable
 
    public void addClusterTopologyListener(final ClusterTopologyListener listener)
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace(this + "::Adding topology listener " + listener, new Exception("Trace"));
+         ActiveMQClientLogger.LOGGER.trace(this + "::Adding topology listener " + listener, new Exception("Trace"));
       }
       synchronized (topologyListeners)
       {
@@ -99,9 +99,9 @@ public final class Topology implements Serializable
 
    public void removeClusterTopologyListener(final ClusterTopologyListener listener)
    {
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace(this + "::Removing topology listener " + listener, new Exception("Trace"));
+         ActiveMQClientLogger.LOGGER.trace(this + "::Removing topology listener " + listener, new Exception("Trace"));
       }
       synchronized (topologyListeners)
       {
@@ -114,9 +114,9 @@ public final class Topology implements Serializable
    {
       synchronized (this)
       {
-         if (HornetQClientLogger.LOGGER.isDebugEnabled())
+         if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
          {
-            HornetQClientLogger.LOGGER.debug(this + "::node " + nodeId + "=" + memberInput);
+            ActiveMQClientLogger.LOGGER.debug(this + "::node " + nodeId + "=" + memberInput);
          }
          memberInput.setUniqueEventID(System.currentTimeMillis());
          topology.remove(nodeId);
@@ -146,9 +146,9 @@ public final class Topology implements Serializable
    public TopologyMemberImpl updateBackup(final TopologyMemberImpl memberInput)
    {
       final String nodeId = memberInput.getNodeId();
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace(this + "::updateBackup::" + nodeId + ", memberInput=" + memberInput);
+         ActiveMQClientLogger.LOGGER.trace(this + "::updateBackup::" + nodeId + ", memberInput=" + memberInput);
       }
 
       synchronized (this)
@@ -156,9 +156,9 @@ public final class Topology implements Serializable
          TopologyMemberImpl currentMember = getMember(nodeId);
          if (currentMember == null)
          {
-            if (HornetQClientLogger.LOGGER.isTraceEnabled())
+            if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
             {
-               HornetQClientLogger.LOGGER.trace("There's no live to be updated on backup update, node=" + nodeId + " memberInput=" + memberInput,
+               ActiveMQClientLogger.LOGGER.trace("There's no live to be updated on backup update, node=" + nodeId + " memberInput=" + memberInput,
                                                 new Exception("trace"));
             }
 
@@ -191,7 +191,7 @@ public final class Topology implements Serializable
       Long deleteTme = getMapDelete().get(nodeId);
       if (deleteTme != null && uniqueEventID != 0 && uniqueEventID < deleteTme)
       {
-         HornetQClientLogger.LOGGER.debug("Update uniqueEvent=" + uniqueEventID +
+         ActiveMQClientLogger.LOGGER.debug("Update uniqueEvent=" + uniqueEventID +
                    ", nodeId=" +
                    nodeId +
                    ", memberInput=" +
@@ -206,9 +206,9 @@ public final class Topology implements Serializable
 
          if (currentMember == null)
          {
-            if (HornetQClientLogger.LOGGER.isTraceEnabled())
+            if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
             {
-               HornetQClientLogger.LOGGER.trace(this + "::NewMemberAdd nodeId=" + nodeId + " member = " + memberInput,
+               ActiveMQClientLogger.LOGGER.trace(this + "::NewMemberAdd nodeId=" + nodeId + " member = " + memberInput,
                                           new Exception("trace"));
             }
             memberInput.setUniqueEventID(uniqueEventID);
@@ -232,9 +232,9 @@ public final class Topology implements Serializable
                newMember.setBackup(currentMember.getBackup());
             }
 
-            if (HornetQClientLogger.LOGGER.isTraceEnabled())
+            if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
             {
-               HornetQClientLogger.LOGGER.trace(this + "::updated currentMember=nodeID=" + nodeId + ", currentMember=" +
+               ActiveMQClientLogger.LOGGER.trace(this + "::updated currentMember=nodeID=" + nodeId + ", currentMember=" +
                                                    currentMember + ", memberInput=" + memberInput + "newMember=" +
                                                    newMember,
                                           new Exception("trace"));
@@ -267,9 +267,9 @@ public final class Topology implements Serializable
    {
       final ArrayList<ClusterTopologyListener> copy = copyListeners();
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace(this + "::prepare to send " + nodeId + " to " + copy.size() + " elements");
+         ActiveMQClientLogger.LOGGER.trace(this + "::prepare to send " + nodeId + " to " + copy.size() + " elements");
       }
 
       if (copy.size() > 0)
@@ -280,9 +280,9 @@ public final class Topology implements Serializable
             {
                for (ClusterTopologyListener listener : copy)
                {
-                  if (HornetQClientLogger.LOGGER.isTraceEnabled())
+                  if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
                   {
-                     HornetQClientLogger.LOGGER.trace(Topology.this + " informing " +
+                     ActiveMQClientLogger.LOGGER.trace(Topology.this + " informing " +
                                         listener +
                                         " about node up = " +
                                         nodeId +
@@ -296,7 +296,7 @@ public final class Topology implements Serializable
                   }
                   catch (Throwable e)
                   {
-                     HornetQClientLogger.LOGGER.errorSendingTopology(e);
+                     ActiveMQClientLogger.LOGGER.errorSendingTopology(e);
                   }
                }
             }
@@ -328,7 +328,7 @@ public final class Topology implements Serializable
          {
             if (member.getUniqueEventID() > uniqueEventID)
             {
-               HornetQClientLogger.LOGGER.debug("The removeMember was issued before the node " + nodeId + " was started, ignoring call");
+               ActiveMQClientLogger.LOGGER.debug("The removeMember was issued before the node " + nodeId + " was started, ignoring call");
                member = null;
             }
             else
@@ -339,9 +339,9 @@ public final class Topology implements Serializable
          }
       }
 
-      if (HornetQClientLogger.LOGGER.isTraceEnabled())
+      if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
       {
-         HornetQClientLogger.LOGGER.trace("removeMember " + this +
+         ActiveMQClientLogger.LOGGER.trace("removeMember " + this +
                             " removing nodeID=" +
                             nodeId +
                             ", result=" +
@@ -360,9 +360,9 @@ public final class Topology implements Serializable
             {
                for (ClusterTopologyListener listener : copy)
                {
-                  if (HornetQClientLogger.LOGGER.isTraceEnabled())
+                  if (ActiveMQClientLogger.LOGGER.isTraceEnabled())
                   {
-                     HornetQClientLogger.LOGGER.trace(this + " informing " + listener + " about node down = " + nodeId);
+                     ActiveMQClientLogger.LOGGER.trace(this + " informing " + listener + " about node down = " + nodeId);
                   }
                   try
                   {
@@ -370,7 +370,7 @@ public final class Topology implements Serializable
                   }
                   catch (Exception e)
                   {
-                     HornetQClientLogger.LOGGER.errorSendingTopologyNodedown(e);
+                     ActiveMQClientLogger.LOGGER.errorSendingTopologyNodedown(e);
                   }
                }
             }
@@ -394,9 +394,9 @@ public final class Topology implements Serializable
 
    public synchronized void sendTopology(final ClusterTopologyListener listener)
    {
-      if (HornetQClientLogger.LOGGER.isDebugEnabled())
+      if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
       {
-         HornetQClientLogger.LOGGER.debug(this + " is sending topology to " + listener);
+         ActiveMQClientLogger.LOGGER.debug(this + " is sending topology to " + listener);
       }
 
       execute(new Runnable()
@@ -414,9 +414,9 @@ public final class Topology implements Serializable
 
             for (Map.Entry<String, TopologyMemberImpl> entry : copy.entrySet())
             {
-               if (HornetQClientLogger.LOGGER.isDebugEnabled())
+               if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
                {
-                  HornetQClientLogger.LOGGER.debug(Topology.this + " sending " +
+                  ActiveMQClientLogger.LOGGER.debug(Topology.this + " sending " +
                             entry.getKey() +
                             " / " +
                             entry.getValue().getConnector() +

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/cluster/DiscoveryGroup.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/cluster/DiscoveryGroup.java b/activemq-core-client/src/main/java/org/apache/activemq/core/cluster/DiscoveryGroup.java
index ce4dbd2..1ee0662 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/cluster/DiscoveryGroup.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/cluster/DiscoveryGroup.java
@@ -27,8 +27,8 @@ import org.apache.activemq.api.core.BroadcastEndpointFactory;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.api.core.management.CoreNotificationType;
-import org.apache.activemq.core.client.HornetQClientLogger;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.server.management.NotificationService;
 import org.apache.activemq.utils.TypedProperties;
@@ -46,9 +46,9 @@ import org.apache.activemq.utils.TypedProperties;
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author Clebert Suconic
  */
-public final class DiscoveryGroup implements HornetQComponent
+public final class DiscoveryGroup implements ActiveMQComponent
 {
-   private static final boolean isTrace = HornetQClientLogger.LOGGER.isTraceEnabled();
+   private static final boolean isTrace = ActiveMQClientLogger.LOGGER.isTraceEnabled();
 
    private final List<DiscoveryListener> listeners = new ArrayList<DiscoveryListener>();
 
@@ -106,7 +106,7 @@ public final class DiscoveryGroup implements HornetQComponent
 
       started = true;
 
-      thread = new Thread(new DiscoveryRunnable(), "hornetq-discovery-group-thread-" + name);
+      thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 
       thread.setDaemon(true);
 
@@ -147,7 +147,7 @@ public final class DiscoveryGroup implements HornetQComponent
       }
       catch (Exception e1)
       {
-         HornetQClientLogger.LOGGER.errorStoppingDiscoveryBroadcastEndpoint(endpoint, e1);
+         ActiveMQClientLogger.LOGGER.errorStoppingDiscoveryBroadcastEndpoint(endpoint, e1);
       }
 
       try
@@ -156,7 +156,7 @@ public final class DiscoveryGroup implements HornetQComponent
          thread.join(10000);
          if (thread.isAlive())
          {
-            HornetQClientLogger.LOGGER.timedOutStoppingDiscovery();
+            ActiveMQClientLogger.LOGGER.timedOutStoppingDiscovery();
          }
       }
       catch (InterruptedException e)
@@ -177,7 +177,7 @@ public final class DiscoveryGroup implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQClientLogger.LOGGER.errorSendingNotifOnDiscoveryStop(e);
+            ActiveMQClientLogger.LOGGER.errorSendingNotifOnDiscoveryStop(e);
          }
       }
    }
@@ -252,7 +252,7 @@ public final class DiscoveryGroup implements HornetQComponent
       {
          if (!currentUniqueID.equals(uniqueID))
          {
-            HornetQClientLogger.LOGGER.multipleServersBroadcastingSameNode(originatingNodeID);
+            ActiveMQClientLogger.LOGGER.multipleServersBroadcastingSameNode(originatingNodeID);
             uniqueIDMap.put(originatingNodeID, uniqueID);
          }
       }
@@ -278,7 +278,7 @@ public final class DiscoveryGroup implements HornetQComponent
                      {
                         // This is totally unexpected, so I'm not even bothering on creating
                         // a log entry for that
-                        HornetQClientLogger.LOGGER.warn("Unexpected null data received from DiscoveryEndpoint");
+                        ActiveMQClientLogger.LOGGER.warn("Unexpected null data received from DiscoveryEndpoint");
                      }
                      break;
                   }
@@ -291,7 +291,7 @@ public final class DiscoveryGroup implements HornetQComponent
                   }
                   else
                   {
-                     HornetQClientLogger.LOGGER.errorReceivingPAcketInDiscovery(e);
+                     ActiveMQClientLogger.LOGGER.errorReceivingPAcketInDiscovery(e);
                   }
                }
 
@@ -346,10 +346,10 @@ public final class DiscoveryGroup implements HornetQComponent
                {
                   if (isTrace)
                   {
-                     HornetQClientLogger.LOGGER.trace("Connectors changed on Discovery:");
+                     ActiveMQClientLogger.LOGGER.trace("Connectors changed on Discovery:");
                      for (DiscoveryEntry connector : connectors.values())
                      {
-                        HornetQClientLogger.LOGGER.trace(connector);
+                        ActiveMQClientLogger.LOGGER.trace(connector);
                      }
                   }
                   callListeners();
@@ -365,7 +365,7 @@ public final class DiscoveryGroup implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQClientLogger.LOGGER.failedToReceiveDatagramInDiscovery(e);
+            ActiveMQClientLogger.LOGGER.failedToReceiveDatagramInDiscovery(e);
          }
       }
 
@@ -397,7 +397,7 @@ public final class DiscoveryGroup implements HornetQComponent
          catch (Throwable t)
          {
             // Catch it so exception doesn't prevent other listeners from running
-            HornetQClientLogger.LOGGER.failedToCallListenerInDiscovery(t);
+            ActiveMQClientLogger.LOGGER.failedToCallListenerInDiscovery(t);
          }
       }
    }
@@ -419,7 +419,7 @@ public final class DiscoveryGroup implements HornetQComponent
          {
             if (isTrace)
             {
-               HornetQClientLogger.LOGGER.trace("Timed out node on discovery:" + entry.getValue());
+               ActiveMQClientLogger.LOGGER.trace("Timed out node on discovery:" + entry.getValue());
             }
             iter.remove();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/exception/ActiveMQXAException.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/exception/ActiveMQXAException.java b/activemq-core-client/src/main/java/org/apache/activemq/core/exception/ActiveMQXAException.java
new file mode 100644
index 0000000..d25a364
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/exception/ActiveMQXAException.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.exception;
+
+import javax.transaction.xa.XAException;
+
+/**
+ * A ActiveMQXAException
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class ActiveMQXAException extends XAException
+{
+   private static final long serialVersionUID = 6535914602965015803L;
+
+   public ActiveMQXAException(final int errorCode, final String message)
+   {
+      super(message);
+
+      this.errorCode = errorCode;
+   }
+
+   public ActiveMQXAException(final int errorCode)
+   {
+      super(errorCode);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/exception/HornetQXAException.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/exception/HornetQXAException.java b/activemq-core-client/src/main/java/org/apache/activemq/core/exception/HornetQXAException.java
deleted file mode 100644
index e721d3e..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/exception/HornetQXAException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.exception;
-
-import javax.transaction.xa.XAException;
-
-/**
- * A HornetQXAException
- *
- * @author Tim Fox
- *
- *
- */
-public class HornetQXAException extends XAException
-{
-   private static final long serialVersionUID = 6535914602965015803L;
-
-   public HornetQXAException(final int errorCode, final String message)
-   {
-      super(message);
-
-      this.errorCode = errorCode;
-   }
-
-   public HornetQXAException(final int errorCode)
-   {
-      super(errorCode);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/message/BodyEncoder.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/message/BodyEncoder.java b/activemq-core-client/src/main/java/org/apache/activemq/core/message/BodyEncoder.java
index 609386e..e926747 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/message/BodyEncoder.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/message/BodyEncoder.java
@@ -28,27 +28,27 @@ import org.apache.activemq.api.core.ActiveMQException;
 public interface BodyEncoder
 {
    /**
-    * This method must not be called directly by HornetQ clients.
+    * This method must not be called directly by ActiveMQ clients.
     */
    void open() throws ActiveMQException;
 
    /**
-    * This method must not be called directly by HornetQ clients.
+    * This method must not be called directly by ActiveMQ clients.
     */
    void close() throws ActiveMQException;
 
    /**
-    * This method must not be called directly by HornetQ clients.
+    * This method must not be called directly by ActiveMQ clients.
     */
    int encode(ByteBuffer bufferRead) throws ActiveMQException;
 
    /**
-    * This method must not be called directly by HornetQ clients.
+    * This method must not be called directly by ActiveMQ clients.
     */
    int encode(ActiveMQBuffer bufferOut, int size) throws ActiveMQException;
 
    /**
-    * This method must not be called directly by HornetQ clients.
+    * This method must not be called directly by ActiveMQ clients.
     */
    long getLargeBodySize();
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/message/impl/MessageImpl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/message/impl/MessageImpl.java b/activemq-core-client/src/main/java/org/apache/activemq/core/message/impl/MessageImpl.java
index 8d4f3d7..a955b9a 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/message/impl/MessageImpl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/message/impl/MessageImpl.java
@@ -23,7 +23,7 @@ import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
+import org.apache.activemq.core.buffers.impl.ResetLimitWrappedActiveMQBuffer;
 import org.apache.activemq.core.message.BodyEncoder;
 import org.apache.activemq.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.utils.ByteUtil;
@@ -34,7 +34,7 @@ import org.apache.activemq.utils.UUID;
 /**
  * A concrete implementation of a message
  * <p>
- * All messages handled by HornetQ core are of this type
+ * All messages handled by ActiveMQ core are of this type
  *
  * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -78,7 +78,7 @@ public abstract class MessageImpl implements MessageInternal
 
    protected ActiveMQBuffer buffer;
 
-   protected ResetLimitWrappedHornetQBuffer bodyBuffer;
+   protected ResetLimitWrappedActiveMQBuffer bodyBuffer;
 
    protected volatile boolean bufferValid;
 
@@ -100,7 +100,7 @@ public abstract class MessageImpl implements MessageInternal
    }
 
    /**
-    * overridden by the client message, we need access to the connection so we can create the appropriate HornetQBuffer.
+    * overridden by the client message, we need access to the connection so we can create the appropriate ActiveMQBuffer.
     *
     * @param type
     * @param durable
@@ -265,7 +265,7 @@ public abstract class MessageImpl implements MessageInternal
    {
       if (bodyBuffer == null)
       {
-         bodyBuffer = new ResetLimitWrappedHornetQBuffer(BODY_OFFSET, buffer, this);
+         bodyBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer, this);
       }
 
       return bodyBuffer;
@@ -299,7 +299,7 @@ public abstract class MessageImpl implements MessageInternal
 
       newBuffer.setIndex(0, getEndOfBodyPosition());
 
-      return new ResetLimitWrappedHornetQBuffer(BODY_OFFSET, newBuffer, null);
+      return new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, newBuffer, null);
    }
 
    public long getMessageID()

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/CoreRemotingConnection.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/CoreRemotingConnection.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/CoreRemotingConnection.java
index 07fd491..f9af32e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/CoreRemotingConnection.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/CoreRemotingConnection.java
@@ -12,12 +12,12 @@
  */
 package org.apache.activemq.core.protocol.core;
 
-import org.apache.activemq.core.security.HornetQPrincipal;
+import org.apache.activemq.core.security.ActiveMQPrincipal;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 
 
 /**
- * Extension of RemotingConnection for the HornetQ core protocol
+ * Extension of RemotingConnection for the ActiveMQ core protocol
  * @author Tim Fox
  */
 public interface CoreRemotingConnection extends RemotingConnection
@@ -100,5 +100,5 @@ public interface CoreRemotingConnection extends RemotingConnection
     * Returns the default security principal
     * @return the principal
     */
-   HornetQPrincipal getDefaultHornetQPrincipal();
+   ActiveMQPrincipal getDefaultActiveMQPrincipal();
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManager.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManager.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManager.java
new file mode 100644
index 0000000..ba593cc
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManager.java
@@ -0,0 +1,613 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.core.impl;
+
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+
+import io.netty.channel.ChannelPipeline;
+import org.apache.activemq.api.core.ActiveMQBuffer;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQExceptionType;
+import org.apache.activemq.api.core.ActiveMQInterruptedException;
+import org.apache.activemq.api.core.Interceptor;
+import org.apache.activemq.api.core.Pair;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.client.ClientSessionFactory;
+import org.apache.activemq.api.core.client.ActiveMQClient;
+import org.apache.activemq.core.client.ActiveMQClientLogger;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
+import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
+import org.apache.activemq.core.protocol.ClientPacketDecoder;
+import org.apache.activemq.core.protocol.core.Channel;
+import org.apache.activemq.core.protocol.core.ChannelHandler;
+import org.apache.activemq.core.protocol.core.CoreRemotingConnection;
+import org.apache.activemq.core.protocol.core.Packet;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverReplyMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V2;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V3;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.DisconnectMessage_V2;
+import org.apache.activemq.core.protocol.core.impl.wireformat.Ping;
+import org.apache.activemq.core.protocol.core.impl.wireformat.SubscribeClusterTopologyUpdatesMessageV2;
+import org.apache.activemq.core.remoting.impl.netty.ActiveMQFrameDecoder2;
+import org.apache.activemq.core.version.Version;
+import org.apache.activemq.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.spi.core.remoting.Connection;
+import org.apache.activemq.spi.core.remoting.TopologyResponseHandler;
+import org.apache.activemq.spi.core.remoting.SessionContext;
+import org.apache.activemq.utils.VersionLoader;
+
+/**
+ * This class will return specific packets for different types of actions happening on a messaging protocol.
+ * <p/>
+ * This is trying to unify the Core client into multiple protocols.
+ * <p/>
+ * Returning null in certain packets means no action is taken on this specific protocol.
+ * <p/>
+ * Semantic properties could also be added to this implementation.
+ * <p/>
+ * Implementations of this class need to be stateless.
+ *
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQClientProtocolManager implements ClientProtocolManager
+{
+   private final int versionID = VersionLoader.getVersion().getIncrementingVersion();
+
+   private ClientSessionFactoryInternal factoryInternal;
+
+   /**
+    * Guards assignments to {@link #inCreateSession} and {@link #inCreateSessionLatch}
+    */
+   private final Object inCreateSessionGuard = new Object();
+
+   /**
+    * Flag that tells whether we are trying to create a session.
+    */
+   private boolean inCreateSession;
+
+   /**
+    * Used to wait for the creation of a session.
+    */
+   private CountDownLatch inCreateSessionLatch;
+
+   protected volatile RemotingConnectionImpl connection;
+
+   protected TopologyResponseHandler topologyResponseHandler;
+
+   /**
+    * Flag that signals that the communication is closing. Causes many processes to exit.
+    */
+   private volatile boolean alive = true;
+
+   private final CountDownLatch waitLatch = new CountDownLatch(1);
+
+
+   public ActiveMQClientProtocolManager()
+   {
+   }
+
+   public String getName()
+   {
+      return ActiveMQClient.DEFAULT_CORE_PROTOCOL;
+   }
+
+   public void setSessionFactory(ClientSessionFactory factory)
+   {
+      this.factoryInternal = (ClientSessionFactoryInternal)factory;
+   }
+
+   public ClientSessionFactory getSessionFactory()
+   {
+      return this.factoryInternal;
+   }
+
+   @Override
+   public void addChannelHandlers(ChannelPipeline pipeline)
+   {
+      pipeline.addLast("activemq-decoder", new ActiveMQFrameDecoder2());
+   }
+
+   public boolean waitOnLatch(long milliseconds) throws InterruptedException
+   {
+      return waitLatch.await(milliseconds, TimeUnit.MILLISECONDS);
+   }
+
+   public Channel getChannel0()
+   {
+      if (connection == null)
+      {
+         return null;
+      }
+      else
+      {
+         return connection.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
+      }
+   }
+
+   public RemotingConnection getCurrentConnection()
+   {
+      return connection;
+   }
+
+
+   public Channel getChannel1()
+   {
+      if (connection == null)
+      {
+         return null;
+      }
+      else
+      {
+         return connection.getChannel(1, -1);
+      }
+   }
+
+   public Lock lockSessionCreation()
+   {
+      try
+      {
+         Lock localFailoverLock = factoryInternal.lockFailover();
+         try
+         {
+            if (connection == null)
+            {
+               return null;
+            }
+
+            Lock lock = getChannel1().getLock();
+
+            // Lock it - this must be done while the failoverLock is held
+            while (isAlive() && !lock.tryLock(100, TimeUnit.MILLISECONDS))
+            {
+            }
+
+            return lock;
+         }
+         finally
+         {
+            localFailoverLock.unlock();
+         }
+         // We can now release the failoverLock
+      }
+      catch (InterruptedException e)
+      {
+         Thread.currentThread().interrupt();
+         return null;
+      }
+   }
+
+
+   public void stop()
+   {
+      alive = false;
+
+
+      synchronized (inCreateSessionGuard)
+      {
+         if (inCreateSessionLatch != null)
+            inCreateSessionLatch.countDown();
+      }
+
+
+      Channel channel1 = getChannel1();
+      if (channel1 != null)
+      {
+         channel1.returnBlocking();
+      }
+
+      waitLatch.countDown();
+
+   }
+
+   public boolean isAlive()
+   {
+      return alive;
+   }
+
+
+   @Override
+   public void ping(long connectionTTL)
+   {
+      Channel channel = connection.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
+
+      Ping ping = new Ping(connectionTTL);
+
+      channel.send(ping);
+
+      connection.flush();
+   }
+
+   @Override
+   public void sendSubscribeTopology(final boolean isServer)
+   {
+      getChannel0().send(new SubscribeClusterTopologyUpdatesMessageV2(isServer,
+                                                                      VersionLoader.getVersion()
+                                                                         .getIncrementingVersion()));
+   }
+
+   @Override
+   public SessionContext createSessionContext(String name, String username, String password,
+                                              boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
+                                              boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
+   {
+      for (Version clientVersion : VersionLoader.getClientVersions())
+      {
+         try
+         {
+            return createSessionContext(clientVersion,
+                                        name,
+                                        username,
+                                        password,
+                                        xa,
+                                        autoCommitSends,
+                                        autoCommitAcks,
+                                        preAcknowledge,
+                                        minLargeMessageSize,
+                                        confirmationWindowSize);
+         }
+         catch (ActiveMQException e)
+         {
+            if (e.getType() != ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
+            {
+               throw e;
+            }
+         }
+      }
+      connection.destroy();
+      throw new ActiveMQException(ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
+   }
+
+   public SessionContext createSessionContext(Version clientVersion, String name, String username, String password,
+                                              boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
+                                              boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
+   {
+      if (!isAlive())
+         throw ActiveMQClientMessageBundle.BUNDLE.clientSessionClosed();
+
+      Channel sessionChannel = null;
+      CreateSessionResponseMessage response = null;
+
+      boolean retry;
+      do
+      {
+         retry = false;
+
+         Lock lock = null;
+
+         try
+         {
+
+            lock = lockSessionCreation();
+
+            // We now set a flag saying createSession is executing
+            synchronized (inCreateSessionGuard)
+            {
+               if (!isAlive())
+                  throw ActiveMQClientMessageBundle.BUNDLE.clientSessionClosed();
+               inCreateSession = true;
+               inCreateSessionLatch = new CountDownLatch(1);
+            }
+
+            long sessionChannelID = connection.generateChannelID();
+
+            Packet request = new CreateSessionMessage(name,
+                                                      sessionChannelID,
+                                                      clientVersion.getIncrementingVersion(),
+                                                      username,
+                                                      password,
+                                                      minLargeMessageSize,
+                                                      xa,
+                                                      autoCommitSends,
+                                                      autoCommitAcks,
+                                                      preAcknowledge,
+                                                      confirmationWindowSize,
+                                                      null);
+
+
+            try
+            {
+               // channel1 reference here has to go away
+               response = (CreateSessionResponseMessage) getChannel1().sendBlocking(request, PacketImpl.CREATESESSION_RESP);
+            }
+            catch (ActiveMQException cause)
+            {
+               if (!isAlive())
+                  throw cause;
+
+               if (cause.getType() == ActiveMQExceptionType.UNBLOCKED)
+               {
+                  // This means the thread was blocked on create session and failover unblocked it
+                  // so failover could occur
+
+                  retry = true;
+
+                  continue;
+               }
+               else
+               {
+                  throw cause;
+               }
+            }
+
+            sessionChannel = connection.getChannel(sessionChannelID, confirmationWindowSize);
+
+
+         }
+         catch (Throwable t)
+         {
+            if (lock != null)
+            {
+               lock.unlock();
+               lock = null;
+            }
+
+            if (t instanceof ActiveMQException)
+            {
+               throw (ActiveMQException) t;
+            }
+            else
+            {
+               throw ActiveMQClientMessageBundle.BUNDLE.failedToCreateSession(t);
+            }
+         }
+         finally
+         {
+            if (lock != null)
+            {
+               lock.unlock();
+            }
+
+            // Execution has finished so notify any failover thread that may be waiting for us to be done
+            inCreateSession = false;
+            inCreateSessionLatch.countDown();
+         }
+      }
+      while (retry);
+
+
+      // these objects won't be null, otherwise it would keep retrying on the previous loop
+      return new ActiveMQSessionContext(name, connection, sessionChannel, response.getServerVersion(), confirmationWindowSize);
+
+   }
+
+   public boolean cleanupBeforeFailover(ActiveMQException cause)
+   {
+
+      boolean needToInterrupt;
+
+      CountDownLatch exitLockLatch;
+      Lock lock = lockSessionCreation();
+
+      if (lock == null)
+      {
+         return false;
+      }
+
+      try
+      {
+         synchronized (inCreateSessionGuard)
+         {
+            needToInterrupt = inCreateSession;
+            exitLockLatch = inCreateSessionLatch;
+         }
+      }
+      finally
+      {
+         lock.unlock();
+      }
+
+      if (needToInterrupt)
+      {
+         forceReturnChannel1(cause);
+
+         // Now we need to make sure that the thread has actually exited and returned it's
+         // connections
+         // before failover occurs
+
+         while (inCreateSession && isAlive())
+         {
+            try
+            {
+               if (exitLockLatch != null)
+               {
+                  exitLockLatch.await(500, TimeUnit.MILLISECONDS);
+               }
+            }
+            catch (InterruptedException e1)
+            {
+               throw new ActiveMQInterruptedException(e1);
+            }
+         }
+      }
+
+      return true;
+   }
+
+   @Override
+   public boolean checkForFailover(String liveNodeID) throws ActiveMQException
+   {
+      CheckFailoverMessage packet = new CheckFailoverMessage(liveNodeID);
+      CheckFailoverReplyMessage message = (CheckFailoverReplyMessage) getChannel1().sendBlocking(packet,
+                                                                                                 PacketImpl.CHECK_FOR_FAILOVER_REPLY);
+      return message.isOkToFailover();
+   }
+
+
+   public RemotingConnection connect(Connection transportConnection, long callTimeout, long callFailoverTimeout,
+                                     List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors,
+                                     TopologyResponseHandler topologyResponseHandler)
+   {
+      this.connection = new RemotingConnectionImpl(getPacketDecoder(), transportConnection,
+                                                                             callTimeout, callFailoverTimeout,
+                                                                             incomingInterceptors, outgoingInterceptors);
+
+      this.topologyResponseHandler = topologyResponseHandler;
+
+      getChannel0().setHandler(new Channel0Handler(connection));
+
+
+      sendHandshake(transportConnection);
+
+      return connection;
+   }
+
+   private void sendHandshake(Connection transportConnection)
+   {
+      if (transportConnection.isUsingProtocolHandling())
+      {
+         // no need to send handshake on inVM as inVM is not using the NettyProtocolHandling
+         String handshake = "ACTIVEMQ";
+         ActiveMQBuffer amqbuffer = connection.createBuffer(handshake.length());
+         amqbuffer.writeBytes(handshake.getBytes());
+         transportConnection.write(amqbuffer);
+      }
+   }
+
+
+   private class Channel0Handler implements ChannelHandler
+   {
+      private final CoreRemotingConnection conn;
+
+      private Channel0Handler(final CoreRemotingConnection conn)
+      {
+         this.conn = conn;
+      }
+
+      public void handlePacket(final Packet packet)
+      {
+         final byte type = packet.getType();
+
+         if (type == PacketImpl.DISCONNECT || type == PacketImpl.DISCONNECT_V2)
+         {
+            final DisconnectMessage msg = (DisconnectMessage) packet;
+            String scaleDownTargetNodeID = null;
+
+            SimpleString nodeID = msg.getNodeID();
+
+            if (packet instanceof DisconnectMessage_V2)
+            {
+               final DisconnectMessage_V2 msg_v2 = (DisconnectMessage_V2) packet;
+               scaleDownTargetNodeID = msg_v2.getScaleDownNodeID() == null ? null : msg_v2.getScaleDownNodeID().toString();
+            }
+
+            if (topologyResponseHandler != null)
+               topologyResponseHandler.nodeDisconnected(conn, nodeID == null ? null : nodeID.toString(), scaleDownTargetNodeID);
+         }
+         else if (type == PacketImpl.CLUSTER_TOPOLOGY)
+         {
+            ClusterTopologyChangeMessage topMessage = (ClusterTopologyChangeMessage) packet;
+            notifyTopologyChange(topMessage);
+         }
+         else if (type == PacketImpl.CLUSTER_TOPOLOGY_V2)
+         {
+            ClusterTopologyChangeMessage_V2 topMessage = (ClusterTopologyChangeMessage_V2) packet;
+            notifyTopologyChange(topMessage);
+         }
+         else if (type == PacketImpl.CLUSTER_TOPOLOGY || type == PacketImpl.CLUSTER_TOPOLOGY_V2 || type == PacketImpl.CLUSTER_TOPOLOGY_V3)
+         {
+            ClusterTopologyChangeMessage topMessage = (ClusterTopologyChangeMessage) packet;
+            notifyTopologyChange(topMessage);
+         }
+         else if (type == PacketImpl.CHECK_FOR_FAILOVER_REPLY)
+         {
+            System.out.println("Channel0Handler.handlePacket");
+         }
+      }
+
+      /**
+       * @param topMessage
+       */
+      private void notifyTopologyChange(final ClusterTopologyChangeMessage topMessage)
+      {
+         final long eventUID;
+         final String backupGroupName;
+         final String scaleDownGroupName;
+         if (topMessage instanceof ClusterTopologyChangeMessage_V3)
+         {
+            eventUID = ((ClusterTopologyChangeMessage_V3) topMessage).getUniqueEventID();
+            backupGroupName = ((ClusterTopologyChangeMessage_V3) topMessage).getBackupGroupName();
+            scaleDownGroupName = ((ClusterTopologyChangeMessage_V3) topMessage).getScaleDownGroupName();
+         }
+         else if (topMessage instanceof ClusterTopologyChangeMessage_V2)
+         {
+            eventUID = ((ClusterTopologyChangeMessage_V2) topMessage).getUniqueEventID();
+            backupGroupName = ((ClusterTopologyChangeMessage_V2) topMessage).getBackupGroupName();
+            scaleDownGroupName = null;
+         }
+         else
+         {
+            eventUID = System.currentTimeMillis();
+            backupGroupName = null;
+            scaleDownGroupName = null;
+         }
+
+         if (topMessage.isExit())
+         {
+            if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
+            {
+               ActiveMQClientLogger.LOGGER.debug("Notifying " + topMessage.getNodeID() + " going down");
+            }
+
+            if (topologyResponseHandler != null)
+            {
+               topologyResponseHandler.notifyNodeDown(eventUID, topMessage.getNodeID());
+            }
+         }
+         else
+         {
+            Pair<TransportConfiguration, TransportConfiguration> transportConfig = topMessage.getPair();
+            if (transportConfig.getA() == null && transportConfig.getB() == null)
+            {
+               transportConfig = new Pair<>(conn.getTransportConnection()
+                                               .getConnectorConfig(),
+                                            null);
+            }
+
+            if (topologyResponseHandler != null)
+            {
+               topologyResponseHandler.notifyNodeUp(eventUID, topMessage.getNodeID(), backupGroupName, scaleDownGroupName, transportConfig, topMessage.isLast());
+            }
+         }
+      }
+   }
+
+   protected PacketDecoder getPacketDecoder()
+   {
+      return ClientPacketDecoder.INSTANCE;
+   }
+
+   private void forceReturnChannel1(ActiveMQException cause)
+   {
+      if (connection != null)
+      {
+         Channel channel1 = connection.getChannel(1, -1);
+
+         if (channel1 != null)
+         {
+            channel1.returnBlocking(cause);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManagerFactory.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManagerFactory.java
new file mode 100644
index 0000000..857fedc
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQClientProtocolManagerFactory.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.core.impl;
+
+import org.apache.activemq.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.spi.core.remoting.ClientProtocolManagerFactory;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQClientProtocolManagerFactory implements ClientProtocolManagerFactory
+{
+   private static final long serialVersionUID = 1;
+
+   private static final ActiveMQClientProtocolManagerFactory INSTANCE = new ActiveMQClientProtocolManagerFactory();
+
+   private ActiveMQClientProtocolManagerFactory()
+   {
+   }
+
+   public static final ActiveMQClientProtocolManagerFactory getInstance()
+   {
+      return INSTANCE;
+   }
+
+   public ClientProtocolManager newProtocolManager()
+   {
+      return new ActiveMQClientProtocolManager();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQConsumerContext.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQConsumerContext.java b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQConsumerContext.java
new file mode 100644
index 0000000..0747f48
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/core/protocol/core/impl/ActiveMQConsumerContext.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.protocol.core.impl;
+
+import org.apache.activemq.spi.core.remoting.ConsumerContext;
+
+/**
+ * @author Clebert Suconic
+ */
+
+public class ActiveMQConsumerContext extends ConsumerContext
+{
+   private long id;
+
+   public ActiveMQConsumerContext(long id)
+   {
+      this.id = id;
+   }
+
+   public long getId()
+   {
+      return id;
+   }
+
+   @Override
+   public boolean equals(Object o)
+   {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      ActiveMQConsumerContext that = (ActiveMQConsumerContext) o;
+
+      if (id != that.id) return false;
+
+      return true;
+   }
+
+   @Override
+   public int hashCode()
+   {
+      return (int) (id ^ (id >>> 32));
+   }
+}


[23/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAStreamMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAStreamMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAStreamMessage.java
new file mode 100644
index 0000000..4fcb0c4
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAStreamMessage.java
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.util.Arrays;
+
+import javax.jms.JMSException;
+import javax.jms.StreamMessage;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAStreamMessage extends ActiveMQRAMessage implements StreamMessage
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRAStreamMessage(final StreamMessage message, final ActiveMQRASession session)
+   {
+      super(message, session);
+
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean readBoolean() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readBoolean()");
+      }
+
+      return ((StreamMessage)message).readBoolean();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public byte readByte() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readByte()");
+      }
+
+      return ((StreamMessage)message).readByte();
+   }
+
+   /**
+    * Read
+    * @param value The value
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readBytes(final byte[] value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ")");
+      }
+
+      return ((StreamMessage)message).readBytes(value);
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public char readChar() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readChar()");
+      }
+
+      return ((StreamMessage)message).readChar();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public double readDouble() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readDouble()");
+      }
+
+      return ((StreamMessage)message).readDouble();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public float readFloat() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readFloat()");
+      }
+
+      return ((StreamMessage)message).readFloat();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readInt() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readInt()");
+      }
+
+      return ((StreamMessage)message).readInt();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public long readLong() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readLong()");
+      }
+
+      return ((StreamMessage)message).readLong();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Object readObject() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readObject()");
+      }
+
+      return ((StreamMessage)message).readObject();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public short readShort() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readShort()");
+      }
+
+      return ((StreamMessage)message).readShort();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public String readString() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readString()");
+      }
+
+      return ((StreamMessage)message).readString();
+   }
+
+   /**
+    * Reset
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void reset() throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("reset()");
+      }
+
+      ((StreamMessage)message).reset();
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBoolean(final boolean value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBoolean(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeBoolean(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeByte(final byte value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeByte(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeByte(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @param offset The offset
+    * @param length The length
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBytes(" + value + ", " + offset + ", " + length + ")");
+      }
+
+      ((StreamMessage)message).writeBytes(value, offset, length);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBytes(final byte[] value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBytes(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeBytes(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeChar(final char value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeChar(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeChar(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeDouble(final double value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeDouble(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeDouble(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeFloat(final float value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeFloat(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeFloat(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeInt(final int value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeInt(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeInt(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeLong(final long value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeLong(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeLong(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeObject(final Object value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeObject(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeObject(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeShort(final short value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeShort(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeShort(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeString(final String value) throws JMSException
+   {
+      if (ActiveMQRAStreamMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeString(" + value + ")");
+      }
+
+      ((StreamMessage)message).writeString(value);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATextMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATextMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATextMessage.java
new file mode 100644
index 0000000..f326992
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATextMessage.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.TextMessage;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRATextMessage extends ActiveMQRAMessage implements TextMessage
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRATextMessage(final TextMessage message, final ActiveMQRASession session)
+   {
+      super(message, session);
+
+      if (ActiveMQRATextMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get text
+    * @return The text
+    * @exception JMSException Thrown if an error occurs
+    */
+   public String getText() throws JMSException
+   {
+      if (ActiveMQRATextMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getText()");
+      }
+
+      return ((TextMessage)message).getText();
+   }
+
+   /**
+    * Set text
+    * @param string The text
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setText(final String string) throws JMSException
+   {
+      if (ActiveMQRATextMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setText(" + string + ")");
+      }
+
+      ((TextMessage)message).setText(string);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicPublisher.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicPublisher.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicPublisher.java
new file mode 100644
index 0000000..99062c8
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicPublisher.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+
+
+/**
+ * ActiveMQQueueSender.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRATopicPublisher extends ActiveMQRAMessageProducer implements TopicPublisher
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param producer the producer
+    * @param session the session
+    */
+   public ActiveMQRATopicPublisher(final TopicPublisher producer, final ActiveMQRASession session)
+   {
+      super(producer, session);
+
+      if (ActiveMQRATopicPublisher.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + producer + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get the topic
+    * @return The topic
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Topic getTopic() throws JMSException
+   {
+      if (ActiveMQRATopicPublisher.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTopic()");
+      }
+
+      return ((TopicPublisher)producer).getTopic();
+   }
+
+   /**
+    * Publish message
+    * @param message The message
+    * @param deliveryMode The delivery mode
+    * @param priority The priority
+    * @param timeToLive The time to live
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void publish(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this +
+                                              " message=" +
+                                              message +
+                                              " deliveryMode=" +
+                                              deliveryMode +
+                                              " priority=" +
+                                              priority +
+                                              " ttl=" +
+                                              timeToLive);
+         }
+
+         checkState();
+
+         ((TopicPublisher)producer).publish(message, deliveryMode, priority, timeToLive);
+
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Publish message
+    * @param message The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void publish(final Message message) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this + " message=" + message);
+         }
+
+         checkState();
+
+         ((TopicPublisher)producer).publish(message);
+
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Publish message
+    * @param destination The destination
+    * @param message The message
+    * @param deliveryMode The delivery mode
+    * @param priority The priority
+    * @param timeToLive The time to live
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void publish(final Topic destination,
+                       final Message message,
+                       final int deliveryMode,
+                       final int priority,
+                       final long timeToLive) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this +
+                                              " destination=" +
+                                              destination +
+                                              " message=" +
+                                              message +
+                                              " deliveryMode=" +
+                                              deliveryMode +
+                                              " priority=" +
+                                              priority +
+                                              " ttl=" +
+                                              timeToLive);
+         }
+
+         checkState();
+
+         ((TopicPublisher)producer).publish(destination, message, deliveryMode, priority, timeToLive);
+
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+
+   /**
+    * Publish message
+    * @param destination The destination
+    * @param message The message
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void publish(final Topic destination, final Message message) throws JMSException
+   {
+      session.lock();
+      try
+      {
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("send " + this + " destination=" + destination + " message=" + message);
+         }
+
+         checkState();
+
+         ((TopicPublisher)producer).publish(destination, message);
+
+         if (ActiveMQRATopicPublisher.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("sent " + this + " result=" + message);
+         }
+      }
+      finally
+      {
+         session.unlock();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicSubscriber.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicSubscriber.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicSubscriber.java
new file mode 100644
index 0000000..25087a1
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRATopicSubscriber.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+
+
+/**
+ * A wrapper for a topic subscriber
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRATopicSubscriber extends ActiveMQRAMessageConsumer implements TopicSubscriber
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param consumer the topic subscriber
+    * @param session the session
+    */
+   public ActiveMQRATopicSubscriber(final TopicSubscriber consumer, final ActiveMQRASession session)
+   {
+      super(consumer, session);
+
+      if (ActiveMQRATopicSubscriber.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + consumer + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get the no local value
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean getNoLocal() throws JMSException
+   {
+      if (ActiveMQRATopicSubscriber.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getNoLocal()");
+      }
+
+      checkState();
+      return ((TopicSubscriber)consumer).getNoLocal();
+   }
+
+   /**
+    * Get the topic
+    * @return The topic
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Topic getTopic() throws JMSException
+   {
+      if (ActiveMQRATopicSubscriber.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTopic()");
+      }
+
+      checkState();
+      return ((TopicSubscriber)consumer).getTopic();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAJMSContext.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAJMSContext.java
new file mode 100644
index 0000000..75e4fda
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAJMSContext.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import org.apache.activemq.jms.client.ActiveMQConnectionForContext;
+import org.apache.activemq.jms.client.ThreadAwareContext;
+
+import javax.jms.XAJMSContext;
+
+public class ActiveMQRAXAJMSContext extends ActiveMQRAJMSContext implements XAJMSContext
+{
+   public ActiveMQRAXAJMSContext(ActiveMQConnectionForContext connection, ThreadAwareContext threadAwareContext)
+   {
+      super(connection, threadAwareContext);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAResource.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAResource.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAResource.java
new file mode 100644
index 0000000..cd61b20
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAXAResource.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.core.client.impl.ClientSessionInternal;
+import org.apache.activemq.core.client.impl.ActiveMQXAResource;
+
+/**
+ * ActiveMQXAResource.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAXAResource implements ActiveMQXAResource
+{
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The managed connection */
+   private final ActiveMQRAManagedConnection managedConnection;
+
+   /** The resource */
+   private final XAResource xaResource;
+
+   /**
+    * Create a new ActiveMQXAResource.
+    * @param managedConnection the managed connection
+    * @param xaResource the xa resource
+    */
+   public ActiveMQRAXAResource(final ActiveMQRAManagedConnection managedConnection, final XAResource xaResource)
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + managedConnection + ", " + xaResource + ")");
+      }
+
+      this.managedConnection = managedConnection;
+      this.xaResource = xaResource;
+   }
+
+   /**
+    * Start
+    * @param xid A global transaction identifier
+    * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+    * @exception XAException An error has occurred
+    */
+   public void start(final Xid xid, final int flags) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start(" + xid + ", " + flags + ")");
+      }
+
+      managedConnection.lock();
+
+      ClientSessionInternal sessionInternal = (ClientSessionInternal) xaResource;
+      try
+      {
+         //this resets any tx stuff, we assume here that the tm and jca layer are well behaved when it comes to this
+         sessionInternal.resetIfNeeded();
+      }
+      catch (ActiveMQException e)
+      {
+         ActiveMQRALogger.LOGGER.problemResettingXASession();
+      }
+      try
+      {
+         xaResource.start(xid, flags);
+      }
+      finally
+      {
+         managedConnection.setInManagedTx(true);
+         managedConnection.unlock();
+      }
+   }
+
+   /**
+    * End
+    * @param xid A global transaction identifier
+    * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
+    * @exception XAException An error has occurred
+    */
+   public void end(final Xid xid, final int flags) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("end(" + xid + ", " + flags + ")");
+      }
+
+      managedConnection.lock();
+      try
+      {
+         xaResource.end(xid, flags);
+      }
+      finally
+      {
+         managedConnection.setInManagedTx(false);
+         managedConnection.unlock();
+      }
+   }
+
+   /**
+    * Prepare
+    * @param xid A global transaction identifier
+    * @return XA_RDONLY or XA_OK
+    * @exception XAException An error has occurred
+    */
+   public int prepare(final Xid xid) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("prepare(" + xid + ")");
+      }
+
+      return xaResource.prepare(xid);
+   }
+
+   /**
+    * Commit
+    * @param xid A global transaction identifier
+    * @param onePhase If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
+    * @exception XAException An error has occurred
+    */
+   public void commit(final Xid xid, final boolean onePhase) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("commit(" + xid + ", " + onePhase + ")");
+      }
+
+      xaResource.commit(xid, onePhase);
+   }
+
+   /**
+    * Rollback
+    * @param xid A global transaction identifier
+    * @exception XAException An error has occurred
+    */
+   public void rollback(final Xid xid) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("rollback(" + xid + ")");
+      }
+
+      xaResource.rollback(xid);
+   }
+
+   /**
+    * Forget
+    * @param xid A global transaction identifier
+    * @exception XAException An error has occurred
+    */
+   public void forget(final Xid xid) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("forget(" + xid + ")");
+      }
+
+      managedConnection.lock();
+      try
+      {
+         xaResource.forget(xid);
+      }
+      finally
+      {
+         managedConnection.setInManagedTx(true);
+         managedConnection.setInManagedTx(false);
+         managedConnection.unlock();
+      }
+   }
+
+   /**
+    * IsSameRM
+    * @param xaRes An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
+    * @return True if its the same RM instance; otherwise false.
+    * @exception XAException An error has occurred
+    */
+   public boolean isSameRM(final XAResource xaRes) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isSameRM(" + xaRes + ")");
+      }
+
+      return xaResource.isSameRM(xaRes);
+   }
+
+   /**
+    * Recover
+    * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS
+    * @return Zero or more XIDs
+    * @exception XAException An error has occurred
+    */
+   public Xid[] recover(final int flag) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("recover(" + flag + ")");
+      }
+
+      return xaResource.recover(flag);
+   }
+
+   /**
+    * Get the transaction timeout in seconds
+    * @return The transaction timeout
+    * @exception XAException An error has occurred
+    */
+   public int getTransactionTimeout() throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getTransactionTimeout()");
+      }
+
+      return xaResource.getTransactionTimeout();
+   }
+
+   /**
+    * Set the transaction timeout
+    * @param seconds The number of seconds
+    * @return True if the transaction timeout value is set successfully; otherwise false.
+    * @exception XAException An error has occurred
+    */
+   public boolean setTransactionTimeout(final int seconds) throws XAException
+   {
+      if (ActiveMQRAXAResource.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setTransactionTimeout(" + seconds + ")");
+      }
+
+      return xaResource.setTransactionTimeout(seconds);
+   }
+
+   @Override
+   public XAResource getResource()
+   {
+      return xaResource;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java
new file mode 100644
index 0000000..377e980
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java
@@ -0,0 +1,354 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.naming.Context;
+import javax.transaction.TransactionManager;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.jgroups.JChannel;
+
+/**
+ * Various utility functions
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public final class ActiveMQRaUtils
+{
+   /**
+    * Private constructor
+    */
+   private ActiveMQRaUtils()
+   {
+   }
+
+   /**
+    * Compare two strings.
+    *
+    * @param me  First value
+    * @param you Second value
+    * @return True if object equals else false.
+    */
+   public static boolean compare(final String me, final String you)
+   {
+      // If both null or intern equals
+      if (me == you)
+      {
+         return true;
+      }
+
+      // if me null and you are not
+      if (me == null)
+      {
+         return false;
+      }
+
+      // me will not be null, test for equality
+      return me.equals(you);
+   }
+
+   /**
+    * Compare two integers.
+    *
+    * @param me  First value
+    * @param you Second value
+    * @return True if object equals else false.
+    */
+   public static boolean compare(final Integer me, final Integer you)
+   {
+      // If both null or intern equals
+      if (me == you)
+      {
+         return true;
+      }
+
+      // if me null and you are not
+      if (me == null)
+      {
+         return false;
+      }
+
+      // me will not be null, test for equality
+      return me.equals(you);
+   }
+
+   /**
+    * Compare two longs.
+    *
+    * @param me  First value
+    * @param you Second value
+    * @return True if object equals else false.
+    */
+   public static boolean compare(final Long me, final Long you)
+   {
+      // If both null or intern equals
+      if (me == you)
+      {
+         return true;
+      }
+
+      // if me null and you are not
+      if (me == null)
+      {
+         return false;
+      }
+
+      // me will not be null, test for equality
+      return me.equals(you);
+   }
+
+   /**
+    * Compare two doubles.
+    *
+    * @param me  First value
+    * @param you Second value
+    * @return True if object equals else false.
+    */
+   public static boolean compare(final Double me, final Double you)
+   {
+      // If both null or intern equals
+      if (me == you)
+      {
+         return true;
+      }
+
+      // if me null and you are not
+      if (me == null)
+      {
+         return false;
+      }
+
+      // me will not be null, test for equality
+      return me.equals(you);
+   }
+
+   /**
+    * Compare two booleans.
+    *
+    * @param me  First value
+    * @param you Second value
+    * @return True if object equals else false.
+    */
+   public static boolean compare(final Boolean me, final Boolean you)
+   {
+      // If both null or intern equals
+      if (me == you)
+      {
+         return true;
+      }
+
+      // if me null and you are not
+      if (me == null)
+      {
+         return false;
+      }
+
+      // me will not be null, test for equality
+      return me.equals(you);
+   }
+
+   /**
+    * Lookup an object in the default initial context
+    *
+    * @param context The context to use
+    * @param name    the name to lookup
+    * @param clazz   the expected type
+    * @return the object
+    * @throws Exception for any error
+    */
+   public static Object lookup(final Context context, final String name, final Class<?> clazz) throws Exception
+   {
+      return context.lookup(name);
+   }
+
+   /**
+    * Used on parsing JNDI Configuration
+    *
+    * @param config
+    * @return hash-table with configuration option pairs
+    */
+   public static Hashtable<String, String> parseHashtableConfig(final String config)
+   {
+      Hashtable<String, String> hashtable = new Hashtable<String, String>();
+
+      String[] topElements = config.split(";");
+
+      for (String element : topElements)
+      {
+         String[] expression = element.split("=");
+
+         if (expression.length != 2)
+         {
+            throw new IllegalArgumentException("Invalid expression " + element + " at " + config);
+         }
+
+         hashtable.put(expression[0].trim(), expression[1].trim());
+      }
+
+      return hashtable;
+   }
+
+   public static List<Map<String, Object>> parseConfig(final String config)
+   {
+      List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
+
+      String[] topElements = config.split(",");
+
+      for (String topElement : topElements)
+      {
+         HashMap<String, Object> map = new HashMap<String, Object>();
+         result.add(map);
+
+         String[] elements = topElement.split(";");
+
+         for (String element : elements)
+         {
+            String[] expression = element.split("=");
+
+            if (expression.length != 2)
+            {
+               throw new IllegalArgumentException("Invalid expression " + element + " at " + config);
+            }
+
+            map.put(expression[0].trim(), expression[1].trim());
+         }
+      }
+
+
+      return result;
+   }
+
+   public static List<String> parseConnectorConnectorConfig(String config)
+   {
+      List<String> res = new ArrayList<String>();
+
+      String[] elements = config.split(",");
+
+      for (String element : elements)
+      {
+         res.add(element.trim());
+      }
+
+      return res;
+   }
+
+
+   /**
+    * The Resource adapter can't depend on any provider's specific library. Because of that we use reflection to locate the
+    * transaction manager during startup.
+    * <p/>
+    * <p/>
+    * TODO: https://jira.jboss.org/browse/HORNETQ-417
+    * We should use a proper SPI instead of reflection
+    * We would need to define a proper SPI package for this.
+    */
+   public static TransactionManager locateTM(final String locatorClass, final String locatorMethod)
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<TransactionManager>()
+      {
+         public TransactionManager run()
+         {
+            try
+            {
+               ClassLoader loader = Thread.currentThread().getContextClassLoader();
+               Class<?> aClass = loader.loadClass(locatorClass);
+               Object o = aClass.newInstance();
+               Method m = aClass.getMethod(locatorMethod);
+               return (TransactionManager) m.invoke(o);
+            }
+            catch (Throwable e)
+            {
+               ActiveMQRALogger.LOGGER.debug(e.getMessage(), e);
+               return null;
+            }
+         }
+      });
+   }
+
+   /**
+    * Within AS7 the RA is loaded by JCA. properties can only be passed in String form. However if
+    * RA is configured using jgroups stack, we need to pass a Channel object. As is impossible with
+    * JCA, we use this method to allow a JChannel object to be located.
+    */
+   public static JChannel locateJGroupsChannel(final String locatorClass, final String name)
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<JChannel>()
+      {
+         public JChannel run()
+         {
+            try
+            {
+               ClassLoader loader = Thread.currentThread().getContextClassLoader();
+               Class<?> aClass = loader.loadClass(locatorClass);
+               Object o = aClass.newInstance();
+               Method m = aClass.getMethod("locateChannel", new Class[]{String.class});
+               return (JChannel) m.invoke(o, name);
+            }
+            catch (Throwable e)
+            {
+               ActiveMQRALogger.LOGGER.debug(e.getMessage(), e);
+               return null;
+            }
+         }
+      });
+   }
+
+   /**
+    * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+    * utility class, as it would be a door to load anything you like in a safe VM.
+    * For that reason any class trying to do a privileged block should do with the AccessController directly.
+    */
+   private static Object safeInitNewInstance(final String className)
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<Object>()
+      {
+         public Object run()
+         {
+            ClassLoader loader = getClass().getClassLoader();
+            try
+            {
+               Class<?> clazz = loader.loadClass(className);
+               return clazz.newInstance();
+            }
+            catch (Throwable t)
+            {
+               try
+               {
+                  loader = Thread.currentThread().getContextClassLoader();
+                  if (loader != null)
+                     return loader.loadClass(className).newInstance();
+               }
+               catch (RuntimeException e)
+               {
+                  throw e;
+               }
+               catch (Exception e)
+               {
+               }
+
+               throw new IllegalArgumentException("Could not find class " + className);
+            }
+         }
+      });
+   }
+
+
+}


[07/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationEndpoint.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationEndpoint.java b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationEndpoint.java
index a65ac05..2914448 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationEndpoint.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationEndpoint.java
@@ -50,7 +50,7 @@ import org.apache.activemq.core.protocol.core.ChannelHandler;
 import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.core.protocol.core.impl.wireformat.BackupReplicationStartFailedMessage;
-import org.apache.activemq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
@@ -68,12 +68,12 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationStartSy
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationStartSyncMessage.SyncDataType;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
 import org.apache.activemq.core.replication.ReplicationManager.ADD_OPERATION_TYPE;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.cluster.qourum.SharedNothingBackupQuorum;
-import org.apache.activemq.core.server.impl.HornetQServerImpl;
+import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.core.server.impl.SharedNothingBackupActivation;
 
 /**
@@ -82,12 +82,12 @@ import org.apache.activemq.core.server.impl.SharedNothingBackupActivation;
  *
  * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
  */
-public final class ReplicationEndpoint implements ChannelHandler, HornetQComponent
+public final class ReplicationEndpoint implements ChannelHandler, ActiveMQComponent
 {
-   private static final boolean trace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private static final boolean trace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final IOCriticalErrorListener criticalErrorListener;
-   private final HornetQServerImpl server;
+   private final ActiveMQServerImpl server;
    private final boolean wantedFailBack;
    private final SharedNothingBackupActivation activation;
    private final boolean noSync = false;
@@ -126,7 +126,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
    private Executor executor;
 
    // Constructors --------------------------------------------------
-   public ReplicationEndpoint(final HornetQServerImpl server, IOCriticalErrorListener criticalErrorListener,
+   public ReplicationEndpoint(final ActiveMQServerImpl server, IOCriticalErrorListener criticalErrorListener,
                               boolean wantedFailBack, SharedNothingBackupActivation activation)
    {
       this.server = server;
@@ -231,19 +231,19 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
          }
          else
          {
-            HornetQServerLogger.LOGGER.invalidPacketForReplication(packet);
+            ActiveMQServerLogger.LOGGER.invalidPacketForReplication(packet);
          }
       }
       catch (ActiveMQException e)
       {
-         HornetQServerLogger.LOGGER.errorHandlingReplicationPacket(e, packet);
-         response = new HornetQExceptionMessage(e);
+         ActiveMQServerLogger.LOGGER.errorHandlingReplicationPacket(e, packet);
+         response = new ActiveMQExceptionMessage(e);
       }
       catch (Exception e)
       {
-         HornetQServerLogger.LOGGER.errorHandlingReplicationPacket(e, packet);
+         ActiveMQServerLogger.LOGGER.errorHandlingReplicationPacket(e, packet);
          response =
-            new HornetQExceptionMessage(HornetQMessageBundle.BUNDLE.replicationUnhandledError(e));
+            new ActiveMQExceptionMessage(ActiveMQMessageBundle.BUNDLE.replicationUnhandledError(e));
       }
       channel.send(response);
    }
@@ -253,7 +253,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
     */
    private void handleFatalError(BackupReplicationStartFailedMessage packet)
    {
-      HornetQServerLogger.LOGGER.errorStartingReplication(packet.getRegistrationProblem());
+      ActiveMQServerLogger.LOGGER.errorStartingReplication(packet.getRegistrationProblem());
       server.stopTheServer(false);
    }
 
@@ -359,7 +359,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
             }
             catch (Exception e)
             {
-               HornetQServerLogger.LOGGER.errorClosingPageOnReplication(e);
+               ActiveMQServerLogger.LOGGER.errorClosingPageOnReplication(e);
             }
          }
       }
@@ -399,20 +399,20 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
    {
       if (!activation.isRemoteBackupUpToDate())
       {
-         throw HornetQMessageBundle.BUNDLE.journalsNotInSync();
+         throw ActiveMQMessageBundle.BUNDLE.journalsNotInSync();
       }
 
       if (journalLoadInformation == null || journalLoadInformation.length != journalInformation.length)
       {
-         throw HornetQMessageBundle.BUNDLE.replicationTooManyJournals();
+         throw ActiveMQMessageBundle.BUNDLE.replicationTooManyJournals();
       }
 
       for (int i = 0; i < journalInformation.length; i++)
       {
          if (!journalInformation[i].equals(journalLoadInformation[i]))
          {
-            HornetQServerLogger.LOGGER.journalcomparisonMismatch(journalParametersToString(journalInformation));
-            throw HornetQMessageBundle.BUNDLE.replicationTooManyJournals();
+            ActiveMQServerLogger.LOGGER.journalcomparisonMismatch(journalParametersToString(journalInformation));
+            throw ActiveMQMessageBundle.BUNDLE.replicationTooManyJournals();
          }
       }
 
@@ -485,7 +485,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
       journalsHolder = null;
       backupQuorum.liveIDSet(liveID);
       activation.setRemoteBackupUpToDate();
-      HornetQServerLogger.LOGGER.backupServerSynched(server);
+      ActiveMQServerLogger.LOGGER.backupServerSynched(server);
       return;
    }
 
@@ -507,7 +507,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
             ReplicatedLargeMessage largeMessage = lookupLargeMessage(id, false);
             if (!(largeMessage instanceof LargeServerMessageInSync))
             {
-               HornetQServerLogger.LOGGER.largeMessageIncompatible();
+               ActiveMQServerLogger.LOGGER.largeMessageIncompatible();
                return;
             }
             LargeServerMessageInSync largeMessageInSync = (LargeServerMessageInSync) largeMessage;
@@ -533,7 +533,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
             return;
          }
          default:
-            throw HornetQMessageBundle.BUNDLE.replicationUnhandledFileType(msg.getFileType());
+            throw ActiveMQMessageBundle.BUNDLE.replicationUnhandledFileType(msg.getFileType());
       }
 
       if (data == null)
@@ -560,7 +560,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
    {
       if (activation.isRemoteBackupUpToDate())
       {
-         throw HornetQMessageBundle.BUNDLE.replicationBackupUpToDate();
+         throw ActiveMQMessageBundle.BUNDLE.replicationBackupUpToDate();
       }
 
 
@@ -587,7 +587,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
             case JournalMessages:
                if (wantedFailBack && !packet.isServerToFailBack())
                {
-                  HornetQServerLogger.LOGGER.autoFailBackDenied();
+                  ActiveMQServerLogger.LOGGER.autoFailBackDenied();
                }
 
                final JournalContent journalContent = SyncDataType.getJournalContentType(packet.getDataType());
@@ -609,7 +609,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
                registerJournal(journalContent.typeByte, syncJournal);
                break;
             default:
-               throw HornetQMessageBundle.BUNDLE.replicationUnhandledDataType();
+               throw ActiveMQMessageBundle.BUNDLE.replicationUnhandledDataType();
          }
       }
    }
@@ -630,7 +630,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
                }
                catch (Exception e)
                {
-                  HornetQServerLogger.LOGGER.errorDeletingLargeMessage(e, packet.getMessageId());
+                  ActiveMQServerLogger.LOGGER.errorDeletingLargeMessage(e, packet.getMessageId());
                }
             }
          });
@@ -663,7 +663,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
          if (message == null)
          {
             // No warnings if it's a delete, as duplicate deletes may be sent repeatedly.
-            HornetQServerLogger.LOGGER.largeMessageNotAvailable(messageId);
+            ActiveMQServerLogger.LOGGER.largeMessageNotAvailable(messageId);
          }
       }
 
@@ -679,7 +679,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
    {
       final long id = packet.getMessageId();
       createLargeMessage(id, false);
-      HornetQServerLogger.LOGGER.trace("Receiving Large Message " + id + " on backup");
+      ActiveMQServerLogger.LOGGER.trace("Receiving Large Message " + id + " on backup");
    }
 
    private void createLargeMessage(final long id, boolean liveToBackupSync)
@@ -777,7 +777,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
       {
          if (ReplicationEndpoint.trace)
          {
-            HornetQServerLogger.LOGGER.trace("Endpoint appendUpdate id = " + packet.getId());
+            ActiveMQServerLogger.LOGGER.trace("Endpoint appendUpdate id = " + packet.getId());
          }
          journalToUse.appendUpdateRecord(packet.getId(), packet.getJournalRecordType(), packet.getRecordData(), noSync);
       }
@@ -785,7 +785,7 @@ public final class ReplicationEndpoint implements ChannelHandler, HornetQCompone
       {
          if (ReplicationEndpoint.trace)
          {
-            HornetQServerLogger.LOGGER.trace("Endpoint append id = " + packet.getId());
+            ActiveMQServerLogger.LOGGER.trace("Endpoint append id = " + packet.getId());
          }
          journalToUse.appendAddRecord(packet.getId(), packet.getJournalRecordType(), packet.getRecordData(), noSync);
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationManager.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationManager.java b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationManager.java
index ced14b1..8dbe0c8 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationManager.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/replication/ReplicationManager.java
@@ -56,8 +56,8 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationPageWri
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationPrepareMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationStartSyncMessage;
 import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
-import org.apache.activemq.core.server.HornetQComponent;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQComponent;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.utils.ExecutorFactory;
 
@@ -70,7 +70,7 @@ import org.apache.activemq.utils.ExecutorFactory;
  * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
  * @see ReplicationEndpoint
  */
-public final class ReplicationManager implements HornetQComponent
+public final class ReplicationManager implements ActiveMQComponent
 {
    public enum ADD_OPERATION_TYPE
    {
@@ -323,7 +323,7 @@ public final class ReplicationManager implements HornetQComponent
             }
             catch (Throwable e)
             {
-               HornetQServerLogger.LOGGER.errorCompletingCallbackOnReplicationManager(e);
+               ActiveMQServerLogger.LOGGER.errorCompletingCallbackOnReplicationManager(e);
             }
          }
       }
@@ -417,11 +417,11 @@ public final class ReplicationManager implements HornetQComponent
          if (me.getType() == ActiveMQExceptionType.DISCONNECTED)
          {
             // Backup has shut down - no need to log a stack trace
-            HornetQServerLogger.LOGGER.replicationStopOnBackupShutdown();
+            ActiveMQServerLogger.LOGGER.replicationStopOnBackupShutdown();
          }
          else
          {
-            HornetQServerLogger.LOGGER.replicationStopOnBackupFail(me);
+            ActiveMQServerLogger.LOGGER.replicationStopOnBackupFail(me);
          }
 
          try
@@ -430,7 +430,7 @@ public final class ReplicationManager implements HornetQComponent
          }
          catch (Exception e)
          {
-            HornetQServerLogger.LOGGER.errorStoppingReplication(e);
+            ActiveMQServerLogger.LOGGER.errorStoppingReplication(e);
          }
       }
 
@@ -490,7 +490,7 @@ public final class ReplicationManager implements HornetQComponent
       SequentialFile file = jf.getFile().cloneFile();
       try
       {
-         HornetQServerLogger.LOGGER.journalSynch(jf, file.size(), file);
+         ActiveMQServerLogger.LOGGER.journalSynch(jf, file.size(), file);
          sendLargeFile(content, null, jf.getFileID(), file, Long.MAX_VALUE);
       }
       finally
@@ -543,7 +543,7 @@ public final class ReplicationManager implements HornetQComponent
             {
                // We can afford having a single buffer here for this entire loop
                // because sendReplicatePacket will encode the packet as a NettyBuffer
-               // through HornetQBuffer class leaving this buffer free to be reused on the next copy
+               // through ActiveMQBuffer class leaving this buffer free to be reused on the next copy
                final ByteBuffer buffer = ByteBuffer.allocate(1 << 17); // 1 << 17 == 131072 == 128 * 1024
                while (true)
                {
@@ -646,10 +646,10 @@ public final class ReplicationManager implements HornetQComponent
     */
    public OperationContext sendLiveIsStopping(final LiveStopping finalMessage)
    {
-      HornetQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " enabled=" + enabled);
+      ActiveMQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " enabled=" + enabled);
       if (enabled)
       {
-         HornetQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " " + enabled);
+         ActiveMQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " " + enabled);
          return sendReplicatePacket(new ReplicationLiveIsStoppingMessage(finalMessage));
       }
       return null;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/security/impl/SecurityStoreImpl.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/security/impl/SecurityStoreImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/security/impl/SecurityStoreImpl.java
index 2fbc96f..cfe144a 100644
--- a/activemq-server/src/main/java/org/apache/activemq/core/security/impl/SecurityStoreImpl.java
+++ b/activemq-server/src/main/java/org/apache/activemq/core/security/impl/SecurityStoreImpl.java
@@ -22,19 +22,19 @@ import org.apache.activemq.api.core.management.ManagementHelper;
 import org.apache.activemq.core.security.CheckType;
 import org.apache.activemq.core.security.Role;
 import org.apache.activemq.core.security.SecurityStore;
-import org.apache.activemq.core.server.HornetQMessageBundle;
-import org.apache.activemq.core.server.HornetQServerLogger;
+import org.apache.activemq.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.core.server.ActiveMQServerLogger;
 import org.apache.activemq.core.server.ServerSession;
 import org.apache.activemq.core.server.management.Notification;
 import org.apache.activemq.core.server.management.NotificationService;
 import org.apache.activemq.core.settings.HierarchicalRepository;
 import org.apache.activemq.core.settings.HierarchicalRepositoryChangeListener;
-import org.apache.activemq.spi.core.security.HornetQSecurityManager;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.utils.ConcurrentHashSet;
 import org.apache.activemq.utils.TypedProperties;
 
 /**
- * The HornetQ SecurityStore implementation
+ * The ActiveMQ SecurityStore implementation
  *
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
  * @author <a href="ataylor@redhat.com">Andy Taylor</a>
@@ -51,11 +51,11 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
 
    // Attributes ----------------------------------------------------
 
-   private final boolean trace = HornetQServerLogger.LOGGER.isTraceEnabled();
+   private final boolean trace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final HierarchicalRepository<Set<Role>> securityRepository;
 
-   private final HornetQSecurityManager securityManager;
+   private final ActiveMQSecurityManager securityManager;
 
    private final ConcurrentMap<String, ConcurrentHashSet<SimpleString>> cache = new ConcurrentHashMap<String, ConcurrentHashSet<SimpleString>>();
 
@@ -77,7 +77,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
     * @param notificationService can be <code>null</code>
     */
    public SecurityStoreImpl(final HierarchicalRepository<Set<Role>> securityRepository,
-                            final HornetQSecurityManager securityManager,
+                            final ActiveMQSecurityManager securityManager,
                             final long invalidationInterval,
                             final boolean securityEnabled,
                             final String managementClusterUser,
@@ -116,7 +116,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
          {
             if (trace)
             {
-               HornetQServerLogger.LOGGER.trace("Authenticating cluster admin user");
+               ActiveMQServerLogger.LOGGER.trace("Authenticating cluster admin user");
             }
 
             /*
@@ -125,7 +125,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
              */
             if (!managementClusterPassword.equals(password))
             {
-               throw HornetQMessageBundle.BUNDLE.unableToValidateClusterUser(user);
+               throw ActiveMQMessageBundle.BUNDLE.unableToValidateClusterUser(user);
             }
             else
             {
@@ -146,7 +146,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
                notificationService.sendNotification(notification);
             }
 
-            throw HornetQMessageBundle.BUNDLE.unableToValidateUser(user);
+            throw ActiveMQMessageBundle.BUNDLE.unableToValidateUser(user);
          }
       }
    }
@@ -157,7 +157,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
       {
          if (trace)
          {
-            HornetQServerLogger.LOGGER.trace("checking access permissions to " + address);
+            ActiveMQServerLogger.LOGGER.trace("checking access permissions to " + address);
          }
 
          String user = session.getUsername();
@@ -192,7 +192,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
                notificationService.sendNotification(notification);
             }
 
-            throw HornetQMessageBundle.BUNDLE.userNoPermissions(session.getUsername(), checkType, saddress);
+            throw ActiveMQMessageBundle.BUNDLE.userNoPermissions(session.getUsername(), checkType, saddress);
          }
          // if we get here we're granted, add to the cache
          ConcurrentHashSet<SimpleString> set = new ConcurrentHashSet<SimpleString>();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQMessageBundle.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQMessageBundle.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQMessageBundle.java
new file mode 100644
index 0000000..14270a7
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQMessageBundle.java
@@ -0,0 +1,371 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.core.server;
+
+import org.apache.activemq.api.core.ActiveMQAddressFullException;
+import org.apache.activemq.api.core.ActiveMQClusterSecurityException;
+import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
+import org.apache.activemq.api.core.ActiveMQDisconnectedException;
+import org.apache.activemq.api.core.ActiveMQDuplicateMetaDataException;
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.api.core.ActiveMQIOErrorException;
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.apache.activemq.api.core.ActiveMQIncompatibleClientServerException;
+import org.apache.activemq.api.core.ActiveMQInternalErrorException;
+import org.apache.activemq.api.core.ActiveMQInvalidFilterExpressionException;
+import org.apache.activemq.api.core.ActiveMQInvalidTransientQueueUseException;
+import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
+import org.apache.activemq.api.core.ActiveMQQueueExistsException;
+import org.apache.activemq.api.core.ActiveMQSecurityException;
+import org.apache.activemq.api.core.ActiveMQSessionCreationException;
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.postoffice.Binding;
+import org.apache.activemq.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
+import org.apache.activemq.core.security.CheckType;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+import java.io.File;
+
+/**
+ * Logger Code 11
+ * <p/>
+ * Each message id must be 6 digits long starting with 10, the 3rd digit should be 9. So the range
+ * is from 119000 to 119999.
+ * <p/>
+ * Once released, methods should not be deleted as they may be referenced by knowledge base
+ * articles. Unused methods should be marked as deprecated.
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQMessageBundle
+{
+   ActiveMQMessageBundle BUNDLE = Messages.getBundle(ActiveMQMessageBundle.class);
+
+   @Message(id = 119000, value = "Activation for server {0}", format = Message.Format.MESSAGE_FORMAT)
+   String activationForServer(ActiveMQServer server);
+
+   @Message(id = 119001, value = "Generating thread dump because - {0}", format = Message.Format.MESSAGE_FORMAT)
+   String generatingThreadDump(String reason);
+
+   @Message(id = 119002, value = "Thread {0} name = {1} id = {2} group = {3}", format = Message.Format.MESSAGE_FORMAT)
+   String threadDump(Thread key, String name, Long id, ThreadGroup threadGroup);
+
+   @Message(id = 119003, value = "End Thread dump", format = Message.Format.MESSAGE_FORMAT)
+   String endThreadDump();
+
+   @Message(id = 119004, value = "Information about server {0}\nCluster Connection:{1}", format = Message.Format.MESSAGE_FORMAT)
+   String serverDescribe(String identity, String describe);
+
+   @Message(id = 119005, value = "connections for {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException connectionsClosedByManagement(String ipAddress);
+
+   @Message(id = 119006, value = "journals are not JournalImpl. You can''t set a replicator!", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException notJournalImpl();
+
+   @Message(id = 119007, value = "unhandled error during replication", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException replicationUnhandledError(@Cause Exception e);
+
+   @Message(id = 119008, value = "Live Node contains more journals than the backup node. Probably a version match error", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException replicationTooManyJournals();
+
+   @Message(id = 119009, value = "Unhandled file type {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException replicationUnhandledFileType(ReplicationSyncFileMessage.FileType fileType);
+
+   @Message(id = 119010, value = "Remote Backup can not be up-to-date!", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException replicationBackupUpToDate();
+
+   @Message(id = 119011, value = "unhandled data type!", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException replicationUnhandledDataType();
+
+   @Message(id = 119012, value = "No binding for divert {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException noBindingForDivert(SimpleString name);
+
+   @Message(id = 119013, value = "Binding {0} is not a divert", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException bindingNotDivert(SimpleString name);
+
+   @Message(id = 119014,
+            value = "Did not receive data from {0}. It is likely the client has exited or crashed without "
+               +
+               "closing its connection, or the network between the server and client has failed. " +
+               "You also might have configured connection-ttl and client-failure-check-period incorrectly. " +
+               "Please check user manual for more information." +
+               " The connection will now be closed.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQConnectionTimedOutException clientExited(String remoteAddress);
+
+   @Message(id = 119015, value = "Timeout on waiting I/O completion", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIOErrorException ioTimeout();
+
+   @Message(id = 119016, value = "queue {0} has been removed cannot deliver message, queues should not be removed when grouping is used", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNonExistentQueueException groupingQueueRemoved(SimpleString chosenClusterName);
+
+   @Message(id = 119017, value = "Queue {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQNonExistentQueueException noSuchQueue(SimpleString queueName);
+
+   @Message(id = 119018, value = "Binding already exists {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQQueueExistsException bindingAlreadyExists(Binding binding);
+
+   @Message(id = 119019, value = "Queue already exists {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQQueueExistsException queueAlreadyExists(SimpleString queueName);
+
+   @Message(id = 119020, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
+
+   @Message(id = 119021, value = "MessageId was not assigned to Message", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException messageIdNotAssigned();
+
+   @Message(id = 119022, value = "Cannot compare journals if not in sync!", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException journalsNotInSync();
+
+   @Message(id = 119023, value = "Connected server is not a backup server", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException serverNotBackupServer();
+
+   @Message(id = 119024, value = "Backup replication server is already connected to another server", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException alreadyHaveReplicationServer();
+
+   @Message(id = 119025, value = "Cannot delete queue {0} on binding {1} - it has consumers = {2}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException cannotDeleteQueue(SimpleString name, SimpleString queueName, String s);
+
+   @Message(id = 119026, value = "Backup Server was not yet in sync with live", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException backupServerNotInSync();
+
+   @Message(id = 119027, value = "Could not find reference on consumer ID={0}, messageId = {1} queue = {2}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException consumerNoReference(Long id, Long messageID, SimpleString name);
+
+   @Message(id = 119028, value = "Consumer {0} doesn''t exist on the server", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException consumerDoesntExist(long consumerID);
+
+   @Message(id = 119029, value = "No address configured on the Server''s Session", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException noAddress();
+
+   @Message(id = 119030, value = "large-message not initialized on server", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException largeMessageNotInitialised();
+
+   @Message(id = 119031, value = "Unable to validate user: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQSecurityException unableToValidateUser(String user);
+
+   @Message(id = 119032, value = "User: {0} does not have permission=''{1}'' on address {2}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQSecurityException userNoPermissions(String username, CheckType checkType, String saddress);
+
+   @Message(id = 119033, value = "Server and client versions incompatible", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIncompatibleClientServerException incompatibleClientServer();
+
+   @Message(id = 119034, value = "Server not started", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQSessionCreationException serverNotStarted();
+
+   @Message(id = 119035, value = "Metadata {0}={1} had been set already", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQDuplicateMetaDataException duplicateMetadata(String key, String data);
+
+   @Message(id = 119036, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidType(Object type);
+
+   @Message(id = 119037, value = "retry interval must be positive, was {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidRetryInterval(Long size);
+
+   @Message(id = 119038, value = "{0} must neither be null nor empty", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException emptyOrNull(String name);
+
+   @Message(id = 119039, value = "{0}  must be greater than 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException greaterThanZero(String name, Number val);
+
+   @Message(id = 119040, value = "{0} must be a valid percentual value between 0 and 100 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException notPercent(String name, Number val);
+
+   @Message(id = 119041, value = "{0}  must be equals to -1 or greater than 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException greaterThanMinusOne(String name, Number val);
+
+   @Message(id = 119042, value = "{0}  must be equals to -1 or greater or equals to 0 (actual value: {1})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException greaterThanZeroOrMinusOne(String name, Number val);
+
+   @Message(id = 119043, value = "{0} must be between {1} and {2} inclusive (actual value: {3})", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException mustbeBetween(String name, Integer minPriority, Integer maxPriority, Object value);
+
+   @Message(id = 119044, value = "Invalid journal type {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidJournalType(String val);
+
+   @Message(id = 119045, value = "Invalid address full message policy type {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidAddressFullPolicyType(String val);
+
+   @Message(id = 119046, value = "invalid value: {0} count must be greater than 0", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException greaterThanZero(Integer count);
+
+   @Message(id = 119047, value = "Cannot set Message Counter Sample Period < {0}ms", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidMessageCounterPeriod(Long period);
+
+   @Message(id = 119048, value = "invalid new Priority value: {0}. It must be between 0 and 9 (both included)", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidNewPriority(Integer period);
+
+   @Message(id = 119049, value = "No queue found for {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noQueueFound(String otherQueueName);
+
+   @Message(id = 119050, value = "Only NIO and AsyncIO are supported journals", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidJournal();
+
+   @Message(id = 119051, value = "Invalid journal type {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidJournalType2(JournalType journalType);
+
+   @Message(id = 119052, value = "Directory {0} does not exist and cannot be created", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException cannotCreateDir(String dir);
+
+   @Message(id = 119053, value = "Invalid index {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidIndex(Integer index);
+
+   @Message(id = 119054, value = "Cannot convert to int", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException cannotConvertToInt();
+
+   @Message(id = 119055, value = "Routing name is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException routeNameIsNull();
+
+   @Message(id = 119056, value = "Cluster name is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException clusterNameIsNull();
+
+   @Message(id = 119057, value = "Address is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException addressIsNull();
+
+   @Message(id = 119058, value = "Binding type not specified", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException bindingTypeNotSpecified();
+
+   @Message(id = 119059, value = "Binding ID is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException bindingIdNotSpecified();
+
+   @Message(id = 119060, value = "Distance is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException distancenotSpecified();
+
+   @Message(id = 119061, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException connectionExists(Object id);
+
+   @Message(id = 119062, value = "Acceptor with id {0} already registered", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException acceptorExists(Integer id);
+
+   @Message(id = 119063, value = "Acceptor with id {0} not registered", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException acceptorNotExists(Integer id);
+
+   @Message(id = 119064, value = "Unknown protocol {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException unknownProtocol(String protocol);
+
+   @Message(id = 119065, value = "node id is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nodeIdNull();
+
+   @Message(id = 119066, value = "Queue name is null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException queueNameIsNull();
+
+   @Message(id = 119067, value = "Cannot find resource with name {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException cannotFindResource(String resourceName);
+
+   @Message(id = 119068, value = "no getter method for {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noGetterMethod(String resourceName);
+
+   @Message(id = 119069, value = "no operation {0}/{1}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noOperation(String operation, Integer length);
+
+   @Message(id = 119070, value = "match can not be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullMatch();
+
+   @Message(id = 119071, value = "# can only be at end of match", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidMatch();
+
+   @Message(id = 119072, value = "User cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullUser();
+
+   @Message(id = 119073, value = "Password cannot be null", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException nullPassword();
+
+   @Message(id = 119074, value = "Error instantiating transformer class {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException errorCreatingTransformerClass(@Cause Exception e, String transformerClassName);
+
+   @Message(id = 119075, value = "method autoEncode doesn''t know how to convert {0} yet", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException autoConvertError(Class<? extends Object> aClass);
+
+   /**
+    * Message used on on {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
+    */
+   @Message(id = 119076, value = "Executing destroyConnection with {0}={1} through management''s request", format = Message.Format.MESSAGE_FORMAT)
+   String destroyConnectionWithSessionMetadataHeader(String key, String value);
+
+   /**
+    * Message used on on {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
+    */
+   @Message(id = 119077, value = "Closing connection {0}", format = Message.Format.MESSAGE_FORMAT)
+   String destroyConnectionWithSessionMetadataClosingConnection(String serverSessionString);
+
+   /**
+    * Exception used on on {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
+    */
+   @Message(id = 119078, value = "Disconnected per admin''s request on {0}={1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQDisconnectedException destroyConnectionWithSessionMetadataSendException(String key, String value);
+
+   /**
+    * Message used on on {@link org.apache.activemq.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)}
+    */
+   @Message(id = 119079, value = "No session found with {0}={1}", format = Message.Format.MESSAGE_FORMAT)
+   String destroyConnectionWithSessionMetadataNoSessionFound(String key, String value);
+
+   @Message(id = 119080, value = "Invalid Page IO, PagingManager was stopped or closed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException invalidPageIO();
+
+   @Message(id = 119081, value = "No Discovery Group configuration named {0} found", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQException noDiscoveryGroupFound(DiscoveryGroupConfiguration dg);
+
+   @Message(id = 119082, value = "Queue {0} already exists on another subscription", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInvalidTransientQueueUseException queueSubscriptionBelongsToDifferentAddress(SimpleString queueName);
+
+   @Message(id = 119083, value = "Queue {0} has a different filter than requested", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInvalidTransientQueueUseException queueSubscriptionBelongsToDifferentFilter(SimpleString queueName);
+
+   @Message(id = 119085, value = "Classpath lacks a protocol-manager for protocol {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQException noProtocolManagerFound(String protocol);
+
+   // this code has to match with version 2.3.x as it's used on integration tests at Wildfly and JBoss EAP
+   @Message(id = 119099, value = "Unable to authenticate cluster user: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQClusterSecurityException unableToValidateClusterUser(String user);
+
+
+   @Message(id = 119100, value = "Trying to move a journal file that refers to a file instead of a directory: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException journalDirIsFile(File fDir);
+
+   @Message(id = 119101, value = "error trying to backup journal files at directory: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   IllegalStateException couldNotMoveJournal(File dir);
+
+   @Message(id = 119102, value = "Address \"{0}\" is full.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAddressFullException addressIsFull(String addressName);
+
+   @Message(id = 119103, value = "No Connectors or Discovery Groups configured for Scale Down", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQException noConfigurationFoundForScaleDown();
+
+   @Message(id = 119104, value = "Server is stopping. Message grouping not allowed", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQException groupWhileStopping();
+
+   @Message(id = 119105, value = "Server will not accept create session request since scale down has not occurred", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQSessionCreationException sessionNotFailedOver();
+
+   @Message(id = 119106, value = "Invalid slow consumer policy type {0}", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException invalidSlowConsumerPolicyType(String val);
+
+   @Message(id = 119107, value = "consumer connections for address {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException consumerConnectionsClosedByManagement(String address);
+
+   @Message(id = 119108, value = "connections for user {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInternalErrorException connectionsForUserClosedByManagement(String userName);
+
+   @Message(id = 119109, value = "unsupported HA Policy Configuration {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException unsupportedHAPolicyConfiguration(Object o);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServer.java b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServer.java
new file mode 100644
index 0000000..438203e
--- /dev/null
+++ b/activemq-server/src/main/java/org/apache/activemq/core/server/ActiveMQServer.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.server;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.core.config.BridgeConfiguration;
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.config.DivertConfiguration;
+import org.apache.activemq.core.management.impl.ActiveMQServerControlImpl;
+import org.apache.activemq.core.paging.PagingManager;
+import org.apache.activemq.core.persistence.StorageManager;
+import org.apache.activemq.core.postoffice.PostOffice;
+import org.apache.activemq.core.remoting.server.RemotingService;
+import org.apache.activemq.core.replication.ReplicationManager;
+import org.apache.activemq.core.security.Role;
+import org.apache.activemq.core.security.SecurityStore;
+import org.apache.activemq.core.server.cluster.ClusterManager;
+import org.apache.activemq.core.server.cluster.ha.HAPolicy;
+import org.apache.activemq.core.server.group.GroupingHandler;
+import org.apache.activemq.core.server.impl.Activation;
+import org.apache.activemq.core.server.impl.ConnectorsService;
+import org.apache.activemq.core.server.management.ManagementService;
+import org.apache.activemq.core.settings.HierarchicalRepository;
+import org.apache.activemq.core.settings.impl.AddressSettings;
+import org.apache.activemq.core.transaction.ResourceManager;
+import org.apache.activemq.core.version.Version;
+import org.apache.activemq.spi.core.protocol.ProtocolManagerFactory;
+import org.apache.activemq.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.spi.core.protocol.SessionCallback;
+import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
+import org.apache.activemq.utils.ExecutorFactory;
+
+/**
+ * This interface defines the internal interface of the ActiveMQ Server exposed to other components
+ * of the server.
+ * <p>
+ * This is not part of our public API.
+ * @author <a href="tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="ataylor@redhat.com">Andy Taylor</a>
+ */
+public interface ActiveMQServer extends ActiveMQComponent
+{
+
+   /**
+    * Sets the server identity.
+    * <p>
+    * The identity will be exposed on logs. It may help to debug issues on the log traces and
+    * debugs.
+    * <p>
+    * This method was created mainly for testing but it may be used in scenarios where you need to
+    * have more than one Server inside the same VM.
+    */
+   void setIdentity(String identity);
+
+   String getIdentity();
+
+   String describe();
+
+   void addActivationParam(String key, Object val);
+
+   Configuration getConfiguration();
+
+   RemotingService getRemotingService();
+
+   StorageManager getStorageManager();
+
+   PagingManager getPagingManager();
+
+   ManagementService getManagementService();
+
+   ActiveMQSecurityManager getSecurityManager();
+
+   Version getVersion();
+
+   NodeManager getNodeManager();
+
+   /**
+    * Returns the resource to manage this ActiveMQ server.
+    * @throws IllegalStateException if the server is not properly started.
+    */
+   ActiveMQServerControlImpl getActiveMQServerControl();
+
+   void registerActivateCallback(ActivateCallback callback);
+
+   void unregisterActivateCallback(ActivateCallback callback);
+
+   ServerSession createSession(String name,
+                               String username,
+                               String password,
+                               int minLargeMessageSize,
+                               RemotingConnection remotingConnection,
+                               boolean autoCommitSends,
+                               boolean autoCommitAcks,
+                               boolean preAcknowledge,
+                               boolean xa,
+                               String defaultAddress,
+                               SessionCallback callback,
+                               ServerSessionFactory sessionFactory) throws Exception;
+
+   SecurityStore getSecurityStore();
+
+   void removeSession(String name) throws Exception;
+
+   Set<ServerSession> getSessions();
+
+   HierarchicalRepository<Set<Role>> getSecurityRepository();
+
+   HierarchicalRepository<AddressSettings> getAddressSettingsRepository();
+
+   int getConnectionCount();
+
+   PostOffice getPostOffice();
+
+   QueueFactory getQueueFactory();
+
+   ResourceManager getResourceManager();
+
+   List<ServerSession> getSessions(String connectionID);
+
+   /** @return a session containing the meta-key and meata-value */
+   ServerSession lookupSession(String metakey, String metavalue);
+
+   ClusterManager getClusterManager();
+
+   SimpleString getNodeID();
+
+   boolean isActive();
+
+   /**
+    * Wait for server initialization.
+    * @param timeout
+    * @param unit
+    * @see CountDownLatch#await(long, TimeUnit)
+    * @return {@code true} if the server was already initialized or if it was initialized within the
+    *         timeout period, {@code false} otherwise.
+    * @throws InterruptedException
+    */
+   boolean waitForActivation(long timeout, TimeUnit unit) throws InterruptedException;
+
+   /**
+    * Creates a shared queue. if non durable it will exist as long as there are consumers.
+    *
+    * Notice: the queue won't be deleted until the first consumer arrives.
+    *
+    * @param address
+    * @param name
+    * @param filterString
+    * @param durable
+    * @throws Exception
+    */
+   void createSharedQueue(final SimpleString address,
+                           final SimpleString name,
+                           final SimpleString filterString,
+                           boolean durable) throws Exception;
+
+   Queue createQueue(SimpleString address,
+                     SimpleString queueName,
+                     SimpleString filter,
+                     boolean durable,
+                     boolean temporary) throws Exception;
+
+   Queue deployQueue(SimpleString address,
+                     SimpleString queueName,
+                     SimpleString filterString,
+                     boolean durable,
+                     boolean temporary) throws Exception;
+
+   Queue locateQueue(SimpleString queueName) throws Exception;
+
+   void destroyQueue(SimpleString queueName) throws Exception;
+
+   void destroyQueue(SimpleString queueName, ServerSession session) throws Exception;
+
+   void destroyQueue(SimpleString queueName, ServerSession session, boolean checkConsumerCount) throws Exception;
+
+   void destroyQueue(SimpleString queueName, ServerSession session, boolean checkConsumerCount, boolean removeConsumers) throws Exception;
+
+   String destroyConnectionWithSessionMetadata(String metaKey, String metaValue) throws Exception;
+
+   ScheduledExecutorService getScheduledPool();
+
+   ExecutorFactory getExecutorFactory();
+
+   void setGroupingHandler(GroupingHandler groupingHandler);
+
+   GroupingHandler getGroupingHandler();
+
+   ReplicationManager getReplicationManager();
+
+   void deployDivert(DivertConfiguration config) throws Exception;
+
+   void destroyDivert(SimpleString name) throws Exception;
+
+   ConnectorsService getConnectorsService();
+
+   void deployBridge(BridgeConfiguration config) throws Exception;
+
+   void destroyBridge(String name) throws Exception;
+
+   ServerSession getSessionByID(String sessionID);
+
+   void threadDump(String reason);
+
+   /**
+    * return true if there is a binding for this address (i.e. if there is a created queue)
+    * @param address
+    * @return
+    */
+   boolean isAddressBound(String address) throws Exception;
+
+   void stop(boolean failoverOnServerShutdown) throws Exception;
+
+   /*
+   * add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will
+   * replace any factories with the same protocol
+   * */
+   void addProtocolManagerFactory(ProtocolManagerFactory factory);
+
+   /*
+   * add a ProtocolManagerFactory to be used.
+   * */
+   void removeProtocolManagerFactory(ProtocolManagerFactory factory);
+
+   ActiveMQServer createBackupServer(Configuration configuration);
+
+   void addScaledDownNode(SimpleString scaledDownNodeId);
+
+   boolean hasScaledDown(SimpleString scaledDownNodeId);
+
+   Activation getActivation();
+
+   HAPolicy getHAPolicy();
+
+   void setHAPolicy(HAPolicy haPolicy);
+}


[26/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnection.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnection.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnection.java
new file mode 100644
index 0000000..7ec8379
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnection.java
@@ -0,0 +1,921 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.ResourceAllocationException;
+import javax.jms.Session;
+import javax.jms.XASession;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.IllegalStateException;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+import javax.resource.spi.SecurityException;
+import javax.security.auth.Subject;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.activemq.core.client.impl.ClientSessionInternal;
+import org.apache.activemq.jms.client.ActiveMQConnection;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.client.ActiveMQXAConnection;
+
+/**
+ * The managed connection
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
+ */
+public final class ActiveMQRAManagedConnection implements ManagedConnection, ExceptionListener
+{
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The managed connection factory
+    */
+   private final ActiveMQRAManagedConnectionFactory mcf;
+
+   /**
+    * The connection request information
+    */
+   private final ActiveMQRAConnectionRequestInfo cri;
+
+   /**
+    * The resource adapter
+    */
+   private final ActiveMQResourceAdapter ra;
+
+   /**
+    * The user name
+    */
+   private final String userName;
+
+   /**
+    * The password
+    */
+   private final String password;
+
+   /**
+    * Has the connection been destroyed
+    */
+   private final AtomicBoolean isDestroyed = new AtomicBoolean(false);
+
+   /**
+    * Event listeners
+    */
+   private final List<ConnectionEventListener> eventListeners;
+
+   /**
+    * Handles
+    */
+   private final Set<ActiveMQRASession> handles;
+
+   /**
+    * Lock
+    */
+   private ReentrantLock lock = new ReentrantLock();
+
+   // Physical connection stuff
+   private ActiveMQConnectionFactory connectionFactory;
+
+   private ActiveMQXAConnection connection;
+
+   // The ManagedConnection will play with a XA and a NonXASession to couple with
+   // cases where a commit is called on a non-XAed (or non-enlisted) case.
+   private Session nonXAsession;
+
+   private XASession xaSession;
+
+   private XAResource xaResource;
+
+   private final TransactionManager tm;
+
+   private boolean inManagedTx;
+
+   /**
+    * Constructor
+    *
+    * @param mcf      The managed connection factory
+    * @param cri      The connection request information
+    * @param userName The user name
+    * @param password The password
+    */
+   public ActiveMQRAManagedConnection(final ActiveMQRAManagedConnectionFactory mcf,
+                                      final ActiveMQRAConnectionRequestInfo cri,
+                                      final ActiveMQResourceAdapter ra,
+                                      final String userName,
+                                      final String password) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cri + ", " + userName + ", ****)");
+      }
+
+      this.mcf = mcf;
+      this.cri = cri;
+      this.tm = ra.getTM();
+      this.ra = ra;
+      this.userName = userName;
+      this.password = password;
+      eventListeners = Collections.synchronizedList(new ArrayList<ConnectionEventListener>());
+      handles = Collections.synchronizedSet(new HashSet<ActiveMQRASession>());
+
+      connection = null;
+      nonXAsession = null;
+      xaSession = null;
+      xaResource = null;
+
+      try
+      {
+         setup();
+      }
+      catch (ResourceException e)
+      {
+         try
+         {
+            destroy();
+         }
+         catch (Throwable ignored)
+         {
+         }
+
+         throw e;
+      }
+      catch (Throwable t)
+      {
+         try
+         {
+            destroy();
+         }
+         catch (Throwable ignored)
+         {
+         }
+         throw new ResourceException("Error during setup", t);
+      }
+   }
+
+   /**
+    * Get a connection
+    *
+    * @param subject       The security subject
+    * @param cxRequestInfo The request info
+    * @return The connection
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public synchronized Object getConnection(final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getConnection(" + subject + ", " + cxRequestInfo + ")");
+      }
+
+      // Check user first
+      ActiveMQRACredential credential = ActiveMQRACredential.getCredential(mcf, subject, cxRequestInfo);
+
+      // Null users are allowed!
+      if (userName != null && !userName.equals(credential.getUserName()))
+      {
+         throw new SecurityException("Password credentials not the same, reauthentication not allowed");
+      }
+
+      if (userName == null && credential.getUserName() != null)
+      {
+         throw new SecurityException("Password credentials not the same, reauthentication not allowed");
+      }
+
+      if (isDestroyed.get())
+      {
+         throw new IllegalStateException("The managed connection is already destroyed");
+      }
+
+      ActiveMQRASession session = new ActiveMQRASession(this, (ActiveMQRAConnectionRequestInfo) cxRequestInfo);
+      handles.add(session);
+      return session;
+   }
+
+   /**
+    * Destroy all handles.
+    *
+    * @throws ResourceException Failed to close one or more handles.
+    */
+   private void destroyHandles() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("destroyHandles()");
+      }
+
+      try
+      {
+
+         if (connection != null)
+         {
+            connection.stop();
+         }
+      }
+      catch (Throwable t)
+      {
+         ActiveMQRALogger.LOGGER.trace("Ignored error stopping connection", t);
+      }
+
+      for (ActiveMQRASession session : handles)
+      {
+         session.destroy();
+      }
+
+      handles.clear();
+   }
+
+   /**
+    * Destroy the physical connection.
+    *
+    * @throws ResourceException Could not property close the session and connection.
+    */
+   public void destroy() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("destroy()");
+      }
+
+      if (isDestroyed.get() || connection == null)
+      {
+         return;
+      }
+
+      isDestroyed.set(true);
+
+      try
+      {
+         connection.setExceptionListener(null);
+      }
+      catch (JMSException e)
+      {
+         ActiveMQRALogger.LOGGER.debug("Error unsetting the exception listener " + this, e);
+      }
+      if (connection != null)
+      {
+         connection.signalStopToAllSessions();
+      }
+
+      destroyHandles();
+
+      try
+      {
+         /**
+          * (xa|nonXA)Session.close() may NOT be called BEFORE connection.close()
+          * <p>
+          * If the ClientSessionFactory is trying to fail-over or reconnect with -1 attempts, and
+          * one calls session.close() it may effectively dead-lock.
+          * <p>
+          * connection close will close the ClientSessionFactory which will close all sessions.
+          */
+         if (connection != null)
+         {
+            connection.close();
+         }
+
+         // The following calls should not be necessary, as the connection should close the
+         // ClientSessionFactory, which will close the sessions.
+         try
+         {
+            if (nonXAsession != null)
+            {
+               nonXAsession.close();
+            }
+
+            if (xaSession != null)
+            {
+               xaSession.close();
+            }
+         }
+         catch (JMSException e)
+         {
+            ActiveMQRALogger.LOGGER.debug("Error closing session " + this, e);
+         }
+
+         // we must close the ActiveMQConnectionFactory because it contains a ServerLocator
+         if (connectionFactory != null)
+         {
+            connectionFactory.close();
+         }
+      }
+      catch (Throwable e)
+      {
+         throw new ResourceException("Could not properly close the session and connection", e);
+      }
+   }
+
+   /**
+    * Cleanup
+    *
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public void cleanup() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("cleanup()");
+      }
+
+      if (isDestroyed.get())
+      {
+         throw new IllegalStateException("ManagedConnection already destroyed");
+      }
+
+      destroyHandles();
+
+      inManagedTx = false;
+
+      inManagedTx = false;
+
+      // I'm recreating the lock object when we return to the pool
+      // because it looks too nasty to expect the connection handle
+      // to unlock properly in certain race conditions
+      // where the dissociation of the managed connection is "random".
+      lock = new ReentrantLock();
+   }
+
+   /**
+    * Move a handler from one mc to this one.
+    *
+    * @param obj An object of type ActiveMQSession.
+    * @throws ResourceException     Failed to associate connection.
+    * @throws IllegalStateException ManagedConnection in an illegal state.
+    */
+   public void associateConnection(final Object obj) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("associateConnection(" + obj + ")");
+      }
+
+      if (!isDestroyed.get() && obj instanceof ActiveMQRASession)
+      {
+         ActiveMQRASession h = (ActiveMQRASession) obj;
+         h.setManagedConnection(this);
+         handles.add(h);
+      }
+      else
+      {
+         throw new IllegalStateException("ManagedConnection in an illegal state");
+      }
+   }
+
+   public void checkTransactionActive() throws JMSException
+   {
+      // don't bother looking at the transaction if there's an active XID
+      if (!inManagedTx && tm != null)
+      {
+         try
+         {
+            Transaction tx = tm.getTransaction();
+            if (tx != null)
+            {
+               int status = tx.getStatus();
+               // Only allow states that will actually succeed
+               if (status != Status.STATUS_ACTIVE && status != Status.STATUS_PREPARING &&
+                  status != Status.STATUS_PREPARED &&
+                  status != Status.STATUS_COMMITTING)
+               {
+                  throw new javax.jms.IllegalStateException("Transaction " + tx + " not active");
+               }
+            }
+         }
+         catch (SystemException e)
+         {
+            JMSException jmsE = new javax.jms.IllegalStateException("Unexpected exception on the Transaction ManagerTransaction");
+            jmsE.initCause(e);
+            throw jmsE;
+         }
+      }
+   }
+
+
+   /**
+    * Aqquire a lock on the managed connection
+    */
+   protected void lock()
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("lock()");
+      }
+
+      lock.lock();
+   }
+
+   /**
+    * Aqquire a lock on the managed connection within the specified period
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   protected void tryLock() throws JMSException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("tryLock()");
+      }
+
+      Integer tryLock = mcf.getUseTryLock();
+      if (tryLock == null || tryLock.intValue() <= 0)
+      {
+         lock();
+         return;
+      }
+      try
+      {
+         if (lock.tryLock(tryLock.intValue(), TimeUnit.SECONDS) == false)
+         {
+            throw new ResourceAllocationException("Unable to obtain lock in " + tryLock + " seconds: " + this);
+         }
+      }
+      catch (InterruptedException e)
+      {
+         throw new ResourceAllocationException("Interrupted attempting lock: " + this);
+      }
+   }
+
+   /**
+    * Unlock the managed connection
+    */
+   protected void unlock()
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("unlock()");
+      }
+
+      lock.unlock();
+   }
+
+   /**
+    * Add a connection event listener.
+    *
+    * @param l The connection event listener to be added.
+    */
+   public void addConnectionEventListener(final ConnectionEventListener l)
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("addConnectionEventListener(" + l + ")");
+      }
+
+      eventListeners.add(l);
+   }
+
+   /**
+    * Remove a connection event listener.
+    *
+    * @param l The connection event listener to be removed.
+    */
+   public void removeConnectionEventListener(final ConnectionEventListener l)
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("removeConnectionEventListener(" + l + ")");
+      }
+
+      eventListeners.remove(l);
+   }
+
+   /**
+    * Get the XAResource for the connection.
+    *
+    * @return The XAResource for the connection.
+    * @throws ResourceException XA transaction not supported
+    */
+   public XAResource getXAResource() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getXAResource()");
+      }
+
+      //
+      // Spec says a mc must always return the same XA resource,
+      // so we cache it.
+      //
+      if (xaResource == null)
+      {
+         ClientSessionInternal csi = (ClientSessionInternal) xaSession.getXAResource();
+         ActiveMQRAXAResource activeMQRAXAResource = new ActiveMQRAXAResource(this, xaSession.getXAResource());
+         xaResource = new ActiveMQXAResourceWrapper(activeMQRAXAResource, ra.getJndiName(), csi.getNodeId());
+      }
+
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("XAResource=" + xaResource);
+      }
+
+      return xaResource;
+   }
+
+   /**
+    * Get the location transaction for the connection.
+    *
+    * @return The local transaction for the connection.
+    * @throws ResourceException Thrown if operation fails.
+    */
+   public LocalTransaction getLocalTransaction() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getLocalTransaction()");
+      }
+
+      LocalTransaction tx = new ActiveMQRALocalTransaction(this);
+
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("LocalTransaction=" + tx);
+      }
+
+      return tx;
+   }
+
+   /**
+    * Get the meta data for the connection.
+    *
+    * @return The meta data for the connection.
+    * @throws ResourceException     Thrown if the operation fails.
+    * @throws IllegalStateException Thrown if the managed connection already is destroyed.
+    */
+   public ManagedConnectionMetaData getMetaData() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMetaData()");
+      }
+
+      if (isDestroyed.get())
+      {
+         throw new IllegalStateException("The managed connection is already destroyed");
+      }
+
+      return new ActiveMQRAMetaData(this);
+   }
+
+   /**
+    * Set the log writer -- NOT SUPPORTED
+    *
+    * @param out The log writer
+    * @throws ResourceException If operation fails
+    */
+   public void setLogWriter(final PrintWriter out) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setLogWriter(" + out + ")");
+      }
+   }
+
+   /**
+    * Get the log writer -- NOT SUPPORTED
+    *
+    * @return Always null
+    * @throws ResourceException If operation fails
+    */
+   public PrintWriter getLogWriter() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getLogWriter()");
+      }
+
+      return null;
+   }
+
+   /**
+    * Notifies user of a JMS exception.
+    *
+    * @param exception The JMS exception
+    */
+   public void onException(final JMSException exception)
+   {
+      if (ActiveMQConnection.EXCEPTION_FAILOVER.equals(exception.getErrorCode()))
+      {
+         return;
+      }
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("onException(" + exception + ")");
+      }
+
+      if (isDestroyed.get())
+      {
+         if (ActiveMQRAManagedConnection.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("Ignoring error on already destroyed connection " + this, exception);
+         }
+         return;
+      }
+
+      ActiveMQRALogger.LOGGER.handlingJMSFailure(exception);
+
+      try
+      {
+         connection.setExceptionListener(null);
+      }
+      catch (JMSException e)
+      {
+         ActiveMQRALogger.LOGGER.debug("Unable to unset exception listener", e);
+      }
+
+      ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);
+      sendEvent(event);
+   }
+
+   /**
+    * Get the session for this connection.
+    *
+    * @return The session
+    * @throws JMSException
+    */
+   protected Session getSession() throws JMSException
+   {
+      if (xaResource != null && inManagedTx)
+      {
+         if (ActiveMQRAManagedConnection.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("getSession() -> XA session " + xaSession.getSession());
+         }
+
+         return xaSession.getSession();
+      }
+      else
+      {
+         if (ActiveMQRAManagedConnection.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("getSession() -> non XA session " + nonXAsession);
+         }
+
+         return nonXAsession;
+      }
+   }
+
+   /**
+    * Send an event.
+    *
+    * @param event The event to send.
+    */
+   protected void sendEvent(final ConnectionEvent event)
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("sendEvent(" + event + ")");
+      }
+
+      int type = event.getId();
+
+      // convert to an array to avoid concurrent modification exceptions
+      ConnectionEventListener[] list = eventListeners.toArray(new ConnectionEventListener[eventListeners.size()]);
+
+      for (ConnectionEventListener l : list)
+      {
+         switch (type)
+         {
+            case ConnectionEvent.CONNECTION_CLOSED:
+               l.connectionClosed(event);
+               break;
+
+            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
+               l.localTransactionStarted(event);
+               break;
+
+            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
+               l.localTransactionCommitted(event);
+               break;
+
+            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
+               l.localTransactionRolledback(event);
+               break;
+
+            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
+               l.connectionErrorOccurred(event);
+               break;
+
+            default:
+               throw new IllegalArgumentException("Illegal eventType: " + type);
+         }
+      }
+   }
+
+   /**
+    * Remove a handle from the handle map.
+    *
+    * @param handle The handle to remove.
+    */
+   protected void removeHandle(final ActiveMQRASession handle)
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("removeHandle(" + handle + ")");
+      }
+
+      handles.remove(handle);
+   }
+
+   /**
+    * Get the request info for this connection.
+    *
+    * @return The connection request info for this connection.
+    */
+   protected ActiveMQRAConnectionRequestInfo getCRI()
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getCRI()");
+      }
+
+      return cri;
+   }
+
+   /**
+    * Get the connection factory for this connection.
+    *
+    * @return The connection factory for this connection.
+    */
+   protected ActiveMQRAManagedConnectionFactory getManagedConnectionFactory()
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getManagedConnectionFactory()");
+      }
+
+      return mcf;
+   }
+
+   /**
+    * Start the connection
+    *
+    * @throws JMSException Thrown if the connection can't be started
+    */
+   void start() throws JMSException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("start()");
+      }
+
+      if (connection != null)
+      {
+         connection.start();
+      }
+   }
+
+   /**
+    * Stop the connection
+    *
+    * @throws JMSException Thrown if the connection can't be stopped
+    */
+   void stop() throws JMSException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("stop()");
+      }
+
+      if (connection != null)
+      {
+         connection.stop();
+      }
+   }
+
+   /**
+    * Get the user name
+    *
+    * @return The user name
+    */
+   protected String getUserName()
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return userName;
+   }
+
+   /**
+    * Setup the connection.
+    *
+    * @throws ResourceException Thrown if a connection couldn't be created
+    */
+   private void setup() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnection.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setup()");
+      }
+
+      try
+      {
+
+         createCF();
+
+         boolean transacted = cri.isTransacted();
+         int acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
+         if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION)
+         {
+            if (userName != null && password != null)
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXATopicConnection(userName, password);
+            }
+            else
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXATopicConnection();
+            }
+
+            connection.setExceptionListener(this);
+
+            xaSession = connection.createXATopicSession();
+            nonXAsession = connection.createNonXATopicSession(transacted, acknowledgeMode);
+
+         }
+         else if (cri.getType() == ActiveMQRAConnectionFactory.QUEUE_CONNECTION)
+         {
+            if (userName != null && password != null)
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXAQueueConnection(userName, password);
+            }
+            else
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXAQueueConnection();
+            }
+
+            connection.setExceptionListener(this);
+
+            xaSession = connection.createXAQueueSession();
+            nonXAsession = connection.createNonXAQueueSession(transacted, acknowledgeMode);
+
+         }
+         else
+         {
+            if (userName != null && password != null)
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXAConnection(userName, password);
+            }
+            else
+            {
+               connection = (ActiveMQXAConnection) connectionFactory.createXAConnection();
+            }
+
+            connection.setExceptionListener(this);
+
+            xaSession = connection.createXASession();
+            nonXAsession = connection.createNonXASession(transacted, acknowledgeMode);
+         }
+
+      }
+      catch (JMSException je)
+      {
+         throw new ResourceException(je.getMessage(), je);
+      }
+   }
+
+   private void createCF()
+   {
+      if (connectionFactory == null)
+      {
+         connectionFactory = ra.createActiveMQConnectionFactory(mcf.getProperties());
+      }
+   }
+
+   protected void setInManagedTx(boolean inManagedTx)
+   {
+      this.inManagedTx = inManagedTx;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnectionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnectionFactory.java
new file mode 100644
index 0000000..8c40ab9
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAManagedConnectionFactory.java
@@ -0,0 +1,805 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.ConnectionMetaData;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+import javax.security.auth.Subject;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
+
+/**
+ * ActiveMQ ManagedConnectionFactory
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>.
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public final class ActiveMQRAManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+   /**
+    * Serial version UID
+    */
+   static final long serialVersionUID = -1452379518562456741L;
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The resource adapter
+    */
+   private ActiveMQResourceAdapter ra;
+
+   /**
+    * Connection manager
+    */
+   private ConnectionManager cm;
+
+   /**
+    * The managed connection factory properties
+    */
+   private final ActiveMQRAMCFProperties mcfProperties;
+
+   /**
+    * Connection Factory used if properties are set
+    */
+   private ActiveMQConnectionFactory recoveryConnectionFactory;
+
+   /*
+   * The resource recovery if there is one
+   * */
+   private XARecoveryConfig resourceRecovery;
+
+   /**
+    * Constructor
+    */
+   public ActiveMQRAManagedConnectionFactory()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+
+      ra = null;
+      cm = null;
+      mcfProperties = new ActiveMQRAMCFProperties();
+   }
+
+   /**
+    * Creates a Connection Factory instance
+    *
+    * @return javax.resource.cci.ConnectionFactory instance
+    * @throws ResourceException Thrown if a connection factory can't be created
+    */
+   public Object createConnectionFactory() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.debug("createConnectionFactory()");
+      }
+
+      return createConnectionFactory(new ActiveMQRAConnectionManager());
+   }
+
+   /**
+    * Creates a Connection Factory instance
+    *
+    * @param cxManager The connection manager
+    * @return javax.resource.cci.ConnectionFactory instance
+    * @throws ResourceException Thrown if a connection factory can't be created
+    */
+   public Object createConnectionFactory(final ConnectionManager cxManager) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnectionFactory(" + cxManager + ")");
+      }
+
+      cm = cxManager;
+
+      ActiveMQRAConnectionFactory cf = new ActiveMQRAConnectionFactoryImpl(this, cm);
+
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created connection factory: " + cf +
+                                         ", using connection manager: " +
+                                         cm);
+      }
+      return cf;
+   }
+
+   /**
+    * Creates a new physical connection to the underlying EIS resource manager.
+    *
+    * @param subject       Caller's security information
+    * @param cxRequestInfo Additional resource adapter specific connection request information
+    * @return The managed connection
+    * @throws ResourceException Thrown if a managed connection can't be created
+    */
+   public ManagedConnection createManagedConnection(final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createManagedConnection(" + subject + ", " + cxRequestInfo + ")");
+      }
+
+      ActiveMQRAConnectionRequestInfo cri = getCRI((ActiveMQRAConnectionRequestInfo) cxRequestInfo);
+
+      ActiveMQRACredential credential = ActiveMQRACredential.getCredential(this, subject, cri);
+
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("jms credential: " + credential);
+      }
+
+      ActiveMQRAManagedConnection mc = new ActiveMQRAManagedConnection(this,
+                                                                     cri,
+                                                                     ra,
+                                                                     credential.getUserName(),
+                                                                     credential.getPassword());
+
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("created new managed connection: " + mc);
+      }
+
+      registerRecovery();
+
+      return mc;
+   }
+
+   private synchronized void registerRecovery()
+   {
+      if (recoveryConnectionFactory == null)
+      {
+         recoveryConnectionFactory = ra.createRecoveryActiveMQConnectionFactory(mcfProperties);
+         resourceRecovery = ra.getRecoveryManager().register(recoveryConnectionFactory, null, null);
+      }
+   }
+
+   public XARecoveryConfig getResourceRecovery()
+   {
+      return resourceRecovery;
+   }
+
+   /**
+    * Returns a matched connection from the candidate set of connections.
+    *
+    * @param connectionSet The candidate connection set
+    * @param subject       Caller's security information
+    * @param cxRequestInfo Additional resource adapter specific connection request information
+    * @return The managed connection
+    * @throws ResourceException Thrown if the managed connection can not be found
+    */
+   public ManagedConnection matchManagedConnections(@SuppressWarnings("rawtypes") final Set connectionSet, final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("matchManagedConnections(" + connectionSet +
+                                         ", " +
+                                         subject +
+                                         ", " +
+                                         cxRequestInfo +
+                                         ")");
+      }
+
+      ActiveMQRAConnectionRequestInfo cri = getCRI((ActiveMQRAConnectionRequestInfo) cxRequestInfo);
+      ActiveMQRACredential credential = ActiveMQRACredential.getCredential(this, subject, cri);
+
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Looking for connection matching credentials: " + credential);
+      }
+
+      Iterator<?> connections = connectionSet.iterator();
+
+      while (connections.hasNext())
+      {
+         Object obj = connections.next();
+
+         if (obj instanceof ActiveMQRAManagedConnection)
+         {
+            ActiveMQRAManagedConnection mc = (ActiveMQRAManagedConnection) obj;
+            ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();
+
+            if ((mc.getUserName() == null || mc.getUserName() != null && mc.getUserName()
+               .equals(credential.getUserName())) && mcf.equals(this))
+            {
+               if (cri.equals(mc.getCRI()))
+               {
+                  if (ActiveMQRAManagedConnectionFactory.trace)
+                  {
+                     ActiveMQRALogger.LOGGER.trace("Found matching connection: " + mc);
+                  }
+
+                  return mc;
+               }
+            }
+         }
+      }
+
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("No matching connection was found");
+      }
+
+      return null;
+   }
+
+   /**
+    * Set the log writer -- NOT SUPPORTED
+    *
+    * @param out The writer
+    * @throws ResourceException Thrown if the writer can't be set
+    */
+   public void setLogWriter(final PrintWriter out) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setLogWriter(" + out + ")");
+      }
+   }
+
+   /**
+    * Get the log writer -- NOT SUPPORTED
+    *
+    * @return The writer
+    * @throws ResourceException Thrown if the writer can't be retrieved
+    */
+   public PrintWriter getLogWriter() throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getLogWriter()");
+      }
+
+      return null;
+   }
+
+   /**
+    * Get the resource adapter
+    *
+    * @return The resource adapter
+    */
+   public ResourceAdapter getResourceAdapter()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getResourceAdapter()");
+      }
+
+      return ra;
+   }
+
+   /**
+    * Set the resource adapter
+    * <p/>
+    * This should ensure that when the RA is stopped, this MCF will be stopped as well.
+    *
+    * @param ra The resource adapter
+    * @throws ResourceException Thrown if incorrect resource adapter
+    */
+   public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")");
+      }
+
+      if (ra == null || !(ra instanceof ActiveMQResourceAdapter))
+      {
+         throw new ResourceException("Resource adapter is " + ra);
+      }
+
+      this.ra = (ActiveMQResourceAdapter) ra;
+      this.ra.setManagedConnectionFactory(this);
+   }
+
+   /**
+    * Indicates whether some other object is "equal to" this one.
+    *
+    * @param obj Object with which to compare
+    * @return True if this object is the same as the obj argument; false otherwise.
+    */
+   @Override
+   public boolean equals(final Object obj)
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")");
+      }
+
+      if (obj == null)
+      {
+         return false;
+      }
+
+      if (obj instanceof ActiveMQRAManagedConnectionFactory)
+      {
+         ActiveMQRAManagedConnectionFactory other = (ActiveMQRAManagedConnectionFactory) obj;
+
+         return mcfProperties.equals(other.getProperties()) && ra.equals(other.getResourceAdapter());
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   /**
+    * Return the hash code for the object
+    *
+    * @return The hash code
+    */
+   @Override
+   public int hashCode()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("hashCode()");
+      }
+
+      int hash = mcfProperties.hashCode();
+      hash += 31 * ra.hashCode();
+
+      return hash;
+   }
+
+   /**
+    * Get the default session type
+    *
+    * @return The value
+    */
+   public String getSessionDefaultType()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSessionDefaultType()");
+      }
+
+      return mcfProperties.getSessionDefaultType();
+   }
+
+   /**
+    * Set the default session type
+    *
+    * @param type either javax.jms.Topic or javax.jms.Queue
+    */
+   public void setSessionDefaultType(final String type)
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSessionDefaultType(" + type + ")");
+      }
+
+      mcfProperties.setSessionDefaultType(type);
+   }
+
+   /**
+    * @return the connectionParameters
+    */
+   public String getConnectionParameters()
+   {
+      return mcfProperties.getStrConnectionParameters();
+   }
+
+   public void setConnectionParameters(final String configuration)
+   {
+      mcfProperties.setConnectionParameters(configuration);
+   }
+
+   /**
+    * @return the transportType
+    */
+   public String getConnectorClassName()
+   {
+      return mcfProperties.getConnectorClassName();
+   }
+
+   public void setConnectorClassName(final String value)
+   {
+      mcfProperties.setConnectorClassName(value);
+   }
+
+   public String getConnectionLoadBalancingPolicyClassName()
+   {
+      return mcfProperties.getConnectionLoadBalancingPolicyClassName();
+   }
+
+   public void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName)
+   {
+      mcfProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   public String getDiscoveryAddress()
+   {
+      return mcfProperties.getDiscoveryAddress();
+   }
+
+   public void setDiscoveryAddress(final String discoveryAddress)
+   {
+      mcfProperties.setDiscoveryAddress(discoveryAddress);
+   }
+
+   public Integer getDiscoveryPort()
+   {
+      return mcfProperties.getDiscoveryPort();
+   }
+
+   public void setDiscoveryPort(final Integer discoveryPort)
+   {
+      mcfProperties.setDiscoveryPort(discoveryPort);
+   }
+
+   public Long getDiscoveryRefreshTimeout()
+   {
+      return mcfProperties.getDiscoveryRefreshTimeout();
+   }
+
+   public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout)
+   {
+      mcfProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
+   }
+
+   public Long getDiscoveryInitialWaitTimeout()
+   {
+      return mcfProperties.getDiscoveryInitialWaitTimeout();
+   }
+
+   public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout)
+   {
+      mcfProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
+   }
+
+   public String getClientID()
+   {
+      return mcfProperties.getClientID();
+   }
+
+   public void setClientID(final String clientID)
+   {
+      mcfProperties.setClientID(clientID);
+   }
+
+   public Integer getDupsOKBatchSize()
+   {
+      return mcfProperties.getDupsOKBatchSize();
+   }
+
+   public void setDupsOKBatchSize(final Integer dupsOKBatchSize)
+   {
+      mcfProperties.setDupsOKBatchSize(dupsOKBatchSize);
+   }
+
+   public Integer getTransactionBatchSize()
+   {
+      return mcfProperties.getTransactionBatchSize();
+   }
+
+   public void setTransactionBatchSize(final Integer transactionBatchSize)
+   {
+      mcfProperties.setTransactionBatchSize(transactionBatchSize);
+   }
+
+   public Long getClientFailureCheckPeriod()
+   {
+      return mcfProperties.getClientFailureCheckPeriod();
+   }
+
+   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
+   {
+      mcfProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+   }
+
+   public Long getConnectionTTL()
+   {
+      return mcfProperties.getConnectionTTL();
+   }
+
+   public void setConnectionTTL(final Long connectionTTL)
+   {
+      mcfProperties.setConnectionTTL(connectionTTL);
+   }
+
+   public Long getCallTimeout()
+   {
+      return mcfProperties.getCallTimeout();
+   }
+
+   public void setCallTimeout(final Long callTimeout)
+   {
+      mcfProperties.setCallTimeout(callTimeout);
+   }
+
+   public Integer getConsumerWindowSize()
+   {
+      return mcfProperties.getConsumerWindowSize();
+   }
+
+   public void setConsumerWindowSize(final Integer consumerWindowSize)
+   {
+      mcfProperties.setConsumerWindowSize(consumerWindowSize);
+   }
+
+   public Integer getConsumerMaxRate()
+   {
+      return mcfProperties.getConsumerMaxRate();
+   }
+
+   public void setConsumerMaxRate(final Integer consumerMaxRate)
+   {
+      mcfProperties.setConsumerMaxRate(consumerMaxRate);
+   }
+
+   public Integer getConfirmationWindowSize()
+   {
+      return mcfProperties.getConfirmationWindowSize();
+   }
+
+   public void setConfirmationWindowSize(final Integer confirmationWindowSize)
+   {
+      mcfProperties.setConfirmationWindowSize(confirmationWindowSize);
+   }
+
+   public Integer getProducerMaxRate()
+   {
+      return mcfProperties.getProducerMaxRate();
+   }
+
+   public void setProducerMaxRate(final Integer producerMaxRate)
+   {
+      mcfProperties.setProducerMaxRate(producerMaxRate);
+   }
+
+   public Integer getMinLargeMessageSize()
+   {
+      return mcfProperties.getMinLargeMessageSize();
+   }
+
+   public void setMinLargeMessageSize(final Integer minLargeMessageSize)
+   {
+      mcfProperties.setMinLargeMessageSize(minLargeMessageSize);
+   }
+
+   public Boolean isBlockOnAcknowledge()
+   {
+      return mcfProperties.isBlockOnAcknowledge();
+   }
+
+   public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge)
+   {
+      mcfProperties.setBlockOnAcknowledge(blockOnAcknowledge);
+   }
+
+   public Boolean isBlockOnNonDurableSend()
+   {
+      return mcfProperties.isBlockOnNonDurableSend();
+   }
+
+   public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend)
+   {
+      mcfProperties.setBlockOnNonDurableSend(blockOnNonDurableSend);
+   }
+
+   public Boolean isBlockOnDurableSend()
+   {
+      return mcfProperties.isBlockOnDurableSend();
+   }
+
+   public void setBlockOnDurableSend(final Boolean blockOnDurableSend)
+   {
+      mcfProperties.setBlockOnDurableSend(blockOnDurableSend);
+   }
+
+   public Boolean isAutoGroup()
+   {
+      return mcfProperties.isAutoGroup();
+   }
+
+   public void setAutoGroup(final Boolean autoGroup)
+   {
+      mcfProperties.setAutoGroup(autoGroup);
+   }
+
+   public Boolean isPreAcknowledge()
+   {
+      return mcfProperties.isPreAcknowledge();
+   }
+
+   public void setPreAcknowledge(final Boolean preAcknowledge)
+   {
+      mcfProperties.setPreAcknowledge(preAcknowledge);
+   }
+
+   public Long getRetryInterval()
+   {
+      return mcfProperties.getRetryInterval();
+   }
+
+   public void setRetryInterval(final Long retryInterval)
+   {
+      mcfProperties.setRetryInterval(retryInterval);
+   }
+
+   public Double getRetryIntervalMultiplier()
+   {
+      return mcfProperties.getRetryIntervalMultiplier();
+   }
+
+   public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier)
+   {
+      mcfProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
+   }
+
+   public Integer getReconnectAttempts()
+   {
+      return mcfProperties.getReconnectAttempts();
+   }
+
+   public void setReconnectAttempts(final Integer reconnectAttempts)
+   {
+      mcfProperties.setReconnectAttempts(reconnectAttempts);
+   }
+
+   public Boolean isUseGlobalPools()
+   {
+      return mcfProperties.isUseGlobalPools();
+   }
+
+   public void setUseGlobalPools(final Boolean useGlobalPools)
+   {
+      mcfProperties.setUseGlobalPools(useGlobalPools);
+   }
+
+   public Integer getScheduledThreadPoolMaxSize()
+   {
+      return mcfProperties.getScheduledThreadPoolMaxSize();
+   }
+
+   public void setScheduledThreadPoolMaxSize(final Integer scheduledThreadPoolMaxSize)
+   {
+      mcfProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+   }
+
+   public Integer getThreadPoolMaxSize()
+   {
+      return mcfProperties.getThreadPoolMaxSize();
+   }
+
+   public void setThreadPoolMaxSize(final Integer threadPoolMaxSize)
+   {
+      mcfProperties.setThreadPoolMaxSize(threadPoolMaxSize);
+   }
+
+   public Boolean isHA()
+   {
+      return mcfProperties.isHA();
+   }
+
+   public void setHA(Boolean ha)
+   {
+      mcfProperties.setHA(ha);
+   }
+
+   /**
+    * Get the useTryLock.
+    *
+    * @return the useTryLock.
+    */
+   public Integer getUseTryLock()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUseTryLock()");
+      }
+
+      return mcfProperties.getUseTryLock();
+   }
+
+   /**
+    * Set the useTryLock.
+    *
+    * @param useTryLock the useTryLock.
+    */
+   public void setUseTryLock(final Integer useTryLock)
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUseTryLock(" + useTryLock + ")");
+      }
+
+      mcfProperties.setUseTryLock(useTryLock);
+   }
+
+   /**
+    * Get the connection metadata
+    *
+    * @return The metadata
+    */
+   public ConnectionMetaData getMetaData()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMetadata()");
+      }
+
+      return new ActiveMQRAConnectionMetaData();
+   }
+
+   /**
+    * Get the managed connection factory properties
+    *
+    * @return The properties
+    */
+   protected ActiveMQRAMCFProperties getProperties()
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProperties()");
+      }
+
+      return mcfProperties;
+   }
+
+   /**
+    * Get a connection request info instance
+    *
+    * @param info The instance that should be updated; may be <code>null</code>
+    * @return The instance
+    */
+   private ActiveMQRAConnectionRequestInfo getCRI(final ActiveMQRAConnectionRequestInfo info)
+   {
+      if (ActiveMQRAManagedConnectionFactory.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getCRI(" + info + ")");
+      }
+
+      if (info == null)
+      {
+         // Create a default one
+         return new ActiveMQRAConnectionRequestInfo(ra.getProperties(), mcfProperties.getType());
+      }
+      else
+      {
+         // Fill the one with any defaults
+         info.setDefaults(ra.getProperties());
+         return info;
+      }
+   }
+
+   // this should be called when ActiveMQResourceAdapter.stop() is called since this MCF is registered with it
+   public void stop()
+   {
+      if (resourceRecovery != null)
+      {
+         ra.getRecoveryManager().unRegister(resourceRecovery);
+      }
+
+      if (recoveryConnectionFactory != null)
+      {
+         recoveryConnectionFactory.close();
+         recoveryConnectionFactory = null;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMapMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMapMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMapMessage.java
new file mode 100644
index 0000000..8affe60
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMapMessage.java
@@ -0,0 +1,452 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.util.Arrays;
+import java.util.Enumeration;
+
+import javax.jms.JMSException;
+import javax.jms.MapMessage;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 71554 $
+ */
+public class ActiveMQRAMapMessage extends ActiveMQRAMessage implements MapMessage
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    *
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRAMapMessage(final MapMessage message, final ActiveMQRASession session)
+   {
+      super(message, session);
+
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean getBoolean(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBoolean(" + name + ")");
+      }
+
+      return ((MapMessage)message).getBoolean(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public byte getByte(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getByte(" + name + ")");
+      }
+
+      return ((MapMessage)message).getByte(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public byte[] getBytes(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBytes(" + name + ")");
+      }
+
+      return ((MapMessage)message).getBytes(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public char getChar(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getChar(" + name + ")");
+      }
+
+      return ((MapMessage)message).getChar(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public double getDouble(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDouble(" + name + ")");
+      }
+
+      return ((MapMessage)message).getDouble(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public float getFloat(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getFloat(" + name + ")");
+      }
+
+      return ((MapMessage)message).getFloat(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int getInt(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getInt(" + name + ")");
+      }
+
+      return ((MapMessage)message).getInt(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public long getLong(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getLong(" + name + ")");
+      }
+
+      return ((MapMessage)message).getLong(name);
+   }
+
+   /**
+    * Get the map names
+    * @return The values
+    * @exception JMSException Thrown if an error occurs
+    */
+   @SuppressWarnings("rawtypes")
+   public Enumeration getMapNames() throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getMapNames()");
+      }
+
+      return ((MapMessage)message).getMapNames();
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public Object getObject(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getObject(" + name + ")");
+      }
+
+      return ((MapMessage)message).getObject(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public short getShort(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getShort(" + name + ")");
+      }
+
+      return ((MapMessage)message).getShort(name);
+   }
+
+   /**
+    * Get
+    * @param name The name
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public String getString(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getString(" + name + ")");
+      }
+
+      return ((MapMessage)message).getString(name);
+   }
+
+   /**
+    * Does the item exist
+    * @param name The name
+    * @return True / false
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean itemExists(final String name) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("itemExists(" + name + ")");
+      }
+
+      return ((MapMessage)message).itemExists(name);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setBoolean(final String name, final boolean value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBoolean(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setBoolean(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setByte(final String name, final byte value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setByte(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setByte(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @param offset The offset
+    * @param length The length
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setBytes(final String name, final byte[] value, final int offset, final int length) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBytes(" + name + ", " + Arrays.toString(value) + ", " + offset + ", " +
+                  length + ")");
+      }
+
+      ((MapMessage)message).setBytes(name, value, offset, length);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setBytes(final String name, final byte[] value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBytes(" + name + ", " + Arrays.toString(value) + ")");
+      }
+
+      ((MapMessage)message).setBytes(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setChar(final String name, final char value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setChar(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setChar(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setDouble(final String name, final double value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDouble(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setDouble(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setFloat(final String name, final float value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFloat(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setFloat(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setInt(final String name, final int value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setInt(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setInt(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setLong(final String name, final long value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setLong(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setLong(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setObject(final String name, final Object value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setObject(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setObject(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setShort(final String name, final short value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setShort(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setShort(name, value);
+   }
+
+   /**
+    * Set
+    * @param name The name
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void setString(final String name, final String value) throws JMSException
+   {
+      if (ActiveMQRAMapMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setString(" + name + ", " + value + ")");
+      }
+
+      ((MapMessage)message).setString(name, value);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessage.java
new file mode 100644
index 0000000..565ab15
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMessage.java
@@ -0,0 +1,897 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import java.util.Arrays;
+import java.util.Enumeration;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAMessage implements Message
+{
+   /**
+    * Whether trace is enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The message
+    */
+   protected Message message;
+
+   /**
+    * The session
+    */
+   protected ActiveMQRASession session;
+
+   /**
+    * Create a new wrapper
+    *
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRAMessage(final Message message, final ActiveMQRASession session)
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+
+      this.message = message;
+      this.session = session;
+   }
+
+   /**
+    * Acknowledge
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void acknowledge() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("acknowledge()");
+      }
+
+      session.getSession(); // Check for closed
+      message.acknowledge();
+   }
+
+   /**
+    * Clear body
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void clearBody() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("clearBody()");
+      }
+
+      message.clearBody();
+   }
+
+   /**
+    * Clear properties
+    *
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void clearProperties() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("clearProperties()");
+      }
+
+      message.clearProperties();
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public boolean getBooleanProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBooleanProperty(" + name + ")");
+      }
+
+      return message.getBooleanProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public byte getByteProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getByteProperty(" + name + ")");
+      }
+
+      return message.getByteProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public double getDoubleProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getDoubleProperty(" + name + ")");
+      }
+
+      return message.getDoubleProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public float getFloatProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getFloatProperty(" + name + ")");
+      }
+
+      return message.getFloatProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public int getIntProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getIntProperty(" + name + ")");
+      }
+
+      return message.getIntProperty(name);
+   }
+
+   /**
+    * Get correlation id
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public String getJMSCorrelationID() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSCorrelationID()");
+      }
+
+      return message.getJMSCorrelationID();
+   }
+
+   /**
+    * Get correlation id
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public byte[] getJMSCorrelationIDAsBytes() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSCorrelationIDAsBytes()");
+      }
+
+      return message.getJMSCorrelationIDAsBytes();
+   }
+
+   /**
+    * Get delivery mode
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public int getJMSDeliveryMode() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSDeliveryMode()");
+      }
+
+      return message.getJMSDeliveryMode();
+   }
+
+   /**
+    * Get destination
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Destination getJMSDestination() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSDestination()");
+      }
+
+      return message.getJMSDestination();
+   }
+
+   /**
+    * Get expiration
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public long getJMSExpiration() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSExpiration()");
+      }
+
+      return message.getJMSExpiration();
+   }
+
+   /**
+    * Get message id
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public String getJMSMessageID() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSMessageID()");
+      }
+
+      return message.getJMSMessageID();
+   }
+
+   /**
+    * Get priority
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public int getJMSPriority() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSPriority()");
+      }
+
+      return message.getJMSPriority();
+   }
+
+   /**
+    * Get redelivered status
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public boolean getJMSRedelivered() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSRedelivered()");
+      }
+
+      return message.getJMSRedelivered();
+   }
+
+   /**
+    * Get reply to destination
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Destination getJMSReplyTo() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSReplyTo()");
+      }
+
+      return message.getJMSReplyTo();
+   }
+
+   /**
+    * Get timestamp
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public long getJMSTimestamp() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSTimestamp()");
+      }
+
+      return message.getJMSTimestamp();
+   }
+
+   /**
+    * Get type
+    *
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public String getJMSType() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSType()");
+      }
+
+      return message.getJMSType();
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public long getLongProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getLongProperty(" + name + ")");
+      }
+
+      return message.getLongProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public Object getObjectProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getObjectProperty(" + name + ")");
+      }
+
+      return message.getObjectProperty(name);
+   }
+
+   /**
+    * Get property names
+    *
+    * @return The values
+    * @throws JMSException Thrown if an error occurs
+    */
+   @SuppressWarnings("rawtypes")
+   public Enumeration getPropertyNames() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPropertyNames()");
+      }
+
+      return message.getPropertyNames();
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public short getShortProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getShortProperty(" + name + ")");
+      }
+
+      return message.getShortProperty(name);
+   }
+
+   /**
+    * Get property
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public String getStringProperty(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getStringProperty(" + name + ")");
+      }
+
+      return message.getStringProperty(name);
+   }
+
+   /**
+    * Do property exist
+    *
+    * @param name The name
+    * @return The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public boolean propertyExists(final String name) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("propertyExists(" + name + ")");
+      }
+
+      return message.propertyExists(name);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setBooleanProperty(final String name, final boolean value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setBooleanProperty(" + name + ", " + value + ")");
+      }
+
+      message.setBooleanProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setByteProperty(final String name, final byte value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setByteProperty(" + name + ", " + value + ")");
+      }
+
+      message.setByteProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setDoubleProperty(final String name, final double value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDoubleProperty(" + name + ", " + value + ")");
+      }
+
+      message.setDoubleProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setFloatProperty(final String name, final float value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setFloatProperty(" + name + ", " + value + ")");
+      }
+
+      message.setFloatProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setIntProperty(final String name, final int value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setIntProperty(" + name + ", " + value + ")");
+      }
+
+      message.setIntProperty(name, value);
+   }
+
+   /**
+    * Set correlation id
+    *
+    * @param correlationID The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSCorrelationID(final String correlationID) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSCorrelationID(" + correlationID + ")");
+      }
+
+      message.setJMSCorrelationID(correlationID);
+   }
+
+   /**
+    * Set correlation id
+    *
+    * @param correlationID The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSCorrelationIDAsBytes(" + Arrays.toString(correlationID) + ")");
+      }
+
+      message.setJMSCorrelationIDAsBytes(correlationID);
+   }
+
+   /**
+    * Set delivery mode
+    *
+    * @param deliveryMode The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSDeliveryMode(final int deliveryMode) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSDeliveryMode(" + deliveryMode + ")");
+      }
+
+      message.setJMSDeliveryMode(deliveryMode);
+   }
+
+   /**
+    * Set destination
+    *
+    * @param destination The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSDestination(final Destination destination) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSDestination(" + destination + ")");
+      }
+
+      message.setJMSDestination(destination);
+   }
+
+   /**
+    * Set expiration
+    *
+    * @param expiration The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSExpiration(final long expiration) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSExpiration(" + expiration + ")");
+      }
+
+      message.setJMSExpiration(expiration);
+   }
+
+   /**
+    * Set message id
+    *
+    * @param id The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSMessageID(final String id) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSMessageID(" + id + ")");
+      }
+
+      message.setJMSMessageID(id);
+   }
+
+   /**
+    * Set priority
+    *
+    * @param priority The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSPriority(final int priority) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSPriority(" + priority + ")");
+      }
+
+      message.setJMSPriority(priority);
+   }
+
+   /**
+    * Set redelivered status
+    *
+    * @param redelivered The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSRedelivered(final boolean redelivered) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSRedelivered(" + redelivered + ")");
+      }
+
+      message.setJMSRedelivered(redelivered);
+   }
+
+   /**
+    * Set reply to
+    *
+    * @param replyTo The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSReplyTo(final Destination replyTo) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSReplyTo(" + replyTo + ")");
+      }
+
+      message.setJMSReplyTo(replyTo);
+   }
+
+   /**
+    * Set timestamp
+    *
+    * @param timestamp The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSTimestamp(final long timestamp) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSTimestamp(" + timestamp + ")");
+      }
+
+      message.setJMSTimestamp(timestamp);
+   }
+
+   /**
+    * Set type
+    *
+    * @param type The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setJMSType(final String type) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSType(" + type + ")");
+      }
+
+      message.setJMSType(type);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setLongProperty(final String name, final long value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setLongProperty(" + name + ", " + value + ")");
+      }
+
+      message.setLongProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setObjectProperty(final String name, final Object value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setObjectProperty(" + name + ", " + value + ")");
+      }
+
+      message.setObjectProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setShortProperty(final String name, final short value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setShortProperty(" + name + ", " + value + ")");
+      }
+
+      message.setShortProperty(name, value);
+   }
+
+   /**
+    * Set property
+    *
+    * @param name  The name
+    * @param value The value
+    * @throws JMSException Thrown if an error occurs
+    */
+   public void setStringProperty(final String name, final String value) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setStringProperty(" + name + ", " + value + ")");
+      }
+
+      message.setStringProperty(name, value);
+   }
+
+   @Override
+   public long getJMSDeliveryTime() throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSDeliveryTime()");
+      }
+      return message.getJMSDeliveryTime();
+   }
+
+   @Override
+   public void setJMSDeliveryTime(long deliveryTime) throws JMSException
+   {
+
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setJMSDeliveryTime(" + deliveryTime + ")");
+      }
+      message.setJMSDeliveryTime(deliveryTime);
+   }
+
+   @Override
+   public <T> T getBody(Class<T> c) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBody(" + c + ")");
+      }
+      return message.getBody(c);
+   }
+
+   @Override
+   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
+                                     Class c) throws JMSException
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isBodyAssignableTo(" + c + ")");
+      }
+      return message.isBodyAssignableTo(c);
+   }
+
+   /**
+    * Return the hash code
+    *
+    * @return The hash code
+    */
+   @Override
+   public int hashCode()
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("hashCode()");
+      }
+
+      return message.hashCode();
+   }
+
+   /**
+    * Check for equality
+    *
+    * @param object The other object
+    * @return True / false
+    */
+   @Override
+   public boolean equals(final Object object)
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("equals(" + object + ")");
+      }
+
+      if (object != null && object instanceof ActiveMQRAMessage)
+      {
+         return message.equals(((ActiveMQRAMessage)object).message);
+      }
+      else
+      {
+         return message.equals(object);
+      }
+   }
+
+   /**
+    * Return string representation
+    *
+    * @return The string
+    */
+   @Override
+   public String toString()
+   {
+      if (ActiveMQRAMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("toString()");
+      }
+
+      return message.toString();
+   }
+}


[27/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABundle.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABundle.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABundle.java
new file mode 100644
index 0000000..42953b2
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABundle.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+
+import org.apache.activemq.api.core.ActiveMQIllegalStateException;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.resource.NotSupportedException;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 15
+ *
+ * each message id must be 6 digits long starting with 15, the 3rd digit should be 9
+ *
+ * so 159000 to 159999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQRABundle
+{
+   /** Error message for strict behaviour */
+   String ISE = "This method is not applicable inside the application server. See the JEE spec, e.g. JEE 7 Section 6.7";
+
+   ActiveMQRABundle BUNDLE = Messages.getBundle(ActiveMQRABundle.class);
+
+   @Message(id = 159000, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
+
+   @Message(id = 159001, value = "MDB cannot be deployed as it has no Activation Spec. Please provide an Activation!", format = Message.Format.MESSAGE_FORMAT)
+   NotSupportedException noActivationSpec();
+
+   @Message(id = 159002, value = "Please provide a destination for the MDB", format = Message.Format.MESSAGE_FORMAT)
+   IllegalArgumentException noDestinationName();
+
+   @Message(id = 159003, value = ISE, format = Message.Format.MESSAGE_FORMAT)
+   JMSRuntimeException illegalJEEMethod();
+
+   @Message(id = 159004, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
+   JMSRuntimeException invalidSessionTransactedModeRuntime();
+
+   @Message(id = 159005, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
+   JMSRuntimeException invalidClientAcknowledgeModeRuntime();
+
+   @Message(id = 159006, value = "Invalid Session Mode {0}", format = Message.Format.MESSAGE_FORMAT)
+   JMSRuntimeException invalidAcknowledgeMode(int sessionMode);
+
+   @Message(id = 159007, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
+   JMSException invalidSessionTransactedMode();
+
+   @Message(id = 159008, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
+   JMSException invalidClientAcknowledgeMode();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABytesMessage.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABytesMessage.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABytesMessage.java
new file mode 100644
index 0000000..c4a24c7
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRABytesMessage.java
@@ -0,0 +1,455 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.util.Arrays;
+
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+
+
+/**
+ * A wrapper for a message
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRABytesMessage extends ActiveMQRAMessage implements BytesMessage
+{
+   /** Whether trace is enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Create a new wrapper
+    * @param message the message
+    * @param session the session
+    */
+   public ActiveMQRABytesMessage(final BytesMessage message, final ActiveMQRASession session)
+   {
+      super(message, session);
+
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", " + session + ")");
+      }
+   }
+
+   /**
+    * Get body length
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public long getBodyLength() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getBodyLength()");
+      }
+
+      return ((BytesMessage)message).getBodyLength();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public boolean readBoolean() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readBoolean()");
+      }
+
+      return ((BytesMessage)message).readBoolean();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public byte readByte() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readByte()");
+      }
+
+      return ((BytesMessage)message).readByte();
+   }
+
+   /**
+    * Read
+    * @param value The value
+    * @param length The length
+    * @return The result
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readBytes(final byte[] value, final int length) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ", " + length + ")");
+      }
+
+      return ((BytesMessage)message).readBytes(value, length);
+   }
+
+   /**
+    * Read
+    * @param value The value
+    * @return The result
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readBytes(final byte[] value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readBytes(" + Arrays.toString(value) + ")");
+      }
+
+      return ((BytesMessage)message).readBytes(value);
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public char readChar() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readChar()");
+      }
+
+      return ((BytesMessage)message).readChar();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public double readDouble() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readDouble()");
+      }
+
+      return ((BytesMessage)message).readDouble();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public float readFloat() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readFloat()");
+      }
+
+      return ((BytesMessage)message).readFloat();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readInt() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readInt()");
+      }
+
+      return ((BytesMessage)message).readInt();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public long readLong() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readLong()");
+      }
+
+      return ((BytesMessage)message).readLong();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public short readShort() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readShort()");
+      }
+
+      return ((BytesMessage)message).readShort();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readUnsignedByte() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readUnsignedByte()");
+      }
+
+      return ((BytesMessage)message).readUnsignedByte();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public int readUnsignedShort() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readUnsignedShort()");
+      }
+
+      return ((BytesMessage)message).readUnsignedShort();
+   }
+
+   /**
+    * Read
+    * @return The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public String readUTF() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("readUTF()");
+      }
+
+      return ((BytesMessage)message).readUTF();
+   }
+
+   /**
+    * Reset
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void reset() throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("reset()");
+      }
+
+      ((BytesMessage)message).reset();
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBoolean(final boolean value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBoolean(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeBoolean(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeByte(final byte value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeByte(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeByte(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @param offset The offset
+    * @param length The length
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBytes(" + Arrays.toString(value) + ", " + offset + ", " + length + ")");
+      }
+
+      ((BytesMessage)message).writeBytes(value, offset, length);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeBytes(final byte[] value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeBytes(" + Arrays.toString(value) + ")");
+      }
+
+      ((BytesMessage)message).writeBytes(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeChar(final char value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeChar(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeChar(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeDouble(final double value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeDouble(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeDouble(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeFloat(final float value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeFloat(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeFloat(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeInt(final int value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeInt(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeInt(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeLong(final long value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeLong(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeLong(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeObject(final Object value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeObject(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeObject(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeShort(final short value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeShort(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeShort(value);
+   }
+
+   /**
+    * Write
+    * @param value The value
+    * @exception JMSException Thrown if an error occurs
+    */
+   public void writeUTF(final String value) throws JMSException
+   {
+      if (ActiveMQRABytesMessage.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("writeUTF(" + value + ")");
+      }
+
+      ((BytesMessage)message).writeUTF(value);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactory.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactory.java
new file mode 100644
index 0000000..0c1869e
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactory.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.XAQueueConnectionFactory;
+import javax.jms.XATopicConnectionFactory;
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+import java.io.Serializable;
+
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * An aggregate interface for the JMS connection factories
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.com">Jesper Pedersen</a>
+ */
+public interface ActiveMQRAConnectionFactory extends XAQueueConnectionFactory,
+   XATopicConnectionFactory, Serializable, Referenceable
+{
+   /**
+    * Connection factory capable of handling connections
+    */
+   int CONNECTION = 0;
+
+   /**
+    * Connection factory capable of handling queues
+    */
+   int QUEUE_CONNECTION = 1;
+
+   /**
+    * Connection factory capable of handling topics
+    */
+   int TOPIC_CONNECTION = 2;
+
+   /**
+    * Connection factory capable of handling XA connections
+    */
+   int XA_CONNECTION = 3;
+
+   /**
+    * Connection factory capable of handling XA queues
+    */
+   int XA_QUEUE_CONNECTION = 4;
+
+   /**
+    * Connection factory capable of handling XA topics
+    */
+   int XA_TOPIC_CONNECTION = 5;
+
+   ActiveMQConnectionFactory getDefaultFactory() throws ResourceException;
+
+   ActiveMQResourceAdapter getResourceAdapter();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactoryImpl.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactoryImpl.java
new file mode 100644
index 0000000..b0d6d00
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionFactoryImpl.java
@@ -0,0 +1,570 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.Connection;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSRuntimeException;
+import javax.jms.JMSSecurityException;
+import javax.jms.JMSSecurityRuntimeException;
+import javax.jms.QueueConnection;
+import javax.jms.Session;
+import javax.jms.TopicConnection;
+import javax.jms.XAConnection;
+import javax.jms.XAJMSContext;
+import javax.jms.XAQueueConnection;
+import javax.jms.XATopicConnection;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.referenceable.ConnectionFactoryObjectFactory;
+import org.apache.activemq.jms.referenceable.SerializableObjectRefAddr;
+
+/**
+ * The connection factory
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAConnectionFactoryImpl implements ActiveMQRAConnectionFactory
+{
+   /**
+    * Serial version UID
+    */
+   static final long serialVersionUID = 7981708919479859360L;
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The managed connection factory
+    */
+   private final ActiveMQRAManagedConnectionFactory mcf;
+
+   /**
+    * The connection manager
+    */
+   private ConnectionManager cm;
+
+   /**
+    * Naming reference
+    */
+   private Reference reference;
+
+   /**
+    * Constructor
+    *
+    * @param mcf The managed connection factory
+    * @param cm  The connection manager
+    */
+   public ActiveMQRAConnectionFactoryImpl(final ActiveMQRAManagedConnectionFactory mcf, final ConnectionManager cm)
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mcf + ", " + cm + ")");
+      }
+
+      this.mcf = mcf;
+
+      if (cm == null)
+      {
+         // This is standalone usage, no appserver
+         this.cm = new ActiveMQRAConnectionManager();
+         if (ActiveMQRAConnectionFactoryImpl.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("Created new ConnectionManager=" + this.cm);
+         }
+      }
+      else
+      {
+         this.cm = cm;
+      }
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Using ManagedConnectionFactory=" + mcf + ", ConnectionManager=" + cm);
+      }
+   }
+
+   /**
+    * Set the reference
+    *
+    * @param reference The reference
+    */
+   public void setReference(final Reference reference)
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setReference(" + reference + ")");
+      }
+
+      this.reference = reference;
+   }
+
+   /**
+    * Get the reference
+    *
+    * @return The reference
+    */
+   public Reference getReference()
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getReference()");
+      }
+      if (reference == null)
+      {
+         try
+         {
+            reference = new Reference(this.getClass().getCanonicalName(),
+                                      new SerializableObjectRefAddr("ActiveMQ-CF", this),
+                                      ConnectionFactoryObjectFactory.class.getCanonicalName(),
+                                      null);
+         }
+         catch (NamingException e)
+         {
+            ActiveMQRALogger.LOGGER.errorCreatingReference(e);
+         }
+      }
+
+      return reference;
+
+   }
+
+   /**
+    * Create a queue connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public QueueConnection createQueueConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createQueueConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.QUEUE_CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created queue connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a queue connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public QueueConnection createQueueConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createQueueConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.QUEUE_CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created queue connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a topic connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public TopicConnection createTopicConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTopicConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.TOPIC_CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created topic connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a topic connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public TopicConnection createTopicConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createTopicConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.TOPIC_CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created topic connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public Connection createConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public Connection createConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA queue connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XAQueueConnection createXAQueueConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXAQueueConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created queue connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA  queue connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XAQueueConnection createXAQueueConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXAQueueConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created queue connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA topic connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XATopicConnection createXATopicConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXATopicConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created topic connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA topic connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XATopicConnection createXATopicConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXATopicConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf,
+                                                                      cm,
+                                                                      getResourceAdapter().getTM(),
+                                                                      ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created topic connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA connection
+    *
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XAConnection createXAConnection() throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXAConnection()");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.XA_CONNECTION);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created connection: " + s);
+      }
+
+      return s;
+   }
+
+   /**
+    * Create a XA connection
+    *
+    * @param userName The user name
+    * @param password The password
+    * @return The connection
+    * @throws JMSException Thrown if the operation fails
+    */
+   public XAConnection createXAConnection(final String userName, final String password) throws JMSException
+   {
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("createXAConnection(" + userName + ", ****)");
+      }
+
+      ActiveMQRASessionFactoryImpl s = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.XA_CONNECTION);
+      s.setUserName(userName);
+      s.setPassword(password);
+      validateUser(s);
+
+      if (ActiveMQRAConnectionFactoryImpl.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Created connection: " + s);
+      }
+
+      return s;
+   }
+
+   @Override
+   public JMSContext createContext()
+   {
+      return createContext(null, null);
+   }
+
+   @Override
+   public JMSContext createContext(String userName, String password)
+   {
+      return createContext(userName, password, Session.AUTO_ACKNOWLEDGE);
+   }
+
+   @Override
+   public JMSContext createContext(String userName, String password, int sessionMode)
+   {
+      @SuppressWarnings("resource")
+      ActiveMQRASessionFactoryImpl conn = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.CONNECTION);
+      conn.setUserName(userName);
+      conn.setPassword(password);
+      try
+      {
+         validateUser(conn);
+      }
+      catch (JMSSecurityException e)
+      {
+         JMSSecurityRuntimeException e2 = new JMSSecurityRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      return conn.createContext(sessionMode);
+   }
+
+   @Override
+   public JMSContext createContext(int sessionMode)
+   {
+      return createContext(null, null, sessionMode);
+   }
+
+   @Override
+   public XAJMSContext createXAContext()
+   {
+      return createXAContext(null, null);
+   }
+
+   @Override
+   public XAJMSContext createXAContext(String userName, String password)
+   {
+      ActiveMQRASessionFactoryImpl conn = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTM(), ActiveMQRAConnectionFactory.XA_CONNECTION);
+      conn.setUserName(userName);
+      conn.setPassword(password);
+      try
+      {
+         validateUser(conn);
+      }
+      catch (JMSSecurityException e)
+      {
+         JMSSecurityRuntimeException e2 = new JMSSecurityRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      catch (JMSException e)
+      {
+         JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
+         e2.initCause(e);
+         throw e2;
+      }
+      return conn.createXAContext();
+   }
+
+   private void validateUser(ActiveMQRASessionFactoryImpl s) throws JMSException
+   {
+      Session session = s.createSession();
+      session.close();
+   }
+
+   @Override
+   public ActiveMQConnectionFactory getDefaultFactory() throws ResourceException
+   {
+      return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getDefaultActiveMQConnectionFactory();
+   }
+
+   @Override
+   public ActiveMQResourceAdapter getResourceAdapter()
+   {
+      return (ActiveMQResourceAdapter) mcf.getResourceAdapter();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionManager.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionManager.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionManager.java
new file mode 100644
index 0000000..d41d9c7
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionManager.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import org.apache.activemq.utils.ConcurrentHashSet;
+
+
+/**
+ * The connection manager used in non-managed environments.
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAConnectionManager implements ConnectionManager
+{
+   /** Serial version UID */
+   static final long serialVersionUID = 4409118162975011014L;
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Constructor
+    */
+   public ActiveMQRAConnectionManager()
+   {
+      if (ActiveMQRAConnectionManager.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+   }
+
+   ConcurrentHashSet<ManagedConnection> connections = new ConcurrentHashSet<>();
+
+   /**
+    * Allocates a connection
+    * @param mcf The managed connection factory
+    * @param cxRequestInfo The connection request information
+    * @return The connection
+    * @exception ResourceException Thrown if there is a problem obtaining the connection
+    */
+   public Object allocateConnection(final ManagedConnectionFactory mcf, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ActiveMQRAConnectionManager.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("allocateConnection(" + mcf + ", " + cxRequestInfo + ")");
+      }
+
+      ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo);
+      Object c = mc.getConnection(null, cxRequestInfo);
+
+      if (ActiveMQRAConnectionManager.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("Allocated connection: " + c + ", with managed connection: " + mc);
+      }
+
+      connections.add(mc);
+      return c;
+   }
+
+   public void stop()
+   {
+      for (ManagedConnection conn : connections)
+      {
+         try
+         {
+            conn.destroy();
+         }
+         catch (Throwable e)
+         {
+
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionMetaData.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionMetaData.java
new file mode 100644
index 0000000..a2dbe98
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionMetaData.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import javax.jms.ConnectionMetaData;
+
+
+/**
+ * This class implements javax.jms.ConnectionMetaData
+ *
+ * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRAConnectionMetaData implements ConnectionMetaData
+{
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * Constructor
+    */
+   public ActiveMQRAConnectionMetaData()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+   }
+
+   /**
+    * Get the JMS version
+    * @return The version
+    */
+   public String getJMSVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSVersion()");
+      }
+
+      return "2.0";
+   }
+
+   /**
+    * Get the JMS major version
+    * @return The major version
+    */
+   public int getJMSMajorVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSMajorVersion()");
+      }
+
+      return 2;
+   }
+
+   /**
+    * Get the JMS minor version
+    * @return The minor version
+    */
+   public int getJMSMinorVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSMinorVersion()");
+      }
+
+      return 0;
+   }
+
+   /**
+    * Get the JMS provider name
+    * @return The name
+    */
+   public String getJMSProviderName()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSProviderName()");
+      }
+
+      return "ActiveMQ";
+   }
+
+   /**
+    * Get the provider version
+    * @return The version
+    */
+   public String getProviderVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getJMSProviderName()");
+      }
+
+      return "2.4";
+   }
+
+   /**
+    * Get the provider major version
+    * @return The version
+    */
+   public int getProviderMajorVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProviderMajorVersion()");
+      }
+
+      return 2;
+   }
+
+   /**
+    * Get the provider minor version
+    * @return The version
+    */
+   public int getProviderMinorVersion()
+   {
+      if (ActiveMQRAConnectionMetaData.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getProviderMinorVersion()");
+      }
+
+      return 4;
+   }
+
+   /**
+    * Get the JMS XPropertyNames
+    * @return The names
+    */
+   public Enumeration<Object> getJMSXPropertyNames()
+   {
+      Vector<Object> v = new Vector<Object>();
+      v.add("JMSXGroupID");
+      v.add("JMSXGroupSeq");
+      v.add("JMSXDeliveryCount");
+      return v.elements();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionRequestInfo.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionRequestInfo.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionRequestInfo.java
new file mode 100644
index 0000000..9a37a5d
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAConnectionRequestInfo.java
@@ -0,0 +1,306 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.Session;
+import javax.resource.spi.ConnectionRequestInfo;
+
+
+/**
+ * Connection request information
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ActiveMQRAConnectionRequestInfo implements ConnectionRequestInfo
+{
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The user name */
+   private String userName;
+
+   /** The password */
+   private String password;
+
+   /** The client id */
+   private String clientID;
+
+   /** The type */
+   private final int type;
+
+   /** Use transactions */
+   private final boolean transacted;
+
+   /** The acknowledge mode */
+   private final int acknowledgeMode;
+
+   /**
+    * Constructor
+    * @param prop The resource adapter properties
+    * @param type The connection type
+    */
+   public ActiveMQRAConnectionRequestInfo(final ActiveMQRAProperties prop, final int type)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + prop + ")");
+      }
+
+      userName = prop.getUserName();
+      password = prop.getPassword();
+      clientID = prop.getClientID();
+      this.type = type;
+      transacted = true;
+      acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
+   }
+
+   /**
+    * Constructor
+    * @param transacted Use transactions
+    * @param acknowledgeMode The acknowledge mode
+    * @param type The connection type
+    */
+   public ActiveMQRAConnectionRequestInfo(final boolean transacted, final int acknowledgeMode, final int type)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + transacted +
+                                                  ", " +
+                                                  acknowledgeMode +
+                                                  ", " +
+                                                  type +
+                                                  ")");
+      }
+
+      this.transacted = transacted;
+      this.acknowledgeMode = acknowledgeMode;
+      this.type = type;
+   }
+
+   /**
+    * Fill in default values if they are missing
+    * @param prop The resource adapter properties
+    */
+   public void setDefaults(final ActiveMQRAProperties prop)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setDefaults(" + prop + ")");
+      }
+
+      if (userName == null)
+      {
+         userName = prop.getUserName();
+      }
+      if (password == null)
+      {
+         password = prop.getPassword();
+      }
+      if (clientID == null)
+      {
+         clientID = prop.getClientID();
+      }
+   }
+
+   /**
+    * Get the user name
+    * @return The value
+    */
+   public String getUserName()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return userName;
+   }
+
+   /**
+    * Set the user name
+    * @param userName The value
+    */
+   public void setUserName(final String userName)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUserName(" + userName + ")");
+      }
+
+      this.userName = userName;
+   }
+
+   /**
+    * Get the password
+    * @return The value
+    */
+   public String getPassword()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPassword()");
+      }
+
+      return password;
+   }
+
+   /**
+    * Set the password
+    * @param password The value
+    */
+   public void setPassword(final String password)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      this.password = password;
+   }
+
+   /**
+    * Get the client id
+    * @return The value
+    */
+   public String getClientID()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getClientID()");
+      }
+
+      return clientID;
+   }
+
+   /**
+    * Set the client id
+    * @param clientID The value
+    */
+   public void setClientID(final String clientID)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setClientID(" + clientID + ")");
+      }
+
+      this.clientID = clientID;
+   }
+
+   /**
+    * Get the connection type
+    * @return The type
+    */
+   public int getType()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getType()");
+      }
+
+      return type;
+   }
+
+   /**
+    * Use transactions
+    * @return True if transacted; otherwise false
+    */
+   public boolean isTransacted()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("isTransacted() " + transacted);
+      }
+
+      return transacted;
+   }
+
+   /**
+    * Get the acknowledge mode
+    * @return The mode
+    */
+   public int getAcknowledgeMode()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()");
+      }
+
+      return acknowledgeMode;
+   }
+
+   /**
+    * Indicates whether some other object is "equal to" this one.
+    * @param obj Object with which to compare
+    * @return True if this object is the same as the obj argument; false otherwise.
+    */
+   @Override
+   public boolean equals(final Object obj)
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")");
+      }
+
+      if (obj == null)
+      {
+         return false;
+      }
+
+      if (obj instanceof ActiveMQRAConnectionRequestInfo)
+      {
+         ActiveMQRAConnectionRequestInfo you = (ActiveMQRAConnectionRequestInfo)obj;
+         return ActiveMQRaUtils.compare(userName, you.getUserName()) && ActiveMQRaUtils.compare(password, you.getPassword()) &&
+                ActiveMQRaUtils.compare(clientID, you.getClientID()) &&
+                type == you.getType() &&
+                transacted == you.isTransacted() &&
+                acknowledgeMode == you.getAcknowledgeMode();
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   /**
+    * Return the hash code for the object
+    * @return The hash code
+    */
+   @Override
+   public int hashCode()
+   {
+      if (ActiveMQRAConnectionRequestInfo.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("hashCode()");
+      }
+
+      int hash = 7;
+
+      hash += 31 * hash + (userName != null ? userName.hashCode() : 0);
+      hash += 31 * hash + (password != null ? password.hashCode() : 0);
+      hash += 31 * hash + Integer.valueOf(type).hashCode();
+      hash += 31 * hash + (transacted ? 1 : 0);
+      hash += 31 * hash + Integer.valueOf(acknowledgeMode).hashCode();
+
+      return hash;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ActiveMQRAConnectionRequestInfo[type=" + type +
+         ", transacted=" + transacted + ", acknowledgeMode=" + acknowledgeMode +
+         ", clientID=" + clientID + ", userName=" + userName + ", password=****]";
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRACredential.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRACredential.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRACredential.java
new file mode 100644
index 0000000..69fee4b
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRACredential.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.io.Serializable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Set;
+
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.SecurityException;
+import javax.resource.spi.security.PasswordCredential;
+import javax.security.auth.Subject;
+
+
+/**
+ * Credential information
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 71554 $
+ */
+public class ActiveMQRACredential implements Serializable
+{
+   /** Serial version UID */
+   static final long serialVersionUID = 210476602237497193L;
+
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The user name */
+   private String userName;
+
+   /** The password */
+   private String password;
+
+   /**
+    * Private constructor
+    */
+   private ActiveMQRACredential()
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+   }
+
+   /**
+    * Get the user name
+    * @return The value
+    */
+   public String getUserName()
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUserName()");
+      }
+
+      return userName;
+   }
+
+   /**
+    * Set the user name
+    * @param userName The value
+    */
+   private void setUserName(final String userName)
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUserName(" + userName + ")");
+      }
+
+      this.userName = userName;
+   }
+
+   /**
+    * Get the password
+    * @return The value
+    */
+   public String getPassword()
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getPassword()");
+      }
+
+      return password;
+   }
+
+   /**
+    * Set the password
+    * @param password The value
+    */
+   private void setPassword(final String password)
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setPassword(****)");
+      }
+
+      this.password = password;
+   }
+
+   /**
+    * Get credentials
+    * @param mcf The managed connection factory
+    * @param subject The subject
+    * @param info The connection request info
+    * @return The credentials
+    * @exception SecurityException Thrown if the credentials can't be retrieved
+    */
+   public static ActiveMQRACredential getCredential(final ManagedConnectionFactory mcf,
+                                                   final Subject subject,
+                                                   final ConnectionRequestInfo info) throws SecurityException
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getCredential(" + mcf + ", " + subject + ", " + info + ")");
+      }
+
+      ActiveMQRACredential jc = new ActiveMQRACredential();
+      if (subject == null && info != null)
+      {
+         jc.setUserName(((ActiveMQRAConnectionRequestInfo)info).getUserName());
+         jc.setPassword(((ActiveMQRAConnectionRequestInfo)info).getPassword());
+      }
+      else if (subject != null)
+      {
+         PasswordCredential pwdc = GetCredentialAction.getCredential(subject, mcf);
+
+         if (pwdc == null)
+         {
+            throw new SecurityException("No password credentials found");
+         }
+
+         jc.setUserName(pwdc.getUserName());
+         jc.setPassword(new String(pwdc.getPassword()));
+      }
+      else
+      {
+         throw new SecurityException("No Subject or ConnectionRequestInfo set, could not get credentials");
+      }
+
+      return jc;
+   }
+
+   /**
+    * String representation
+    * @return The representation
+    */
+   @Override
+   public String toString()
+   {
+      if (ActiveMQRACredential.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("toString()");
+      }
+
+      return super.toString() + "{ username=" + userName + ", password=**** }";
+   }
+
+   /**
+    * Privileged class to get credentials
+    */
+   private static class GetCredentialAction implements PrivilegedAction<PasswordCredential>
+   {
+      /** The subject */
+      private final Subject subject;
+
+      /** The managed connection factory */
+      private final ManagedConnectionFactory mcf;
+
+      /**
+       * Constructor
+       * @param subject The subject
+       * @param mcf The managed connection factory
+       */
+      GetCredentialAction(final Subject subject, final ManagedConnectionFactory mcf)
+      {
+         if (ActiveMQRACredential.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("constructor(" + subject + ", " + mcf + ")");
+         }
+
+         this.subject = subject;
+         this.mcf = mcf;
+      }
+
+      /**
+       * Run
+       * @return The credential
+       */
+      public PasswordCredential run()
+      {
+         if (ActiveMQRACredential.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("run()");
+         }
+
+         Set<PasswordCredential> creds = subject.getPrivateCredentials(PasswordCredential.class);
+         PasswordCredential pwdc = null;
+
+         for (PasswordCredential curCred : creds)
+         {
+            if (curCred.getManagedConnectionFactory().equals(mcf))
+            {
+               pwdc = curCred;
+               break;
+            }
+         }
+         return pwdc;
+      }
+
+      /**
+       * Get credentials
+       * @param subject The subject
+       * @param mcf The managed connection factory
+       * @return The credential
+       */
+      static PasswordCredential getCredential(final Subject subject, final ManagedConnectionFactory mcf)
+      {
+         if (ActiveMQRACredential.trace)
+         {
+            ActiveMQRALogger.LOGGER.trace("getCredential(" + subject + ", " + mcf + ")");
+         }
+
+         GetCredentialAction action = new GetCredentialAction(subject, mcf);
+         return AccessController.doPrivileged(action);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAJMSContext.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAJMSContext.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAJMSContext.java
new file mode 100644
index 0000000..b02e623
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAJMSContext.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import org.apache.activemq.jms.client.ActiveMQConnectionForContext;
+import org.apache.activemq.jms.client.ActiveMQJMSContext;
+import org.apache.activemq.jms.client.ThreadAwareContext;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSContext;
+
+public class ActiveMQRAJMSContext extends ActiveMQJMSContext
+{
+   public ActiveMQRAJMSContext(ActiveMQConnectionForContext connection, int ackMode, ThreadAwareContext threadAwareContext)
+   {
+      super(connection, ackMode, threadAwareContext);
+   }
+
+   public ActiveMQRAJMSContext(ActiveMQConnectionForContext connection, ThreadAwareContext threadAwareContext)
+   {
+      super(connection, threadAwareContext);
+   }
+
+   @Override
+   public JMSContext createContext(int sessionMode)
+   {
+      throw ActiveMQRABundle.BUNDLE.illegalJEEMethod();
+   }
+
+   @Override
+   public void stop()
+   {
+      throw ActiveMQRABundle.BUNDLE.illegalJEEMethod();
+   }
+
+   @Override
+   public void setClientID(String clientID)
+   {
+      throw ActiveMQRABundle.BUNDLE.illegalJEEMethod();
+   }
+
+   @Override
+   public void setExceptionListener(ExceptionListener listener)
+   {
+      throw ActiveMQRABundle.BUNDLE.illegalJEEMethod();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALocalTransaction.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALocalTransaction.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALocalTransaction.java
new file mode 100644
index 0000000..8de68ee
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALocalTransaction.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.JMSException;
+import javax.resource.ResourceException;
+import javax.resource.spi.LocalTransaction;
+
+
+/**
+ * JMS Local transaction
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ */
+public class ActiveMQRALocalTransaction implements LocalTransaction
+{
+   /** Trace enabled */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /** The managed connection */
+   private final ActiveMQRAManagedConnection mc;
+
+   /**
+    * Constructor
+    * @param mc The managed connection
+    */
+   public ActiveMQRALocalTransaction(final ActiveMQRAManagedConnection mc)
+   {
+      if (ActiveMQRALocalTransaction.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor(" + mc + ")");
+      }
+
+      this.mc = mc;
+   }
+
+   /**
+    * Begin
+    * @exception ResourceException Thrown if the operation fails
+    */
+   public void begin() throws ResourceException
+   {
+      if (ActiveMQRALocalTransaction.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("begin()");
+      }
+
+     // mc.setInManagedTx(true);
+   }
+
+   /**
+    * Commit
+    * @exception ResourceException Thrown if the operation fails
+    */
+   public void commit() throws ResourceException
+   {
+      if (ActiveMQRALocalTransaction.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("commit()");
+      }
+
+      mc.lock();
+      try
+      {
+         if (mc.getSession().getTransacted())
+         {
+            mc.getSession().commit();
+         }
+      }
+      catch (JMSException e)
+      {
+         throw new ResourceException("Could not commit LocalTransaction", e);
+      }
+      finally
+      {
+         //mc.setInManagedTx(false);
+         mc.unlock();
+      }
+   }
+
+   /**
+    * Rollback
+    * @exception ResourceException Thrown if the operation fails
+    */
+   public void rollback() throws ResourceException
+   {
+      if (ActiveMQRALocalTransaction.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("rollback()");
+      }
+
+      mc.lock();
+      try
+      {
+         if (mc.getSession().getTransacted())
+         {
+            mc.getSession().rollback();
+         }
+      }
+      catch (JMSException ex)
+      {
+         throw new ResourceException("Could not rollback LocalTransaction", ex);
+      }
+      finally
+      {
+         //mc.setInManagedTx(false);
+         mc.unlock();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java
new file mode 100644
index 0000000..8c0cf18
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.ra;
+
+import org.apache.activemq.ra.inflow.ActiveMQActivationSpec;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * Logger Code 15
+ * <p/>
+ * each message id must be 6 digits long starting with 15, the 3rd digit donates
+ * the level so
+ * <p/>
+ * <pre>
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ * </pre>
+ * <p/>
+ * so an INFO message would be 151000 to 151999
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 3/15/12
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQRALogger extends BasicLogger
+{
+   /**
+    * The default logger.
+    */
+   ActiveMQRALogger LOGGER = Logger.getMessageLogger(ActiveMQRALogger.class, ActiveMQRALogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151000, value = "awaiting topic/queue creation {0}", format = Message.Format.MESSAGE_FORMAT)
+   void awaitingTopicQueueCreation(String destination);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151001, value = "Attempting to reconnect {0}", format = Message.Format.MESSAGE_FORMAT)
+   void attemptingReconnect(ActiveMQActivationSpec spec);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151002, value = "Reconnected with ActiveMQ", format = Message.Format.MESSAGE_FORMAT)
+   void reconnected();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151003, value = "ActiveMQ resource adaptor stopped", format = Message.Format.MESSAGE_FORMAT)
+   void raStopped();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151004, value = "Instantiating {0} \"{1}\" directly since UseJNDI=false.", format = Message.Format.MESSAGE_FORMAT)
+   void instantiatingDestination(String destinationType, String destination);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 151005, value = "awaiting ActiveMQ Server availability", format = Message.Format.MESSAGE_FORMAT)
+   void awaitingJMSServerCreation();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152000, value = "It wasn''t possible to lookup for a Transaction Manager through the configured properties TransactionManagerLocatorClass and TransactionManagerLocatorMethod\nActiveMQ Resource Adapter won''t be able to set and verify transaction timeouts in certain cases.", format = Message.Format.MESSAGE_FORMAT)
+   void noTXLocator();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152001, value = "problem resetting ActiveMQ xa session after failure", format = Message.Format.MESSAGE_FORMAT)
+   void problemResettingXASession();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152002, value = "Unable to roll local transaction back", format = Message.Format.MESSAGE_FORMAT)
+   void unableToRollbackTX();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152003, value = "unable to reset session after failure", format = Message.Format.MESSAGE_FORMAT)
+   void unableToResetSession();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152004, value = "Handling JMS exception failure", format = Message.Format.MESSAGE_FORMAT)
+   void handlingJMSFailure(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152005, value = "Failure in ActiveMQ activation {0}", format = Message.Format.MESSAGE_FORMAT)
+   void failureInActivation(@Cause Throwable t, ActiveMQActivationSpec spec);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 152006, value = "Unable to call after delivery", format = Message.Format.MESSAGE_FORMAT)
+   void unableToCallAfterDelivery(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 154000, value = "Error while creating object Reference.", format = Message.Format.MESSAGE_FORMAT)
+   void errorCreatingReference(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 154001, value = "Unable to stop ActiveMQ resource adapter.", format = Message.Format.MESSAGE_FORMAT)
+   void errorStoppingRA(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 154003, value = "Unable to reconnect {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorReconnecting(@Cause Throwable t, ActiveMQActivationSpec spec);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 154004, value = "Failed to deliver message", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeliveringMessage(@Cause Throwable t);
+
+   @LogMessage(level = Logger.Level.DEBUG)
+   @Message(id = 153001, value = "using different ActiveMQRAConnectionFactory", format = Message.Format.MESSAGE_FORMAT)
+   void warnDifferentConnectionfactory();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMCFProperties.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMCFProperties.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMCFProperties.java
new file mode 100644
index 0000000..13db7a6
--- /dev/null
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAMCFProperties.java
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import java.io.Serializable;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+
+/**
+ * The MCF default properties - these are set in the <tx-connection-factory> at the jms-ds.xml
+ *
+ * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ActiveMQRAMCFProperties extends ConnectionFactoryProperties implements Serializable
+{
+   /**
+    * Serial version UID
+    */
+   static final long serialVersionUID = -5951352236582886862L;
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled();
+
+   /**
+    * The queue type
+    */
+   private static final String QUEUE_TYPE = Queue.class.getName();
+
+   /**
+    * The topic type
+    */
+   private static final String TOPIC_TYPE = Topic.class.getName();
+
+
+   private String strConnectorClassName;
+
+   public String strConnectionParameters;
+
+   /**
+    * The connection type
+    */
+   private int type = ActiveMQRAConnectionFactory.CONNECTION;
+
+   /**
+    * Use tryLock
+    */
+   private Integer useTryLock;
+
+   /**
+    * Constructor
+    */
+   public ActiveMQRAMCFProperties()
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("constructor()");
+      }
+
+      useTryLock = null;
+   }
+
+   /**
+    * Get the connection type
+    *
+    * @return The type
+    */
+   public int getType()
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getType()");
+      }
+
+      return type;
+   }
+
+   public String getConnectorClassName()
+   {
+      return strConnectorClassName;
+   }
+
+   public void setConnectorClassName(final String connectorClassName)
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setConnectorClassName(" + connectorClassName + ")");
+      }
+
+      strConnectorClassName = connectorClassName;
+
+      setParsedConnectorClassNames(ActiveMQRaUtils.parseConnectorConnectorConfig(connectorClassName));
+   }
+   /**
+    * @return the connectionParameters
+    */
+   public String getStrConnectionParameters()
+   {
+      return strConnectionParameters;
+   }
+
+   public void setConnectionParameters(final String configuration)
+   {
+      strConnectionParameters = configuration;
+      setParsedConnectionParameters(ActiveMQRaUtils.parseConfig(configuration));
+   }
+
+   /**
+    * Set the default session type.
+    *
+    * @param defaultType either javax.jms.Topic or javax.jms.Queue
+    */
+   public void setSessionDefaultType(final String defaultType)
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setSessionDefaultType(" + type + ")");
+      }
+
+      if (defaultType.equals(ActiveMQRAMCFProperties.QUEUE_TYPE))
+      {
+         type = ActiveMQRAConnectionFactory.QUEUE_CONNECTION;
+      }
+      else if (defaultType.equals(ActiveMQRAMCFProperties.TOPIC_TYPE))
+      {
+         type = ActiveMQRAConnectionFactory.TOPIC_CONNECTION;
+      }
+      else
+      {
+         type = ActiveMQRAConnectionFactory.CONNECTION;
+      }
+   }
+
+   /**
+    * Get the default session type.
+    *
+    * @return The default session type
+    */
+   public String getSessionDefaultType()
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getSessionDefaultType()");
+      }
+
+      if (type == ActiveMQRAConnectionFactory.CONNECTION)
+      {
+         return "BOTH";
+      }
+      else if (type == ActiveMQRAConnectionFactory.QUEUE_CONNECTION)
+      {
+         return ActiveMQRAMCFProperties.TOPIC_TYPE;
+      }
+      else
+      {
+         return ActiveMQRAMCFProperties.QUEUE_TYPE;
+      }
+   }
+
+   /**
+    * Get the useTryLock.
+    *
+    * @return the useTryLock.
+    */
+   public Integer getUseTryLock()
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("getUseTryLock()");
+      }
+
+      return useTryLock;
+   }
+
+   /**
+    * Set the useTryLock.
+    *
+    * @param useTryLock the useTryLock.
+    */
+   public void setUseTryLock(final Integer useTryLock)
+   {
+      if (ActiveMQRAMCFProperties.trace)
+      {
+         ActiveMQRALogger.LOGGER.trace("setUseTryLock(" + useTryLock + ")");
+      }
+
+      this.useTryLock = useTryLock;
+   }
+}


[31/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-server/src/main/java/org/apache/activemq/jms/transaction/JMSTransactionDetail.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/transaction/JMSTransactionDetail.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/transaction/JMSTransactionDetail.java
index 31809a2..49f61d4 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/transaction/JMSTransactionDetail.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/transaction/JMSTransactionDetail.java
@@ -19,12 +19,12 @@ import javax.transaction.xa.Xid;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.transaction.Transaction;
 import org.apache.activemq.core.transaction.TransactionDetail;
-import org.apache.activemq.jms.client.HornetQBytesMessage;
-import org.apache.activemq.jms.client.HornetQMapMessage;
-import org.apache.activemq.jms.client.HornetQMessage;
-import org.apache.activemq.jms.client.HornetQObjectMessage;
-import org.apache.activemq.jms.client.HornetQStreamMessage;
-import org.apache.activemq.jms.client.HornetQTextMessage;
+import org.apache.activemq.jms.client.ActiveMQBytesMessage;
+import org.apache.activemq.jms.client.ActiveMQMapMessage;
+import org.apache.activemq.jms.client.ActiveMQMessage;
+import org.apache.activemq.jms.client.ActiveMQObjectMessage;
+import org.apache.activemq.jms.client.ActiveMQStreamMessage;
+import org.apache.activemq.jms.client.ActiveMQTextMessage;
 
 /**
  * A JMSTransactionDetail
@@ -46,17 +46,17 @@ public class JMSTransactionDetail extends TransactionDetail
       int type = msg.getType();
       switch (type)
       {
-         case HornetQMessage.TYPE: // 0
+         case ActiveMQMessage.TYPE: // 0
             return "Default";
-         case HornetQObjectMessage.TYPE: // 2
+         case ActiveMQObjectMessage.TYPE: // 2
             return "ObjectMessage";
-         case HornetQTextMessage.TYPE: // 3
+         case ActiveMQTextMessage.TYPE: // 3
             return "TextMessage";
-         case HornetQBytesMessage.TYPE: // 4
+         case ActiveMQBytesMessage.TYPE: // 4
             return "ByteMessage";
-         case HornetQMapMessage.TYPE: // 5
+         case ActiveMQMapMessage.TYPE: // 5
             return "MapMessage";
-         case HornetQStreamMessage.TYPE: // 6
+         case ActiveMQStreamMessage.TYPE: // 6
             return "StreamMessage";
          default:
             return "(Unknown Type)";
@@ -68,7 +68,7 @@ public class JMSTransactionDetail extends TransactionDetail
    {
       try
       {
-         return HornetQMessage.coreMaptoJMSMap(msg.toMap());
+         return ActiveMQMessage.coreMaptoJMSMap(msg.toMap());
       }
       catch (Throwable t)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/ActiveMQFileLock.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/ActiveMQFileLock.java b/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/ActiveMQFileLock.java
new file mode 100644
index 0000000..5fcd3e3
--- /dev/null
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/ActiveMQFileLock.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.core.asyncio.impl;
+
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+
+import org.apache.activemq.core.libaio.Native;
+
+/**
+ * A ActiveMQFileLock
+ * @author clebertsuconic
+ */
+public class ActiveMQFileLock extends FileLock
+{
+
+   private final int handle;
+
+   protected ActiveMQFileLock(final int handle)
+   {
+      super((FileChannel)null, 0, 0, false);
+      this.handle = handle;
+   }
+
+   @Override
+   public boolean isValid()
+   {
+      return true;
+   }
+
+   @Override
+   public void release() throws IOException
+   {
+      Native.closeFile(handle);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/AsynchronousFileImpl.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/AsynchronousFileImpl.java b/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/AsynchronousFileImpl.java
index f087537..c497356 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/AsynchronousFileImpl.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/AsynchronousFileImpl.java
@@ -31,7 +31,7 @@ import org.apache.activemq.core.asyncio.AsynchronousFile;
 import org.apache.activemq.core.asyncio.BufferCallback;
 import org.apache.activemq.core.asyncio.IOExceptionListener;
 import org.apache.activemq.core.libaio.Native;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 import org.apache.activemq.utils.ReusableLatch;
 
 /**
@@ -111,11 +111,11 @@ public class AsynchronousFileImpl implements AsynchronousFile
    {
       try
       {
-         HornetQJournalLogger.LOGGER.trace(name + " being loaded");
+         ActiveMQJournalLogger.LOGGER.trace(name + " being loaded");
          System.loadLibrary(name);
          if (Native.getNativeVersion() != AsynchronousFileImpl.EXPECTED_NATIVE_VERSION)
          {
-            HornetQJournalLogger.LOGGER.incompatibleNativeLibrary();
+            ActiveMQJournalLogger.LOGGER.incompatibleNativeLibrary();
             return false;
          }
          else
@@ -125,7 +125,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
       }
       catch (Throwable e)
       {
-         HornetQJournalLogger.LOGGER.debug(name + " -> error loading the native library", e);
+         ActiveMQJournalLogger.LOGGER.debug(name + " -> error loading the native library", e);
          return false;
       }
 
@@ -144,13 +144,13 @@ public class AsynchronousFileImpl implements AsynchronousFile
          }
          else
          {
-            HornetQJournalLogger.LOGGER.debug("Library " + library + " not found!");
+            ActiveMQJournalLogger.LOGGER.debug("Library " + library + " not found!");
          }
       }
 
       if (!AsynchronousFileImpl.loaded)
       {
-         HornetQJournalLogger.LOGGER.debug("Couldn't locate LibAIO Wrapper");
+         ActiveMQJournalLogger.LOGGER.debug("Couldn't locate LibAIO Wrapper");
       }
    }
 
@@ -238,7 +238,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
 
          try
          {
-            handler = Native.init(AsynchronousFileImpl.class, fileName1, this.maxIO, HornetQJournalLogger.LOGGER);
+            handler = Native.init(AsynchronousFileImpl.class, fileName1, this.maxIO, ActiveMQJournalLogger.LOGGER);
          }
          catch (ActiveMQException e)
          {
@@ -279,12 +279,12 @@ public class AsynchronousFileImpl implements AsynchronousFile
 
          while (!pendingWrites.await(60000))
          {
-            HornetQJournalLogger.LOGGER.couldNotGetLock(fileName);
+            ActiveMQJournalLogger.LOGGER.couldNotGetLock(fileName);
          }
 
          while (!maxIOSemaphore.tryAcquire(maxIO, 60, TimeUnit.SECONDS))
          {
-            HornetQJournalLogger.LOGGER.couldNotGetLock(fileName);
+            ActiveMQJournalLogger.LOGGER.couldNotGetLock(fileName);
          }
 
          maxIOSemaphore = null;
@@ -493,7 +493,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
    {
       if (opened)
       {
-         HornetQJournalLogger.LOGGER.fileFinalizedWhileOpen(fileName);
+         ActiveMQJournalLogger.LOGGER.fileFinalizedWhileOpen(fileName);
       }
    }
 
@@ -566,7 +566,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
                               final int errorCode,
                               final String errorMessage)
    {
-      HornetQJournalLogger.LOGGER.callbackError(errorMessage);
+      ActiveMQJournalLogger.LOGGER.callbackError(errorMessage);
 
       fireExceptionListener(errorCode, errorMessage);
 
@@ -616,7 +616,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
     */
    private void fireExceptionListener(final int errorCode, final String errorMessage)
    {
-      HornetQJournalLogger.LOGGER.ioError(errorCode, errorMessage);
+      ActiveMQJournalLogger.LOGGER.ioError(errorCode, errorMessage);
       if (ioExceptionListener != null)
       {
          ioExceptionListener.onIOException(ActiveMQExceptionType.getType(errorCode).createException(errorMessage), errorMessage);
@@ -649,7 +649,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
             }
             catch (Exception ex)
             {
-               HornetQJournalLogger.LOGGER.errorStartingPoller(ex);
+               ActiveMQJournalLogger.LOGGER.errorStartingPoller(ex);
             }
          }
       }
@@ -683,7 +683,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
    {
       if (Native.flock(handle))
       {
-         return new HornetQFileLock(handle);
+         return new ActiveMQFileLock(handle);
       }
       else
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/HornetQFileLock.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/HornetQFileLock.java b/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/HornetQFileLock.java
deleted file mode 100644
index 94546ce..0000000
--- a/activemq-journal/src/main/java/org/apache/activemq/core/asyncio/impl/HornetQFileLock.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.core.asyncio.impl;
-
-import java.io.IOException;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-
-import org.apache.activemq.core.libaio.Native;
-
-/**
- * A HornetQFileLock
- * @author clebertsuconic
- */
-public class HornetQFileLock extends FileLock
-{
-
-   private final int handle;
-
-   protected HornetQFileLock(final int handle)
-   {
-      super((FileChannel)null, 0, 0, false);
-      this.handle = handle;
-   }
-
-   @Override
-   public boolean isValid()
-   {
-      return true;
-   }
-
-   @Override
-   public void release() throws IOException
-   {
-      Native.closeFile(handle);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/Journal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/Journal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/Journal.java
index c311f70..a174aae 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/Journal.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/Journal.java
@@ -16,7 +16,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.activemq.core.journal.impl.JournalFile;
-import org.apache.activemq.core.server.HornetQComponent;
+import org.apache.activemq.core.server.ActiveMQComponent;
 
 /**
  * Most methods on the journal provide a blocking version where you select the sync mode and a non
@@ -28,7 +28,7 @@ import org.apache.activemq.core.server.HornetQComponent;
  * @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
  * @see org.apache.activemq.utils.IDGenerator
  */
-public interface Journal extends HornetQComponent
+public interface Journal extends ActiveMQComponent
 {
    enum JournalState
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AIOSequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AIOSequentialFileFactory.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AIOSequentialFileFactory.java
index 1313546..8002155 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AIOSequentialFileFactory.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AIOSequentialFileFactory.java
@@ -26,8 +26,8 @@ import org.apache.activemq.core.asyncio.impl.AsynchronousFileImpl;
 import org.apache.activemq.core.journal.IOCriticalErrorListener;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.libaio.Native;
-import org.apache.activemq.journal.HornetQJournalLogger;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 
 /**
  * A AIOSequentialFileFactory
@@ -36,7 +36,7 @@ import org.apache.activemq.utils.HornetQThreadFactory;
  */
 public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory
 {
-   private static final boolean trace = HornetQJournalLogger.LOGGER.isTraceEnabled();
+   private static final boolean trace = ActiveMQJournalLogger.LOGGER.isTraceEnabled();
 
    private final ReuseBuffersController buffersControl = new ReuseBuffersController();
 
@@ -47,7 +47,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    // Journal
    private static void trace(final String message)
    {
-      HornetQJournalLogger.LOGGER.trace(message);
+      ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
    public AIOSequentialFileFactory(final String journalDir)
@@ -181,7 +181,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    {
       super.start();
 
-      pollerExecutor = Executors.newCachedThreadPool(new HornetQThreadFactory("ActiveMQ-AIO-poller-pool" + System.identityHashCode(this),
+      pollerExecutor = Executors.newCachedThreadPool(new ActiveMQThreadFactory("ActiveMQ-AIO-poller-pool" + System.identityHashCode(this),
                                                                               true,
                                                                               AIOSequentialFileFactory.getThisClassLoader()));
 
@@ -200,7 +200,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
          {
             if (!pollerExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS))
             {
-               HornetQJournalLogger.LOGGER.timeoutOnPollerShutdown(new Exception("trace"));
+               ActiveMQJournalLogger.LOGGER.timeoutOnPollerShutdown(new Exception("trace"));
             }
          }
          catch (InterruptedException e)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFile.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFile.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFile.java
index aebefb7..ecf5e87 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFile.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFile.java
@@ -29,8 +29,8 @@ import org.apache.activemq.core.journal.EncodingSupport;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.journal.HornetQJournalBundle;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalBundle;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A AbstractSequentialFile
@@ -100,7 +100,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
 
       if (file.exists() && !file.delete())
       {
-         HornetQJournalLogger.LOGGER.errorDeletingFile(this);
+         ActiveMQJournalLogger.LOGGER.errorDeletingFile(this);
       }
    }
 
@@ -108,7 +108,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
    {
       try
       {
-         HornetQJournalLogger.LOGGER.debug("Copying " + this + " as " + newFileName);
+         ActiveMQJournalLogger.LOGGER.debug("Copying " + this + " as " + newFileName);
          if (!newFileName.isOpen())
          {
             newFileName.open();
@@ -175,7 +175,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
       {
          if (!file.renameTo(newFile))
          {
-            throw HornetQJournalBundle.BUNDLE.ioRenameFileError(file.getName(), newFileName);
+            throw ActiveMQJournalBundle.BUNDLE.ioRenameFileError(file.getName(), newFileName);
          }
          file = newFile;
       }
@@ -201,7 +201,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
 
          while (!donelatch.await(60, TimeUnit.SECONDS))
          {
-            HornetQJournalLogger.LOGGER.couldNotCompleteTask(new Exception("trace"), file.getName());
+            ActiveMQJournalLogger.LOGGER.couldNotCompleteTask(new Exception("trace"), file.getName());
          }
       }
    }
@@ -328,7 +328,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
             }
             catch (Throwable e)
             {
-               HornetQJournalLogger.LOGGER.errorCompletingCallback(e);
+               ActiveMQJournalLogger.LOGGER.errorCompletingCallback(e);
             }
          }
       }
@@ -343,7 +343,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
             }
             catch (Throwable e)
             {
-               HornetQJournalLogger.LOGGER.errorCallingErrorCallback(e);
+               ActiveMQJournalLogger.LOGGER.errorCallingErrorCallback(e);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFileFactory.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFileFactory.java
index bec5106..024b160 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFileFactory.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/AbstractSequentialFileFactory.java
@@ -28,8 +28,8 @@ import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.core.journal.IOCriticalErrorListener;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.journal.HornetQJournalLogger;
-import org.apache.activemq.utils.HornetQThreadFactory;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
+import org.apache.activemq.utils.ActiveMQThreadFactory;
 
 /**
  *
@@ -99,7 +99,7 @@ abstract class AbstractSequentialFileFactory implements SequentialFileFactory
          {
             if (!writeExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS))
             {
-               HornetQJournalLogger.LOGGER.timeoutOnWriterShutdown(new Exception("trace"));
+               ActiveMQJournalLogger.LOGGER.timeoutOnWriterShutdown(new Exception("trace"));
             }
          }
          catch (InterruptedException e)
@@ -123,7 +123,7 @@ abstract class AbstractSequentialFileFactory implements SequentialFileFactory
 
       if (isSupportsCallbacks())
       {
-         writeExecutor = Executors.newSingleThreadExecutor(new HornetQThreadFactory("HornetQ-Asynchronous-Persistent-Writes" + System.identityHashCode(this),
+         writeExecutor = Executors.newSingleThreadExecutor(new ActiveMQThreadFactory("ActiveMQ-Asynchronous-Persistent-Writes" + System.identityHashCode(this),
                                                                                     true,
                                                                                     AbstractSequentialFileFactory.getThisClassLoader()));
       }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/CompactJournal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/CompactJournal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/CompactJournal.java
index c2d68ab..5ffe75d 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/CompactJournal.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/CompactJournal.java
@@ -29,7 +29,7 @@ public final class CompactJournal // NO_UCD
    {
       if (arg.length != 4)
       {
-         System.err.println("Use: java -cp hornetq-core.jar org.apache.activemq.core.journal.impl.CompactJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize>");
+         System.err.println("Use: java -cp activemq-core.jar org.apache.activemq.core.journal.impl.CompactJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize>");
          return;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/DummyCallback.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/DummyCallback.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/DummyCallback.java
index d0e3fb5..4150008 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/DummyCallback.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/DummyCallback.java
@@ -12,7 +12,7 @@
  */
 package org.apache.activemq.core.journal.impl;
 
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A DummyCallback
@@ -36,7 +36,7 @@ class DummyCallback extends SyncIOCompletion
 
    public void onError(final int errorCode, final String errorMessage)
    {
-      HornetQJournalLogger.LOGGER.errorWritingData(new Exception(errorMessage), errorMessage, errorCode);
+      ActiveMQJournalLogger.LOGGER.errorWritingData(new Exception(errorMessage), errorMessage, errorCode);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
index 87ff658..ee55d6b 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
@@ -27,7 +27,7 @@ import org.apache.activemq.utils.Base64;
  *
  * If you use the main method, use it as  <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
  *
- * Example: java -cp hornetq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * Example: java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
  *
  * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
  *
@@ -50,7 +50,7 @@ public class ExportJournal
    {
       if (arg.length != 5)
       {
-         System.err.println("Use: java -cp hornetq-core.jar org.apache.activemq.core.journal.impl.ExportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
+         System.err.println("Use: java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
          return;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
index d845e47..047efde 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
@@ -40,7 +40,7 @@ import org.apache.activemq.utils.Base64;
  * Example:
  *
  * <pre>
- * java -cp hornetq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
  * </pre>
  * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
  */
@@ -61,7 +61,7 @@ public class ImportJournal
    {
       if (arg.length != 5)
       {
-         System.err.println("Use: java -cp hornetq-core.jar:netty.jar org.apache.activemq.core.journal.impl.ImportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
+         System.err.println("Use: java -cp activemq-core.jar:netty.jar org.apache.activemq.core.journal.impl.ImportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
          return;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalCompactor.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalCompactor.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalCompactor.java
index d582be1..5cbc654 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalCompactor.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalCompactor.java
@@ -34,7 +34,7 @@ import org.apache.activemq.core.journal.impl.dataformat.JournalCompleteRecordTX.
 import org.apache.activemq.core.journal.impl.dataformat.JournalDeleteRecordTX;
 import org.apache.activemq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.apache.activemq.core.journal.impl.dataformat.JournalRollbackRecordTX;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A JournalCompactor
@@ -284,7 +284,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ
          }
          catch (Exception e)
          {
-            HornetQJournalLogger.LOGGER.errorReplayingCommands(e);
+            ActiveMQJournalLogger.LOGGER.errorReplayingCommands(e);
          }
       }
 
@@ -339,7 +339,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ
       if (pendingTransactions.get(transactionID) != null)
       {
          // Sanity check, this should never happen
-         HornetQJournalLogger.LOGGER.inconsistencyDuringCompacting(transactionID);
+         ActiveMQJournalLogger.LOGGER.inconsistencyDuringCompacting(transactionID);
       }
       else
       {
@@ -363,7 +363,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ
       if (newRecords.get(recordID) != null)
       {
          // Sanity check, it should never happen
-         HornetQJournalLogger.LOGGER.inconsistencyDuringCompactingDelete(recordID);
+         ActiveMQJournalLogger.LOGGER.inconsistencyDuringCompactingDelete(recordID);
       }
 
    }
@@ -454,7 +454,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ
 
          if (newRecord == null)
          {
-            HornetQJournalLogger.LOGGER.compactingWithNoAddRecord(info.id);
+            ActiveMQJournalLogger.LOGGER.compactingWithNoAddRecord(info.id);
          }
          else
          {
@@ -529,7 +529,7 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ
          JournalRecord deleteRecord = journal.getRecords().remove(id);
          if (deleteRecord == null)
          {
-            HornetQJournalLogger.LOGGER.noRecordDuringCompactReplay(id);
+            ActiveMQJournalLogger.LOGGER.noRecordDuringCompactReplay(id);
          }
          else
          {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalFilesRepository.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalFilesRepository.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalFilesRepository.java
index 81b31eb..9c7600b 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalFilesRepository.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalFilesRepository.java
@@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * This is a helper class for the Journal, which will control access to dataFiles, openedFiles and freeFiles
@@ -39,7 +39,7 @@ import org.apache.activemq.journal.HornetQJournalLogger;
  */
 public class JournalFilesRepository
 {
-   private static final boolean trace = HornetQJournalLogger.LOGGER.isTraceEnabled();
+   private static final boolean trace = ActiveMQJournalLogger.LOGGER.isTraceEnabled();
 
    /**
     * Used to debug the consistency of the journal ordering.
@@ -53,7 +53,7 @@ public class JournalFilesRepository
    // Journal
    private static void trace(final String message)
    {
-      HornetQJournalLogger.LOGGER.trace(message);
+      ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
    private final SequentialFileFactory fileFactory;
@@ -94,7 +94,7 @@ public class JournalFilesRepository
          }
          catch (Exception e)
          {
-            HornetQJournalLogger.LOGGER.errorPushingFile(e);
+            ActiveMQJournalLogger.LOGGER.errorPushingFile(e);
          }
       }
    };
@@ -153,7 +153,7 @@ public class JournalFilesRepository
          }
          catch (Exception e)
          {
-            HornetQJournalLogger.LOGGER.errorClosingFile(e);
+            ActiveMQJournalLogger.LOGGER.errorClosingFile(e);
          }
       }
       openedFiles.clear();
@@ -256,7 +256,7 @@ public class JournalFilesRepository
    {
       if (!dataFiles.remove(file))
       {
-         HornetQJournalLogger.LOGGER.couldNotRemoveFile(file);
+         ActiveMQJournalLogger.LOGGER.couldNotRemoveFile(file);
       }
    }
 
@@ -310,17 +310,17 @@ public class JournalFilesRepository
       {
          if (file.getFileID() <= seq)
          {
-            HornetQJournalLogger.LOGGER.checkFiles();
-            HornetQJournalLogger.LOGGER.info(debugFiles());
-            HornetQJournalLogger.LOGGER.seqOutOfOrder();
+            ActiveMQJournalLogger.LOGGER.checkFiles();
+            ActiveMQJournalLogger.LOGGER.info(debugFiles());
+            ActiveMQJournalLogger.LOGGER.seqOutOfOrder();
             System.exit(-1);
          }
 
          if (journal.getCurrentFile() != null && journal.getCurrentFile().getFileID() <= file.getFileID())
          {
-            HornetQJournalLogger.LOGGER.checkFiles();
-            HornetQJournalLogger.LOGGER.info(debugFiles());
-            HornetQJournalLogger.LOGGER.currentFile(file.getFileID(), journal.getCurrentFile().getFileID(),
+            ActiveMQJournalLogger.LOGGER.checkFiles();
+            ActiveMQJournalLogger.LOGGER.info(debugFiles());
+            ActiveMQJournalLogger.LOGGER.currentFile(file.getFileID(), journal.getCurrentFile().getFileID(),
                                                     file.getFileID(), (journal.getCurrentFile() == file));
 
             // throw new RuntimeException ("Check failure!");
@@ -339,9 +339,9 @@ public class JournalFilesRepository
       {
          if (file.getFileID() <= lastFreeId)
          {
-            HornetQJournalLogger.LOGGER.checkFiles();
-            HornetQJournalLogger.LOGGER.info(debugFiles());
-            HornetQJournalLogger.LOGGER.fileIdOutOfOrder();
+            ActiveMQJournalLogger.LOGGER.checkFiles();
+            ActiveMQJournalLogger.LOGGER.info(debugFiles());
+            ActiveMQJournalLogger.LOGGER.fileIdOutOfOrder();
 
             throw new RuntimeException("Check failure!");
          }
@@ -350,9 +350,9 @@ public class JournalFilesRepository
 
          if (file.getFileID() < seq)
          {
-            HornetQJournalLogger.LOGGER.checkFiles();
-            HornetQJournalLogger.LOGGER.info(debugFiles());
-            HornetQJournalLogger.LOGGER.fileTooSmall();
+            ActiveMQJournalLogger.LOGGER.checkFiles();
+            ActiveMQJournalLogger.LOGGER.info(debugFiles());
+            ActiveMQJournalLogger.LOGGER.fileTooSmall();
 
             // throw new RuntimeException ("Check failure!");
          }
@@ -406,7 +406,7 @@ public class JournalFilesRepository
       }
       if (calculatedSize != fileSize)
       {
-         HornetQJournalLogger.LOGGER.deletingFile(file);
+         ActiveMQJournalLogger.LOGGER.deletingFile(file);
          file.getFile().delete();
       }
       else
@@ -433,11 +433,11 @@ public class JournalFilesRepository
          {
             if (trace)
             {
-               HornetQJournalLogger.LOGGER.trace("DataFiles.size() = " + dataFiles.size());
-               HornetQJournalLogger.LOGGER.trace("openedFiles.size() = " + openedFiles.size());
-               HornetQJournalLogger.LOGGER.trace("minfiles = " + minFiles);
-               HornetQJournalLogger.LOGGER.trace("Free Files = " + freeFilesCount.get());
-               HornetQJournalLogger.LOGGER.trace("File " + file +
+               ActiveMQJournalLogger.LOGGER.trace("DataFiles.size() = " + dataFiles.size());
+               ActiveMQJournalLogger.LOGGER.trace("openedFiles.size() = " + openedFiles.size());
+               ActiveMQJournalLogger.LOGGER.trace("minfiles = " + minFiles);
+               ActiveMQJournalLogger.LOGGER.trace("Free Files = " + freeFilesCount.get());
+               ActiveMQJournalLogger.LOGGER.trace("File " + file +
                                                     " being deleted as freeFiles.size() + dataFiles.size() + 1 + openedFiles.size() (" +
                                                     (freeFilesCount.get() + dataFiles.size() + 1 + openedFiles.size()) +
                                                     ") < minFiles (" + minFiles + ")");
@@ -473,7 +473,7 @@ public class JournalFilesRepository
    /**
     * <p>This method will instantly return the opened file, and schedule opening and reclaiming.</p>
     * <p>In case there are no cached opened files, this method will block until the file was opened,
-    * what would happen only if the system is under heavy load by another system (like a backup system, or a DB sharing the same box as HornetQ).</p>
+    * what would happen only if the system is under heavy load by another system (like a backup system, or a DB sharing the same box as ActiveMQ).</p>
     */
    public JournalFile openFile() throws InterruptedException
    {
@@ -498,7 +498,7 @@ public class JournalFilesRepository
          nextFile = openedFiles.poll(5, TimeUnit.SECONDS);
          if (nextFile == null)
          {
-            HornetQJournalLogger.LOGGER.errorOpeningFile(new Exception("trace"));
+            ActiveMQJournalLogger.LOGGER.errorOpeningFile(new Exception("trace"));
          }
       }
 
@@ -524,7 +524,7 @@ public class JournalFilesRepository
 
       if (!openedFiles.offer(nextOpenedFile))
       {
-         HornetQJournalLogger.LOGGER.failedToAddFile(nextOpenedFile);
+         ActiveMQJournalLogger.LOGGER.failedToAddFile(nextOpenedFile);
       }
    }
 
@@ -733,7 +733,7 @@ public class JournalFilesRepository
       }
       catch (Throwable e)
       {
-         HornetQJournalLogger.LOGGER.errorRetrievingID(e, fileName);
+         ActiveMQJournalLogger.LOGGER.errorRetrievingID(e, fileName);
          return 0;
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalImpl.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalImpl.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalImpl.java
index d5ba1ce..206a9eb 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalImpl.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/JournalImpl.java
@@ -62,8 +62,8 @@ import org.apache.activemq.core.journal.impl.dataformat.JournalDeleteRecord;
 import org.apache.activemq.core.journal.impl.dataformat.JournalDeleteRecordTX;
 import org.apache.activemq.core.journal.impl.dataformat.JournalInternalRecord;
 import org.apache.activemq.core.journal.impl.dataformat.JournalRollbackRecordTX;
-import org.apache.activemq.journal.HornetQJournalBundle;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalBundle;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 import org.apache.activemq.utils.ConcurrentHashSet;
 import org.apache.activemq.utils.DataConstants;
 
@@ -85,7 +85,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
    private static final int[] COMPATIBLE_VERSIONS = new int[]{1};
 
    // Static --------------------------------------------------------
-   private static final boolean trace = HornetQJournalLogger.LOGGER.isTraceEnabled();
+   private static final boolean trace = ActiveMQJournalLogger.LOGGER.isTraceEnabled();
 
    // This is useful at debug time...
    // if you set it to true, all the appends, deletes, rollbacks, commits, etc.. are sent to System.out
@@ -96,12 +96,12 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
    // Journal
    private static void trace(final String message)
    {
-      HornetQJournalLogger.LOGGER.trace(message);
+      ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
    private static void traceRecord(final String message)
    {
-      HornetQJournalLogger.LOGGER.trace(message);
+      ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
    // The sizes of primitive types
@@ -288,7 +288,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
    {
       final int numIts = 100000000;
 
-      HornetQJournalLogger.LOGGER.runningJournalBlast(numIts);
+      ActiveMQJournalLogger.LOGGER.runningJournalBlast(numIts);
 
       final CountDownLatch latch = new CountDownLatch(numIts * 2);
 
@@ -747,7 +747,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
       }
       catch (Throwable e)
       {
-         HornetQJournalLogger.LOGGER.errorReadingFile(e);
+         ActiveMQJournalLogger.LOGGER.errorReadingFile(e);
          throw new Exception(e.getMessage(), e);
       }
       finally
@@ -1329,7 +1329,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
             // HORNETQ-482 - Flush deletes only if memory is critical
             if (recordsToDelete.size() > DELETE_FLUSH && runtime.freeMemory() < runtime.maxMemory() * 0.2)
             {
-               HornetQJournalLogger.LOGGER.debug("Flushing deletes during loading, deleteCount = " + recordsToDelete.size());
+               ActiveMQJournalLogger.LOGGER.debug("Flushing deletes during loading, deleteCount = " + recordsToDelete.size());
                // Clean up when the list is too large, or it won't be possible to load large sets of files
                // Done as part of JBMESSAGING-1678
                Iterator<RecordInfo> iter = records.iterator();
@@ -1345,7 +1345,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
                recordsToDelete.clear();
 
-               HornetQJournalLogger.LOGGER.debug("flush delete done");
+               ActiveMQJournalLogger.LOGGER.debug("flush delete done");
             }
          }
 
@@ -1418,7 +1418,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
             catch (Throwable e)
             {
                errors.incrementAndGet();
-               HornetQJournalLogger.LOGGER.errorCompacting(e);
+               ActiveMQJournalLogger.LOGGER.errorCompacting(e);
                e.printStackTrace();
             }
             finally
@@ -1467,7 +1467,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
          try
          {
-            HornetQJournalLogger.LOGGER.debug("Starting compacting operation on journal");
+            ActiveMQJournalLogger.LOGGER.debug("Starting compacting operation on journal");
 
             onCompactStart();
 
@@ -1536,7 +1536,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                }
                catch (Throwable e)
                {
-                  HornetQJournalLogger.LOGGER.compactReadError(file);
+                  ActiveMQJournalLogger.LOGGER.compactReadError(file);
                   throw new Exception("Error on reading compacting for " + file, e);
                }
             }
@@ -1612,7 +1612,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                   }
                   else
                   {
-                     HornetQJournalLogger.LOGGER.compactMergeError(newTransaction.getId());
+                     ActiveMQJournalLogger.LOGGER.compactMergeError(newTransaction.getId());
                   }
                }
             }
@@ -1625,7 +1625,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
             renameFiles(dataFilesToProcess, newDatafiles);
             deleteControlFile(controlFile);
 
-            HornetQJournalLogger.LOGGER.debug("Finished compacting on journal");
+            ActiveMQJournalLogger.LOGGER.debug("Finished compacting on journal");
 
          }
          finally
@@ -1896,7 +1896,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                }
                else
                {
-                  HornetQJournalLogger.LOGGER.preparedTXIncomplete(transactionID);
+                  ActiveMQJournalLogger.LOGGER.preparedTXIncomplete(transactionID);
                   tx.invalid = true;
                }
             }
@@ -1946,7 +1946,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                   }
                   else
                   {
-                     HornetQJournalLogger.LOGGER.txMissingElements(transactionID);
+                     ActiveMQJournalLogger.LOGGER.txMissingElements(transactionID);
 
                      journalTransaction.forget();
                   }
@@ -2018,7 +2018,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
       {
          if ((!transaction.prepared || transaction.invalid) && replicationSync != JournalState.SYNCING_UP_TO_DATE)
          {
-            HornetQJournalLogger.LOGGER.uncomittedTxFound(transaction.transactionID);
+            ActiveMQJournalLogger.LOGGER.uncomittedTxFound(transaction.transactionID);
 
             if (changeData)
             {
@@ -2164,7 +2164,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
             }
             catch (Throwable e)
             {
-               HornetQJournalLogger.LOGGER.errorCompacting(e);
+               ActiveMQJournalLogger.LOGGER.errorCompacting(e);
             }
             finally
             {
@@ -2350,7 +2350,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
       new PerfBlast(pages).start();
    }
 
-   // HornetQComponent implementation
+   // ActiveMQComponent implementation
    // ---------------------------------------------------
 
    public synchronized boolean isStarted()
@@ -2412,7 +2412,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
             if (!compactorExecutor.awaitTermination(120, TimeUnit.SECONDS))
             {
-               HornetQJournalLogger.LOGGER.couldNotStopCompactor();
+               ActiveMQJournalLogger.LOGGER.couldNotStopCompactor();
             }
 
             filesExecutor.shutdown();
@@ -2421,7 +2421,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
             if (!filesExecutor.awaitTermination(60, TimeUnit.SECONDS))
             {
-               HornetQJournalLogger.LOGGER.couldNotStopJournalExecutor();
+               ActiveMQJournalLogger.LOGGER.couldNotStopJournalExecutor();
             }
 
             try
@@ -2433,7 +2433,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
             }
             catch (Throwable e)
             {
-               HornetQJournalLogger.LOGGER.warn(e.getMessage(), e);
+               ActiveMQJournalLogger.LOGGER.warn(e.getMessage(), e);
             }
 
             fileFactory.deactivateBuffer();
@@ -2515,7 +2515,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                   }
                   catch (Throwable e)
                   {
-                     HornetQJournalLogger.LOGGER.errorReinitializingFile(e, file);
+                     ActiveMQJournalLogger.LOGGER.errorReinitializingFile(e, file);
                   }
                }
             }
@@ -2690,7 +2690,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
          if (!isCompatible)
          {
-            throw HornetQJournalBundle.BUNDLE.journalFileMisMatch();
+            throw ActiveMQJournalBundle.BUNDLE.journalFileMisMatch();
          }
       }
 
@@ -2698,7 +2698,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
       if (readUserVersion != userVersion)
       {
-         throw HornetQJournalBundle.BUNDLE.journalDifferentVersion();
+         throw ActiveMQJournalBundle.BUNDLE.journalDifferentVersion();
       }
 
       long fileID = bb.getLong();
@@ -2848,7 +2848,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
                }
                catch (Exception e)
                {
-                  HornetQJournalLogger.LOGGER.errorSchedulingCompacting(e);
+                  ActiveMQJournalLogger.LOGGER.errorSchedulingCompacting(e);
                }
             }
          });
@@ -2938,11 +2938,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
       if (leftFiles.size() > 0)
       {
-         HornetQJournalLogger.LOGGER.tempFilesLeftOpen();
+         ActiveMQJournalLogger.LOGGER.tempFilesLeftOpen();
 
          for (String fileToDelete : leftFiles)
          {
-            HornetQJournalLogger.LOGGER.deletingOrphanedFile(fileToDelete);
+            ActiveMQJournalLogger.LOGGER.deletingOrphanedFile(fileToDelete);
             SequentialFile file = fileFactory.createSequentialFile(fileToDelete, 1);
             file.delete();
          }
@@ -3008,7 +3008,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
       private PerfBlast(final int pages)
       {
-         super("hornetq-perfblast-thread");
+         super("activemq-perfblast-thread");
 
          this.pages = pages;
       }
@@ -3044,7 +3044,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
          }
          catch (Exception e)
          {
-            HornetQJournalLogger.LOGGER.failedToPerfBlast(e);
+            ActiveMQJournalLogger.LOGGER.failedToPerfBlast(e);
          }
          finally
          {
@@ -3219,7 +3219,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
 
       if (trace)
       {
-         HornetQJournalLogger.LOGGER.trace("Moving next file " + currentFile);
+         ActiveMQJournalLogger.LOGGER.trace("Moving next file " + currentFile);
       }
 
       fileFactory.activateBuffer(currentFile.getFile());

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/NIOSequentialFile.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/NIOSequentialFile.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/NIOSequentialFile.java
index e8db83e..3dd74b3 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/NIOSequentialFile.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/NIOSequentialFile.java
@@ -28,8 +28,8 @@ import org.apache.activemq.api.core.ActiveMQIllegalStateException;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.journal.HornetQJournalBundle;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalBundle;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A NIOSequentialFile
@@ -162,7 +162,7 @@ public final class NIOSequentialFile extends AbstractSequentialFile
       {
          while (!maxIOSemaphore.tryAcquire(maxIO, 60, TimeUnit.SECONDS))
          {
-            HornetQJournalLogger.LOGGER.errorClosingFile(getFileName());
+            ActiveMQJournalLogger.LOGGER.errorClosingFile(getFileName());
          }
       }
 
@@ -336,7 +336,7 @@ public final class NIOSequentialFile extends AbstractSequentialFile
          }
          else
          {
-            throw HornetQJournalBundle.BUNDLE.fileNotOpened();
+            throw ActiveMQJournalBundle.BUNDLE.fileNotOpened();
          }
          return;
       }
@@ -372,13 +372,13 @@ public final class NIOSequentialFile extends AbstractSequentialFile
                   }
                   catch (IOException e)
                   {
-                     HornetQJournalLogger.LOGGER.errorSubmittingWrite(e);
+                     ActiveMQJournalLogger.LOGGER.errorSubmittingWrite(e);
                      factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), NIOSequentialFile.this);
                      callback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), e.getMessage());
                   }
                   catch (Throwable e)
                   {
-                     HornetQJournalLogger.LOGGER.errorSubmittingWrite(e);
+                     ActiveMQJournalLogger.LOGGER.errorSubmittingWrite(e);
                      callback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), e.getMessage());
                   }
                }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/Reclaimer.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/Reclaimer.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/Reclaimer.java
index 4638ff5..72cd90d 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/Reclaimer.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/Reclaimer.java
@@ -13,7 +13,7 @@
 package org.apache.activemq.core.journal.impl;
 
 
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  *
@@ -36,11 +36,11 @@ import org.apache.activemq.journal.HornetQJournalLogger;
  */
 public class Reclaimer
 {
-   private static boolean trace = HornetQJournalLogger.LOGGER.isTraceEnabled();
+   private static boolean trace = ActiveMQJournalLogger.LOGGER.isTraceEnabled();
 
    private static void trace(final String message)
    {
-      HornetQJournalLogger.LOGGER.trace(message);
+      ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
    public void scan(final JournalFile[] files)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SimpleWaitIOCallback.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SimpleWaitIOCallback.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SimpleWaitIOCallback.java
index 5b17ddd..5650aee 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SimpleWaitIOCallback.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SimpleWaitIOCallback.java
@@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.ActiveMQExceptionType;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A SimpleWaitIOCallback
@@ -51,7 +51,7 @@ public final class SimpleWaitIOCallback extends SyncIOCompletion
 
       this.errorMessage = errorMessage1;
 
-      HornetQJournalLogger.LOGGER.errorOnIOCallback(errorMessage1);
+      ActiveMQJournalLogger.LOGGER.errorOnIOCallback(errorMessage1);
 
       latch.countDown();
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SyncSpeedTest.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SyncSpeedTest.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SyncSpeedTest.java
index 72059af..0ca8aa0 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SyncSpeedTest.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/SyncSpeedTest.java
@@ -25,7 +25,7 @@ import java.util.concurrent.Executors;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A SyncSpeedTest
@@ -169,7 +169,7 @@ public class SyncSpeedTest
          {
             if (!file.delete())
             {
-               HornetQJournalLogger.LOGGER.errorDeletingFile(file);
+               ActiveMQJournalLogger.LOGGER.errorDeletingFile(file);
             }
          }
 
@@ -309,7 +309,7 @@ public class SyncSpeedTest
 
          for (Thread t : threads)
          {
-            HornetQJournalLogger.LOGGER.startingThread();
+            ActiveMQJournalLogger.LOGGER.startingThread();
             t.start();
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/TimedBuffer.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/TimedBuffer.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/TimedBuffer.java
index 50d71d1..3e54b70 100644
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/TimedBuffer.java
+++ b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/TimedBuffer.java
@@ -27,7 +27,7 @@ import org.apache.activemq.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.core.journal.EncodingSupport;
 import org.apache.activemq.core.journal.IOAsyncTask;
 import org.apache.activemq.core.journal.impl.dataformat.ByteArrayEncoding;
-import org.apache.activemq.journal.HornetQJournalLogger;
+import org.apache.activemq.journal.ActiveMQJournalLogger;
 
 /**
  * A TimedBuffer
@@ -151,7 +151,7 @@ public class TimedBuffer
 
       timerRunnable = new CheckTimer();
 
-      timerThread = new Thread(timerRunnable, "hornetq-buffer-timeout");
+      timerThread = new Thread(timerRunnable, "activemq-buffer-timeout");
 
       timerThread.start();
 
@@ -373,9 +373,9 @@ public class TimedBuffer
             if (lastExecution != 0)
             {
                double rate = 1000 * (double) (bytesF - lastBytesFlushed) / (now - lastExecution);
-               HornetQJournalLogger.LOGGER.writeRate(rate, (long) (rate / (1024 * 1024)));
+               ActiveMQJournalLogger.LOGGER.writeRate(rate, (long) (rate / (1024 * 1024)));
                double flushRate = 1000 * (double) (flushesD - lastFlushesDone) / (now - lastExecution);
-               HornetQJournalLogger.LOGGER.flushRate(flushRate);
+               ActiveMQJournalLogger.LOGGER.flushRate(flushRate);
             }
 
             lastExecution = now;
@@ -477,7 +477,7 @@ public class TimedBuffer
             catch (Exception e)
             {
                setUseSleep(false);
-               HornetQJournalLogger.LOGGER.warn(e.getMessage() + ", disabling sleep on TimedBuffer, using spin now", e);
+               ActiveMQJournalLogger.LOGGER.warn(e.getMessage() + ", disabling sleep on TimedBuffer, using spin now", e);
             }
 
             if (checks < MAX_CHECKS_ON_SLEEP)
@@ -494,7 +494,7 @@ public class TimedBuffer
                {
                   if (failedChecks > MAX_CHECKS_ON_SLEEP * 0.5)
                   {
-                     HornetQJournalLogger.LOGGER.debug("Thread.sleep with nano seconds is not working as expected, Your kernel possibly doesn't support real time. the Journal TimedBuffer will spin for timeouts");
+                     ActiveMQJournalLogger.LOGGER.debug("Thread.sleep with nano seconds is not working as expected, Your kernel possibly doesn't support real time. the Journal TimedBuffer will spin for timeouts");
                      setUseSleep(false);
                   }
                }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalBundle.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalBundle.java b/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalBundle.java
new file mode 100644
index 0000000..4106e4e
--- /dev/null
+++ b/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalBundle.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.journal;
+
+
+import org.apache.activemq.api.core.ActiveMQIOErrorException;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 14
+ *
+ * each message id must be 6 digits long starting with 14, the 3rd digit should be 9
+ *
+ * so 149000 to 149999
+ */
+@MessageBundle(projectCode = "AMQ")
+public interface ActiveMQJournalBundle
+{
+   ActiveMQJournalBundle BUNDLE = Messages.getBundle(ActiveMQJournalBundle.class);
+
+   @Message(id = 149000, value =  "failed to rename file {0} to {1}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIOErrorException ioRenameFileError(String name, String newFileName);
+
+   @Message(id = 149001, value =  "Journal data belong to a different version", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIOErrorException journalDifferentVersion();
+
+   @Message(id = 149002, value =  "Journal files version mismatch. You should export the data from the previous version and import it as explained on the user''s manual",
+         format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIOErrorException journalFileMisMatch();
+
+   @Message(id = 149003, value =   "File not opened", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQIOErrorException fileNotOpened();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalLogger.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalLogger.java b/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalLogger.java
new file mode 100644
index 0000000..331df41
--- /dev/null
+++ b/activemq-journal/src/main/java/org/apache/activemq/journal/ActiveMQJournalLogger.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.journal;
+
+import org.apache.activemq.core.journal.impl.JournalFile;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/15/12
+ *
+ * Logger Code 14
+ *
+ * each message id must be 6 digits long starting with 14, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 141000 to 141999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQJournalLogger extends BasicLogger
+{
+   /**
+    * The journal logger.
+    */
+   ActiveMQJournalLogger LOGGER = Logger.getMessageLogger(ActiveMQJournalLogger.class, ActiveMQJournalLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141000, value = "*** running direct journal blast: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void runningJournalBlast(Integer numIts);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141002, value = "starting thread for sync speed test", format = Message.Format.MESSAGE_FORMAT)
+   void startingThread();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141003, value = "Write rate = {0} bytes / sec or {1} MiB / sec", format = Message.Format.MESSAGE_FORMAT)
+   void writeRate(Double rate, Long l);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141004, value = "Flush rate = {0} flushes / sec", format = Message.Format.MESSAGE_FORMAT)
+   void flushRate(Double rate);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141005, value = "Check Data Files:", format = Message.Format.MESSAGE_FORMAT)
+   void checkFiles();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141006, value = "Sequence out of order on journal", format = Message.Format.MESSAGE_FORMAT)
+   void seqOutOfOrder();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141007, value = "Current File on the journal is <= the sequence file.getFileID={0} on the dataFiles" +
+                                 "\nCurrentfile.getFileId={1} while the file.getFileID()={2}" +
+                                 "\nIs same = ({3})",
+            format = Message.Format.MESSAGE_FORMAT)
+   void currentFile(Long fileID, Long id, Long fileFileID, Boolean b);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141008, value = "Free File ID out of order", format = Message.Format.MESSAGE_FORMAT)
+   void fileIdOutOfOrder();
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 141009, value = "A Free File is less than the maximum data", format = Message.Format.MESSAGE_FORMAT)
+   void fileTooSmall();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142000, value = "You have a native library with a different version than expected", format = Message.Format.MESSAGE_FORMAT)
+   void incompatibleNativeLibrary();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142001, value = "Could not get lock after 60 seconds on closing Asynchronous File: {0}",
+            format = Message.Format.MESSAGE_FORMAT)
+   void couldNotGetLock(String fileName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142002, value = "Asynchronous File: {0} being finalized with opened state", format = Message.Format.MESSAGE_FORMAT)
+   void fileFinalizedWhileOpen(String fileName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142003, value = "AIO Callback Error: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void callbackError(String error);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142004, value = "Inconsistency during compacting: CommitRecord ID = {0} for an already committed transaction during compacting",
+         format = Message.Format.MESSAGE_FORMAT)
+   void inconsistencyDuringCompacting(Long transactionID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142005, value = "Inconsistency during compacting: Delete record being read on an existent record (id={0})",
+         format = Message.Format.MESSAGE_FORMAT)
+   void inconsistencyDuringCompactingDelete(Long recordID);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142006, value = "Could not find add Record information for record {0} during compacting",
+         format = Message.Format.MESSAGE_FORMAT)
+   void compactingWithNoAddRecord(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142007, value = "Can not find record {0} during compact replay",
+         format = Message.Format.MESSAGE_FORMAT)
+   void noRecordDuringCompactReplay(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142008, value = "Could not remove file {0} from the list of data files",
+         format = Message.Format.MESSAGE_FORMAT)
+   void couldNotRemoveFile(JournalFile file);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142009, value = "Deleting {0} as it does not have the configured size",
+         format = Message.Format.MESSAGE_FORMAT)
+   void deletingFile(JournalFile file);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142010, value = "Failed to add file to opened files queue: {0}. This should NOT happen!",
+         format = Message.Format.MESSAGE_FORMAT)
+   void failedToAddFile(JournalFile nextOpenedFile);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142011, value = "Error on reading compacting for {0}",
+         format = Message.Format.MESSAGE_FORMAT)
+   void compactReadError(JournalFile file);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142012, value = "Couldn''t find tx={0} to merge after compacting",
+         format = Message.Format.MESSAGE_FORMAT)
+   void compactMergeError(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142013, value = "Prepared transaction {0} was not considered completed, it will be ignored",
+         format = Message.Format.MESSAGE_FORMAT)
+   void preparedTXIncomplete(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142014, value = "Transaction {0} is missing elements so the transaction is being ignored",
+         format = Message.Format.MESSAGE_FORMAT)
+   void txMissingElements(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142015, value = "Uncommitted transaction with id {0} found and discarded",
+         format = Message.Format.MESSAGE_FORMAT)
+   void uncomittedTxFound(Long id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142016, value = "Couldn''t stop compactor executor after 120 seconds",
+         format = Message.Format.MESSAGE_FORMAT)
+   void couldNotStopCompactor();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142017, value = "Couldn''t stop journal executor after 60 seconds",
+         format = Message.Format.MESSAGE_FORMAT)
+   void couldNotStopJournalExecutor();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142018, value = "Temporary files were left unnatended after a crash on journal directory, deleting invalid files now",
+         format = Message.Format.MESSAGE_FORMAT)
+   void tempFilesLeftOpen();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142019, value =  "Deleting orphaned file {0}", format = Message.Format.MESSAGE_FORMAT)
+   void deletingOrphanedFile(String fileToDelete);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142020, value =  "Couldn''t get lock after 60 seconds on closing Asynchronous File: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingFile(String fileToDelete);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142021, value =  "Error on IO callback, {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorOnIOCallback(String errorMessage);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142022, value =  "Timed out on AIO poller shutdown", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutOnPollerShutdown(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142023, value =  "Executor on file {0} couldn''t complete its tasks in 60 seconds.", format = Message.Format.MESSAGE_FORMAT)
+   void couldNotCompleteTask(@Cause Exception e, String name);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142024, value =  "Error completing callback", format = Message.Format.MESSAGE_FORMAT)
+   void errorCompletingCallback(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142025, value =  "Error calling onError callback", format = Message.Format.MESSAGE_FORMAT)
+   void errorCallingErrorCallback(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142026, value =  "Timed out on AIO writer shutdown", format = Message.Format.MESSAGE_FORMAT)
+   void timeoutOnWriterShutdown(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142027, value =  "Error on writing data! {0} code - {1}", format = Message.Format.MESSAGE_FORMAT)
+   void errorWritingData(@Cause Throwable e, String errorMessage, Integer errorCode);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142028, value =  "Error replaying pending commands after compacting", format = Message.Format.MESSAGE_FORMAT)
+   void errorReplayingCommands(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142029, value =  "Error closing file", format = Message.Format.MESSAGE_FORMAT)
+   void errorClosingFile(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142030, value = "Could not open a file in 60 Seconds", format = Message.Format.MESSAGE_FORMAT)
+   void errorOpeningFile(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142031, value =  "Error retrieving ID part of the file name {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorRetrievingID(@Cause Throwable e, String fileName);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142032, value =  "Error reading journal file", format = Message.Format.MESSAGE_FORMAT)
+   void errorReadingFile(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142033, value =  "Error reinitializing file {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorReinitializingFile(@Cause Throwable e, JournalFile file);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 142034, value = "Exception on submitting write", format = Message.Format.MESSAGE_FORMAT)
+   void errorSubmittingWrite(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingFile(Object e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144001, value = "Error starting poller", format = Message.Format.MESSAGE_FORMAT)
+   void errorStartingPoller(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144002, value = "Error pushing opened file", format = Message.Format.MESSAGE_FORMAT)
+   void errorPushingFile(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144003, value = "Error compacting", format = Message.Format.MESSAGE_FORMAT)
+   void errorCompacting(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144004, value = "Error scheduling compacting", format = Message.Format.MESSAGE_FORMAT)
+   void errorSchedulingCompacting(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144005, value = "Failed to performance blast", format = Message.Format.MESSAGE_FORMAT)
+   void failedToPerfBlast(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 144006, value = "IOError code {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
+   void ioError(final int errorCode, final String errorMessage);
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalBundle.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalBundle.java b/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalBundle.java
deleted file mode 100644
index 39a2adf..0000000
--- a/activemq-journal/src/main/java/org/apache/activemq/journal/HornetQJournalBundle.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.journal;
-
-
-import org.apache.activemq.api.core.ActiveMQIOErrorException;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 14
- *
- * each message id must be 6 digits long starting with 14, the 3rd digit should be 9
- *
- * so 149000 to 149999
- */
-@MessageBundle(projectCode = "HQ")
-public interface HornetQJournalBundle
-{
-   HornetQJournalBundle BUNDLE = Messages.getBundle(HornetQJournalBundle.class);
-
-   @Message(id = 149000, value =  "failed to rename file {0} to {1}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIOErrorException ioRenameFileError(String name, String newFileName);
-
-   @Message(id = 149001, value =  "Journal data belong to a different version", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIOErrorException journalDifferentVersion();
-
-   @Message(id = 149002, value =  "Journal files version mismatch. You should export the data from the previous version and import it as explained on the user''s manual",
-         format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIOErrorException journalFileMisMatch();
-
-   @Message(id = 149003, value =   "File not opened", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQIOErrorException fileNotOpened();
-}


[14/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivationSpec.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivationSpec.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivationSpec.java
deleted file mode 100644
index 9a87d34..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQActivationSpec.java
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra.inflow;
-
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.resource.ResourceException;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.InvalidPropertyException;
-import javax.resource.spi.ResourceAdapter;
-import java.beans.IntrospectionException;
-import java.beans.PropertyDescriptor;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.activemq.ra.ConnectionFactoryProperties;
-import org.apache.activemq.ra.HornetQRALogger;
-import org.apache.activemq.ra.HornetQRaUtils;
-import org.apache.activemq.ra.HornetQResourceAdapter;
-
-/**
- * The activation spec
- * These properties are set on the MDB ActivactionProperties
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- */
-public class HornetQActivationSpec extends ConnectionFactoryProperties implements ActivationSpec, Serializable
-{
-   private static final long serialVersionUID = -7997041053897964654L;
-
-   private static final int DEFAULT_MAX_SESSION = 15;
-
-   /**
-    * Whether trace is enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-
-   public String strConnectorClassName;
-
-   public String strConnectionParameters;
-
-   /**
-    * The resource adapter
-    */
-   private HornetQResourceAdapter ra;
-
-   /**
-    * The connection factory lookup
-    */
-   private String connectionFactoryLookup;
-
-   /**
-    * The destination
-    */
-   private String destination;
-
-   /**
-    * The destination type
-    */
-   private String destinationType;
-
-   /**
-    * The message selector
-    */
-   private String messageSelector;
-
-   /**
-    * The acknowledgement mode
-    */
-   private int acknowledgeMode;
-
-   /**
-    * The subscription durability
-    */
-   private boolean subscriptionDurability;
-
-   /**
-    * The subscription name
-    */
-   private String subscriptionName;
-
-   /**
-    * If this is true, a durable subscription could be shared by multiple MDB instances
-    */
-   private boolean shareSubscriptions;
-
-   /**
-    * The user
-    */
-   private String user;
-
-   /**
-    * The password
-    */
-   private String password;
-
-   /**
-    * The maximum number of sessions
-    */
-   private Integer maxSession;
-
-   /**
-    * Transaction timeout
-    */
-   private Integer transactionTimeout;
-
-   private Boolean useJNDI = true;
-
-   private String jndiParams = null;
-
-   private Hashtable parsedJndiParams;
-
-   /* use local tx instead of XA*/
-   private Boolean localTx;
-
-   // undefined by default, default is specified at the RA level in HornetQRAProperties
-   private Integer setupAttempts;
-
-   // undefined by default, default is specified at the RA level in HornetQRAProperties
-   private Long setupInterval;
-
-   /**
-    * Constructor
-    */
-   public HornetQActivationSpec()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("constructor()");
-      }
-
-      ra = null;
-      destination = null;
-      destinationType = null;
-      messageSelector = null;
-      acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-      subscriptionDurability = false;
-      subscriptionName = null;
-      user = null;
-      password = null;
-      maxSession = DEFAULT_MAX_SESSION;
-      transactionTimeout = 0;
-   }
-
-   /**
-    * Get the resource adapter
-    *
-    * @return The resource adapter
-    */
-   public ResourceAdapter getResourceAdapter()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getResourceAdapter()");
-      }
-
-      return ra;
-   }
-
-   /**
-    * @return the useJNDI
-    */
-   public boolean isUseJNDI()
-   {
-      if (useJNDI == null)
-      {
-         return ra.isUseJNDI();
-      }
-      return useJNDI;
-   }
-
-   /**
-    * @param value the useJNDI to set
-    */
-   public void setUseJNDI(final boolean value)
-   {
-      useJNDI = value;
-   }
-
-   /**
-    * @return return the jndi params to use
-    */
-   public String getJndiParams()
-   {
-      if (jndiParams == null)
-      {
-         return ra.getJndiParams();
-      }
-      return jndiParams;
-   }
-
-   public void setJndiParams(String jndiParams)
-   {
-      this.jndiParams = jndiParams;
-      parsedJndiParams = HornetQRaUtils.parseHashtableConfig(jndiParams);
-   }
-
-   public Hashtable<?, ?> getParsedJndiParams()
-   {
-      if (parsedJndiParams == null)
-      {
-         return ra.getParsedJndiParams();
-      }
-      return parsedJndiParams;
-   }
-
-   /**
-    * Set the resource adapter
-    *
-    * @param ra The resource adapter
-    * @throws ResourceException Thrown if incorrect resource adapter
-    */
-   public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")");
-      }
-
-      if (ra == null || !(ra instanceof HornetQResourceAdapter))
-      {
-         throw new ResourceException("Resource adapter is " + ra);
-      }
-
-      this.ra = (HornetQResourceAdapter) ra;
-   }
-
-   /**
-    * Get the connection factory lookup
-    *
-    * @return The value
-    */
-   public String getConnectionFactoryLookup()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getConnectionFactoryLookup() ->" + connectionFactoryLookup);
-      }
-
-      return connectionFactoryLookup;
-   }
-
-   /**
-    * Set the connection factory lookup
-    *
-    * @param value The value
-    */
-   public void setConnectionFactoryLookup(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConnectionFactoryLookup(" + value + ")");
-      }
-
-      connectionFactoryLookup = value;
-   }
-
-   /**
-    * Get the destination
-    *
-    * @return The value
-    */
-   public String getDestination()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDestination()");
-      }
-
-      return destination;
-   }
-
-   /**
-    * Set the destination
-    *
-    * @param value The value
-    */
-   public void setDestination(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDestination(" + value + ")");
-      }
-
-      destination = value;
-   }
-
-   /**
-    * Get the destination lookup
-    *
-    * @return The value
-    */
-   public String getDestinationLookup()
-   {
-      return getDestination();
-   }
-
-   /**
-    * Set the destination
-    *
-    * @param value The value
-    */
-   public void setDestinationLookup(final String value)
-   {
-      setDestination(value);
-      setUseJNDI(true);
-   }
-
-   /**
-    * Get the destination type
-    *
-    * @return The value
-    */
-   public String getDestinationType()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getDestinationType()");
-      }
-
-      return destinationType;
-   }
-
-   /**
-    * Set the destination type
-    *
-    * @param value The value
-    */
-   public void setDestinationType(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setDestinationType(" + value + ")");
-      }
-
-      destinationType = value;
-   }
-
-   /**
-    * Get the message selector
-    *
-    * @return The value
-    */
-   public String getMessageSelector()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMessageSelector()");
-      }
-
-      return messageSelector;
-   }
-
-   /**
-    * Set the message selector
-    *
-    * @param value The value
-    */
-   public void setMessageSelector(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setMessageSelector(" + value + ")");
-      }
-
-      messageSelector = value;
-   }
-
-   /**
-    * Get the acknowledge mode
-    *
-    * @return The value
-    */
-   public String getAcknowledgeMode()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getAcknowledgeMode()");
-      }
-
-      if (Session.DUPS_OK_ACKNOWLEDGE == acknowledgeMode)
-      {
-         return "Dups-ok-acknowledge";
-      }
-      else
-      {
-         return "Auto-acknowledge";
-      }
-   }
-
-   /**
-    * Set the acknowledge mode
-    *
-    * @param value The value
-    */
-   public void setAcknowledgeMode(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setAcknowledgeMode(" + value + ")");
-      }
-
-      if ("DUPS_OK_ACKNOWLEDGE".equalsIgnoreCase(value) || "Dups-ok-acknowledge".equalsIgnoreCase(value))
-      {
-         acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;
-      }
-      else if ("AUTO_ACKNOWLEDGE".equalsIgnoreCase(value) || "Auto-acknowledge".equalsIgnoreCase(value))
-      {
-         acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-      }
-      else
-      {
-         throw new IllegalArgumentException("Unsupported acknowledgement mode " + value);
-      }
-   }
-
-   /**
-    * @return the acknowledgement mode
-    */
-   public int getAcknowledgeModeInt()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getAcknowledgeMode()");
-      }
-
-      return acknowledgeMode;
-   }
-
-   /**
-    * Get the subscription durability
-    *
-    * @return The value
-    */
-   public String getSubscriptionDurability()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSubscriptionDurability()");
-      }
-
-      if (subscriptionDurability)
-      {
-         return "Durable";
-      }
-      else
-      {
-         return "NonDurable";
-      }
-   }
-
-   /**
-    * Set the subscription durability
-    *
-    * @param value The value
-    */
-   public void setSubscriptionDurability(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSubscriptionDurability(" + value + ")");
-      }
-
-      subscriptionDurability = "Durable".equals(value);
-   }
-
-   /**
-    * Get the status of subscription durability
-    *
-    * @return The value
-    */
-   public boolean isSubscriptionDurable()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isSubscriptionDurable()");
-      }
-
-      return subscriptionDurability;
-   }
-
-   /**
-    * Get the subscription name
-    *
-    * @return The value
-    */
-   public String getSubscriptionName()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSubscriptionName()");
-      }
-
-      return subscriptionName;
-   }
-
-   /**
-    * Set the subscription name
-    *
-    * @param value The value
-    */
-   public void setSubscriptionName(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSubscriptionName(" + value + ")");
-      }
-
-      subscriptionName = value;
-   }
-
-
-   /**
-    * @return the shareDurableSubscriptions
-    */
-   public boolean isShareSubscriptions()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("isShareSubscriptions() = " + shareSubscriptions);
-      }
-
-      return shareSubscriptions;
-   }
-
-   /**
-    * @param shareSubscriptions the shareDurableSubscriptions to set
-    */
-   public void setShareSubscriptions(boolean shareSubscriptions)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setShareSubscriptions(" + shareSubscriptions + ")");
-      }
-
-      this.shareSubscriptions = shareSubscriptions;
-   }
-
-   /**
-    * Get the user
-    *
-    * @return The value
-    */
-   public String getUser()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getUser()");
-      }
-
-      if (user == null)
-      {
-         return ra.getUserName();
-      }
-      else
-      {
-         return user;
-      }
-   }
-
-   /**
-    * Set the user
-    *
-    * @param value The value
-    */
-   public void setUser(final String value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setUser(" + value + ")");
-      }
-
-      user = value;
-   }
-
-   /**
-    * Get the password
-    *
-    * @return The value
-    */
-   public String getPassword()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getPassword()");
-      }
-
-      if (password == null)
-      {
-         return ra.getPassword();
-      }
-      else
-      {
-         return password;
-      }
-   }
-
-   public String getOwnPassword()
-   {
-      return password;
-   }
-
-   /**
-    * Set the password
-    *
-    * @param value The value
-    */
-   public void setPassword(final String value) throws Exception
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setPassword(****)");
-      }
-
-      password = value;
-   }
-
-   /**
-    * Get the number of max session
-    *
-    * @return The value
-    */
-   public Integer getMaxSession()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getMaxSession()");
-      }
-
-      if (maxSession == null)
-      {
-         return DEFAULT_MAX_SESSION;
-      }
-
-      return maxSession;
-   }
-
-   /**
-    * Set the number of max session
-    *
-    * @param value The value
-    */
-   public void setMaxSession(final Integer value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setMaxSession(" + value + ")");
-      }
-
-      maxSession = value;
-   }
-
-   /**
-    * Get the transaction timeout
-    *
-    * @return The value
-    */
-   public Integer getTransactionTimeout()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getTransactionTimeout()");
-      }
-
-      return transactionTimeout;
-   }
-
-   /**
-    * Set the transaction timeout
-    *
-    * @param value The value
-    */
-   public void setTransactionTimeout(final Integer value)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setTransactionTimeout(" + value + ")");
-      }
-
-      transactionTimeout = value;
-   }
-
-   public Boolean isUseLocalTx()
-   {
-      if (localTx == null)
-      {
-         return ra.getUseLocalTx();
-      }
-      else
-      {
-         return localTx;
-      }
-   }
-
-   public void setUseLocalTx(final Boolean localTx)
-   {
-      this.localTx = localTx;
-   }
-
-   public int getSetupAttempts()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSetupAttempts()");
-      }
-
-      if (setupAttempts == null)
-      {
-         return ra.getSetupAttempts();
-      }
-      else
-      {
-         return setupAttempts;
-      }
-   }
-
-   public void setSetupAttempts(int setupAttempts)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")");
-      }
-
-      this.setupAttempts = setupAttempts;
-   }
-
-   public long getSetupInterval()
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("getSetupInterval()");
-      }
-
-      if (setupInterval == null)
-      {
-         return ra.getSetupInterval();
-      }
-      else
-      {
-         return setupInterval;
-      }
-   }
-
-   public void setSetupInterval(long setupInterval)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setSetupInterval(" + setupInterval + ")");
-      }
-
-      this.setupInterval = setupInterval;
-   }
-
-   /**
-    * Validate
-    *
-    * @throws InvalidPropertyException Thrown if a validation exception occurs
-    */
-   public void validate() throws InvalidPropertyException
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("validate()");
-      }
-
-      List<String> errorMessages = new ArrayList<String>();
-      List<PropertyDescriptor> propsNotSet = new ArrayList<PropertyDescriptor>();
-
-      try
-      {
-         if (destination == null || destination.trim().equals(""))
-         {
-            propsNotSet.add(new PropertyDescriptor("destination", HornetQActivationSpec.class));
-            errorMessages.add("Destination is mandatory.");
-         }
-
-         if (destinationType != null && !Topic.class.getName().equals(destinationType) && !Queue.class.getName().equals(destinationType))
-         {
-            propsNotSet.add(new PropertyDescriptor("destinationType", HornetQActivationSpec.class));
-            errorMessages.add("If set, the destinationType must be either 'javax.jms.Topic' or 'javax.jms.Queue'.");
-         }
-
-         if ((destinationType == null || destinationType.length() == 0 || Topic.class.getName().equals(destinationType)) && isSubscriptionDurable() && (subscriptionName == null || subscriptionName.length() == 0))
-         {
-            propsNotSet.add(new PropertyDescriptor("subscriptionName", HornetQActivationSpec.class));
-            errorMessages.add("If subscription is durable then subscription name must be specified.");
-         }
-      }
-      catch (IntrospectionException e)
-      {
-         e.printStackTrace();
-      }
-
-      if (propsNotSet.size() > 0)
-      {
-         StringBuffer b = new StringBuffer();
-         b.append("Invalid settings:");
-         for (Iterator<String> iter = errorMessages.iterator(); iter.hasNext();)
-         {
-            b.append(" ");
-            b.append(iter.next());
-         }
-         InvalidPropertyException e = new InvalidPropertyException(b.toString());
-         final PropertyDescriptor[] descriptors = propsNotSet.toArray(new PropertyDescriptor[propsNotSet.size()]);
-         e.setInvalidPropertyDescriptors(descriptors);
-         throw e;
-      }
-   }
-
-   public String getConnectorClassName()
-   {
-      return strConnectorClassName;
-   }
-
-   public void setConnectorClassName(final String connectorClassName)
-   {
-      if (HornetQActivationSpec.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setConnectorClassName(" + connectorClassName + ")");
-      }
-
-      strConnectorClassName = connectorClassName;
-
-      setParsedConnectorClassNames(HornetQRaUtils.parseConnectorConnectorConfig(connectorClassName));
-   }
-
-   /**
-    * @return the connectionParameters
-    */
-   public String getConnectionParameters()
-   {
-      return strConnectionParameters;
-   }
-
-   public void setConnectionParameters(final String configuration)
-   {
-      strConnectionParameters = configuration;
-      setParsedConnectionParameters(HornetQRaUtils.parseConfig(configuration));
-   }
-
-   /**
-    * Get a string representation
-    *
-    * @return The value
-    */
-   @Override
-   public String toString()
-   {
-      StringBuffer buffer = new StringBuffer();
-      buffer.append(HornetQActivationSpec.class.getName()).append('(');
-      buffer.append("ra=").append(ra);
-      if (messageSelector != null)
-      {
-         buffer.append(" connectionFactoryLookup=").append(connectionFactoryLookup);
-      }
-      buffer.append(" destination=").append(destination);
-      buffer.append(" destinationType=").append(destinationType);
-      if (messageSelector != null)
-      {
-         buffer.append(" selector=").append(messageSelector);
-      }
-      buffer.append(" ack=").append(getAcknowledgeMode());
-      buffer.append(" durable=").append(subscriptionDurability);
-      buffer.append(" clientID=").append(getClientID());
-      if (subscriptionName != null)
-      {
-         buffer.append(" subscription=").append(subscriptionName);
-      }
-      buffer.append(" user=").append(user);
-      if (password != null)
-      {
-         buffer.append(" password=").append("****");
-      }
-      buffer.append(" maxSession=").append(maxSession);
-      buffer.append(')');
-      return buffer.toString();
-   }
-
-   // here for backwards compatibilty
-   public void setUseDLQ(final boolean b)
-   {
-   }
-
-   public void setDLQJNDIName(final String name)
-   {
-   }
-
-   public void setDLQHandler(final String handler)
-   {
-   }
-
-   public void setDLQMaxResent(final int maxResent)
-   {
-   }
-
-   public void setProviderAdapterJNDI(final String jndi)
-   {
-   }
-
-   /**
-    * @param keepAlive the keepAlive to set
-    */
-   public void setKeepAlive(boolean keepAlive)
-   {
-   }
-
-   /**
-    * @param keepAliveMillis the keepAliveMillis to set
-    */
-   public void setKeepAliveMillis(long keepAliveMillis)
-   {
-   }
-
-
-   public void setReconnectInterval(long interval)
-   {
-   }
-
-   public void setMinSession(final Integer value)
-   {
-   }
-
-   public void setMaxMessages(final Integer value)
-   {
-   }
-
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQMessageHandler.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQMessageHandler.java b/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQMessageHandler.java
deleted file mode 100644
index 45933fc..0000000
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/inflow/HornetQMessageHandler.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.ra.inflow;
-
-import javax.jms.MessageListener;
-import javax.resource.ResourceException;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-import java.util.UUID;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession.QueueQuery;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.MessageHandler;
-import org.apache.activemq.core.client.impl.ClientConsumerInternal;
-import org.apache.activemq.core.client.impl.ClientSessionFactoryInternal;
-import org.apache.activemq.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.jms.client.HornetQDestination;
-import org.apache.activemq.jms.client.HornetQMessage;
-import org.apache.activemq.ra.HornetQRALogger;
-import org.apache.activemq.ra.HornetQResourceAdapter;
-import org.apache.activemq.ra.HornetQXAResourceWrapper;
-import org.apache.activemq.utils.FutureLatch;
-
-/**
- * The message handler
- *
- * @author <a href="adrian@jboss.com">Adrian Brock</a>
- * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:mtaylor@redhat.com">Martyn Taylor</a>
- */
-public class HornetQMessageHandler implements MessageHandler
-{
-   /**
-    * Trace enabled
-    */
-   private static boolean trace = HornetQRALogger.LOGGER.isTraceEnabled();
-   /**
-    * The session
-    */
-   private final ClientSessionInternal session;
-
-   private ClientConsumerInternal consumer;
-
-   /**
-    * The endpoint
-    */
-   private MessageEndpoint endpoint;
-
-   private final HornetQActivation activation;
-
-   private boolean useLocalTx;
-
-   private boolean transacted;
-
-   private boolean useXA = false;
-
-   private final int sessionNr;
-
-   private final TransactionManager tm;
-
-   private ClientSessionFactory cf;
-
-   public HornetQMessageHandler(final HornetQActivation activation,
-                                final TransactionManager tm,
-                                final ClientSessionInternal session,
-                                final ClientSessionFactory cf,
-                                final int sessionNr)
-   {
-      this.activation = activation;
-      this.session = session;
-      this.cf = cf;
-      this.sessionNr = sessionNr;
-      this.tm = tm;
-   }
-
-   public void setup() throws Exception
-   {
-      if (HornetQMessageHandler.trace)
-      {
-         HornetQRALogger.LOGGER.trace("setup()");
-      }
-
-      HornetQActivationSpec spec = activation.getActivationSpec();
-      String selector = spec.getMessageSelector();
-
-      // Create the message consumer
-      SimpleString selectorString = selector == null || selector.trim().equals("") ? null : new SimpleString(selector);
-      if (activation.isTopic() && spec.isSubscriptionDurable())
-      {
-         SimpleString queueName = new SimpleString(HornetQDestination.createQueueNameForDurableSubscription(true,
-                                                                                                            spec.getClientID(),
-                                                                                                            spec.getSubscriptionName()));
-
-         QueueQuery subResponse = session.queueQuery(queueName);
-
-         if (!subResponse.isExists())
-         {
-            session.createQueue(activation.getAddress(), queueName, selectorString, true);
-         }
-         else
-         {
-            // The check for already exists should be done only at the first session
-            // As a deployed MDB could set up multiple instances in order to process messages in parallel.
-            if (sessionNr == 0 && subResponse.getConsumerCount() > 0)
-            {
-               if (!spec.isShareSubscriptions())
-               {
-                  throw new javax.jms.IllegalStateException("Cannot create a subscriber on the durable subscription since it already has subscriber(s)");
-               }
-               else if (HornetQRALogger.LOGGER.isDebugEnabled())
-               {
-                  HornetQRALogger.LOGGER.debug("the mdb on destination " + queueName + " already had " +
-                                                  subResponse.getConsumerCount() +
-                                                  " consumers but the MDB is configured to share subscriptions, so no exceptions are thrown");
-               }
-            }
-
-            SimpleString oldFilterString = subResponse.getFilterString();
-
-            boolean selectorChanged = selector == null && oldFilterString != null ||
-               oldFilterString == null &&
-                  selector != null ||
-               (oldFilterString != null && selector != null && !oldFilterString.toString()
-                  .equals(selector));
-
-            SimpleString oldTopicName = subResponse.getAddress();
-
-            boolean topicChanged = !oldTopicName.equals(activation.getAddress());
-
-            if (selectorChanged || topicChanged)
-            {
-               // Delete the old durable sub
-               session.deleteQueue(queueName);
-
-               // Create the new one
-               session.createQueue(activation.getAddress(), queueName, selectorString, true);
-            }
-         }
-         consumer = (ClientConsumerInternal) session.createConsumer(queueName, null, false);
-      }
-      else
-      {
-         SimpleString tempQueueName;
-         if (activation.isTopic())
-         {
-            if (activation.getTopicTemporaryQueue() == null)
-            {
-               tempQueueName = new SimpleString(UUID.randomUUID().toString());
-               session.createTemporaryQueue(activation.getAddress(), tempQueueName, selectorString);
-               activation.setTopicTemporaryQueue(tempQueueName);
-            }
-            else
-            {
-               tempQueueName = activation.getTopicTemporaryQueue();
-               QueueQuery queueQuery = session.queueQuery(tempQueueName);
-               if (!queueQuery.isExists())
-               {
-                  // this is because we could be using remote servers (in cluster maybe)
-                  // and the queue wasn't created on that node yet.
-                  session.createTemporaryQueue(activation.getAddress(), tempQueueName, selectorString);
-               }
-            }
-         }
-         else
-         {
-            tempQueueName = activation.getAddress();
-         }
-         consumer = (ClientConsumerInternal) session.createConsumer(tempQueueName, selectorString);
-      }
-
-      // Create the endpoint, if we are transacted pass the session so it is enlisted, unless using Local TX
-      MessageEndpointFactory endpointFactory = activation.getMessageEndpointFactory();
-      useLocalTx = !activation.isDeliveryTransacted() && activation.getActivationSpec().isUseLocalTx();
-      transacted = activation.isDeliveryTransacted();
-      if (activation.isDeliveryTransacted() && !activation.getActivationSpec().isUseLocalTx())
-      {
-         XAResource xaResource = new HornetQXAResourceWrapper(session,
-                                                     ((HornetQResourceAdapter) spec.getResourceAdapter()).getJndiName(),
-                                                     ((ClientSessionFactoryInternal) cf).getLiveNodeId());
-         endpoint = endpointFactory.createEndpoint(xaResource);
-         useXA = true;
-      }
-      else
-      {
-         endpoint = endpointFactory.createEndpoint(null);
-         useXA = false;
-      }
-      consumer.setMessageHandler(this);
-   }
-
-   XAResource getXAResource()
-   {
-      return useXA ? session : null;
-   }
-
-   public Thread interruptConsumer(FutureLatch future)
-   {
-      try
-      {
-         if (consumer != null)
-         {
-            return consumer.prepareForClose(future);
-         }
-      }
-      catch (Throwable e)
-      {
-         HornetQRALogger.LOGGER.warn("Error interrupting handler on endpoint " + endpoint + " handler=" + consumer);
-      }
-      return null;
-   }
-
-   /**
-    * Stop the handler
-    */
-   public void teardown()
-   {
-      if (HornetQMessageHandler.trace)
-      {
-         HornetQRALogger.LOGGER.trace("teardown()");
-      }
-
-      try
-      {
-         if (endpoint != null)
-         {
-            endpoint.release();
-            endpoint = null;
-         }
-      }
-      catch (Throwable t)
-      {
-         HornetQRALogger.LOGGER.debug("Error releasing endpoint " + endpoint, t);
-      }
-
-      try
-      {
-         consumer.close();
-         if (activation.getTopicTemporaryQueue() != null)
-         {
-            // We need to delete temporary topics when the activation is stopped or messages will build up on the server
-            SimpleString tmpQueue = activation.getTopicTemporaryQueue();
-            QueueQuery subResponse = session.queueQuery(tmpQueue);
-            if (subResponse.getConsumerCount() == 0)
-            {
-               // This is optional really, since we now use temporaryQueues, we could simply ignore this
-               // and the server temporary queue would remove this as soon as the queue was removed
-               session.deleteQueue(tmpQueue);
-            }
-         }
-      }
-      catch (Throwable t)
-      {
-         HornetQRALogger.LOGGER.debug("Error closing core-queue consumer", t);
-      }
-
-      try
-      {
-         if (session != null)
-         {
-            session.close();
-         }
-      }
-      catch (Throwable t)
-      {
-         HornetQRALogger.LOGGER.debug("Error releasing session " + session, t);
-      }
-
-      try
-      {
-         if (cf != null)
-         {
-            cf.close();
-         }
-      }
-      catch (Throwable t)
-      {
-         HornetQRALogger.LOGGER.debug("Error releasing session factory " + session, t);
-      }
-   }
-
-   public void onMessage(final ClientMessage message)
-   {
-      if (HornetQMessageHandler.trace)
-      {
-         HornetQRALogger.LOGGER.trace("onMessage(" + message + ")");
-      }
-
-      HornetQMessage msg = HornetQMessage.createMessage(message, session);
-      boolean beforeDelivery = false;
-
-      try
-      {
-         if (activation.getActivationSpec().getTransactionTimeout() > 0 && tm != null)
-         {
-            tm.setTransactionTimeout(activation.getActivationSpec().getTransactionTimeout());
-         }
-         endpoint.beforeDelivery(HornetQActivation.ONMESSAGE);
-         beforeDelivery = true;
-         msg.doBeforeReceive();
-
-         //In the transacted case the message must be acked *before* onMessage is called
-
-         if (transacted)
-         {
-            message.acknowledge();
-         }
-
-         ((MessageListener) endpoint).onMessage(msg);
-
-         if (!transacted)
-         {
-            message.acknowledge();
-         }
-
-         try
-         {
-            endpoint.afterDelivery();
-         }
-         catch (ResourceException e)
-         {
-            HornetQRALogger.LOGGER.unableToCallAfterDelivery(e);
-            return;
-         }
-         if (useLocalTx)
-         {
-            session.commit();
-         }
-
-         if (trace)
-         {
-            HornetQRALogger.LOGGER.trace("finished onMessage on " + message);
-         }
-      }
-      catch (Throwable e)
-      {
-         HornetQRALogger.LOGGER.errorDeliveringMessage(e);
-         // we need to call before/afterDelivery as a pair
-         if (beforeDelivery)
-         {
-            if (useXA && tm != null)
-            {
-               // This is the job for the container,
-               // however if the container throws an exception because of some other errors,
-               // there are situations where the container is not setting the rollback only
-               // this is to avoid a scenario where afterDelivery would kick in
-               try
-               {
-                  Transaction tx = tm.getTransaction();
-                  if (tx != null)
-                  {
-                     tx.setRollbackOnly();
-                  }
-               }
-               catch (Exception e1)
-               {
-                  HornetQRALogger.LOGGER.warn("unnable to clear the transaction", e1);
-                  try
-                  {
-                     session.rollback();
-                  }
-                  catch (ActiveMQException e2)
-                  {
-                     HornetQRALogger.LOGGER.warn("Unable to rollback", e2);
-                     return;
-                  }
-               }
-            }
-
-            MessageEndpoint endToUse = endpoint;
-            try
-            {
-               // to avoid a NPE that would happen while the RA is in tearDown
-               if (endToUse != null)
-               {
-                  endToUse.afterDelivery();
-               }
-            }
-            catch (ResourceException e1)
-            {
-               HornetQRALogger.LOGGER.unableToCallAfterDelivery(e1);
-            }
-         }
-         if (useLocalTx || !activation.isDeliveryTransacted())
-         {
-            try
-            {
-               session.rollback(true);
-            }
-            catch (ActiveMQException e1)
-            {
-               HornetQRALogger.LOGGER.unableToRollbackTX();
-            }
-         }
-      }
-      finally
-      {
-         try
-         {
-            session.resetIfNeeded();
-         }
-         catch (ActiveMQException e)
-         {
-            HornetQRALogger.LOGGER.unableToResetSession();
-         }
-      }
-
-   }
-
-   public void start() throws ActiveMQException
-   {
-      session.start();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-ra/src/main/java/org/apache/activemq/ra/recovery/RecoveryManager.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/recovery/RecoveryManager.java b/activemq-ra/src/main/java/org/apache/activemq/ra/recovery/RecoveryManager.java
index cba59e2..057abe7 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/recovery/RecoveryManager.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/recovery/RecoveryManager.java
@@ -17,10 +17,10 @@ import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Set;
 
-import org.apache.activemq.jms.client.HornetQConnectionFactory;
-import org.apache.activemq.jms.server.recovery.HornetQRegistryBase;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jms.server.recovery.ActiveMQRegistryBase;
 import org.apache.activemq.jms.server.recovery.XARecoveryConfig;
-import org.apache.activemq.ra.HornetQRALogger;
+import org.apache.activemq.ra.ActiveMQRALogger;
 import org.apache.activemq.utils.ClassloadingUtil;
 import org.apache.activemq.utils.ConcurrentHashSet;
 
@@ -30,10 +30,10 @@ import org.apache.activemq.utils.ConcurrentHashSet;
  */
 public final class RecoveryManager
 {
-   private HornetQRegistryBase registry;
+   private ActiveMQRegistryBase registry;
 
    private static final String RESOURCE_RECOVERY_CLASS_NAMES = "org.jboss.as.messaging.jms.AS7RecoveryRegistry;"
-            + "org.jboss.as.integration.hornetq.recovery.AS5RecoveryRegistry";
+            + "org.jboss.as.integration.activemq.recovery.AS5RecoveryRegistry";
 
    private final Set<XARecoveryConfig> resources = new ConcurrentHashSet<XARecoveryConfig>();
 
@@ -49,9 +49,9 @@ public final class RecoveryManager
       }
    }
 
-   public XARecoveryConfig register(HornetQConnectionFactory factory, String userName, String password)
+   public XARecoveryConfig register(ActiveMQConnectionFactory factory, String userName, String password)
    {
-      HornetQRALogger.LOGGER.debug("registering recovery for factory : " + factory);
+      ActiveMQRALogger.LOGGER.debug("registering recovery for factory : " + factory);
 
       XARecoveryConfig config = XARecoveryConfig.newConfig(factory, userName, password);
       resources.add(config);
@@ -94,11 +94,11 @@ public final class RecoveryManager
       {
          try
          {
-            registry = (HornetQRegistryBase) safeInitNewInstance(locatorClasse);
+            registry = (ActiveMQRegistryBase) safeInitNewInstance(locatorClasse);
          }
          catch (Throwable e)
          {
-            HornetQRALogger.LOGGER.debug("unable to load  recovery registry " + locatorClasse, e);
+            ActiveMQRALogger.LOGGER.debug("unable to load  recovery registry " + locatorClasse, e);
          }
          if (registry != null)
          {
@@ -108,7 +108,7 @@ public final class RecoveryManager
 
       if (registry != null)
       {
-         HornetQRALogger.LOGGER.debug("Recovery Registry located = " + registry);
+         ActiveMQRALogger.LOGGER.debug("Recovery Registry located = " + registry);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQ.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQ.java b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQ.java
new file mode 100644
index 0000000..d2ffa67
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQ.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.Providers;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Type;
+
+import org.apache.activemq.api.core.client.ClientMessage;
+import org.apache.activemq.rest.util.HttpMessageHelper;
+import org.jboss.resteasy.core.Headers;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.jboss.resteasy.util.GenericType;
+
+/**
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class ActiveMQ
+{
+
+   /**
+    * Sets the message body to a serialized
+    * byte array of the object.  HTTP consumers will have to provide an Accept header to marshal the object
+    *
+    * @param message
+    * @param object
+    */
+   public static void setEntity(ClientMessage message, Serializable object)
+   {
+      setEntity(message, object, null);
+   }
+
+   /**
+    * Sets a message property to be the Content-Type passed in.  Sets the message body to a serialized
+    * byte array of the object.
+    *
+    * @param message
+    * @param object
+    * @param contentType HTTP Content-Type header
+    */
+   public static void setEntity(ClientMessage message, Serializable object, String contentType)
+   {
+      if (contentType != null) message.putStringProperty(HttpHeaderProperty.CONTENT_TYPE, contentType);
+      byte[] data;
+      try
+      {
+         ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+
+         ObjectOutputStream oos = new ObjectOutputStream(baos);
+
+         oos.writeObject(object);
+
+         oos.flush();
+
+         data = baos.toByteArray();
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException(e);
+      }
+
+      message.getBodyBuffer().writeInt(data.length);
+      message.getBodyBuffer().writeBytes(data);
+
+   }
+
+   public static void setHttpHeader(ClientMessage message, String name, String value)
+   {
+      message.putStringProperty(HttpHeaderProperty.toPropertyName(name), value);
+   }
+
+
+   /**
+    * Get an HTTP header value from a JMS Message
+    *
+    * @param message
+    * @param name
+    * @return the HTTP header String
+    */
+   public static String getHttpHeader(ClientMessage message, String name)
+   {
+      return message.getStringProperty(HttpHeaderProperty.toPropertyName(name));
+   }
+
+   /**
+    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
+    *
+    * @param message
+    * @param type
+    * @return
+    */
+   public static <T> T getEntity(ClientMessage message, Class<T> type)
+   {
+      return getEntity(message, type, null, ResteasyProviderFactory.getInstance());
+   }
+
+   /**
+    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
+    *
+    * @param message
+    * @param type
+    * @param factory
+    * @return
+    */
+   public static <T> T getEntity(ClientMessage message, Class<T> type, ResteasyProviderFactory factory)
+   {
+      return getEntity(message, type, null, factory);
+   }
+
+   /**
+    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
+    *
+    * @param message
+    * @param type
+    * @param factory
+    * @return
+    * @throws UnknownMediaType
+    * @throws UnmarshalException
+    */
+   public static <T> T getEntity(ClientMessage message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType, UnmarshalException
+   {
+      return getEntity(message, type.getType(), type.getGenericType(), factory);
+   }
+
+   public static <T> T getEntity(ClientMessage msg, Class<T> type, Type genericType, ResteasyProviderFactory factory)
+   {
+      int size = msg.getBodySize();
+      if (size <= 0) return null;
+
+      byte[] body = new byte[size];
+      msg.getBodyBuffer().readBytes(body);
+
+
+      String contentType = msg.getStringProperty(HttpHeaderProperty.CONTENT_TYPE);
+      if (contentType == null)
+      {
+         throw new UnknownMediaType("Message did not have a Content-Type header cannot extract entity");
+      }
+      MediaType ct = MediaType.valueOf(contentType);
+      MessageBodyReader<T> reader = factory.getMessageBodyReader(type, genericType, null, ct);
+      if (reader == null)
+      {
+         throw new UnmarshalException("Unable to find a JAX-RS reader for type " + type.getName() + " and media type " + contentType);
+      }
+
+      Providers current = ResteasyProviderFactory.getContextData(Providers.class);
+      ResteasyProviderFactory.pushContext(Providers.class, factory);
+      try
+      {
+         return reader.readFrom(type, genericType, null, ct, new Headers<String>(), new ByteArrayInputStream(body));
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException(e);
+      }
+      finally
+      {
+         ResteasyProviderFactory.popContextData(Providers.class);
+         if (current != null) ResteasyProviderFactory.pushContext(Providers.class, current);
+      }
+   }
+
+   /**
+    * Was this ActiveMQ message generated from a REST call?
+    *
+    * @param msg
+    * @return
+    */
+   public static boolean isHttpMessage(ClientMessage msg)
+   {
+      Boolean aBoolean = msg.getBooleanProperty(HttpMessageHelper.POSTED_AS_HTTP_MESSAGE);
+      return aBoolean != null && aBoolean.booleanValue() == true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestBundle.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestBundle.java b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestBundle.java
new file mode 100644
index 0000000..16d20a7
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestBundle.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest;
+
+
+import org.jboss.logging.annotations.MessageBundle;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/12/12
+ *
+ * Logger Code 19
+ *
+ * each message id must be 6 digits long starting with 19, the 3rd digit should be 9
+ *
+ * so 199000 to 199999
+ */
+@MessageBundle(projectCode = "AMQ")
+public class ActiveMQRestBundle
+{
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
new file mode 100644
index 0000000..473c8d5
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.apache.activemq.rest;
+
+import org.apache.activemq.api.core.ActiveMQException;
+import org.apache.activemq.rest.queue.push.xml.XmlLink;
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ *         3/15/12
+ *
+ * Logger Code 19
+ *
+ * each message id must be 6 digits long starting with 19, the 3rd digit donates the level so
+ *
+ * INF0  1
+ * WARN  2
+ * DEBUG 3
+ * ERROR 4
+ * TRACE 5
+ * FATAL 6
+ *
+ * so an INFO message would be 191000 to 191999
+ */
+@MessageLogger(projectCode = "AMQ")
+public interface ActiveMQRestLogger extends BasicLogger
+{
+   /**
+    * The twitter logger.
+    */
+   ActiveMQRestLogger LOGGER = Logger.getMessageLogger(ActiveMQRestLogger.class, ActiveMQRestLogger.class.getPackage().getName());
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 181000, value = "Loading REST push store from: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void loadingRestStore(String path);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 181001, value = "adding REST push registration: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void addingPushRegistration(String id);
+
+   @LogMessage(level = Logger.Level.INFO)
+   @Message(id = 181002, value = "Push consumer started for: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void startingPushConsumer(XmlLink link);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 182000, value = "shutdown REST consumer because of timeout for: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void shutdownRestConsumer(String id);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 182001, value = "shutdown REST subscription because of timeout for: {0}", format = Message.Format.MESSAGE_FORMAT)
+   void shutdownRestSubscription(String id);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 184000, value = "Failed to load push store {0}, it is probably corrupted", format = Message.Format.MESSAGE_FORMAT)
+   void errorLoadingStore(@Cause Exception e, String name);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 184001, value = "Error updating store", format = Message.Format.MESSAGE_FORMAT)
+   void errorUpdatingStore(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 184002, value = "Failed to push message to {0} disabling push registration...", format = Message.Format.MESSAGE_FORMAT)
+   void errorPushingMessage(XmlLink link);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 184003, value = "Error deleting Subscriber queue", format = Message.Format.MESSAGE_FORMAT)
+   void errorDeletingSubscriberQueue(@Cause ActiveMQException e);
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestBundle.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestBundle.java b/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestBundle.java
deleted file mode 100644
index 83bf74a..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestBundle.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest;
-
-
-import org.jboss.logging.annotations.MessageBundle;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 19
- *
- * each message id must be 6 digits long starting with 19, the 3rd digit should be 9
- *
- * so 199000 to 199999
- */
-@MessageBundle(projectCode = "HQ")
-public class HornetQRestBundle
-{
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestLogger.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestLogger.java b/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestLogger.java
deleted file mode 100644
index c706deb..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/HornetQRestLogger.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.apache.activemq.rest;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.rest.queue.push.xml.XmlLink;
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/15/12
- *
- * Logger Code 19
- *
- * each message id must be 6 digits long starting with 19, the 3rd digit donates the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 191000 to 191999
- */
-@MessageLogger(projectCode = "HQ")
-public interface HornetQRestLogger extends BasicLogger
-{
-   /**
-    * The twitter logger.
-    */
-   HornetQRestLogger LOGGER = Logger.getMessageLogger(HornetQRestLogger.class, HornetQRestLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 181000, value = "Loading REST push store from: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void loadingRestStore(String path);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 181001, value = "adding REST push registration: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void addingPushRegistration(String id);
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 181002, value = "Push consumer started for: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void startingPushConsumer(XmlLink link);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 182000, value = "shutdown REST consumer because of timeout for: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void shutdownRestConsumer(String id);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 182001, value = "shutdown REST subscription because of timeout for: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void shutdownRestSubscription(String id);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 184000, value = "Failed to load push store {0}, it is probably corrupted", format = Message.Format.MESSAGE_FORMAT)
-   void errorLoadingStore(@Cause Exception e, String name);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 184001, value = "Error updating store", format = Message.Format.MESSAGE_FORMAT)
-   void errorUpdatingStore(@Cause Exception e);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 184002, value = "Failed to push message to {0} disabling push registration...", format = Message.Format.MESSAGE_FORMAT)
-   void errorPushingMessage(XmlLink link);
-
-   @LogMessage(level = Logger.Level.ERROR)
-   @Message(id = 184003, value = "Error deleting Subscriber queue", format = Message.Format.MESSAGE_FORMAT)
-   void errorDeletingSubscriberQueue(@Cause ActiveMQException e);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/Hornetq.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/Hornetq.java b/activemq-rest/src/main/java/org/apache/activemq/rest/Hornetq.java
deleted file mode 100644
index 4f9e79d..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/Hornetq.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Providers;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Type;
-
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.rest.util.HttpMessageHelper;
-import org.jboss.resteasy.core.Headers;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-import org.jboss.resteasy.util.GenericType;
-
-/**
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class Hornetq
-{
-
-   /**
-    * Sets the message body to a serialized
-    * byte array of the object.  HTTP consumers will have to provide an Accept header to marshal the object
-    *
-    * @param message
-    * @param object
-    */
-   public static void setEntity(ClientMessage message, Serializable object)
-   {
-      setEntity(message, object, null);
-   }
-
-   /**
-    * Sets a message property to be the Content-Type passed in.  Sets the message body to a serialized
-    * byte array of the object.
-    *
-    * @param message
-    * @param object
-    * @param contentType HTTP Content-Type header
-    */
-   public static void setEntity(ClientMessage message, Serializable object, String contentType)
-   {
-      if (contentType != null) message.putStringProperty(HttpHeaderProperty.CONTENT_TYPE, contentType);
-      byte[] data;
-      try
-      {
-         ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
-
-         ObjectOutputStream oos = new ObjectOutputStream(baos);
-
-         oos.writeObject(object);
-
-         oos.flush();
-
-         data = baos.toByteArray();
-      }
-      catch (IOException e)
-      {
-         throw new RuntimeException(e);
-      }
-
-      message.getBodyBuffer().writeInt(data.length);
-      message.getBodyBuffer().writeBytes(data);
-
-   }
-
-   public static void setHttpHeader(ClientMessage message, String name, String value)
-   {
-      message.putStringProperty(HttpHeaderProperty.toPropertyName(name), value);
-   }
-
-
-   /**
-    * Get an HTTP header value from a JMS Message
-    *
-    * @param message
-    * @param name
-    * @return the HTTP header String
-    */
-   public static String getHttpHeader(ClientMessage message, String name)
-   {
-      return message.getStringProperty(HttpHeaderProperty.toPropertyName(name));
-   }
-
-   /**
-    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
-    *
-    * @param message
-    * @param type
-    * @return
-    */
-   public static <T> T getEntity(ClientMessage message, Class<T> type)
-   {
-      return getEntity(message, type, null, ResteasyProviderFactory.getInstance());
-   }
-
-   /**
-    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
-    *
-    * @param message
-    * @param type
-    * @param factory
-    * @return
-    */
-   public static <T> T getEntity(ClientMessage message, Class<T> type, ResteasyProviderFactory factory)
-   {
-      return getEntity(message, type, null, factory);
-   }
-
-   /**
-    * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader
-    *
-    * @param message
-    * @param type
-    * @param factory
-    * @return
-    * @throws UnknownMediaType
-    * @throws UnmarshalException
-    */
-   public static <T> T getEntity(ClientMessage message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType, UnmarshalException
-   {
-      return getEntity(message, type.getType(), type.getGenericType(), factory);
-   }
-
-   public static <T> T getEntity(ClientMessage msg, Class<T> type, Type genericType, ResteasyProviderFactory factory)
-   {
-      int size = msg.getBodySize();
-      if (size <= 0) return null;
-
-      byte[] body = new byte[size];
-      msg.getBodyBuffer().readBytes(body);
-
-
-      String contentType = msg.getStringProperty(HttpHeaderProperty.CONTENT_TYPE);
-      if (contentType == null)
-      {
-         throw new UnknownMediaType("Message did not have a Content-Type header cannot extract entity");
-      }
-      MediaType ct = MediaType.valueOf(contentType);
-      MessageBodyReader<T> reader = factory.getMessageBodyReader(type, genericType, null, ct);
-      if (reader == null)
-      {
-         throw new UnmarshalException("Unable to find a JAX-RS reader for type " + type.getName() + " and media type " + contentType);
-      }
-
-      Providers current = ResteasyProviderFactory.getContextData(Providers.class);
-      ResteasyProviderFactory.pushContext(Providers.class, factory);
-      try
-      {
-         return reader.readFrom(type, genericType, null, ct, new Headers<String>(), new ByteArrayInputStream(body));
-      }
-      catch (IOException e)
-      {
-         throw new RuntimeException(e);
-      }
-      finally
-      {
-         ResteasyProviderFactory.popContextData(Providers.class);
-         if (current != null) ResteasyProviderFactory.pushContext(Providers.class, current);
-      }
-   }
-
-   /**
-    * Was this HornetQ message generated from a REST call?
-    *
-    * @param msg
-    * @return
-    */
-   public static boolean isHttpMessage(ClientMessage msg)
-   {
-      Boolean aBoolean = msg.getBooleanProperty(HttpMessageHelper.POSTED_AS_HTTP_MESSAGE);
-      return aBoolean != null && aBoolean.booleanValue() == true;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/MessageServiceManager.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/MessageServiceManager.java b/activemq-rest/src/main/java/org/apache/activemq/rest/MessageServiceManager.java
index 80b4c5d..c06af01 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/MessageServiceManager.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/MessageServiceManager.java
@@ -159,7 +159,7 @@ public class MessageServiceManager
 
 
       ServerLocator consumerLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig));
-      HornetQRestLogger.LOGGER.debug("Created ServerLocator: " + consumerLocator);
+      ActiveMQRestLogger.LOGGER.debug("Created ServerLocator: " + consumerLocator);
 
       if (configuration.getConsumerWindowSize() != -1)
       {
@@ -167,7 +167,7 @@ public class MessageServiceManager
       }
 
       ClientSessionFactory consumerSessionFactory = consumerLocator.createSessionFactory();
-      HornetQRestLogger.LOGGER.debug("Created ClientSessionFactory: " + consumerSessionFactory);
+      ActiveMQRestLogger.LOGGER.debug("Created ClientSessionFactory: " + consumerSessionFactory);
 
       ServerLocator defaultLocator =  new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig));
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ActiveMQBootstrapListener.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ActiveMQBootstrapListener.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ActiveMQBootstrapListener.java
new file mode 100644
index 0000000..b9e0657
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/ActiveMQBootstrapListener.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest.integration;
+
+import org.apache.activemq.jms.server.embedded.EmbeddedJMS;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class ActiveMQBootstrapListener implements ServletContextListener
+{
+   private EmbeddedJMS jms;
+
+   public void contextInitialized(ServletContextEvent contextEvent)
+   {
+      ServletContext context = contextEvent.getServletContext();
+      jms = new EmbeddedJMS();
+      jms.setRegistry(new ServletContextBindingRegistry(context));
+      try
+      {
+         jms.start();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void contextDestroyed(ServletContextEvent servletContextEvent)
+   {
+      try
+      {
+         if (jms != null) jms.stop();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQ.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQ.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQ.java
new file mode 100644
index 0000000..3aa8b47
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQ.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest.integration;
+
+import org.apache.activemq.core.server.embedded.EmbeddedActiveMQ;
+import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer;
+import org.apache.activemq.rest.MessageServiceManager;
+import org.jboss.resteasy.test.TestPortProvider;
+
+/**
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class EmbeddedRestActiveMQ
+{
+   protected TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
+   protected EmbeddedActiveMQ embeddedActiveMQ;
+   protected MessageServiceManager manager = new MessageServiceManager();
+
+   public EmbeddedRestActiveMQ()
+   {
+      int port = TestPortProvider.getPort();
+      tjws.setPort(port);
+      tjws.setRootResourcePath("");
+      tjws.setSecurityDomain(null);
+      initEmbeddedActiveMQ();
+   }
+
+   protected void initEmbeddedActiveMQ()
+   {
+      embeddedActiveMQ = new EmbeddedActiveMQ();
+   }
+
+   public TJWSEmbeddedJaxrsServer getTjws()
+   {
+      return tjws;
+   }
+
+   public void setTjws(TJWSEmbeddedJaxrsServer tjws)
+   {
+      this.tjws = tjws;
+   }
+
+   public EmbeddedActiveMQ getEmbeddedActiveMQ()
+   {
+      return embeddedActiveMQ;
+   }
+
+   public MessageServiceManager getManager()
+   {
+      return manager;
+   }
+
+   public void start() throws Exception
+   {
+      embeddedActiveMQ.start();
+      tjws.start();
+      manager.start();
+      tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
+      tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
+   }
+
+   public void stop() throws Exception
+   {
+      try
+      {
+         tjws.stop();
+      }
+      catch (Exception e)
+      {
+      }
+      try
+      {
+         manager.stop();
+      }
+      catch (Exception e)
+      {
+      }
+      embeddedActiveMQ.stop();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQJMS.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQJMS.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQJMS.java
new file mode 100644
index 0000000..419af8f
--- /dev/null
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestActiveMQJMS.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.rest.integration;
+
+import org.apache.activemq.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.spi.core.naming.BindingRegistry;
+
+/**
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class EmbeddedRestActiveMQJMS extends EmbeddedRestActiveMQ
+{
+   @Override
+   protected void initEmbeddedActiveMQ()
+   {
+      embeddedActiveMQ = new EmbeddedJMS();
+   }
+
+   public BindingRegistry getRegistry()
+   {
+      if (embeddedActiveMQ == null) return null;
+      return ((EmbeddedJMS) embeddedActiveMQ).getRegistry();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQ.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQ.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQ.java
deleted file mode 100644
index fffcc8e..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQ.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest.integration;
-
-import org.apache.activemq.core.server.embedded.EmbeddedHornetQ;
-import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer;
-import org.apache.activemq.rest.MessageServiceManager;
-import org.jboss.resteasy.test.TestPortProvider;
-
-/**
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class EmbeddedRestHornetQ
-{
-   protected TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
-   protected EmbeddedHornetQ embeddedHornetQ;
-   protected MessageServiceManager manager = new MessageServiceManager();
-
-   public EmbeddedRestHornetQ()
-   {
-      int port = TestPortProvider.getPort();
-      tjws.setPort(port);
-      tjws.setRootResourcePath("");
-      tjws.setSecurityDomain(null);
-      initEmbeddedHornetQ();
-   }
-
-   protected void initEmbeddedHornetQ()
-   {
-      embeddedHornetQ = new EmbeddedHornetQ();
-   }
-
-   public TJWSEmbeddedJaxrsServer getTjws()
-   {
-      return tjws;
-   }
-
-   public void setTjws(TJWSEmbeddedJaxrsServer tjws)
-   {
-      this.tjws = tjws;
-   }
-
-   public EmbeddedHornetQ getEmbeddedHornetQ()
-   {
-      return embeddedHornetQ;
-   }
-
-   public MessageServiceManager getManager()
-   {
-      return manager;
-   }
-
-   public void start() throws Exception
-   {
-      embeddedHornetQ.start();
-      tjws.start();
-      manager.start();
-      tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
-      tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
-   }
-
-   public void stop() throws Exception
-   {
-      try
-      {
-         tjws.stop();
-      }
-      catch (Exception e)
-      {
-      }
-      try
-      {
-         manager.stop();
-      }
-      catch (Exception e)
-      {
-      }
-      embeddedHornetQ.stop();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQJMS.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQJMS.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQJMS.java
deleted file mode 100644
index 3284eb1..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/EmbeddedRestHornetQJMS.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest.integration;
-
-import org.apache.activemq.jms.server.embedded.EmbeddedJMS;
-import org.apache.activemq.spi.core.naming.BindingRegistry;
-
-/**
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class EmbeddedRestHornetQJMS extends EmbeddedRestHornetQ
-{
-   @Override
-   protected void initEmbeddedHornetQ()
-   {
-      embeddedHornetQ = new EmbeddedJMS();
-   }
-
-   public BindingRegistry getRegistry()
-   {
-      if (embeddedHornetQ == null) return null;
-      return ((EmbeddedJMS)embeddedHornetQ).getRegistry();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/integration/HornetqBootstrapListener.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/HornetqBootstrapListener.java b/activemq-rest/src/main/java/org/apache/activemq/rest/integration/HornetqBootstrapListener.java
deleted file mode 100644
index f24038f..0000000
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/integration/HornetqBootstrapListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.rest.integration;
-
-import org.apache.activemq.jms.server.embedded.EmbeddedJMS;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-/**
- * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
- * @version $Revision: 1 $
- */
-public class HornetqBootstrapListener implements ServletContextListener
-{
-   private EmbeddedJMS jms;
-
-   public void contextInitialized(ServletContextEvent contextEvent)
-   {
-      ServletContext context = contextEvent.getServletContext();
-      jms = new EmbeddedJMS();
-      jms.setRegistry(new ServletContextBindingRegistry(context));
-      try
-      {
-         jms.start();
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   public void contextDestroyed(ServletContextEvent servletContextEvent)
-   {
-      try
-      {
-         if (jms != null) jms.stop();
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/AcknowledgedQueueConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/AcknowledgedQueueConsumer.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/AcknowledgedQueueConsumer.java
index c3cefd5..9b00af2 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/AcknowledgedQueueConsumer.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/AcknowledgedQueueConsumer.java
@@ -30,7 +30,7 @@ import org.apache.activemq.api.core.client.ClientConsumer;
 import org.apache.activemq.api.core.client.ClientMessage;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.util.Constants;
 import org.apache.activemq.rest.util.LinkStrategy;
 
@@ -61,7 +61,7 @@ public class AcknowledgedQueueConsumer extends QueueConsumer
                                      @PathParam("index") long index,
                                      @Context UriInfo info)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + info.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + info.getPath() + "\"");
 
       if (closed)
       {
@@ -97,7 +97,7 @@ public class AcknowledgedQueueConsumer extends QueueConsumer
       @FormParam("acknowledge") boolean doAcknowledge,
       @Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       ping(0);
       String basePath = uriInfo.getMatchedURIs().get(1);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumedMessage.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumedMessage.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumedMessage.java
index a9d53d5..ac8b7d3 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumedMessage.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumedMessage.java
@@ -14,7 +14,7 @@ package org.apache.activemq.rest.queue;
 
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.HttpHeaderProperty;
 
 import javax.ws.rs.core.Response;
@@ -51,7 +51,7 @@ public abstract class ConsumedMessage
             continue;
          }
          builder.header(headerName, message.getStringProperty(k));
-         HornetQRestLogger.LOGGER.debug("Adding " + headerName + "=" + message.getStringProperty(k));
+         ActiveMQRestLogger.LOGGER.debug("Adding " + headerName + "=" + message.getStringProperty(k));
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumersResource.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumersResource.java b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumersResource.java
index 9ad4546..f3a9e6f 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumersResource.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/queue/ConsumersResource.java
@@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.rest.HornetQRestLogger;
+import org.apache.activemq.rest.ActiveMQRestLogger;
 import org.apache.activemq.rest.util.TimeoutTask;
 
 /**
@@ -96,7 +96,7 @@ public class ConsumersResource implements TimeoutTask.Callback
       if (consumer == null) return false;
       if (System.currentTimeMillis() - consumer.getLastPingTime() > consumerTimeoutSeconds * 1000)
       {
-         HornetQRestLogger.LOGGER.shutdownRestConsumer(consumer.getId());
+         ActiveMQRestLogger.LOGGER.shutdownRestConsumer(consumer.getId());
          if (autoShutdown)
          {
             shutdown(consumer);
@@ -138,7 +138,7 @@ public class ConsumersResource implements TimeoutTask.Callback
                                       @FormParam("selector") String selector,
                                       @Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");
 
       try
       {
@@ -214,7 +214,7 @@ public class ConsumersResource implements TimeoutTask.Callback
                                @PathParam("consumer-id") String consumerId,
                                @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");
 
       return headConsumer(attributes, consumerId, uriInfo);
    }
@@ -225,7 +225,7 @@ public class ConsumersResource implements TimeoutTask.Callback
                                 @PathParam("consumer-id") String consumerId,
                                 @Context UriInfo uriInfo) throws Exception
    {
-      HornetQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling HEAD request for \"" + uriInfo.getPath() + "\"");
 
       QueueConsumer consumer = findConsumer(attributes, consumerId, uriInfo);
       Response.ResponseBuilder builder = Response.noContent();
@@ -313,7 +313,7 @@ public class ConsumersResource implements TimeoutTask.Callback
       @PathParam("consumer-id") String consumerId,
       @Context UriInfo uriInfo)
    {
-      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
+      ActiveMQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");
 
       QueueConsumer consumer = queueConsumers.remove(consumerId);
       if (consumer == null)


[49/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java
index e4a41fc..6c93367 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ServerLocator.java
@@ -102,7 +102,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns the period used to check if a client has failed to receive pings from the server.
     * <p>
     * Period is in milliseconds, default value is
-    * {@link HornetQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}.
+    * {@link ActiveMQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}.
     *
     * @return the period used to check if a client has failed to receive pings from the server
     */
@@ -125,7 +125,7 @@ public interface ServerLocator extends AutoCloseable
     * <p>
     * There is 1 temporary file created for each large message.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}.
+    * Default value is {@link ActiveMQClient#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}.
     *
     * @return <code>true</code> if consumers created through this factory will cache large messages
     * in temporary files, <code>false</code> else
@@ -145,7 +145,7 @@ public interface ServerLocator extends AutoCloseable
     * <p>
     * This TTL determines how long the server will keep a connection alive in the absence of any
     * data arriving from the client. Value is in milliseconds, default value is
-    * {@link HornetQClient#DEFAULT_CONNECTION_TTL}.
+    * {@link ActiveMQClient#DEFAULT_CONNECTION_TTL}.
     *
     * @return the connection time-to-live in milliseconds
     */
@@ -166,7 +166,7 @@ public interface ServerLocator extends AutoCloseable
     * <p>
     * If client's blocking calls to the server take more than this timeout, the call will throw a
     * {@link org.apache.activemq.api.core.ActiveMQException} with the code {@link org.apache.activemq.api.core.ActiveMQExceptionType#CONNECTION_TIMEDOUT}. Value
-    * is in milliseconds, default value is {@link HornetQClient#DEFAULT_CALL_TIMEOUT}.
+    * is in milliseconds, default value is {@link ActiveMQClient#DEFAULT_CALL_TIMEOUT}.
     *
     * @return the blocking calls timeout
     */
@@ -210,7 +210,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns the large message size threshold.
     * <p>
     * Messages whose size is if greater than this value will be handled as <em>large messages</em>.
-    * Value is in bytes, default value is {@link HornetQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}.
+    * Value is in bytes, default value is {@link ActiveMQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}.
     *
     * @return the message size threshold to treat messages as large messages.
     */
@@ -229,7 +229,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the window size for flow control of the consumers created through this factory.
     * <p>
-    * Value is in bytes, default value is {@link HornetQClient#DEFAULT_CONSUMER_WINDOW_SIZE}.
+    * Value is in bytes, default value is {@link ActiveMQClient#DEFAULT_CONSUMER_WINDOW_SIZE}.
     *
     * @return the window size used for consumer flow control
     */
@@ -252,7 +252,7 @@ public interface ServerLocator extends AutoCloseable
     * This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified.
     * <p>
     * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
-    * Default value is {@link HornetQClient#DEFAULT_CONSUMER_MAX_RATE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_CONSUMER_MAX_RATE}.
     *
     * @return the consumer max rate
     */
@@ -272,7 +272,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns the size for the confirmation window of clients using this factory.
     * <p>
     * Value is in bytes or -1 (to disable the window). Default value is
-    * {@link HornetQClient#DEFAULT_CONFIRMATION_WINDOW_SIZE}.
+    * {@link ActiveMQClient#DEFAULT_CONFIRMATION_WINDOW_SIZE}.
     *
     * @return the size for the confirmation window of clients using this factory
     */
@@ -292,7 +292,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns the window size for flow control of the producers created through this factory.
     * <p>
     * Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection).
-    * Default value is {@link HornetQClient#DEFAULT_PRODUCER_WINDOW_SIZE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_PRODUCER_WINDOW_SIZE}.
     *
     * @return the window size for flow control of the producers created through this factory.
     */
@@ -314,7 +314,7 @@ public interface ServerLocator extends AutoCloseable
     * This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified.
     * <p>
     * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
-    * Default value is {@link HornetQClient#DEFAULT_PRODUCER_MAX_RATE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_PRODUCER_MAX_RATE}.
     *
     * @return maximum rate of message production (in messages per seconds)
     */
@@ -334,7 +334,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns whether consumers created through this factory will block while
     * sending message acknowledgments or do it asynchronously.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}.
     *
     * @return whether consumers will block while sending message
     * acknowledgments or do it asynchronously
@@ -358,7 +358,7 @@ public interface ServerLocator extends AutoCloseable
     * If the session is configured to send durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
     * to be notified once the message has been handled by the server.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_DURABLE_SEND}.
+    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_DURABLE_SEND}.
     *
     * @return whether producers will block while sending persistent messages or do it asynchronously
     */
@@ -378,7 +378,7 @@ public interface ServerLocator extends AutoCloseable
     * If the session is configured to send non-durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
     * to be notified once the message has been handled by the server.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}.
+    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}.
     *
     * @return whether producers will block while sending non-durable messages or do it asynchronously
     */
@@ -398,7 +398,7 @@ public interface ServerLocator extends AutoCloseable
     * <p>
     * if <code>true</code>, a random unique group ID is created and set on each message for the property
     * {@link org.apache.activemq.api.core.Message#HDR_GROUP_ID}.
-    * Default value is {@link HornetQClient#DEFAULT_AUTO_GROUP}.
+    * Default value is {@link ActiveMQClient#DEFAULT_AUTO_GROUP}.
     *
     * @return whether producers will automatically assign a group ID to their messages
     */
@@ -433,7 +433,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns whether messages will pre-acknowledged on the server before they are sent to the consumers or not.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_PRE_ACKNOWLEDGE}
+    * Default value is {@link ActiveMQClient#DEFAULT_PRE_ACKNOWLEDGE}
     */
    boolean isPreAcknowledge();
 
@@ -451,7 +451,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the acknowledgments batch size.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_ACK_BATCH_SIZE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_ACK_BATCH_SIZE}.
     *
     * @return the acknowledgments batch size
     */
@@ -484,7 +484,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns whether this factory will use global thread pools (shared among all the factories in the same JVM)
     * or its own pools.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_USE_GLOBAL_POOLS}.
+    * Default value is {@link ActiveMQClient#DEFAULT_USE_GLOBAL_POOLS}.
     *
     * @return <code>true</code> if this factory uses global thread pools, <code>false</code> else
     */
@@ -502,7 +502,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the maximum size of the scheduled thread pool.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
     *
     * @return the maximum size of the scheduled thread pool.
     */
@@ -522,7 +522,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the maximum size of the thread pool.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_THREAD_POOL_MAX_SIZE}.
+    * Default value is {@link ActiveMQClient#DEFAULT_THREAD_POOL_MAX_SIZE}.
     *
     * @return the maximum size of the thread pool.
     */
@@ -542,7 +542,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the time to retry connections created by this factory after failure.
     * <p>
-    * Value is in milliseconds, default is {@link HornetQClient#DEFAULT_RETRY_INTERVAL}.
+    * Value is in milliseconds, default is {@link ActiveMQClient#DEFAULT_RETRY_INTERVAL}.
     *
     * @return the time to retry connections created by this factory after failure
     */
@@ -561,7 +561,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the multiplier to apply to successive retry intervals.
     * <p>
-    * Default value is  {@link HornetQClient#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
+    * Default value is  {@link ActiveMQClient#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
     *
     * @return the multiplier to apply to successive retry intervals
     */
@@ -580,7 +580,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the maximum retry interval (in the case a retry interval multiplier has been specified).
     * <p>
-    * Value is in milliseconds, default value is  {@link HornetQClient#DEFAULT_MAX_RETRY_INTERVAL}.
+    * Value is in milliseconds, default value is  {@link ActiveMQClient#DEFAULT_MAX_RETRY_INTERVAL}.
     *
     * @return the maximum retry interval
     */
@@ -600,7 +600,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the maximum number of attempts to retry connection in case of failure.
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_RECONNECT_ATTEMPTS}.
+    * Default value is {@link ActiveMQClient#DEFAULT_RECONNECT_ATTEMPTS}.
     *
     * @return the maximum number of attempts to retry connection in case of failure.
     */
@@ -635,7 +635,7 @@ public interface ServerLocator extends AutoCloseable
     * Returns true if the client will automatically attempt to connect to the backup server if the initial
     * connection to the live server fails
     * <p>
-    * Default value is {@link HornetQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}.
+    * Default value is {@link ActiveMQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}.
     */
    boolean isFailoverOnInitialConnection();
 
@@ -669,7 +669,7 @@ public interface ServerLocator extends AutoCloseable
    /**
     * Returns the initial size of messages created through this factory.
     * <p>
-    * Value is in bytes, default value is  {@link HornetQClient#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
+    * Value is in bytes, default value is  {@link ActiveMQClient#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
     *
     * @return the initial size of messages created through this factory
     */
@@ -690,7 +690,7 @@ public interface ServerLocator extends AutoCloseable
     * method is the same as invoking <code>addIncomingInterceptor(Interceptor).</code>
     *
     * @param interceptor an Interceptor
-    * @deprecated As of HornetQ 2.3.0.Final, replaced by
+    * @deprecated As of ActiveMQ 2.3.0.Final, replaced by
     * {@link #addIncomingInterceptor(Interceptor)} and
     * {@link #addOutgoingInterceptor(Interceptor)}
     */
@@ -719,7 +719,7 @@ public interface ServerLocator extends AutoCloseable
     *
     * @param interceptor interceptor to remove
     * @return <code>true</code> if the interceptor is removed from this factory, <code>false</code> else
-    * @deprecated As of HornetQ 2.3.0.Final, replaced by
+    * @deprecated As of ActiveMQ 2.3.0.Final, replaced by
     * {@link #removeIncomingInterceptor(Interceptor)} and
     * {@link #removeOutgoingInterceptor(Interceptor)}
     */

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/loadbalance/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/loadbalance/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/loadbalance/package-info.java
index d9f059e..4846887 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/loadbalance/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/loadbalance/package-info.java
@@ -14,8 +14,8 @@
  * Client load-balancing API.
  * <br>
  * This package defines the policies supported by
- * HornetQ to load-balance client connections across
- * HornetQ servers.
+ * ActiveMQ to load-balance client connections across
+ * ActiveMQ servers.
  */
 package org.apache.activemq.api.core.client.loadbalance;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/package-info.java
index d76a779..9cdc0ae 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/package-info.java
@@ -13,7 +13,7 @@
 /**
  * Core Client Messaging API.
  * <br>
- * This package defines the API used by HornetQ clients to produce and consume messages.
+ * This package defines the API used by ActiveMQ clients to produce and consume messages.
  */
 package org.apache.activemq.api.core.client;
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/AcceptorControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/AcceptorControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/AcceptorControl.java
index 4f05cac..c322924 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/AcceptorControl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/AcceptorControl.java
@@ -21,7 +21,7 @@ import java.util.Map;
  *
  * @see Acceptor
  */
-public interface AcceptorControl extends HornetQComponentControl
+public interface AcceptorControl extends ActiveMQComponentControl
 {
    /**
     * Returns the name of the acceptor

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQComponentControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQComponentControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQComponentControl.java
new file mode 100644
index 0000000..e701849
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQComponentControl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.api.core.management;
+
+/**
+ * A ActiveMQComponentControl is used to manage the life cycle of a ActiveMQ component.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public interface ActiveMQComponentControl
+{
+   /**
+    * Returns {@code true} if this component is started, {@code false} else.
+    */
+   boolean isStarted();
+
+   /**
+    * Starts this component.
+    */
+   void start() throws Exception;
+
+   /**
+    * Stops this component.
+    */
+   void stop() throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java
new file mode 100644
index 0000000..cb8c226
--- /dev/null
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ActiveMQServerControl.java
@@ -0,0 +1,621 @@
+/*
+ * Copyright 2005-2014 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.apache.activemq.api.core.management;
+
+import javax.management.MBeanOperationInfo;
+
+/**
+ * A ActiveMQServerControl is used to manage ActiveMQ servers.
+ */
+public interface ActiveMQServerControl
+{
+   /**
+    * Returns this server's version.
+    */
+   String getVersion();
+
+   /**
+    * Returns the number of connections connected to this server.
+    */
+   int getConnectionCount();
+
+   /**
+    * Return whether this server is started.
+    */
+   boolean isStarted();
+
+   /**
+    * Returns the list of interceptors used by this server. Invoking this method is the same as invoking
+    * <code>getIncomingInterceptorClassNames().</code>
+    *
+    * @see org.apache.activemq.api.core.Interceptor
+    * @deprecated As of ActiveMQ 2.3.0.Final, replaced by
+    * {@link #getIncomingInterceptorClassNames()} and
+    * {@link #getOutgoingInterceptorClassNames()}
+    */
+   @Deprecated
+   String[] getInterceptorClassNames();
+
+   /**
+    * Returns the list of interceptors used by this server for incoming messages.
+    *
+    * @see org.apache.activemq.api.core.Interceptor
+    */
+   String[] getIncomingInterceptorClassNames();
+
+   /**
+    * Returns the list of interceptors used by this server for outgoing messages.
+    *
+    * @see org.apache.activemq.api.core.Interceptor
+    */
+   String[] getOutgoingInterceptorClassNames();
+
+   /**
+    * Returns whether this server is clustered.
+    */
+   boolean isClustered();
+
+   /**
+    * Returns the maximum number of threads in the <em>scheduled</em> thread pool.
+    */
+   int getScheduledThreadPoolMaxSize();
+
+   /**
+    * Returns the maximum number of threads in the thread pool.
+    */
+   int getThreadPoolMaxSize();
+
+   /**
+    * Returns the interval time (in milliseconds) to invalidate security credentials.
+    */
+   long getSecurityInvalidationInterval();
+
+   /**
+    * Returns whether security is enabled for this server.
+    */
+   boolean isSecurityEnabled();
+
+   /**
+    * Returns the file system directory used to store bindings.
+    */
+   String getBindingsDirectory();
+
+   /**
+    * Returns the file system directory used to store journal log.
+    */
+   String getJournalDirectory();
+
+   /**
+    * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).
+    */
+   String getJournalType();
+
+   /**
+    * Returns whether the journal is synchronized when receiving transactional data.
+    */
+   boolean isJournalSyncTransactional();
+
+   /**
+    * Returns whether the journal is synchronized when receiving non-transactional data.
+    */
+   boolean isJournalSyncNonTransactional();
+
+   /**
+    * Returns the size (in bytes) of each journal files.
+    */
+   int getJournalFileSize();
+
+   /**
+    * Returns the number of journal files to pre-create.
+    */
+   int getJournalMinFiles();
+
+   /**
+    * Returns the maximum number of write requests that can be in the AIO queue at any given time.
+    */
+   int getJournalMaxIO();
+
+   /**
+    * Returns the size of the internal buffer on the journal.
+    */
+   int getJournalBufferSize();
+
+   /**
+    * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal.
+    */
+   int getJournalBufferTimeout();
+
+   /**
+    * do any clients failover on a server shutdown
+    */
+   void setFailoverOnServerShutdown(boolean failoverOnServerShutdown) throws Exception;
+
+
+   /**
+    * returns if clients failover on a server shutdown
+    */
+   boolean isFailoverOnServerShutdown();
+
+   /**
+    * Returns the minimal number of journal files before compacting.
+    */
+   int getJournalCompactMinFiles();
+
+   /**
+    * Return the percentage of live data before compacting the journal.
+    */
+   int getJournalCompactPercentage();
+
+   /**
+    * Returns whether this server is using persistence and store data.
+    */
+   boolean isPersistenceEnabled();
+
+   /**
+    * Returns whether the bindings directory is created on this server startup.
+    */
+   boolean isCreateBindingsDir();
+
+   /**
+    * Returns whether the journal directory is created on this server startup.
+    */
+   boolean isCreateJournalDir();
+
+   /**
+    * Returns whether message counter is enabled for this server.
+    */
+   boolean isMessageCounterEnabled();
+
+   /**
+    * Returns the maximum number of days kept in memory for message counter.
+    */
+   int getMessageCounterMaxDayCount();
+
+   /**
+    * Sets the maximum number of days kept in memory for message counter.
+    *
+    * @param count value must be greater than 0
+    */
+   void setMessageCounterMaxDayCount(int count) throws Exception;
+
+   /**
+    * Returns the sample period (in milliseconds) to take message counter snapshot.
+    */
+   long getMessageCounterSamplePeriod();
+
+   /**
+    * Sets the sample period to take message counter snapshot.
+    *
+    * @param newPeriod value must be greater than 1000ms
+    */
+   void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
+
+   /**
+    * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
+    * <br>
+    * If a backup server has been activated, returns {@code false}.
+    */
+   boolean isBackup();
+
+   /**
+    * Returns whether this server shares its data store with a corresponding live or backup server.
+    */
+   boolean isSharedStore();
+
+   /**
+    * Returns the file system directory used to store paging files.
+    */
+   String getPagingDirectory();
+
+   /**
+    * Returns whether delivery count is persisted before messages are delivered to the consumers.
+    */
+   boolean isPersistDeliveryCountBeforeDelivery();
+
+   /**
+    * Returns the connection time to live.
+    * <br>
+    * This value overrides the connection time to live <em>sent by the client</em>.
+    */
+   long getConnectionTTLOverride();
+
+   /**
+    * Returns the management address of this server.
+    * <br>
+    * Clients can send management messages to this address to manage this server.
+    */
+   String getManagementAddress();
+
+   /**
+    * Returns the management notification address of this server.
+    * <br>
+    * Clients can bind queues to this address to receive management notifications emitted by this server.
+    */
+   String getManagementNotificationAddress();
+
+   /**
+    * Returns the size of the cache for pre-creating message IDs.
+    */
+   int getIDCacheSize();
+
+   /**
+    * Returns whether message ID cache is persisted.
+    */
+   boolean isPersistIDCache();
+
+   /**
+    * Returns the file system directory used to store large messages.
+    */
+   String getLargeMessagesDirectory();
+
+   /**
+    * Returns whether wildcard routing is supported by this server.
+    */
+   boolean isWildcardRoutingEnabled();
+
+   /**
+    * Returns the timeout (in milliseconds) after which transactions is removed
+    * from the resource manager after it was created.
+    */
+   long getTransactionTimeout();
+
+   /**
+    * Returns the frequency (in milliseconds)  to scan transactions to detect which transactions
+    * have timed out.
+    */
+   long getTransactionTimeoutScanPeriod();
+
+   /**
+    * Returns the frequency (in milliseconds)  to scan messages to detect which messages
+    * have expired.
+    */
+   long getMessageExpiryScanPeriod();
+
+   /**
+    * Returns the priority of the thread used to scan message expiration.
+    */
+   long getMessageExpiryThreadPriority();
+
+   /**
+    * Returns whether code coming from connection is executed asynchronously or not.
+    */
+   boolean isAsyncConnectionExecutionEnabled();
+
+   /**
+    * Returns the connectors configured for this server.
+    */
+   Object[] getConnectors() throws Exception;
+
+   /**
+    * Returns the connectors configured for this server using JSON serialization.
+    */
+   String getConnectorsAsJSON() throws Exception;
+
+   /**
+    * Returns the addresses created on this server.
+    */
+   String[] getAddressNames();
+
+   /**
+    * Returns the names of the queues created on this server.
+    */
+   String[] getQueueNames();
+
+   // Operations ----------------------------------------------------
+
+   /**
+    * Create a durable queue.
+    * <br>
+    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    */
+   @Operation(desc = "Create a queue with the specified address", impact = MBeanOperationInfo.ACTION)
+   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name) throws Exception;
+
+   /**
+    * Create a queue.
+    * <br>
+    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    * @param filter  of the queue
+    * @param durable whether the queue is durable
+    */
+   @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION)
+   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name,
+                    @Parameter(name = "filter", desc = "Filter of the queue") String filter,
+                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
+
+   /**
+    * Create a queue.
+    * <br>
+    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    * @param durable whether the queue is durable
+    */
+   @Operation(desc = "Create a queue with the specified address, name and durability", impact = MBeanOperationInfo.ACTION)
+   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name,
+                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
+
+   /**
+    * Deploy a durable queue.
+    * <br>
+    * This method will do nothing if the queue with the given name already exists on the server.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    * @param filter  of the queue
+    */
+   @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
+   void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name,
+                    @Parameter(name = "filter", desc = "Filter of the queue") String filter) throws Exception;
+
+   /**
+    * Deploy a queue.
+    * <br>
+    * This method will do nothing if the queue with the given name already exists on the server.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    * @param filter  of the queue
+    * @param durable whether the queue is durable
+    */
+   @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
+   void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name,
+                    @Parameter(name = "filter", desc = "Filter of the queue") String filter,
+                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
+
+   /**
+    * Destroys the queue corresponding to the specified name.
+    */
+   @Operation(desc = "Destroy a queue", impact = MBeanOperationInfo.ACTION)
+   void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
+
+   /**
+    * Enables message counters for this server.
+    */
+   @Operation(desc = "Enable message counters", impact = MBeanOperationInfo.ACTION)
+   void enableMessageCounters() throws Exception;
+
+   /**
+    * Disables message counters for this server.
+    */
+   @Operation(desc = "Disable message counters", impact = MBeanOperationInfo.ACTION)
+   void disableMessageCounters() throws Exception;
+
+   /**
+    * Reset all message counters.
+    */
+   @Operation(desc = "Reset all message counters", impact = MBeanOperationInfo.ACTION)
+   void resetAllMessageCounters() throws Exception;
+
+   /**
+    * Reset histories for all message counters.
+    */
+   @Operation(desc = "Reset all message counters history", impact = MBeanOperationInfo.ACTION)
+   void resetAllMessageCounterHistories() throws Exception;
+
+   /**
+    * List all the prepared transaction, sorted by date, oldest first.
+    * <br>
+    * The Strings are Base-64 representation of the transaction XID and can be
+    * used to heuristically commit or rollback the transactions.
+    *
+    * @see #commitPreparedTransaction(String)
+    * @see #rollbackPreparedTransaction(String)
+    */
+   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
+   String[] listPreparedTransactions() throws Exception;
+
+   /**
+    * List all the prepared transaction, sorted by date,
+    * oldest first, with details, in text format.
+    */
+   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in JSON format")
+   String listPreparedTransactionDetailsAsJSON() throws Exception;
+
+   /**
+    * List all the prepared transaction, sorted by date,
+    * oldest first, with details, in HTML format
+    */
+   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in HTML format")
+   String listPreparedTransactionDetailsAsHTML() throws Exception;
+
+   /**
+    * List transactions which have been heuristically committed.
+    */
+   String[] listHeuristicCommittedTransactions() throws Exception;
+
+   /**
+    * List transactions which have been heuristically rolled back.
+    */
+   String[] listHeuristicRolledBackTransactions() throws Exception;
+
+   /**
+    * Heuristically commits a prepared transaction.
+    *
+    * @param transactionAsBase64 base 64 representation of a prepare transaction
+    * @return {@code true} if the transaction was successfully committed, {@code false} else
+    * @see #listPreparedTransactions()
+    */
+   @Operation(desc = "Commit a prepared transaction")
+   boolean commitPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
+
+   /**
+    * Heuristically rolls back a prepared transaction.
+    *
+    * @param transactionAsBase64 base 64 representation of a prepare transaction
+    * @return {@code true} if the transaction was successfully rolled back, {@code false} else
+    * @see #listPreparedTransactions()
+    */
+   @Operation(desc = "Rollback a prepared transaction")
+   boolean rollbackPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
+
+   /**
+    * Lists the addresses of all the clients connected to this address.
+    */
+   @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
+   String[] listRemoteAddresses() throws Exception;
+
+   /**
+    * Lists the addresses of the clients connected to this address which matches the specified IP address.
+    */
+   @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO)
+   String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+
+   /**
+    * Closes all the connections of clients connected to this server which matches the specified IP address.
+    */
+   @Operation(desc = "Closes all the connections for the given IP Address", impact = MBeanOperationInfo.INFO)
+   boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+
+   /**
+    * Closes all the connections of clients connected to this server which matches the specified IP address.
+    */
+   @Operation(desc = "Closes all the consumer connections for the given ActiveMQ address", impact = MBeanOperationInfo.INFO)
+   boolean closeConsumerConnectionsForAddress(@Parameter(desc = "a ActiveMQ address", name = "address") String address) throws Exception;
+
+   /**
+    * Closes all the connections of sessions with a matching user name.
+    */
+   @Operation(desc = "Closes all the connections for sessions with the given user name", impact = MBeanOperationInfo.INFO)
+   boolean closeConnectionsForUser(@Parameter(desc = "a user name", name = "userName") String address) throws Exception;
+
+   /**
+    * Lists all the IDs of the connections connected to this server.
+    */
+   @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
+   String[] listConnectionIDs() throws Exception;
+
+   String listProducersInfoAsJSON() throws Exception;
+
+   /**
+    * Lists all the sessions IDs for the specified connection ID.
+    */
+   @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
+   String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+
+   /**
+    * This method is used by ActiveMQ clustering and must not be called by ActiveMQ clients.
+    */
+   void sendQueueInfoToQueue(String queueName, String address) throws Exception;
+
+   @Operation(desc = "Add security settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
+   void addSecuritySettings(
+      @Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
+      @Parameter(desc = "a comma-separated list of roles allowed to send messages", name = "send") String sendRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to consume messages", name = "consume") String consumeRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to create durable queues", name = "createDurableQueueRoles") String createDurableQueueRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to delete durable queues", name = "deleteDurableQueueRoles") String deleteDurableQueueRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to create non durable queues", name = "createNonDurableQueueRoles") String createNonDurableQueueRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to delete non durable queues", name = "deleteNonDurableQueueRoles") String deleteNonDurableQueueRoles,
+      @Parameter(desc = "a comma-separated list of roles allowed to send management messages messages", name = "manage") String manageRoles) throws Exception;
+
+   @Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
+   void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+   @Operation(desc = "get roles for a specific address match", impact = MBeanOperationInfo.INFO)
+   Object[] getRoles(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+   @Operation(desc = "get roles (as a JSON string) for a specific address match", impact = MBeanOperationInfo.INFO)
+   String getRolesAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+   /**
+    * adds a new address setting for a specific address
+    */
+   @Operation(desc = "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
+   void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
+                           @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
+                           @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
+                           @Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
+                           @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
+                           @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
+                           @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
+                           @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
+                           @Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
+                           @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
+                           @Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
+                           @Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
+                           @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
+                           @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
+                           @Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
+                           @Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
+                           @Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
+                           @Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy) throws Exception;
+
+   void removeAddressSettings(String addressMatch) throws Exception;
+
+   /**
+    * returns the address settings as a JSON string
+    */
+   @Operation(desc = "returns the address settings as a JSON string for an address match", impact = MBeanOperationInfo.INFO)
+   String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+   String[] getDivertNames();
+
+   @Operation(desc = "Create a Divert", impact = MBeanOperationInfo.ACTION)
+   void createDivert(@Parameter(name = "name", desc = "Name of the divert") String name,
+                     @Parameter(name = "routingName", desc = "Routing name of the divert") String routingName,
+                     @Parameter(name = "address", desc = "Address to divert from") String address,
+                     @Parameter(name = "forwardingAddress", desc = "Address to divert to") String forwardingAddress,
+                     @Parameter(name = "exclusive", desc = "Is the divert exclusive?") boolean exclusive,
+                     @Parameter(name = "filterString", desc = "Filter of the divert") String filterString,
+                     @Parameter(name = "transformerClassName", desc = "Class name of the divert's transformer") String transformerClassName) throws Exception;
+
+   @Operation(desc = "Destroy a Divert", impact = MBeanOperationInfo.ACTION)
+   void destroyDivert(@Parameter(name = "name", desc = "Name of the divert") String name) throws Exception;
+
+   String[] getBridgeNames();
+
+   @Operation(desc = "Create a Bridge", impact = MBeanOperationInfo.ACTION)
+   void createBridge(@Parameter(name = "name", desc = "Name of the bridge") String name,
+                     @Parameter(name = "queueName", desc = "Name of the source queue") String queueName,
+                     @Parameter(name = "forwardingAddress", desc = "Forwarding address") String forwardingAddress,
+                     @Parameter(name = "filterString", desc = "Filter of the brdige") String filterString,
+                     @Parameter(name = "transformerClassName", desc = "Class name of the bridge transformer") String transformerClassName,
+                     @Parameter(name = "retryInterval", desc = "Connection retry interval") long retryInterval,
+                     @Parameter(name = "retryIntervalMultiplier", desc = "Connection retry interval multiplier") double retryIntervalMultiplier,
+                     @Parameter(name = "initialConnectAttempts", desc = "Number of initial connection attempts") int initialConnectAttempts,
+                     @Parameter(name = "reconnectAttempts", desc = "Number of reconnection attempts") int reconnectAttempts,
+                     @Parameter(name = "useDuplicateDetection", desc = "Use duplicate detection") boolean useDuplicateDetection,
+                     @Parameter(name = "confirmationWindowSize", desc = "Confirmation window size") int confirmationWindowSize,
+                     @Parameter(name = "clientFailureCheckPeriod", desc = "Period to check client failure") long clientFailureCheckPeriod,
+                     @Parameter(name = "staticConnectorNames", desc = "comma separated list of connector names or name of discovery group if 'useDiscoveryGroup' is set to true") String connectorNames,
+                     @Parameter(name = "useDiscoveryGroup", desc = "use discovery  group") boolean useDiscoveryGroup,
+                     @Parameter(name = "ha", desc = "Is it using HA") boolean ha,
+                     @Parameter(name = "user", desc = "User name") String user,
+                     @Parameter(name = "password", desc = "User password") String password) throws Exception;
+
+
+   @Operation(desc = "Destroy a bridge", impact = MBeanOperationInfo.ACTION)
+   void destroyBridge(@Parameter(name = "name", desc = "Name of the bridge") String name) throws Exception;
+
+   @Operation(desc = "force the server to stop and notify clients to failover", impact = MBeanOperationInfo.UNKNOWN)
+   void forceFailover() throws Exception;
+
+   void updateDuplicateIdCache(String address, Object[] ids) throws Exception;
+
+   @Operation(desc = "force the server to stop and to scale down to another server", impact = MBeanOperationInfo.UNKNOWN)
+   void scaleDown(@Parameter(name = "name", desc = "The connector to use to scale down, if not provided the first appropriate connector will be used")String connector) throws Exception;
+}
+

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BridgeControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BridgeControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BridgeControl.java
index 938107c..1950837 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BridgeControl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BridgeControl.java
@@ -19,7 +19,7 @@ package org.apache.activemq.api.core.management;
  * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
  *
  */
-public interface BridgeControl extends HornetQComponentControl
+public interface BridgeControl extends ActiveMQComponentControl
 {
    /**
     * Returns the name of this bridge

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BroadcastGroupControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BroadcastGroupControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BroadcastGroupControl.java
index 2d857bd..0ace7d0 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BroadcastGroupControl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/BroadcastGroupControl.java
@@ -18,7 +18,7 @@ package org.apache.activemq.api.core.management;
  * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
  *
  */
-public interface BroadcastGroupControl extends HornetQComponentControl
+public interface BroadcastGroupControl extends ActiveMQComponentControl
 {
    /**
     * Returns the configuration name of this broadcast group.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ClusterConnectionControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ClusterConnectionControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ClusterConnectionControl.java
index 8942f13..f2fe3e2 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ClusterConnectionControl.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ClusterConnectionControl.java
@@ -20,7 +20,7 @@ import java.util.Map;
  * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
  *
  */
-public interface ClusterConnectionControl extends HornetQComponentControl
+public interface ClusterConnectionControl extends ActiveMQComponentControl
 {
    /**
     * Returns the configuration name of this cluster connection.

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQComponentControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQComponentControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQComponentControl.java
deleted file mode 100644
index 6733264..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQComponentControl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.api.core.management;
-
-/**
- * A HornetQComponentControl is used to manage the life cycle of a HornetQ component.
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface HornetQComponentControl
-{
-   /**
-    * Returns {@code true} if this component is started, {@code false} else.
-    */
-   boolean isStarted();
-
-   /**
-    * Starts this component.
-    */
-   void start() throws Exception;
-
-   /**
-    * Stops this component.
-    */
-   void stop() throws Exception;
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQServerControl.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQServerControl.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQServerControl.java
deleted file mode 100644
index 8da629c..0000000
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/HornetQServerControl.java
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.api.core.management;
-
-import javax.management.MBeanOperationInfo;
-
-/**
- * A HornetQServerControl is used to manage HornetQ servers.
- */
-public interface HornetQServerControl
-{
-   /**
-    * Returns this server's version.
-    */
-   String getVersion();
-
-   /**
-    * Returns the number of connections connected to this server.
-    */
-   int getConnectionCount();
-
-   /**
-    * Return whether this server is started.
-    */
-   boolean isStarted();
-
-   /**
-    * Returns the list of interceptors used by this server. Invoking this method is the same as invoking
-    * <code>getIncomingInterceptorClassNames().</code>
-    *
-    * @see org.apache.activemq.api.core.Interceptor
-    * @deprecated As of HornetQ 2.3.0.Final, replaced by
-    * {@link #getIncomingInterceptorClassNames()} and
-    * {@link #getOutgoingInterceptorClassNames()}
-    */
-   @Deprecated
-   String[] getInterceptorClassNames();
-
-   /**
-    * Returns the list of interceptors used by this server for incoming messages.
-    *
-    * @see org.apache.activemq.api.core.Interceptor
-    */
-   String[] getIncomingInterceptorClassNames();
-
-   /**
-    * Returns the list of interceptors used by this server for outgoing messages.
-    *
-    * @see org.apache.activemq.api.core.Interceptor
-    */
-   String[] getOutgoingInterceptorClassNames();
-
-   /**
-    * Returns whether this server is clustered.
-    */
-   boolean isClustered();
-
-   /**
-    * Returns the maximum number of threads in the <em>scheduled</em> thread pool.
-    */
-   int getScheduledThreadPoolMaxSize();
-
-   /**
-    * Returns the maximum number of threads in the thread pool.
-    */
-   int getThreadPoolMaxSize();
-
-   /**
-    * Returns the interval time (in milliseconds) to invalidate security credentials.
-    */
-   long getSecurityInvalidationInterval();
-
-   /**
-    * Returns whether security is enabled for this server.
-    */
-   boolean isSecurityEnabled();
-
-   /**
-    * Returns the file system directory used to store bindings.
-    */
-   String getBindingsDirectory();
-
-   /**
-    * Returns the file system directory used to store journal log.
-    */
-   String getJournalDirectory();
-
-   /**
-    * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).
-    */
-   String getJournalType();
-
-   /**
-    * Returns whether the journal is synchronized when receiving transactional data.
-    */
-   boolean isJournalSyncTransactional();
-
-   /**
-    * Returns whether the journal is synchronized when receiving non-transactional data.
-    */
-   boolean isJournalSyncNonTransactional();
-
-   /**
-    * Returns the size (in bytes) of each journal files.
-    */
-   int getJournalFileSize();
-
-   /**
-    * Returns the number of journal files to pre-create.
-    */
-   int getJournalMinFiles();
-
-   /**
-    * Returns the maximum number of write requests that can be in the AIO queue at any given time.
-    */
-   int getJournalMaxIO();
-
-   /**
-    * Returns the size of the internal buffer on the journal.
-    */
-   int getJournalBufferSize();
-
-   /**
-    * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal.
-    */
-   int getJournalBufferTimeout();
-
-   /**
-    * do any clients failover on a server shutdown
-    */
-   void setFailoverOnServerShutdown(boolean failoverOnServerShutdown) throws Exception;
-
-
-   /**
-    * returns if clients failover on a server shutdown
-    */
-   boolean isFailoverOnServerShutdown();
-
-   /**
-    * Returns the minimal number of journal files before compacting.
-    */
-   int getJournalCompactMinFiles();
-
-   /**
-    * Return the percentage of live data before compacting the journal.
-    */
-   int getJournalCompactPercentage();
-
-   /**
-    * Returns whether this server is using persistence and store data.
-    */
-   boolean isPersistenceEnabled();
-
-   /**
-    * Returns whether the bindings directory is created on this server startup.
-    */
-   boolean isCreateBindingsDir();
-
-   /**
-    * Returns whether the journal directory is created on this server startup.
-    */
-   boolean isCreateJournalDir();
-
-   /**
-    * Returns whether message counter is enabled for this server.
-    */
-   boolean isMessageCounterEnabled();
-
-   /**
-    * Returns the maximum number of days kept in memory for message counter.
-    */
-   int getMessageCounterMaxDayCount();
-
-   /**
-    * Sets the maximum number of days kept in memory for message counter.
-    *
-    * @param count value must be greater than 0
-    */
-   void setMessageCounterMaxDayCount(int count) throws Exception;
-
-   /**
-    * Returns the sample period (in milliseconds) to take message counter snapshot.
-    */
-   long getMessageCounterSamplePeriod();
-
-   /**
-    * Sets the sample period to take message counter snapshot.
-    *
-    * @param newPeriod value must be greater than 1000ms
-    */
-   void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
-
-   /**
-    * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
-    * <br>
-    * If a backup server has been activated, returns {@code false}.
-    */
-   boolean isBackup();
-
-   /**
-    * Returns whether this server shares its data store with a corresponding live or backup server.
-    */
-   boolean isSharedStore();
-
-   /**
-    * Returns the file system directory used to store paging files.
-    */
-   String getPagingDirectory();
-
-   /**
-    * Returns whether delivery count is persisted before messages are delivered to the consumers.
-    */
-   boolean isPersistDeliveryCountBeforeDelivery();
-
-   /**
-    * Returns the connection time to live.
-    * <br>
-    * This value overrides the connection time to live <em>sent by the client</em>.
-    */
-   long getConnectionTTLOverride();
-
-   /**
-    * Returns the management address of this server.
-    * <br>
-    * Clients can send management messages to this address to manage this server.
-    */
-   String getManagementAddress();
-
-   /**
-    * Returns the management notification address of this server.
-    * <br>
-    * Clients can bind queues to this address to receive management notifications emitted by this server.
-    */
-   String getManagementNotificationAddress();
-
-   /**
-    * Returns the size of the cache for pre-creating message IDs.
-    */
-   int getIDCacheSize();
-
-   /**
-    * Returns whether message ID cache is persisted.
-    */
-   boolean isPersistIDCache();
-
-   /**
-    * Returns the file system directory used to store large messages.
-    */
-   String getLargeMessagesDirectory();
-
-   /**
-    * Returns whether wildcard routing is supported by this server.
-    */
-   boolean isWildcardRoutingEnabled();
-
-   /**
-    * Returns the timeout (in milliseconds) after which transactions is removed
-    * from the resource manager after it was created.
-    */
-   long getTransactionTimeout();
-
-   /**
-    * Returns the frequency (in milliseconds)  to scan transactions to detect which transactions
-    * have timed out.
-    */
-   long getTransactionTimeoutScanPeriod();
-
-   /**
-    * Returns the frequency (in milliseconds)  to scan messages to detect which messages
-    * have expired.
-    */
-   long getMessageExpiryScanPeriod();
-
-   /**
-    * Returns the priority of the thread used to scan message expiration.
-    */
-   long getMessageExpiryThreadPriority();
-
-   /**
-    * Returns whether code coming from connection is executed asynchronously or not.
-    */
-   boolean isAsyncConnectionExecutionEnabled();
-
-   /**
-    * Returns the connectors configured for this server.
-    */
-   Object[] getConnectors() throws Exception;
-
-   /**
-    * Returns the connectors configured for this server using JSON serialization.
-    */
-   String getConnectorsAsJSON() throws Exception;
-
-   /**
-    * Returns the addresses created on this server.
-    */
-   String[] getAddressNames();
-
-   /**
-    * Returns the names of the queues created on this server.
-    */
-   String[] getQueueNames();
-
-   // Operations ----------------------------------------------------
-
-   /**
-    * Create a durable queue.
-    * <br>
-    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
-    *
-    * @param address address to bind the queue to
-    * @param name    name of the queue
-    */
-   @Operation(desc = "Create a queue with the specified address", impact = MBeanOperationInfo.ACTION)
-   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
-                    @Parameter(name = "name", desc = "Name of the queue") String name) throws Exception;
-
-   /**
-    * Create a queue.
-    * <br>
-    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
-    *
-    * @param address address to bind the queue to
-    * @param name    name of the queue
-    * @param filter  of the queue
-    * @param durable whether the queue is durable
-    */
-   @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION)
-   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
-                    @Parameter(name = "name", desc = "Name of the queue") String name,
-                    @Parameter(name = "filter", desc = "Filter of the queue") String filter,
-                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
-
-   /**
-    * Create a queue.
-    * <br>
-    * This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
-    *
-    * @param address address to bind the queue to
-    * @param name    name of the queue
-    * @param durable whether the queue is durable
-    */
-   @Operation(desc = "Create a queue with the specified address, name and durability", impact = MBeanOperationInfo.ACTION)
-   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
-                    @Parameter(name = "name", desc = "Name of the queue") String name,
-                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
-
-   /**
-    * Deploy a durable queue.
-    * <br>
-    * This method will do nothing if the queue with the given name already exists on the server.
-    *
-    * @param address address to bind the queue to
-    * @param name    name of the queue
-    * @param filter  of the queue
-    */
-   @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
-   void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
-                    @Parameter(name = "name", desc = "Name of the queue") String name,
-                    @Parameter(name = "filter", desc = "Filter of the queue") String filter) throws Exception;
-
-   /**
-    * Deploy a queue.
-    * <br>
-    * This method will do nothing if the queue with the given name already exists on the server.
-    *
-    * @param address address to bind the queue to
-    * @param name    name of the queue
-    * @param filter  of the queue
-    * @param durable whether the queue is durable
-    */
-   @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
-   void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
-                    @Parameter(name = "name", desc = "Name of the queue") String name,
-                    @Parameter(name = "filter", desc = "Filter of the queue") String filter,
-                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
-
-   /**
-    * Destroys the queue corresponding to the specified name.
-    */
-   @Operation(desc = "Destroy a queue", impact = MBeanOperationInfo.ACTION)
-   void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
-
-   /**
-    * Enables message counters for this server.
-    */
-   @Operation(desc = "Enable message counters", impact = MBeanOperationInfo.ACTION)
-   void enableMessageCounters() throws Exception;
-
-   /**
-    * Disables message counters for this server.
-    */
-   @Operation(desc = "Disable message counters", impact = MBeanOperationInfo.ACTION)
-   void disableMessageCounters() throws Exception;
-
-   /**
-    * Reset all message counters.
-    */
-   @Operation(desc = "Reset all message counters", impact = MBeanOperationInfo.ACTION)
-   void resetAllMessageCounters() throws Exception;
-
-   /**
-    * Reset histories for all message counters.
-    */
-   @Operation(desc = "Reset all message counters history", impact = MBeanOperationInfo.ACTION)
-   void resetAllMessageCounterHistories() throws Exception;
-
-   /**
-    * List all the prepared transaction, sorted by date, oldest first.
-    * <br>
-    * The Strings are Base-64 representation of the transaction XID and can be
-    * used to heuristically commit or rollback the transactions.
-    *
-    * @see #commitPreparedTransaction(String)
-    * @see #rollbackPreparedTransaction(String)
-    */
-   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
-   String[] listPreparedTransactions() throws Exception;
-
-   /**
-    * List all the prepared transaction, sorted by date,
-    * oldest first, with details, in text format.
-    */
-   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in JSON format")
-   String listPreparedTransactionDetailsAsJSON() throws Exception;
-
-   /**
-    * List all the prepared transaction, sorted by date,
-    * oldest first, with details, in HTML format
-    */
-   @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in HTML format")
-   String listPreparedTransactionDetailsAsHTML() throws Exception;
-
-   /**
-    * List transactions which have been heuristically committed.
-    */
-   String[] listHeuristicCommittedTransactions() throws Exception;
-
-   /**
-    * List transactions which have been heuristically rolled back.
-    */
-   String[] listHeuristicRolledBackTransactions() throws Exception;
-
-   /**
-    * Heuristically commits a prepared transaction.
-    *
-    * @param transactionAsBase64 base 64 representation of a prepare transaction
-    * @return {@code true} if the transaction was successfully committed, {@code false} else
-    * @see #listPreparedTransactions()
-    */
-   @Operation(desc = "Commit a prepared transaction")
-   boolean commitPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
-
-   /**
-    * Heuristically rolls back a prepared transaction.
-    *
-    * @param transactionAsBase64 base 64 representation of a prepare transaction
-    * @return {@code true} if the transaction was successfully rolled back, {@code false} else
-    * @see #listPreparedTransactions()
-    */
-   @Operation(desc = "Rollback a prepared transaction")
-   boolean rollbackPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
-
-   /**
-    * Lists the addresses of all the clients connected to this address.
-    */
-   @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
-   String[] listRemoteAddresses() throws Exception;
-
-   /**
-    * Lists the addresses of the clients connected to this address which matches the specified IP address.
-    */
-   @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO)
-   String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
-
-   /**
-    * Closes all the connections of clients connected to this server which matches the specified IP address.
-    */
-   @Operation(desc = "Closes all the connections for the given IP Address", impact = MBeanOperationInfo.INFO)
-   boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
-
-   /**
-    * Closes all the connections of clients connected to this server which matches the specified IP address.
-    */
-   @Operation(desc = "Closes all the consumer connections for the given HornetQ address", impact = MBeanOperationInfo.INFO)
-   boolean closeConsumerConnectionsForAddress(@Parameter(desc = "a HornetQ address", name = "address") String address) throws Exception;
-
-   /**
-    * Closes all the connections of sessions with a matching user name.
-    */
-   @Operation(desc = "Closes all the connections for sessions with the given user name", impact = MBeanOperationInfo.INFO)
-   boolean closeConnectionsForUser(@Parameter(desc = "a user name", name = "userName") String address) throws Exception;
-
-   /**
-    * Lists all the IDs of the connections connected to this server.
-    */
-   @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
-   String[] listConnectionIDs() throws Exception;
-
-   String listProducersInfoAsJSON() throws Exception;
-
-   /**
-    * Lists all the sessions IDs for the specified connection ID.
-    */
-   @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
-   String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
-
-   /**
-    * This method is used by HornetQ clustering and must not be called by HornetQ clients.
-    */
-   void sendQueueInfoToQueue(String queueName, String address) throws Exception;
-
-   @Operation(desc = "Add security settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
-   void addSecuritySettings(
-      @Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
-      @Parameter(desc = "a comma-separated list of roles allowed to send messages", name = "send") String sendRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to consume messages", name = "consume") String consumeRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to create durable queues", name = "createDurableQueueRoles") String createDurableQueueRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to delete durable queues", name = "deleteDurableQueueRoles") String deleteDurableQueueRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to create non durable queues", name = "createNonDurableQueueRoles") String createNonDurableQueueRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to delete non durable queues", name = "deleteNonDurableQueueRoles") String deleteNonDurableQueueRoles,
-      @Parameter(desc = "a comma-separated list of roles allowed to send management messages messages", name = "manage") String manageRoles) throws Exception;
-
-   @Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
-   void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
-
-   @Operation(desc = "get roles for a specific address match", impact = MBeanOperationInfo.INFO)
-   Object[] getRoles(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
-
-   @Operation(desc = "get roles (as a JSON string) for a specific address match", impact = MBeanOperationInfo.INFO)
-   String getRolesAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
-
-   /**
-    * adds a new address setting for a specific address
-    */
-   @Operation(desc = "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
-   void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
-                           @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
-                           @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
-                           @Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
-                           @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
-                           @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
-                           @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
-                           @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
-                           @Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
-                           @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
-                           @Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
-                           @Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
-                           @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
-                           @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
-                           @Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
-                           @Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
-                           @Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
-                           @Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy) throws Exception;
-
-   void removeAddressSettings(String addressMatch) throws Exception;
-
-   /**
-    * returns the address settings as a JSON string
-    */
-   @Operation(desc = "returns the address settings as a JSON string for an address match", impact = MBeanOperationInfo.INFO)
-   String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
-
-   String[] getDivertNames();
-
-   @Operation(desc = "Create a Divert", impact = MBeanOperationInfo.ACTION)
-   void createDivert(@Parameter(name = "name", desc = "Name of the divert") String name,
-                     @Parameter(name = "routingName", desc = "Routing name of the divert") String routingName,
-                     @Parameter(name = "address", desc = "Address to divert from") String address,
-                     @Parameter(name = "forwardingAddress", desc = "Address to divert to") String forwardingAddress,
-                     @Parameter(name = "exclusive", desc = "Is the divert exclusive?") boolean exclusive,
-                     @Parameter(name = "filterString", desc = "Filter of the divert") String filterString,
-                     @Parameter(name = "transformerClassName", desc = "Class name of the divert's transformer") String transformerClassName) throws Exception;
-
-   @Operation(desc = "Destroy a Divert", impact = MBeanOperationInfo.ACTION)
-   void destroyDivert(@Parameter(name = "name", desc = "Name of the divert") String name) throws Exception;
-
-   String[] getBridgeNames();
-
-   @Operation(desc = "Create a Bridge", impact = MBeanOperationInfo.ACTION)
-   void createBridge(@Parameter(name = "name", desc = "Name of the bridge") String name,
-                     @Parameter(name = "queueName", desc = "Name of the source queue") String queueName,
-                     @Parameter(name = "forwardingAddress", desc = "Forwarding address") String forwardingAddress,
-                     @Parameter(name = "filterString", desc = "Filter of the brdige") String filterString,
-                     @Parameter(name = "transformerClassName", desc = "Class name of the bridge transformer") String transformerClassName,
-                     @Parameter(name = "retryInterval", desc = "Connection retry interval") long retryInterval,
-                     @Parameter(name = "retryIntervalMultiplier", desc = "Connection retry interval multiplier") double retryIntervalMultiplier,
-                     @Parameter(name = "initialConnectAttempts", desc = "Number of initial connection attempts") int initialConnectAttempts,
-                     @Parameter(name = "reconnectAttempts", desc = "Number of reconnection attempts") int reconnectAttempts,
-                     @Parameter(name = "useDuplicateDetection", desc = "Use duplicate detection") boolean useDuplicateDetection,
-                     @Parameter(name = "confirmationWindowSize", desc = "Confirmation window size") int confirmationWindowSize,
-                     @Parameter(name = "clientFailureCheckPeriod", desc = "Period to check client failure") long clientFailureCheckPeriod,
-                     @Parameter(name = "staticConnectorNames", desc = "comma separated list of connector names or name of discovery group if 'useDiscoveryGroup' is set to true") String connectorNames,
-                     @Parameter(name = "useDiscoveryGroup", desc = "use discovery  group") boolean useDiscoveryGroup,
-                     @Parameter(name = "ha", desc = "Is it using HA") boolean ha,
-                     @Parameter(name = "user", desc = "User name") String user,
-                     @Parameter(name = "password", desc = "User password") String password) throws Exception;
-
-
-   @Operation(desc = "Destroy a bridge", impact = MBeanOperationInfo.ACTION)
-   void destroyBridge(@Parameter(name = "name", desc = "Name of the bridge") String name) throws Exception;
-
-   @Operation(desc = "force the server to stop and notify clients to failover", impact = MBeanOperationInfo.UNKNOWN)
-   void forceFailover() throws Exception;
-
-   void updateDuplicateIdCache(String address, Object[] ids) throws Exception;
-
-   @Operation(desc = "force the server to stop and to scale down to another server", impact = MBeanOperationInfo.UNKNOWN)
-   void scaleDown(@Parameter(name = "name", desc = "The connector to use to scale down, if not provided the first appropriate connector will be used")String connector) throws Exception;
-}
-

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ManagementHelper.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ManagementHelper.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ManagementHelper.java
index cad6844..f8e0ad6 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ManagementHelper.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ManagementHelper.java
@@ -19,12 +19,12 @@ import java.util.Map;
 
 import org.apache.activemq.api.core.Message;
 import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.client.HornetQClientMessageBundle;
+import org.apache.activemq.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.utils.json.JSONArray;
 import org.apache.activemq.utils.json.JSONObject;
 
 /**
- * Helper class to use HornetQ Core messages to manage server resources.
+ * Helper class to use ActiveMQ Core messages to manage server resources.
  *
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -292,12 +292,12 @@ public final class ManagementHelper
          param instanceof Byte == false &&
          param instanceof Short == false)
       {
-         throw HornetQClientMessageBundle.BUNDLE.invalidManagementParam(param.getClass().getName());
+         throw ActiveMQClientMessageBundle.BUNDLE.invalidManagementParam(param.getClass().getName());
       }
    }
 
    /**
-    * Used by HornetQ management service.
+    * Used by ActiveMQ management service.
     */
    public static Object[] retrieveOperationParameters(final Message message) throws Exception
    {
@@ -333,7 +333,7 @@ public final class ManagementHelper
    }
 
    /**
-    * Used by HornetQ management service.
+    * Used by ActiveMQ management service.
     */
    public static void storeResult(final Message message, final Object result) throws Exception
    {
@@ -417,7 +417,7 @@ public final class ManagementHelper
    }
 
    /**
-    * Used by HornetQ management service.
+    * Used by ActiveMQ management service.
     */
    public static Map<String, Object> fromCommaSeparatedKeyValues(final String str) throws Exception
    {
@@ -433,7 +433,7 @@ public final class ManagementHelper
    }
 
    /**
-    * Used by HornetQ management service.
+    * Used by ActiveMQ management service.
     */
    public static Object[] fromCommaSeparatedArrayOfCommaSeparatedKeyValues(final String str) throws Exception
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/NotificationType.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/NotificationType.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/NotificationType.java
index 0f94538..0548a1e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/NotificationType.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/NotificationType.java
@@ -13,15 +13,15 @@
 package org.apache.activemq.api.core.management;
 
 /**
- * Types of notification emitted by HornetQ servers.
+ * Types of notification emitted by ActiveMQ servers.
  * <p>
  * These notifications can be received through:
  * <ul>
  * <li>JMX' MBeans subscriptions
- * <li>Core messages to a notification address (default value is {@code hornetq.notifications})
+ * <li>Core messages to a notification address (default value is {@code activemq.notifications})
  * <li>JMS messages
  * </ul>
- * @see the HornetQ user manual section on "Management Notifications"
+ * @see the ActiveMQ user manual section on "Management Notifications"
  * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
  */
 public interface NotificationType

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ObjectNameBuilder.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ObjectNameBuilder.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ObjectNameBuilder.java
index 0f53d16..38811de 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ObjectNameBuilder.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/ObjectNameBuilder.java
@@ -18,7 +18,7 @@ import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.api.core.SimpleString;
 
 /**
- * Helper class to build ObjectNames for HornetQ resources.
+ * Helper class to build ObjectNames for ActiveMQ resources.
  * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a>
  */
 public final class ObjectNameBuilder
@@ -27,7 +27,7 @@ public final class ObjectNameBuilder
    // Constants -----------------------------------------------------
 
    /**
-    * Default JMX domain for HornetQ resources.
+    * Default JMX domain for ActiveMQ resources.
     */
    public static final ObjectNameBuilder DEFAULT = new ObjectNameBuilder(ActiveMQDefaultConfiguration.getDefaultJmxDomain());
 
@@ -63,9 +63,9 @@ public final class ObjectNameBuilder
    // Public --------------------------------------------------------
 
    /**
-    * Returns the ObjectName used by the single {@link HornetQServerControl}.
+    * Returns the ObjectName used by the single {@link ActiveMQServerControl}.
     */
-   public ObjectName getHornetQServerObjectName() throws Exception
+   public ObjectName getActiveMQServerObjectName() throws Exception
    {
       return ObjectName.getInstance(domain + ":module=Core,type=Server");
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/package-info.java
index 97fc8ab..8ea922e 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/management/package-info.java
@@ -11,9 +11,9 @@
  * permissions and limitations under the License.
  */
 /**
- * Management API for HornetQ servers and its Core resources.
+ * Management API for ActiveMQ servers and its Core resources.
  * <br>
- * HornetQ can be managed either using JMX or by sending management messages to the
+ * ActiveMQ can be managed either using JMX or by sending management messages to the
  * server's special management address. Please refer to the user manual for more information.
  */
 package org.apache.activemq.api.core.management;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/package-info.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/package-info.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/package-info.java
index d56fc3c..8fecb75 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/package-info.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/package-info.java
@@ -14,7 +14,7 @@
  * Core Messaging API.
  * <br>
  * This package defines base classes and interfaces used
- * throughout HornetQ API
+ * throughout ActiveMQ API
  */
 package org.apache.activemq.api.core;
 


[36/52] [abbrv] [partial] activemq-6 git commit: ACTIVEMQ6-4 Rename HornetQ* classes to ActiveMQ*

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessage.java
deleted file mode 100644
index 4f8038f..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessage.java
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.JMSRuntimeException;
-import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageNotWriteableException;
-
-import org.apache.activemq.api.core.ActiveMQBuffer;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.jms.HornetQJMSConstants;
-import org.apache.activemq.core.message.impl.MessageInternal;
-import org.apache.activemq.reader.MessageUtil;
-import org.apache.activemq.utils.UUID;
-
-
-/**
- * HornetQ implementation of a JMS Message.
- * <br>
- * JMS Messages only live on the client side - the server only deals with MessageImpl
- * instances
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:bershath@yahoo.com">Tyronne Wickramarathne</a> Partially ported from JBossMQ implementation
- *         originally written by:
- * @author Norbert Lataille (Norbert.Lataille@m4x.org)
- * @author Hiram Chirino (Cojonudo14@hotmail.com)
- * @author David Maplesden (David.Maplesden@orion.co.nz)
- * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- */
-public class HornetQMessage implements javax.jms.Message
-{
-   // Constants -----------------------------------------------------
-   public static final byte TYPE = org.apache.activemq.api.core.Message.DEFAULT_TYPE;
-
-   public static Map<String, Object> coreMaptoJMSMap(final Map<String, Object> coreMessage)
-   {
-      Map<String, Object> jmsMessage = new HashMap<String, Object>();
-
-      String deliveryMode = (Boolean)coreMessage.get("durable") ? "PERSISTENT" : "NON_PERSISTENT";
-      byte priority = (Byte)coreMessage.get("priority");
-      long timestamp = (Long)coreMessage.get("timestamp");
-      long expiration = (Long)coreMessage.get("expiration");
-
-      jmsMessage.put("JMSPriority", priority);
-      jmsMessage.put("JMSTimestamp", timestamp);
-      jmsMessage.put("JMSExpiration", expiration);
-      jmsMessage.put("JMSDeliveryMode", deliveryMode);
-
-      for (Map.Entry<String, Object> entry : coreMessage.entrySet())
-      {
-         if (entry.getKey().equals("type") || entry.getKey().equals("durable") ||
-             entry.getKey().equals("expiration") ||
-             entry.getKey().equals("timestamp") ||
-             entry.getKey().equals("priority"))
-         {
-            // Ignore
-         }
-         else if (entry.getKey().equals("userID"))
-         {
-            jmsMessage.put("JMSMessageID", entry.getValue().toString());
-         }
-         else
-         {
-            Object value = entry.getValue();
-            if (value instanceof SimpleString)
-            {
-               jmsMessage.put(entry.getKey(), value.toString());
-            }
-            else
-            {
-               jmsMessage.put(entry.getKey(), value);
-            }
-         }
-      }
-
-      return jmsMessage;
-   }
-
-   // Static --------------------------------------------------------
-
-   private static final HashSet<String> reservedIdentifiers = new HashSet<String>();
-   static
-   {
-      HornetQMessage.reservedIdentifiers.add("NULL");
-      HornetQMessage.reservedIdentifiers.add("TRUE");
-      HornetQMessage.reservedIdentifiers.add("FALSE");
-      HornetQMessage.reservedIdentifiers.add("NOT");
-      HornetQMessage.reservedIdentifiers.add("AND");
-      HornetQMessage.reservedIdentifiers.add("OR");
-      HornetQMessage.reservedIdentifiers.add("BETWEEN");
-      HornetQMessage.reservedIdentifiers.add("LIKE");
-      HornetQMessage.reservedIdentifiers.add("IN");
-      HornetQMessage.reservedIdentifiers.add("IS");
-      HornetQMessage.reservedIdentifiers.add("ESCAPE");
-   }
-
-   public static HornetQMessage createMessage(final ClientMessage message, final ClientSession session)
-   {
-      int type = message.getType();
-
-      HornetQMessage msg;
-
-      switch (type)
-      {
-         case HornetQMessage.TYPE: // 0
-         {
-            msg = new HornetQMessage(message, session);
-            break;
-         }
-         case HornetQBytesMessage.TYPE: // 4
-         {
-            msg = new HornetQBytesMessage(message, session);
-            break;
-         }
-         case HornetQMapMessage.TYPE: // 5
-         {
-            msg = new HornetQMapMessage(message, session);
-            break;
-         }
-         case HornetQObjectMessage.TYPE:
-         {
-            msg = new HornetQObjectMessage(message, session);
-            break;
-         }
-         case HornetQStreamMessage.TYPE: // 6
-         {
-            msg = new HornetQStreamMessage(message, session);
-            break;
-         }
-         case HornetQTextMessage.TYPE: // 3
-         {
-            msg = new HornetQTextMessage(message, session);
-            break;
-         }
-         default:
-         {
-            throw new JMSRuntimeException("Invalid message type " + type);
-         }
-      }
-
-      return msg;
-   }
-
-   // Attributes ----------------------------------------------------
-
-   // The underlying message
-   protected ClientMessage message;
-
-   private ClientSession session;
-
-   // Read-only?
-   protected boolean readOnly;
-
-   // Properties read-only?
-   protected boolean propertiesReadOnly;
-
-   // Cache it
-   private Destination dest;
-
-   // Cache it
-   private String msgID;
-
-   // Cache it
-   private Destination replyTo;
-
-   // Cache it
-   private String jmsCorrelationID;
-
-   // Cache it
-   private String jmsType;
-
-   private boolean individualAck;
-
-   private long jmsDeliveryTime;
-
-   // Constructors --------------------------------------------------
-
-   /*
-    * Create a new message prior to sending
-    */
-   protected HornetQMessage(final byte type, final ClientSession session)
-   {
-      message = session.createMessage(type, true, 0, System.currentTimeMillis(), (byte)4);
-
-   }
-
-   protected HornetQMessage(final ClientSession session)
-   {
-      this(HornetQMessage.TYPE, session);
-   }
-
-   /**
-    * Constructor for when receiving a message from the server
-    */
-   public HornetQMessage(final ClientMessage message, final ClientSession session)
-   {
-      this.message = message;
-
-      readOnly = true;
-
-      propertiesReadOnly = true;
-
-      this.session = session;
-   }
-
-   /*
-    * A constructor that takes a foreign message
-    */
-   public HornetQMessage(final Message foreign, final ClientSession session) throws JMSException
-   {
-      this(foreign, HornetQMessage.TYPE, session);
-   }
-
-   public HornetQMessage()
-   {
-   }
-
-   protected HornetQMessage(final Message foreign, final byte type, final ClientSession session) throws JMSException
-   {
-      this(type, session);
-
-      setJMSTimestamp(foreign.getJMSTimestamp());
-
-      String value = System.getProperty(HornetQJMSConstants.JMS_HORNETQ_ENABLE_BYTE_ARRAY_JMS_CORRELATION_ID_PROPERTY_NAME);
-
-      boolean supportBytesId = !"false".equals(value);
-
-      if (supportBytesId)
-      {
-         try
-         {
-            byte[] corrIDBytes = foreign.getJMSCorrelationIDAsBytes();
-            setJMSCorrelationIDAsBytes(corrIDBytes);
-         }
-         catch (JMSException e)
-         {
-            // specified as String
-            String corrIDString = foreign.getJMSCorrelationID();
-            if (corrIDString != null)
-            {
-               setJMSCorrelationID(corrIDString);
-            }
-         }
-      }
-      else
-      {
-         // Some providers, like WSMQ do automatic conversions between native byte[] correlation id
-         // and String correlation id. This makes it impossible for HQ to guarantee to return the correct
-         // type as set by the user
-         // So we allow the behaviour to be overridden by a system property
-         // https://jira.jboss.org/jira/browse/HORNETQ-356
-         // https://jira.jboss.org/jira/browse/HORNETQ-332
-         String corrIDString = foreign.getJMSCorrelationID();
-         if (corrIDString != null)
-         {
-            setJMSCorrelationID(corrIDString);
-         }
-      }
-
-      setJMSReplyTo(foreign.getJMSReplyTo());
-      setJMSDestination(foreign.getJMSDestination());
-      setJMSDeliveryMode(foreign.getJMSDeliveryMode());
-      setJMSExpiration(foreign.getJMSExpiration());
-      setJMSPriority(foreign.getJMSPriority());
-      setJMSType(foreign.getJMSType());
-
-      // We can't avoid a cast warning here since getPropertyNames() is on the JMS API
-      for (Enumeration<String> props = foreign.getPropertyNames(); props.hasMoreElements();)
-      {
-         String name = props.nextElement();
-
-         Object prop = foreign.getObjectProperty(name);
-
-         setObjectProperty(name, prop);
-      }
-   }
-
-   // javax.jmx.Message implementation ------------------------------
-
-   public String getJMSMessageID()
-   {
-      if (msgID == null)
-      {
-         UUID uid = message.getUserID();
-
-         msgID = uid == null ? null : "ID:" + uid.toString();
-      }
-      return msgID;
-   }
-
-   public void setJMSMessageID(final String jmsMessageID) throws JMSException
-   {
-      if (jmsMessageID != null && !jmsMessageID.startsWith("ID:"))
-      {
-         throw new JMSException("JMSMessageID must start with ID:");
-      }
-
-      message.setUserID(null);
-
-      msgID = jmsMessageID;
-   }
-
-   public long getJMSTimestamp() throws JMSException
-   {
-      return message.getTimestamp();
-   }
-
-   public void setJMSTimestamp(final long timestamp) throws JMSException
-   {
-      message.setTimestamp(timestamp);
-   }
-
-   public byte[] getJMSCorrelationIDAsBytes() throws JMSException
-   {
-      return MessageUtil.getJMSCorrelationIDAsBytes(message);
-   }
-
-   public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException
-   {
-      try
-      {
-         MessageUtil.setJMSCorrelationIDAsBytes(message, correlationID);
-      }
-      catch (ActiveMQException e)
-      {
-         JMSException ex = new JMSException(e.getMessage());
-         ex.initCause(e);
-         throw ex;
-      }
-   }
-
-   public void setJMSCorrelationID(final String correlationID) throws JMSException
-   {
-      MessageUtil.setJMSCorrelationID(message, correlationID);
-      jmsCorrelationID = correlationID;
-   }
-
-   public String getJMSCorrelationID() throws JMSException
-   {
-      if (jmsCorrelationID == null)
-      {
-         jmsCorrelationID = MessageUtil.getJMSCorrelationID(message);
-      }
-
-      return jmsCorrelationID;
-   }
-
-   public Destination getJMSReplyTo() throws JMSException
-   {
-      if (replyTo == null)
-      {
-
-         SimpleString repl = MessageUtil.getJMSReplyTo(message);
-
-         if (repl != null)
-         {
-            replyTo = HornetQDestination.fromAddress(repl.toString());
-         }
-      }
-      return replyTo;
-   }
-
-   public void setJMSReplyTo(final Destination dest) throws JMSException
-   {
-
-      if (dest == null)
-      {
-         MessageUtil.setJMSReplyTo(message, null);
-         replyTo = null;
-      }
-      else
-      {
-         if (dest instanceof HornetQDestination == false)
-         {
-            throw new InvalidDestinationException("Not a HornetQ destination " + dest);
-         }
-
-         HornetQDestination jbd = (HornetQDestination)dest;
-
-         MessageUtil.setJMSReplyTo(message, jbd.getSimpleAddress());
-
-         replyTo = jbd;
-      }
-   }
-
-   public Destination getJMSDestination() throws JMSException
-   {
-      if (dest == null)
-      {
-         SimpleString sdest = message.getAddress();
-
-         dest = sdest == null ? null : HornetQDestination.fromAddress(sdest.toString());
-      }
-
-      return dest;
-   }
-
-   public void setJMSDestination(final Destination destination) throws JMSException
-   {
-      dest = destination;
-   }
-
-   public int getJMSDeliveryMode() throws JMSException
-   {
-      return message.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
-   }
-
-   public void setJMSDeliveryMode(final int deliveryMode) throws JMSException
-   {
-      if (deliveryMode == DeliveryMode.PERSISTENT)
-      {
-         message.setDurable(true);
-      }
-      else if (deliveryMode == DeliveryMode.NON_PERSISTENT)
-      {
-         message.setDurable(false);
-      }
-      else
-      {
-         throw HornetQJMSClientBundle.BUNDLE.illegalDeliveryMode(deliveryMode);
-      }
-   }
-
-   public boolean getJMSRedelivered() throws JMSException
-   {
-      return message.getDeliveryCount() > 1;
-   }
-
-   public void setJMSRedelivered(final boolean redelivered) throws JMSException
-   {
-      if (!redelivered)
-      {
-         message.setDeliveryCount(1);
-      }
-      else
-      {
-         if (message.getDeliveryCount() > 1)
-         {
-            // do nothing
-         }
-         else
-         {
-            message.setDeliveryCount(2);
-         }
-      }
-   }
-
-   public void setJMSType(final String type) throws JMSException
-   {
-      if (type != null)
-      {
-         MessageUtil.setJMSType(message, type);
-
-         jmsType = type;
-      }
-   }
-
-   public String getJMSType() throws JMSException
-   {
-      if (jmsType == null)
-      {
-         jmsType = MessageUtil.getJMSType(message);
-      }
-      return jmsType;
-   }
-
-   public long getJMSExpiration() throws JMSException
-   {
-      return message.getExpiration();
-   }
-
-   public void setJMSExpiration(final long expiration) throws JMSException
-   {
-      message.setExpiration(expiration);
-   }
-
-   public int getJMSPriority() throws JMSException
-   {
-      return message.getPriority();
-   }
-
-   public void setJMSPriority(final int priority) throws JMSException
-   {
-      checkPriority(priority);
-
-      message.setPriority((byte)priority);
-   }
-
-   public void clearProperties() throws JMSException
-   {
-
-      MessageUtil.clearProperties(message);
-
-      propertiesReadOnly = false;
-   }
-
-   public void clearBody() throws JMSException
-   {
-      readOnly = false;
-   }
-
-   public boolean propertyExists(final String name) throws JMSException
-   {
-      return MessageUtil.propertyExists(message, name);
-   }
-
-   public boolean getBooleanProperty(final String name) throws JMSException
-   {
-      try
-      {
-         return message.getBooleanProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public byte getByteProperty(final String name) throws JMSException
-   {
-      try
-      {
-         return message.getByteProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public short getShortProperty(final String name) throws JMSException
-   {
-      try
-      {
-         return message.getShortProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public int getIntProperty(final String name) throws JMSException
-   {
-      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
-      {
-         return message.getDeliveryCount();
-      }
-
-      try
-      {
-         return message.getIntProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public long getLongProperty(final String name) throws JMSException
-   {
-      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
-      {
-         return message.getDeliveryCount();
-      }
-
-      try
-      {
-         return message.getLongProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public float getFloatProperty(final String name) throws JMSException
-   {
-      try
-      {
-         return message.getFloatProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public double getDoubleProperty(final String name) throws JMSException
-   {
-      try
-      {
-         return message.getDoubleProperty(new SimpleString(name));
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public String getStringProperty(final String name) throws JMSException
-   {
-      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
-      {
-         return String.valueOf(message.getDeliveryCount());
-      }
-
-      try
-      {
-         if (MessageUtil.JMSXGROUPID.equals(name))
-         {
-            return message.getStringProperty(org.apache.activemq.api.core.Message.HDR_GROUP_ID);
-         }
-         else
-         {
-            return message.getStringProperty(new SimpleString(name));
-         }
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public Object getObjectProperty(final String name) throws JMSException
-   {
-      if (MessageUtil.JMSXDELIVERYCOUNT.equals(name))
-      {
-         return String.valueOf(message.getDeliveryCount());
-      }
-
-      Object val = message.getObjectProperty(name);
-      if (val instanceof SimpleString)
-      {
-         val = ((SimpleString)val).toString();
-      }
-      return val;
-   }
-
-   @SuppressWarnings("rawtypes")
-   @Override
-   public Enumeration getPropertyNames() throws JMSException
-   {
-      return Collections.enumeration(MessageUtil.getPropertyNames(message));
-   }
-
-   public void setBooleanProperty(final String name, final boolean value) throws JMSException
-   {
-      checkProperty(name);
-
-      message.putBooleanProperty(new SimpleString(name), value);
-   }
-
-   public void setByteProperty(final String name, final byte value) throws JMSException
-   {
-      checkProperty(name);
-      message.putByteProperty(new SimpleString(name), value);
-   }
-
-   public void setShortProperty(final String name, final short value) throws JMSException
-   {
-      checkProperty(name);
-      message.putShortProperty(new SimpleString(name), value);
-   }
-
-   public void setIntProperty(final String name, final int value) throws JMSException
-   {
-      checkProperty(name);
-      message.putIntProperty(new SimpleString(name), value);
-   }
-
-   public void setLongProperty(final String name, final long value) throws JMSException
-   {
-      checkProperty(name);
-      message.putLongProperty(new SimpleString(name), value);
-   }
-
-   public void setFloatProperty(final String name, final float value) throws JMSException
-   {
-      checkProperty(name);
-      message.putFloatProperty(new SimpleString(name), value);
-   }
-
-   public void setDoubleProperty(final String name, final double value) throws JMSException
-   {
-      checkProperty(name);
-      message.putDoubleProperty(new SimpleString(name), value);
-   }
-
-   public void setStringProperty(final String name, final String value) throws JMSException
-   {
-      checkProperty(name);
-
-      if (MessageUtil.JMSXGROUPID.equals(name))
-      {
-         message.putStringProperty(org.apache.activemq.api.core.Message.HDR_GROUP_ID, SimpleString.toSimpleString(value));
-      }
-      else
-      {
-         message.putStringProperty(new SimpleString(name),  SimpleString.toSimpleString(value));
-      }
-   }
-
-   public void setObjectProperty(final String name, final Object value) throws JMSException
-   {
-      if (HornetQJMSConstants.JMS_HORNETQ_OUTPUT_STREAM.equals(name))
-      {
-         setOutputStream((OutputStream)value);
-
-         return;
-      }
-      else if (HornetQJMSConstants.JMS_HORNETQ_SAVE_STREAM.equals(name))
-      {
-         saveToOutputStream((OutputStream)value);
-
-         return;
-      }
-
-      checkProperty(name);
-
-      if (HornetQJMSConstants.JMS_HORNETQ_INPUT_STREAM.equals(name))
-      {
-         setInputStream((InputStream)value);
-
-         return;
-      }
-
-      try
-      {
-         message.putObjectProperty(new SimpleString(name), value);
-      }
-      catch (ActiveMQPropertyConversionException e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-   public void acknowledge() throws JMSException
-   {
-      if (session != null)
-      {
-         try
-         {
-            if (individualAck)
-            {
-               message.individualAcknowledge();
-            }
-
-            session.commit();
-         }
-         catch (ActiveMQException e)
-         {
-            throw JMSExceptionHelper.convertFromHornetQException(e);
-         }
-      }
-   }
-
-   @Override
-   public long getJMSDeliveryTime() throws JMSException
-   {
-      Long value;
-      try
-      {
-         value = message.getLongProperty(org.apache.activemq.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME);
-      }
-      catch (Exception e)
-      {
-         return 0;
-      }
-
-      if (value == null)
-      {
-         return 0;
-      }
-      else
-      {
-         return value.longValue();
-      }
-   }
-
-   @Override
-   public void setJMSDeliveryTime(long deliveryTime) throws JMSException
-   {
-      message.putLongProperty(org.apache.activemq.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, deliveryTime);
-   }
-
-   @Override
-   public <T> T getBody(Class<T> c) throws JMSException
-   {
-      if (isBodyAssignableTo(c))
-      {
-         return getBodyInternal(c);
-      }
-      // XXX HORNETQ-1209 Do we need translations here?
-      throw new MessageFormatException("Body not assignable to " + c);
-   }
-
-   @SuppressWarnings("unchecked")
-   protected <T> T getBodyInternal(Class<T> c) throws MessageFormatException
-   {
-      InputStream is = ((MessageInternal)message).getBodyInputStream();
-      try
-      {
-         ObjectInputStream ois = new ObjectInputStream(is);
-         return (T)ois.readObject();
-      }
-      catch (Exception e)
-      {
-         throw new MessageFormatException(e.getMessage());
-      }
-   }
-
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class c)
-   {
-      /**
-       * From the specs:
-       * <p>
-       * If the message is a {@code Message} (but not one of its subtypes) then this method will
-       * return true irrespective of the value of this parameter.
-       */
-      return true;
-   }
-
-   /**
-    * Helper method for {@link #isBodyAssignableTo(Class)}.
-    * @return true if the message has no body.
-    */
-   protected boolean hasNoBody()
-   {
-      return message.getBodySize() == 0;
-   }
-
-   // Public --------------------------------------------------------
-
-   public void setIndividualAcknowledge()
-   {
-      this.individualAck = true;
-   }
-
-   public void resetMessageID(final String newMsgID)
-   {
-      this.msgID = newMsgID;
-   }
-
-   public ClientMessage getCoreMessage()
-   {
-      return message;
-   }
-
-   public void doBeforeSend() throws Exception
-   {
-      message.getBodyBuffer().resetReaderIndex();
-   }
-
-   public void checkBuffer()
-   {
-      message.getBodyBuffer();
-   }
-
-   public void doBeforeReceive() throws ActiveMQException
-   {
-      message.checkCompletion();
-
-      ActiveMQBuffer body = message.getBodyBuffer();
-
-      if (body != null)
-      {
-         body.resetReaderIndex();
-      }
-   }
-
-   public byte getType()
-   {
-      return HornetQMessage.TYPE;
-   }
-
-   public void setInputStream(final InputStream input) throws JMSException
-   {
-      checkStream();
-      if (readOnly)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.messageNotWritable();
-      }
-
-      message.setBodyInputStream(input);
-   }
-
-   public void setOutputStream(final OutputStream output) throws JMSException
-   {
-      checkStream();
-      if (!readOnly)
-      {
-         throw new IllegalStateException("OutputStream property is only valid on received messages");
-      }
-
-      try
-      {
-         message.setOutputStream(output);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void saveToOutputStream(final OutputStream output) throws JMSException
-   {
-      checkStream();
-      if (!readOnly)
-      {
-         throw new IllegalStateException("OutputStream property is only valid on received messages");
-      }
-
-      try
-      {
-         message.saveToOutputStream(output);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public boolean waitCompletionOnStream(final long timeWait) throws JMSException
-   {
-      checkStream();
-      try
-      {
-         return message.waitOutputStreamCompletion(timeWait);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   @Override
-   public String toString()
-   {
-      StringBuffer sb = new StringBuffer("HornetQMessage[");
-      sb.append(getJMSMessageID());
-      sb.append("]:");
-      sb.append(message.isDurable() ? "PERSISTENT" : "NON-PERSISTENT");
-      return sb.toString();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   protected void checkWrite() throws JMSException
-   {
-      if (readOnly)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.messageNotWritable();
-      }
-   }
-
-   protected void checkRead() throws JMSException
-   {
-      if (!readOnly)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.messageNotReadable();
-      }
-   }
-
-   // Private ------------------------------------------------------------
-
-   private void checkStream() throws JMSException
-   {
-      if (!(message.getType() == HornetQBytesMessage.TYPE || message.getType() == HornetQStreamMessage.TYPE))
-      {
-         throw HornetQJMSClientBundle.BUNDLE.onlyValidForByteOrStreamMessages();
-      }
-   }
-
-   private void checkProperty(final String name) throws JMSException
-   {
-      if (propertiesReadOnly)
-      {
-         if (name.equals(HornetQJMSConstants.JMS_HORNETQ_INPUT_STREAM))
-         {
-            throw new MessageNotWriteableException("You cannot set the Input Stream on received messages. Did you mean " + HornetQJMSConstants.JMS_HORNETQ_OUTPUT_STREAM +
-                                                   " or " +
-                                                   HornetQJMSConstants.JMS_HORNETQ_SAVE_STREAM +
-                                                   "?");
-         }
-         else
-         {
-            throw HornetQJMSClientBundle.BUNDLE.messageNotWritable();
-         }
-      }
-
-      if (name == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nullArgumentNotAllowed("property");
-      }
-
-      if (name.equals(""))
-      {
-         throw new IllegalArgumentException("The name of a property must not be an empty String.");
-      }
-
-      if (!isValidJavaIdentifier(name))
-      {
-         throw HornetQJMSClientBundle.BUNDLE.invalidJavaIdentifier(name);
-      }
-
-      if (HornetQMessage.reservedIdentifiers.contains(name))
-      {
-         throw new JMSRuntimeException("The property name '" + name + "' is reserved due to selector syntax.");
-      }
-
-      if (name.startsWith("JMS_HORNETQ"))
-      {
-         throw new JMSRuntimeException("The property name '" + name + "' is illegal since it starts with JMS_HORNETQ");
-      }
-   }
-
-   private boolean isValidJavaIdentifier(final String s)
-   {
-      if (s == null || s.length() == 0)
-      {
-         return false;
-      }
-
-      char[] c = s.toCharArray();
-
-      if (!Character.isJavaIdentifierStart(c[0]))
-      {
-         return false;
-      }
-
-      for (int i = 1; i < c.length; i++)
-      {
-         if (!Character.isJavaIdentifierPart(c[i]))
-         {
-            return false;
-         }
-      }
-
-      return true;
-   }
-
-   private void checkPriority(final int priority) throws JMSException
-   {
-      if (priority < 0 || priority > 9)
-      {
-         throw new JMSException(priority + " is not valid: priority must be between 0 and 9");
-      }
-   }
-
-   // Inner classes -------------------------------------------------
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageConsumer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageConsumer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageConsumer.java
deleted file mode 100644
index 48dbabb..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageConsumer.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueReceiver;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.MessageHandler;
-import org.apache.activemq.api.jms.HornetQJMSConstants;
-
-/**
- * HornetQ implementation of a JMS MessageConsumer.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- */
-public final class HornetQMessageConsumer implements QueueReceiver, TopicSubscriber
-{
-   private final ClientConsumer consumer;
-
-   private MessageListener listener;
-
-   private MessageHandler coreListener;
-
-   private final HornetQConnection connection;
-
-   private final HornetQSession session;
-
-   private final int ackMode;
-
-   private final boolean noLocal;
-
-   private final HornetQDestination destination;
-
-   private final String selector;
-
-   private final SimpleString autoDeleteQueueName;
-
-   // Constructors --------------------------------------------------
-
-   protected HornetQMessageConsumer(final HornetQConnection connection,
-                                    final HornetQSession session,
-                                    final ClientConsumer consumer,
-                                    final boolean noLocal,
-                                    final HornetQDestination destination,
-                                    final String selector,
-                                    final SimpleString autoDeleteQueueName) throws JMSException
-   {
-      this.connection = connection;
-
-      this.session = session;
-
-      this.consumer = consumer;
-
-      ackMode = session.getAcknowledgeMode();
-
-      this.noLocal = noLocal;
-
-      this.destination = destination;
-
-      this.selector = selector;
-
-      this.autoDeleteQueueName = autoDeleteQueueName;
-   }
-
-   // MessageConsumer implementation --------------------------------
-
-   public String getMessageSelector() throws JMSException
-   {
-      checkClosed();
-
-      return selector;
-   }
-
-   public MessageListener getMessageListener() throws JMSException
-   {
-      checkClosed();
-
-      return listener;
-   }
-
-   public void setMessageListener(final MessageListener listener) throws JMSException
-   {
-      this.listener = listener;
-
-      coreListener = listener == null ? null : new JMSMessageListenerWrapper(connection, session, consumer, listener, ackMode);
-
-      try
-      {
-         consumer.setMessageHandler(coreListener);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public Message receive() throws JMSException
-   {
-      return getMessage(0, false);
-   }
-
-   public Message receive(final long timeout) throws JMSException
-   {
-      return getMessage(timeout, false);
-   }
-
-   public Message receiveNoWait() throws JMSException
-   {
-      return getMessage(0, true);
-   }
-
-   public void close() throws JMSException
-   {
-      try
-      {
-         consumer.close();
-
-         if (autoDeleteQueueName != null)
-         {
-            // If non durable subscriber need to delete subscription too
-            session.deleteQueue(autoDeleteQueueName);
-         }
-
-         session.removeConsumer(this);
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   // QueueReceiver implementation ----------------------------------
-
-   public Queue getQueue() throws JMSException
-   {
-      checkClosed();
-
-      return (Queue)destination;
-   }
-
-   // TopicSubscriber implementation --------------------------------
-
-   public Topic getTopic() throws JMSException
-   {
-      checkClosed();
-
-      return (Topic)destination;
-   }
-
-   public boolean getNoLocal() throws JMSException
-   {
-      checkClosed();
-
-      return noLocal;
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public String toString()
-   {
-      return "HornetQMessageConsumer[" + consumer + "]";
-   }
-
-   public boolean isClosed()
-   {
-      return consumer.isClosed();
-   }
-
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   private void checkClosed() throws JMSException
-   {
-      if (consumer.isClosed() || session.getCoreSession().isClosed())
-      {
-         throw new IllegalStateException("Consumer is closed");
-      }
-   }
-
-   private HornetQMessage getMessage(final long timeout, final boolean noWait) throws JMSException
-   {
-      try
-      {
-         ClientMessage coreMessage;
-
-         if (noWait)
-         {
-            coreMessage = consumer.receiveImmediate();
-         }
-         else
-         {
-            coreMessage = consumer.receive(timeout);
-         }
-
-         HornetQMessage jmsMsg = null;
-
-         if (coreMessage != null)
-         {
-            boolean needSession =
-                     ackMode == Session.CLIENT_ACKNOWLEDGE || ackMode == HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE;
-            jmsMsg = HornetQMessage.createMessage(coreMessage, needSession ? session.getCoreSession() : null);
-
-            jmsMsg.doBeforeReceive();
-
-            // We Do the ack after doBeforeRecive, as in the case of large messages, this may fail so we don't want messages redelivered
-            // https://issues.jboss.org/browse/JBPAPP-6110
-            if (session.getAcknowledgeMode() == HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE)
-            {
-               jmsMsg.setIndividualAcknowledge();
-            }
-            else
-            {
-               coreMessage.acknowledge();
-            }
-         }
-
-         return jmsMsg;
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageProducer.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageProducer.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageProducer.java
deleted file mode 100644
index 6f083ab..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQMessageProducer.java
+++ /dev/null
@@ -1,601 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.BytesMessage;
-import javax.jms.CompletionListener;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientProducer;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
-import org.apache.activemq.utils.UUID;
-import org.apache.activemq.utils.UUIDGenerator;
-/**
- * HornetQ implementation of a JMS MessageProducer.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- */
-public class HornetQMessageProducer implements MessageProducer, QueueSender, TopicPublisher
-{
-   private final HornetQConnection connection;
-
-   private final SimpleString connID;
-
-   private final ClientProducer clientProducer;
-   private final ClientSession clientSession;
-
-   private boolean disableMessageID = false;
-
-   private boolean disableMessageTimestamp = false;
-
-   private int defaultPriority = Message.DEFAULT_PRIORITY;
-   private long defaultTimeToLive = Message.DEFAULT_TIME_TO_LIVE;
-   private int defaultDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
-   private long defaultDeliveryDelay = Message.DEFAULT_DELIVERY_DELAY;
-
-   private final HornetQDestination defaultDestination;
-   // Constructors --------------------------------------------------
-
-   protected HornetQMessageProducer(final HornetQConnection connection, final ClientProducer producer,
-                                    final HornetQDestination defaultDestination, final ClientSession clientSession) throws JMSException
-   {
-      this.connection = connection;
-
-      connID = connection.getClientID() != null ? new SimpleString(connection.getClientID()) : connection.getUID();
-
-      this.clientProducer = producer;
-
-      this.defaultDestination = defaultDestination;
-
-      this.clientSession = clientSession;
-   }
-
-   // MessageProducer implementation --------------------------------
-
-   public void setDisableMessageID(final boolean value) throws JMSException
-   {
-      checkClosed();
-
-      disableMessageID = value;
-   }
-
-   public boolean getDisableMessageID() throws JMSException
-   {
-      checkClosed();
-
-      return disableMessageID;
-   }
-
-   public void setDisableMessageTimestamp(final boolean value) throws JMSException
-   {
-      checkClosed();
-
-      disableMessageTimestamp = value;
-   }
-
-   public boolean getDisableMessageTimestamp() throws JMSException
-   {
-      checkClosed();
-
-      return disableMessageTimestamp;
-   }
-
-   public void setDeliveryMode(final int deliveryMode) throws JMSException
-   {
-      checkClosed();
-      if (deliveryMode != DeliveryMode.NON_PERSISTENT && deliveryMode != DeliveryMode.PERSISTENT)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.illegalDeliveryMode(deliveryMode);
-      }
-
-      defaultDeliveryMode = deliveryMode;
-   }
-
-   public int getDeliveryMode() throws JMSException
-   {
-      checkClosed();
-
-      return defaultDeliveryMode;
-   }
-
-   public void setPriority(final int defaultPriority) throws JMSException
-   {
-      checkClosed();
-
-      if (defaultPriority < 0 || defaultPriority > 9)
-      {
-         throw new JMSException("Illegal priority value: " + defaultPriority);
-      }
-
-      this.defaultPriority = defaultPriority;
-   }
-
-   public int getPriority() throws JMSException
-   {
-      checkClosed();
-
-      return defaultPriority;
-   }
-
-   public void setTimeToLive(final long timeToLive) throws JMSException
-   {
-      checkClosed();
-
-      defaultTimeToLive = timeToLive;
-   }
-
-   public long getTimeToLive() throws JMSException
-   {
-      checkClosed();
-
-      return defaultTimeToLive;
-   }
-
-   public Destination getDestination() throws JMSException
-   {
-      checkClosed();
-
-      return defaultDestination;
-   }
-
-   public void close() throws JMSException
-   {
-      connection.getThreadAwareContext().assertNotCompletionListenerThread();
-      try
-      {
-         clientProducer.close();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   public void send(final Message message) throws JMSException
-   {
-      checkDefaultDestination();
-      doSendx(defaultDestination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, null);
-   }
-
-   public void send(final Message message,
-                    final int deliveryMode,
-                    final int priority, final long timeToLive) throws JMSException
-   {
-      checkDefaultDestination();
-      doSendx(defaultDestination, message, deliveryMode, priority, timeToLive, null);
-   }
-
-   public void send(final Destination destination, final Message message) throws JMSException
-   {
-      send(destination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive);
-   }
-
-   public void send(final Destination destination, final Message message, final int deliveryMode, final int priority,
-                    final long timeToLive) throws JMSException
-   {
-      checkClosed();
-
-      checkDestination(destination);
-
-      doSendx((HornetQDestination)destination, message, deliveryMode, priority, timeToLive, null);
-   }
-
-   @Override
-   public void setDeliveryDelay(long deliveryDelay) throws JMSException
-   {
-      this.defaultDeliveryDelay = deliveryDelay;
-   }
-
-   @Override
-   public long getDeliveryDelay() throws JMSException
-   {
-      return defaultDeliveryDelay;
-   }
-
-   @Override
-   public void send(Message message, CompletionListener completionListener) throws JMSException
-   {
-      send(message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, completionListener);
-   }
-
-   @Override
-   public void send(Message message, int deliveryMode, int priority, long timeToLive,
-                    CompletionListener completionListener) throws JMSException
-   {
-      checkCompletionListener(completionListener);
-      checkDefaultDestination();
-      doSendx(defaultDestination, message, deliveryMode, priority, timeToLive, completionListener);
-   }
-
-   @Override
-   public void send(Destination destination, Message message, CompletionListener completionListener) throws JMSException
-   {
-      send(destination, message, defaultDeliveryMode, defaultPriority, defaultTimeToLive, completionListener);
-   }
-
-   @Override
-   public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
-                    CompletionListener completionListener) throws JMSException
-   {
-      checkClosed();
-
-      checkCompletionListener(completionListener);
-
-      checkDestination(destination);
-
-      doSendx((HornetQDestination)destination, message, deliveryMode, priority, timeToLive, completionListener);
-   }
-
-   // TopicPublisher Implementation ---------------------------------
-
-   public Topic getTopic() throws JMSException
-   {
-      return (Topic)getDestination();
-   }
-
-   public void publish(final Message message) throws JMSException
-   {
-      send(message);
-   }
-
-   public void publish(final Topic topic, final Message message) throws JMSException
-   {
-      send(topic, message);
-   }
-
-   public void publish(final Message message, final int deliveryMode, final int priority, final long timeToLive) throws JMSException
-   {
-      send(message, deliveryMode, priority, timeToLive);
-   }
-
-   public void publish(final Topic topic, final Message message, final int deliveryMode, final int priority,
-                       final long timeToLive) throws JMSException
-   {
-      checkDestination(topic);
-      doSendx((HornetQDestination)topic, message, deliveryMode, priority, timeToLive, null);
-   }
-
-   // QueueSender Implementation ------------------------------------
-
-   public void send(final Queue queue, final Message message) throws JMSException
-   {
-      send((Destination)queue, message);
-   }
-
-   public void send(final Queue queue, final Message message, final int deliveryMode, final int priority,
-                    final long timeToLive) throws JMSException
-   {
-      checkDestination(queue);
-      doSendx((HornetQDestination)queue, message, deliveryMode, priority, timeToLive, null);
-   }
-
-   public Queue getQueue() throws JMSException
-   {
-      return (Queue)getDestination();
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public String toString()
-   {
-      return "HornetQMessageProducer->" + clientProducer;
-   }
-
-   /**
-    * Check if the default destination has been set
-    */
-   private void checkDefaultDestination()
-   {
-      if (defaultDestination == null)
-      {
-         throw new UnsupportedOperationException("Cannot specify destination if producer has a default destination");
-      }
-   }
-
-   /**
-    * Check if the destination is sent correctly
-    */
-   private void checkDestination(Destination destination) throws InvalidDestinationException
-   {
-      if (destination != null && !(destination instanceof HornetQDestination))
-      {
-         throw new InvalidDestinationException("Not a HornetQ Destination:" + destination);
-      }
-      if (destination != null && defaultDestination != null)
-      {
-         throw new UnsupportedOperationException("Cannot specify destination if producer has a default destination");
-      }
-      if (destination == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nullTopic();
-      }
-   }
-
-   private void checkCompletionListener(CompletionListener completionListener)
-   {
-      if (completionListener == null)
-      {
-         throw HornetQJMSClientBundle.BUNDLE.nullArgumentNotAllowed("CompletionListener");
-      }
-   }
-
-
-   private void doSendx(HornetQDestination destination, final Message jmsMessage, final int deliveryMode,
-                        final int priority, final long timeToLive,
-                        CompletionListener completionListener) throws JMSException
-   {
-
-      jmsMessage.setJMSDeliveryMode(deliveryMode);
-
-      jmsMessage.setJMSPriority(priority);
-
-
-      if (timeToLive == 0)
-      {
-         jmsMessage.setJMSExpiration(0);
-      }
-      else
-      {
-         jmsMessage.setJMSExpiration(System.currentTimeMillis() + timeToLive);
-      }
-
-      if (!disableMessageTimestamp)
-      {
-         jmsMessage.setJMSTimestamp(System.currentTimeMillis());
-      }
-      else
-      {
-         jmsMessage.setJMSTimestamp(0);
-      }
-
-      SimpleString address = null;
-
-      if (destination == null)
-      {
-         if (defaultDestination == null)
-         {
-            throw new UnsupportedOperationException("Destination must be specified on send with an anonymous producer");
-         }
-
-         destination = defaultDestination;
-      }
-      else
-      {
-         if (defaultDestination != null)
-         {
-            if (!destination.equals(defaultDestination))
-            {
-               throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is "
-                                                          + "specified in the arguments to the send, "
-                                                          + "these destinations must be equal");
-            }
-         }
-
-         address = destination.getSimpleAddress();
-
-         if (!connection.containsKnownDestination(address))
-         {
-            try
-            {
-               ClientSession.AddressQuery query = clientSession.addressQuery(address);
-               if (!query.isExists())
-               {
-                  throw new InvalidDestinationException("Destination " + address + " does not exist");
-               }
-               else
-               {
-                  connection.addKnownDestination(address);
-               }
-            }
-            catch (ActiveMQException e)
-            {
-               throw JMSExceptionHelper.convertFromHornetQException(e);
-            }
-         }
-      }
-
-      HornetQMessage hqJmsMessage;
-
-      boolean foreign = false;
-
-      // First convert from foreign message if appropriate
-      if (!(jmsMessage instanceof HornetQMessage))
-      {
-         // JMS 1.1 Sect. 3.11.4: A provider must be prepared to accept, from a client,
-         // a message whose implementation is not one of its own.
-
-         if (jmsMessage instanceof BytesMessage)
-         {
-            hqJmsMessage = new HornetQBytesMessage((BytesMessage)jmsMessage, clientSession);
-         }
-         else if (jmsMessage instanceof MapMessage)
-         {
-            hqJmsMessage = new HornetQMapMessage((MapMessage)jmsMessage, clientSession);
-         }
-         else if (jmsMessage instanceof ObjectMessage)
-         {
-            hqJmsMessage = new HornetQObjectMessage((ObjectMessage)jmsMessage, clientSession);
-         }
-         else if (jmsMessage instanceof StreamMessage)
-         {
-            hqJmsMessage = new HornetQStreamMessage((StreamMessage)jmsMessage, clientSession);
-         }
-         else if (jmsMessage instanceof TextMessage)
-         {
-            hqJmsMessage = new HornetQTextMessage((TextMessage)jmsMessage, clientSession);
-         }
-         else
-         {
-            hqJmsMessage = new HornetQMessage(jmsMessage, clientSession);
-         }
-
-         // Set the destination on the original message
-         jmsMessage.setJMSDestination(destination);
-
-         foreign = true;
-      }
-      else
-      {
-         hqJmsMessage = (HornetQMessage)jmsMessage;
-      }
-
-      if (!disableMessageID)
-      {
-         // Generate a JMS id
-
-         UUID uid = UUIDGenerator.getInstance().generateUUID();
-
-         hqJmsMessage.getCoreMessage().setUserID(uid);
-
-         hqJmsMessage.resetMessageID(null);
-      }
-
-      if (foreign)
-      {
-         jmsMessage.setJMSMessageID(hqJmsMessage.getJMSMessageID());
-      }
-
-      hqJmsMessage.setJMSDestination(destination);
-
-      try
-      {
-         hqJmsMessage.doBeforeSend();
-      }
-      catch (Exception e)
-      {
-         JMSException je = new JMSException(e.getMessage());
-
-         je.initCause(e);
-
-         throw je;
-      }
-
-      if (defaultDeliveryDelay > 0)
-      {
-         hqJmsMessage.setJMSDeliveryTime(System.currentTimeMillis() + defaultDeliveryDelay);
-      }
-
-      ClientMessage coreMessage = hqJmsMessage.getCoreMessage();
-      coreMessage.putStringProperty(HornetQConnection.CONNECTION_ID_PROPERTY_NAME, connID);
-
-      try
-      {
-         /**
-          * Using a completionListener requires wrapping using a {@link CompletionListenerWrapper},
-          * so we avoid it if we can.
-          */
-         if (completionListener != null)
-         {
-            clientProducer.send(address, coreMessage, new CompletionListenerWrapper(completionListener, jmsMessage, this));
-         }
-         else
-         {
-            clientProducer.send(address, coreMessage);
-         }
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-   }
-
-   private void checkClosed() throws JMSException
-   {
-      if (clientProducer.isClosed() || clientSession.isClosed())
-      {
-         throw new IllegalStateException("Producer is closed");
-      }
-   }
-
-   private static final class CompletionListenerWrapper implements SendAcknowledgementHandler
-   {
-      private final CompletionListener completionListener;
-      private final Message jmsMessage;
-      private final HornetQMessageProducer producer;
-
-      /**
-       * @param jmsMessage
-       * @param producer
-       */
-      public CompletionListenerWrapper(CompletionListener listener, Message jmsMessage, HornetQMessageProducer producer)
-      {
-         this.completionListener = listener;
-         this.jmsMessage = jmsMessage;
-         this.producer = producer;
-      }
-
-      @Override
-      public void sendAcknowledged(org.apache.activemq.api.core.Message clientMessage)
-      {
-         if (jmsMessage instanceof StreamMessage)
-         {
-            try
-            {
-               ((StreamMessage)jmsMessage).reset();
-            }
-            catch (JMSException e)
-            {
-               // HORNETQ-1209 XXX ignore?
-            }
-         }
-         if (jmsMessage instanceof BytesMessage)
-         {
-            try
-            {
-               ((BytesMessage)jmsMessage).reset();
-            }
-            catch (JMSException e)
-            {
-               // HORNETQ-1209 XXX ignore?
-            }
-         }
-
-         try
-         {
-            producer.connection.getThreadAwareContext().setCurrentThread(true);
-            completionListener.onCompletion(jmsMessage);
-         }
-         finally
-         {
-            producer.connection.getThreadAwareContext().clearCurrentThread(true);
-         }
-      }
-
-      @Override
-      public String toString()
-      {
-         return CompletionListenerWrapper.class.getSimpleName() + "( completionListener=" + completionListener + ")";
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQObjectMessage.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQObjectMessage.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQObjectMessage.java
deleted file mode 100644
index e4d98e4..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQObjectMessage.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-import javax.jms.ObjectMessage;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.Message;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-
-/**
- * HornetQ implementation of a JMS ObjectMessage.
- * <br>
- * Don't used ObjectMessage if you want good performance!
- * <p>
- * Serialization is slooooow!
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- */
-public class HornetQObjectMessage extends HornetQMessage implements ObjectMessage
-{
-   // Constants -----------------------------------------------------
-
-   public static final byte TYPE = Message.OBJECT_TYPE;
-
-   // Attributes ----------------------------------------------------
-
-   // keep a snapshot of the Serializable Object as a byte[] to provide Object isolation
-   private byte[] data;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   protected HornetQObjectMessage(final ClientSession session)
-   {
-      super(HornetQObjectMessage.TYPE, session);
-   }
-
-   protected HornetQObjectMessage(final ClientMessage message, final ClientSession session)
-   {
-      super(message, session);
-   }
-
-   /**
-    * A copy constructor for foreign JMS ObjectMessages.
-    */
-   public HornetQObjectMessage(final ObjectMessage foreign, final ClientSession session) throws JMSException
-   {
-      super(foreign, HornetQObjectMessage.TYPE, session);
-
-      setObject(foreign.getObject());
-   }
-
-   // Public --------------------------------------------------------
-
-   @Override
-   public byte getType()
-   {
-      return HornetQObjectMessage.TYPE;
-   }
-
-   @Override
-   public void doBeforeSend() throws Exception
-   {
-      message.getBodyBuffer().clear();
-      if (data != null)
-      {
-         message.getBodyBuffer().writeInt(data.length);
-         message.getBodyBuffer().writeBytes(data);
-      }
-
-      super.doBeforeSend();
-   }
-
-   @Override
-   public void doBeforeReceive() throws ActiveMQException
-   {
-      super.doBeforeReceive();
-      try
-      {
-         int len = message.getBodyBuffer().readInt();
-         data = new byte[len];
-         message.getBodyBuffer().readBytes(data);
-      }
-      catch (Exception e)
-      {
-         data = null;
-      }
-
-   }
-
-   // ObjectMessage implementation ----------------------------------
-
-   public void setObject(final Serializable object) throws JMSException
-   {
-      checkWrite();
-
-      if (object != null)
-      {
-         try
-         {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
-
-            ObjectOutputStream oos = new ObjectOutputStream(baos);
-
-            oos.writeObject(object);
-
-            oos.flush();
-
-            data = baos.toByteArray();
-         }
-         catch (Exception e)
-         {
-            JMSException je = new JMSException("Failed to serialize object");
-            je.setLinkedException(e);
-            je.initCause(e);
-            throw je;
-         }
-      }
-   }
-
-   // lazy deserialize the Object the first time the client requests it
-   public Serializable getObject() throws JMSException
-   {
-      if (data == null || data.length == 0)
-      {
-         return null;
-      }
-
-      try
-      {
-         ByteArrayInputStream bais = new ByteArrayInputStream(data);
-         ObjectInputStream ois = new org.apache.activemq.utils.ObjectInputStreamWithClassLoader(bais);
-         Serializable object = (Serializable)ois.readObject();
-         return object;
-      }
-      catch (Exception e)
-      {
-         JMSException je = new JMSException(e.getMessage());
-         je.setStackTrace(e.getStackTrace());
-         throw je;
-      }
-   }
-
-   @Override
-   public void clearBody() throws JMSException
-   {
-      super.clearBody();
-
-      data = null;
-   }
-
-   @Override
-   protected <T> T getBodyInternal(Class<T> c) throws MessageFormatException
-   {
-      try
-      {
-         return (T)getObject();
-      }
-      catch (JMSException e)
-      {
-         throw new MessageFormatException("Deserialization error on HornetQObjectMessage");
-      }
-   }
-
-   @Override
-   public boolean isBodyAssignableTo(@SuppressWarnings("rawtypes")
-                                     Class c)
-   {
-      if (data == null) // we have no body
-         return true;
-      try
-      {
-         return Serializable.class == c || Object.class == c || c.isInstance(getObject());
-      }
-      catch (JMSException e)
-      {
-         return false;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueue.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueue.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueue.java
deleted file mode 100644
index 68e50cf..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueue.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.Queue;
-
-import org.apache.activemq.api.core.SimpleString;
-
-/**
- * HornetQ implementation of a JMS Queue.
- * <br>
- * This class can be instantiated directly.
- *
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 8737 $</tt>
- *
- */
-public class HornetQQueue extends HornetQDestination implements Queue
-{
-   // Constants -----------------------------------------------------
-   private static final long serialVersionUID = -1106092883162295462L;
-
-   // Static --------------------------------------------------------
-
-   public static SimpleString createAddressFromName(final String name)
-   {
-      return new SimpleString(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + name);
-   }
-
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public HornetQQueue(final String name)
-   {
-      super(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + name, name, false, true, null);
-   }
-
-
-
-   /**
-    * @param address
-    * @param name
-    * @param temporary
-    * @param session
-    */
-   public HornetQQueue(String address, String name, boolean temporary, HornetQSession session)
-   {
-      super(address, name, temporary, true, session);
-   }
-
-   public HornetQQueue(final String address, final String name)
-   {
-      super(address, name, false, true, null);
-   }
-
-   // Queue implementation ------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public String getQueueName()
-   {
-      return name;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "HornetQQueue[" + name + "]";
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueBrowser.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueBrowser.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueBrowser.java
deleted file mode 100644
index 869d299..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueBrowser.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientSession;
-
-/**
- * HornetQ implementation of a JMS QueueBrowser.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *
- */
-public final class HornetQQueueBrowser implements QueueBrowser
-{
-   // Constants ------------------------------------------------------------------------------------
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   private final ClientSession session;
-
-   private ClientConsumer consumer;
-
-   private final HornetQQueue queue;
-
-   private SimpleString filterString;
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   protected HornetQQueueBrowser(final HornetQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
-   {
-      this.session = session;
-      this.queue = queue;
-      if (messageSelector != null)
-      {
-         filterString = new SimpleString(SelectorTranslator.convertToHornetQFilterString(messageSelector));
-      }
-   }
-
-   // QueueBrowser implementation -------------------------------------------------------------------
-
-   public void close() throws JMSException
-   {
-      if (consumer != null)
-      {
-         try
-         {
-            consumer.close();
-         }
-         catch (ActiveMQException e)
-         {
-            throw JMSExceptionHelper.convertFromHornetQException(e);
-         }
-      }
-   }
-
-   public Enumeration getEnumeration() throws JMSException
-   {
-      try
-      {
-         close();
-
-         consumer = session.createConsumer(queue.getSimpleAddress(), filterString, true);
-
-         return new BrowserEnumeration();
-      }
-      catch (ActiveMQException e)
-      {
-         throw JMSExceptionHelper.convertFromHornetQException(e);
-      }
-
-   }
-
-   public String getMessageSelector() throws JMSException
-   {
-      return filterString == null ? null : filterString.toString();
-   }
-
-   public Queue getQueue() throws JMSException
-   {
-      return queue;
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   @Override
-   public String toString()
-   {
-      return "HornetQQueueBrowser->" + consumer;
-   }
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-
-   private final class BrowserEnumeration implements Enumeration<HornetQMessage>
-   {
-      ClientMessage current = null;
-
-      public boolean hasMoreElements()
-      {
-         if (current == null)
-         {
-            try
-            {
-               current = consumer.receiveImmediate();
-            }
-            catch (ActiveMQException e)
-            {
-               return false;
-            }
-         }
-         return current != null;
-      }
-
-      public HornetQMessage nextElement()
-      {
-         HornetQMessage msg;
-         if (hasMoreElements())
-         {
-            ClientMessage next = current;
-            current = null;
-            msg = HornetQMessage.createMessage(next, session);
-            try
-            {
-               msg.doBeforeReceive();
-            }
-            catch (Exception e)
-            {
-               HornetQJMSClientLogger.LOGGER.errorCreatingMessage(e);
-
-               return null;
-            }
-            return msg;
-         }
-         else
-         {
-            throw new NoSuchElementException();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueConnectionFactory.java b/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueConnectionFactory.java
deleted file mode 100644
index 68ddd1b..0000000
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jms/client/HornetQQueueConnectionFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2005-2014 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.apache.activemq.jms.client;
-
-import javax.jms.QueueConnectionFactory;
-
-import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.api.jms.JMSFactoryType;
-
-/**
- * A class that represents a QueueConnectionFactory.
- *
- * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
- */
-public class HornetQQueueConnectionFactory extends HornetQConnectionFactory implements QueueConnectionFactory
-{
-   private static final long serialVersionUID = 5312455021322463546L;
-
-   /**
-    *
-    */
-   public HornetQQueueConnectionFactory()
-   {
-      super();
-   }
-
-   /**
-    * @param serverLocator
-    */
-   public HornetQQueueConnectionFactory(ServerLocator serverLocator)
-   {
-      super(serverLocator);
-   }
-
-   /**
-    * @param ha
-    * @param groupConfiguration
-    */
-   public HornetQQueueConnectionFactory(boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
-   {
-      super(ha, groupConfiguration);
-   }
-
-   /**
-    * @param ha
-    * @param initialConnectors
-    */
-   public HornetQQueueConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)
-   {
-      super(ha, initialConnectors);
-   }
-
-   public int getFactoryType()
-   {
-      return JMSFactoryType.QUEUE_CF.intValue();
-   }
-}