activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/3] activemq-6 git commit: ACTIVEMQ6-6 - remove SPI usage
Date Mon, 08 Dec 2014 17:25:43 GMT
ACTIVEMQ6-6 - remove SPI usage

https://issues.apache.org/jira/browse/ACTIVEMQ6-6

Removed the jboss security implementations and also implemented the location of Transaction Managers using Service Loader and removed the jboss implementation.


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

Branch: refs/heads/master
Commit: e34fd09ce325a551bf2eaf579854e2e107435502
Parents: 46182e4
Author: Andy Taylor <andytaylor@apache.org>
Authored: Sat Dec 6 10:59:17 2014 +0000
Committer: Andy Taylor <andytaylor@apache.org>
Committed: Mon Dec 8 11:06:24 2014 +0000

----------------------------------------------------------------------
 activemq-jms-server/pom.xml                     |   5 +
 .../apache/activemq/jms/bridge/JMSBridge.java   |   8 -
 .../activemq/jms/bridge/JMSBridgeControl.java   |   8 -
 .../jms/bridge/impl/JMSBridgeControlImpl.java   |  20 --
 .../activemq/jms/bridge/impl/JMSBridgeImpl.java |  58 +---
 .../apache/activemq/ra/ActiveMQRALogger.java    |   4 -
 .../activemq/ra/ActiveMQRAProperties.java       |  33 --
 .../org/apache/activemq/ra/ActiveMQRaUtils.java |  34 --
 .../activemq/ra/ActiveMQResourceAdapter.java    |  64 +---
 activemq-service-extensions/pom.xml             |   4 +
 .../service/extensions/ServiceUtils.java        |  21 ++
 .../transactions/TransactionManagerLocator.java |  27 ++
 .../DummyTransactionManagerLocator.java         |  94 ++++++
 .../TransactionManagerLocatorTest.java          |  34 ++
 ...sions.transactions.TransactionManagerLocator |   1 +
 .../activemq-jboss-as-integration/pom.xml       |  61 ----
 .../integration/jboss/ActiveMQJBossBundle.java  |  35 ---
 .../integration/jboss/ActiveMQJBossLogger.java  |  62 ----
 .../jboss/security/AS4SecurityActions.java      | 130 --------
 .../jboss/security/JBossASSecurityManager.java  | 313 -------------------
 .../jboss/security/SecurityActions.java         | 167 ----------
 .../tm/JBoss4TransactionManagerLocator.java     |  32 --
 .../tm/JBoss5TransactionManagerLocator.java     |  32 --
 pom.xml                                         |   9 +-
 .../tests/ActiveMQMessageHandlerTest.java       |   6 -
 .../integration/jms/bridge/JMSBridgeTest.java   |   2 -
 .../ra/ActiveMQMessageHandlerTest.java          |   6 -
 .../integration/ra/ActiveMQRATestBase.java      |   3 -
 .../tests/integration/ra/JMSContextTest.java    |   2 -
 .../integration/ra/OutgoingConnectionTest.java  |   4 -
 .../integration/ra/ResourceAdapterTest.java     |  17 -
 .../ra/ActiveMQResourceAdapterConfigTest.java   |  12 -
 .../ra/ConnectionFactoryPropertiesTest.java     |   2 -
 .../tests/unit/ra/ResourceAdapterTest.java      |   4 -
 34 files changed, 196 insertions(+), 1118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-jms-server/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-jms-server/pom.xml b/activemq-jms-server/pom.xml
index c39a31e..73215ae 100644
--- a/activemq-jms-server/pom.xml
+++ b/activemq-jms-server/pom.xml
@@ -37,6 +37,11 @@
          <version>${project.version}</version>
       </dependency>
       <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>activemq-service-extensions</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
          <groupId>org.jboss.spec.javax.jms</groupId>
          <artifactId>jboss-jms-api_2.0_spec</artifactId>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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 b50923a..986d6d1 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
@@ -86,14 +86,6 @@ public interface JMSBridge extends ActiveMQComponent
 
    void setClientID(String clientID);
 
-   String getTransactionManagerLocatorClass();
-
-   void setTransactionManagerLocatorClass(String transactionManagerLocatorClass);
-
-   String getTransactionManagerLocatorMethod();
-
-   void setTransactionManagerLocatorMethod(String transactionManagerLocatorMethod);
-
    boolean isAddMessageIDInHeader();
 
    void setAddMessageIDInHeader(boolean value);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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 1b1dc01..3f1c503 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
@@ -78,14 +78,6 @@ public interface JMSBridgeControl extends ActiveMQComponentControl
 
    void setClientID(String clientID);
 
-   String getTransactionManagerLocatorClass();
-
-   void setTransactionManagerLocatorClass(String transactionManagerLocatorClass);
-
-   String getTransactionManagerLocatorMethod();
-
-   void setTransactionManagerLocatorMethod(String transactionManagerLocatorMethod);
-
    boolean isAddMessageIDInHeader();
 
    void setAddMessageIDInHeader(boolean value);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeControlImpl.java
----------------------------------------------------------------------
diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeControlImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeControlImpl.java
index 68f5ec4..59af74b 100644
--- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeControlImpl.java
+++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeControlImpl.java
@@ -136,16 +136,6 @@ public class JMSBridgeControlImpl extends StandardMBean implements JMSBridgeCont
       return bridge.getTargetUsername();
    }
 
-   public String getTransactionManagerLocatorClass()
-   {
-      return bridge.getTransactionManagerLocatorClass();
-   }
-
-   public String getTransactionManagerLocatorMethod()
-   {
-      return bridge.getTransactionManagerLocatorMethod();
-   }
-
    public boolean isAddMessageIDInHeader()
    {
       return bridge.isAddMessageIDInHeader();
@@ -233,16 +223,6 @@ public class JMSBridgeControlImpl extends StandardMBean implements JMSBridgeCont
       bridge.setTargetUsername(name);
    }
 
-   public void setTransactionManagerLocatorClass(final String transactionManagerLocatorClass)
-   {
-      bridge.setTransactionManagerLocatorClass(transactionManagerLocatorClass);
-   }
-
-   public void setTransactionManagerLocatorMethod(final String transactionManagerLocatorMethod)
-   {
-      bridge.setTransactionManagerLocatorMethod(transactionManagerLocatorMethod);
-   }
-
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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 4e77486..169bce8 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
@@ -36,7 +36,6 @@ import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.TransactionRolledbackException;
 import javax.transaction.xa.XAResource;
-import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Enumeration;
@@ -66,6 +65,7 @@ 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.service.extensions.ServiceUtils;
 import org.apache.activemq.utils.ClassloadingUtil;
 import org.apache.activemq.utils.DefaultSensitiveStringCodec;
 import org.apache.activemq.utils.PasswordMaskingUtil;
@@ -167,10 +167,6 @@ public final class JMSBridgeImpl implements JMSBridge
 
    private int forwardMode;
 
-   private String transactionManagerLocatorClass = "org.apache.activemq.integration.jboss.tm.JBoss5TransactionManagerLocator";
-
-   private String transactionManagerLocatorMethod = "getTm";
-
    private MBeanServer mbeanServer;
 
    private ObjectName objectName;
@@ -404,7 +400,7 @@ public final class JMSBridgeImpl implements JMSBridge
 
       checkParams();
 
-      TransactionManager tm = getTm();
+      TransactionManager tm = ServiceUtils.getTransactionManager();
 
       // There may already be a JTA transaction associated to the thread
 
@@ -839,27 +835,6 @@ public final class JMSBridgeImpl implements JMSBridge
       this.clientID = clientID;
    }
 
-   public String getTransactionManagerLocatorClass()
-   {
-      return transactionManagerLocatorClass;
-   }
-
-   public void setTransactionManagerLocatorClass(final String transactionManagerLocatorClass)
-   {
-      checkBridgeNotStarted();
-      this.transactionManagerLocatorClass = transactionManagerLocatorClass;
-   }
-
-   public String getTransactionManagerLocatorMethod()
-   {
-      return transactionManagerLocatorMethod;
-   }
-
-   public void setTransactionManagerLocatorMethod(final String transactionManagerLocatorMethod)
-   {
-      this.transactionManagerLocatorMethod = transactionManagerLocatorMethod;
-   }
-
    public boolean isAddMessageIDInHeader()
    {
       return addMessageIDInHeader;
@@ -1038,7 +1013,7 @@ public final class JMSBridgeImpl implements JMSBridge
          ActiveMQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction");
       }
 
-      TransactionManager tm = getTm();
+      TransactionManager tm = ServiceUtils.getTransactionManager();
 
       // Set timeout to a large value since we do not want to time out while waiting for messages
       // to arrive - 10 years should be enough
@@ -1061,33 +1036,6 @@ public final class JMSBridgeImpl implements JMSBridge
       return tx;
    }
 
-   private TransactionManager getTm()
-   {
-      if (tm == null)
-      {
-         try
-         {
-            Object o = safeInitNewInstance(transactionManagerLocatorClass);
-            Method m = o.getClass().getMethod(transactionManagerLocatorMethod);
-            tm = (TransactionManager) m.invoke(o);
-         }
-         catch (Exception e)
-         {
-            throw new IllegalStateException("unable to create TransactionManager from " + transactionManagerLocatorClass +
-                                               "." +
-                                               transactionManagerLocatorMethod,
-                                            e);
-         }
-
-         if (tm == null)
-         {
-            throw new IllegalStateException("Cannot locate a transaction manager");
-         }
-      }
-
-      return tm;
-   }
-
    private Connection createConnection(final String username, final String password,
                                        final ConnectionFactoryFactory cff,
                                        final String clientID,

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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
index fbad1e6..caa35d2 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRALogger.java
@@ -76,10 +76,6 @@ public interface ActiveMQRALogger extends BasicLogger
    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();
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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
index 703ed77..51282f6 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRAProperties.java
@@ -58,18 +58,6 @@ public class ActiveMQRAProperties extends ConnectionFactoryProperties implements
     */
    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;
@@ -236,27 +224,6 @@ public class ActiveMQRAProperties extends ConnectionFactoryProperties implements
       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;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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
index 676abfc..5911723 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQRaUtils.java
@@ -17,7 +17,6 @@
 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;
@@ -254,39 +253,6 @@ public final class ActiveMQRaUtils
       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

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/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
index 3aa392e..1675f3f 100644
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
@@ -53,6 +53,7 @@ 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.service.extensions.ServiceUtils;
 import org.apache.activemq.utils.SensitiveDataCodec;
 import org.jgroups.JChannel;
 
@@ -247,7 +248,7 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable
          ActiveMQRALogger.LOGGER.trace("start(" + ctx + ")");
       }
 
-      locateTM();
+      tm = ServiceUtils.getTransactionManager();
 
       recoveryManager.start(useAutoRecovery);
 
@@ -1811,24 +1812,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable
    }
 
    /**
-    * @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()
     */
@@ -1864,24 +1847,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable
       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;
@@ -2173,31 +2138,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable
       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)
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/pom.xml b/activemq-service-extensions/pom.xml
index ea44ad2..c0072b3 100644
--- a/activemq-service-extensions/pom.xml
+++ b/activemq-service-extensions/pom.xml
@@ -27,6 +27,10 @@
          <artifactId>jboss-logging-processor</artifactId>
       </dependency>
       <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jta_1.1_spec</artifactId>
+      </dependency>
+      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/ServiceUtils.java b/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/ServiceUtils.java
index 1e38f62..240916c 100644
--- a/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/ServiceUtils.java
+++ b/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/ServiceUtils.java
@@ -16,10 +16,13 @@
  */
 package org.apache.activemq.service.extensions;
 
+import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAResource;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.ServiceLoader;
 
+import org.apache.activemq.service.extensions.transactions.TransactionManagerLocator;
 import org.apache.activemq.service.extensions.xa.ActiveMQXAResourceWrapper;
 import org.apache.activemq.service.extensions.xa.ActiveMQXAResourceWrapperFactory;
 import org.apache.activemq.service.extensions.xa.ActiveMQXAResourceWrapperFactoryImpl;
@@ -32,6 +35,10 @@ public class ServiceUtils
 {
    private static ActiveMQXAResourceWrapperFactory activeMQXAResourceWrapperFactory;
 
+   private static TransactionManager transactionManager;
+
+   private static boolean transactionManagerLoaded = false;
+
    private static ActiveMQXAResourceWrapperFactory getActiveMQXAResourceWrapperFactory()
    {
       if (activeMQXAResourceWrapperFactory == null)
@@ -46,6 +53,20 @@ public class ServiceUtils
       return getActiveMQXAResourceWrapperFactory().wrap(xaResource, properties);
    }
 
+   public static synchronized TransactionManager getTransactionManager()
+   {
+      if (!transactionManagerLoaded)
+      {
+         Iterator<TransactionManagerLocator> it = ServiceLoader.load(TransactionManagerLocator.class).iterator();
+         if (it.hasNext())
+         {
+            transactionManager = it.next().getTransactionManager();
+         }
+         transactionManagerLoaded = true;
+      }
+      return transactionManager;
+   }
+
    private static void setActiveMQXAResourceWrapperFactory(Iterable<ActiveMQXAResourceWrapperFactory> iterable)
    {
       if (iterable.iterator().hasNext())

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/transactions/TransactionManagerLocator.java
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/transactions/TransactionManagerLocator.java b/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/transactions/TransactionManagerLocator.java
new file mode 100644
index 0000000..d0d249b
--- /dev/null
+++ b/activemq-service-extensions/src/main/java/org/apache/activemq/service/extensions/transactions/TransactionManagerLocator.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.service.extensions.transactions;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public interface TransactionManagerLocator
+{
+   TransactionManager getTransactionManager();
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/DummyTransactionManagerLocator.java
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/DummyTransactionManagerLocator.java b/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/DummyTransactionManagerLocator.java
new file mode 100644
index 0000000..d26efc3
--- /dev/null
+++ b/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/DummyTransactionManagerLocator.java
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.service.extensions.tests.transactions;
+
+import org.apache.activemq.service.extensions.transactions.TransactionManagerLocator;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class DummyTransactionManagerLocator implements TransactionManagerLocator,TransactionManager
+{
+   @Override
+   public void begin() throws NotSupportedException, SystemException
+   {
+
+   }
+
+   @Override
+   public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException
+   {
+
+   }
+
+   @Override
+   public int getStatus() throws SystemException
+   {
+      return 0;
+   }
+
+   @Override
+   public Transaction getTransaction() throws SystemException
+   {
+      return null;
+   }
+
+   @Override
+   public void resume(Transaction transaction) throws IllegalStateException, InvalidTransactionException, SystemException
+   {
+
+   }
+
+   @Override
+   public void rollback() throws IllegalStateException, SecurityException, SystemException
+   {
+
+   }
+
+   @Override
+   public void setRollbackOnly() throws IllegalStateException, SystemException
+   {
+
+   }
+
+   @Override
+   public void setTransactionTimeout(int i) throws SystemException
+   {
+
+   }
+
+   @Override
+   public Transaction suspend() throws SystemException
+   {
+      return null;
+   }
+
+   @Override
+   public TransactionManager getTransactionManager()
+   {
+      return this;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/TransactionManagerLocatorTest.java
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/TransactionManagerLocatorTest.java b/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/TransactionManagerLocatorTest.java
new file mode 100644
index 0000000..ee4b8de
--- /dev/null
+++ b/activemq-service-extensions/src/test/java/org/apache/activemq/service/extensions/tests/transactions/TransactionManagerLocatorTest.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.service.extensions.tests.transactions;
+
+import org.apache.activemq.service.extensions.ServiceUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class TransactionManagerLocatorTest extends Assert
+{
+   @Test
+   public void getTM()
+   {
+      assertNotNull(ServiceUtils.getTransactionManager());
+      assertEquals(ServiceUtils.getTransactionManager().getClass(), DummyTransactionManagerLocator.class);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/activemq-service-extensions/src/test/resources/META-INF/services/org.apache.activemq.service.extensions.transactions.TransactionManagerLocator
----------------------------------------------------------------------
diff --git a/activemq-service-extensions/src/test/resources/META-INF/services/org.apache.activemq.service.extensions.transactions.TransactionManagerLocator b/activemq-service-extensions/src/test/resources/META-INF/services/org.apache.activemq.service.extensions.transactions.TransactionManagerLocator
new file mode 100644
index 0000000..c4bc639
--- /dev/null
+++ b/activemq-service-extensions/src/test/resources/META-INF/services/org.apache.activemq.service.extensions.transactions.TransactionManagerLocator
@@ -0,0 +1 @@
+org.apache.activemq.service.extensions.tests.transactions.DummyTransactionManagerLocator
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/pom.xml
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/pom.xml b/integration/activemq-jboss-as-integration/pom.xml
deleted file mode 100644
index bb7eaa3..0000000
--- a/integration/activemq-jboss-as-integration/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-   <modelVersion>4.0.0</modelVersion>
-
-   <parent>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>activemq-pom</artifactId>
-      <version>6.0.0-SNAPSHOT</version>
-      <relativePath>../../pom.xml</relativePath>
-   </parent>
-
-   <artifactId>activemq-jboss-as-integration</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ6 JBoss AS Integration</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging-processor</artifactId>
-      </dependency>
-
-      <!--
-          JBoss Logging
-      -->
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>activemq-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.security</groupId>
-         <artifactId>jboss-security-spi</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.security</groupId>
-         <artifactId>jbosssx</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-ejb_3.0_spec</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss</groupId>
-         <artifactId>jboss-transaction-spi</artifactId>
-      </dependency>
-      <!--this for xa recovery-->
-      <dependency>
-         <groupId>org.jboss.jbossts.jts</groupId>
-         <artifactId>jbossjts-jacorb</artifactId>
-      </dependency>
-   </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossBundle.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossBundle.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossBundle.java
deleted file mode 100644
index beb074f..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossBundle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss;
-
-
-import org.jboss.logging.annotations.MessageBundle;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         3/12/12
- *
- * Logger Code 13
- *
- * each message id must be 6 digits long starting with 13, the 3rd digit should be 9
- *
- * so 139000 to 139999
- */
-@MessageBundle(projectCode = "AMQ")
-public class ActiveMQJBossBundle
-{
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossLogger.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossLogger.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossLogger.java
deleted file mode 100644
index ad79bdc..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/ActiveMQJBossLogger.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss;
-
-import javax.security.auth.Subject;
-
-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 13
- *
- * each message id must be 6 digits long starting with 13, 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 131000 to 131999
- */
-@MessageLogger(projectCode = "AMQ")
-public interface ActiveMQJBossLogger extends BasicLogger
-{
-   /**
-    * The jboss integration logger.
-    */
-   ActiveMQJBossLogger LOGGER = Logger.getMessageLogger(ActiveMQJBossLogger.class, ActiveMQJBossLogger.class.getPackage().getName());
-
-   @LogMessage(level = Logger.Level.INFO)
-   @Message(id = 131001, value = "Security Context Setting Subject = {0}",
-            format = Message.Format.MESSAGE_FORMAT)
-   void settingSecuritySubject(Subject subject);
-
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 132001, value = "An error happened while setting the context",
-            format = Message.Format.MESSAGE_FORMAT)
-   void errorSettingSecurityContext(@Cause Throwable Throwable);
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/AS4SecurityActions.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/AS4SecurityActions.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/AS4SecurityActions.java
deleted file mode 100644
index 5823ce4..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/AS4SecurityActions.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss.security;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.jboss.security.SecurityAssociation;
-
-/** A collection of privileged actions for this package
- * @author Scott.Stark@jboss.org
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:anil.saldhana@jboss.com">anil saldhana</a>
- * @version $Revison: 1.0$
- */
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- *         Created Oct 21, 2009
- */
-public class AS4SecurityActions
-{
-   interface PrincipalInfoAction
-   {
-      PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(final Principal principal, final Object credential, final Subject subject)
-         {
-            AccessController.doPrivileged(new PrivilegedAction()
-            {
-               public Object run()
-               {
-                  SecurityAssociation.pushSubjectContext(subject, principal, credential);
-                  return null;
-               }
-            });
-         }
-
-         public void dup()
-         {
-            AccessController.doPrivileged(new PrivilegedAction()
-            {
-               public Object run()
-               {
-                  SecurityAssociation.dupSubjectContext();
-                  return null;
-               }
-            });
-         }
-
-         public void pop()
-         {
-            AccessController.doPrivileged(new PrivilegedAction()
-            {
-               public Object run()
-               {
-                  SecurityAssociation.popSubjectContext();
-                  return null;
-               }
-            });
-         }
-      };
-
-      PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(final Principal principal, final Object credential, final Subject subject)
-         {
-            SecurityAssociation.pushSubjectContext(subject, principal, credential);
-         }
-
-         public void dup()
-         {
-            SecurityAssociation.dupSubjectContext();
-         }
-
-         public void pop()
-         {
-            SecurityAssociation.popSubjectContext();
-         }
-      };
-
-      void push(Principal principal, Object credential, Subject subject);
-
-      void dup();
-
-      void pop();
-   }
-
-   static void pushSubjectContext(final Principal principal, final Object credential, final Subject subject)
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject);
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject);
-      }
-   }
-
-   static void popSubjectContext()
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.pop();
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.pop();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/JBossASSecurityManager.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/JBossASSecurityManager.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/JBossASSecurityManager.java
deleted file mode 100644
index 8292ead..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/JBossASSecurityManager.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss.security;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.naming.InitialContext;
-import javax.security.auth.Subject;
-
-import org.apache.activemq.core.security.CheckType;
-import org.apache.activemq.core.security.Role;
-import org.apache.activemq.core.server.ActiveMQComponent;
-import org.apache.activemq.integration.jboss.ActiveMQJBossLogger;
-import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
-import org.jboss.security.AuthenticationManager;
-import org.jboss.security.RealmMapping;
-import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextAssociation;
-import org.jboss.security.SimplePrincipal;
-
-/**
- * This implementation delegates to the JBoss AS security interfaces (which in turn use JAAS)
- * It can be used when running ActiveMQ in JBoss AS
- *
- * @author <a href="ataylor@redhat.com">Andy Taylor</a>
- * @author <a href="tim.fox@jboss.com">Tim Fox</a>
- */
-public class JBossASSecurityManager implements ActiveMQSecurityManager, ActiveMQComponent
-{
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final boolean trace = ActiveMQJBossLogger.LOGGER.isTraceEnabled();
-
-   /**
-    * the realmmapping
-    */
-   private RealmMapping realmMapping;
-
-   /**
-    * the JAAS Authentication Manager
-    */
-   private AuthenticationManager authenticationManager;
-
-   /**
-    * The JNDI name of the AuthenticationManager(and RealmMapping since they are the same object).
-    */
-   private String securityDomainName = "java:/jaas/activemq";
-
-   private boolean started;
-
-   private boolean isAs5 = true;
-
-   private boolean allowClientLogin = false;
-
-   private boolean authoriseOnClientLogin = false;
-
-   public boolean validateUser(final String user, final String password)
-   {
-      SimplePrincipal principal = new SimplePrincipal(user);
-
-      char[] passwordChars = null;
-
-      if (password != null)
-      {
-         passwordChars = password.toCharArray();
-      }
-
-      Subject subject = new Subject();
-
-      return authenticationManager.isValid(principal, passwordChars, subject);
-   }
-
-   public boolean validateUserAndRole(final String user,
-                                      final String password,
-                                      final Set<Role> roles,
-                                      final CheckType checkType)
-   {
-      if (allowClientLogin && SecurityContextAssociation.isClient())
-      {
-         return authoriseOnClientLogin ? useClientAuthentication(roles, checkType) : true;
-      }
-      else
-      {
-         return useConnectionAuthentication(user, password, roles, checkType);
-      }
-   }
-
-   private boolean useConnectionAuthentication(final String user,
-                                               final String password,
-                                               final Set<Role> roles,
-                                               final CheckType checkType)
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<Boolean>()
-      {
-         public Boolean run()
-         {
-
-            SimplePrincipal principal = user == null ? null : new SimplePrincipal(user);
-
-            char[] passwordChars = null;
-
-            if (password != null)
-            {
-               passwordChars = password.toCharArray();
-            }
-
-            Subject subject = new Subject();
-
-            boolean authenticated = authenticationManager.isValid(principal, passwordChars, subject);
-            // Authenticate. Successful authentication will place a new SubjectContext on thread local,
-            // which will be used in the authorization process. However, we need to make sure we clean up
-            // thread local immediately after we used the information, otherwise some other people
-            // security my be screwed up, on account of thread local security stack being corrupted.
-            if (authenticated)
-            {
-               pushSecurityContext(principal, passwordChars, subject);
-               Set<Principal> rolePrincipals = getRolePrincipals(checkType, roles);
-
-               authenticated = realmMapping.doesUserHaveRole(principal, rolePrincipals);
-
-               if (trace)
-               {
-                  ActiveMQJBossLogger.LOGGER.trace("user " + user +
-                                                   (authenticated ? " is " : " is NOT ") +
-                                                   "authorized");
-               }
-               popSecurityContext();
-            }
-            return authenticated;
-         }
-      });
-   }
-
-   private boolean useClientAuthentication(final Set<Role> roles, final CheckType checkType)
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<Boolean>()
-      {
-         public Boolean run()
-         {
-            SecurityContext sc = SecurityContextAssociation.getSecurityContext();
-            Principal principal = sc.getUtil().getUserPrincipal();
-
-            char[] passwordChars = (char[])sc.getUtil().getCredential();
-
-            Subject subject = sc.getSubjectInfo().getAuthenticatedSubject();
-
-            boolean authenticated = authenticationManager.isValid(principal, passwordChars, subject);
-
-            if (authenticated)
-            {
-               Set<Principal> rolePrincipals = getRolePrincipals(checkType, roles);
-
-               authenticated = realmMapping.doesUserHaveRole(principal, rolePrincipals);
-
-               if (trace)
-               {
-                  ActiveMQJBossLogger.LOGGER.trace("user " + principal.getName() +
-                                                   (authenticated ? " is " : " is NOT ") +
-                                                   "authorized");
-               }
-            }
-            return authenticated;
-         }
-
-      });
-
-   }
-
-   private void popSecurityContext()
-   {
-      if (isAs5)
-      {
-         SecurityActions.popSubjectContext();
-      }
-      else
-      {
-         AS4SecurityActions.popSubjectContext();
-      }
-   }
-
-   private void pushSecurityContext(final SimplePrincipal principal, final char[] passwordChars, final Subject subject)
-   {
-      if (isAs5)
-      {
-         SecurityActions.pushSubjectContext(principal, passwordChars, subject, securityDomainName);
-      }
-      else
-      {
-         AS4SecurityActions.pushSubjectContext(principal, passwordChars, subject);
-      }
-   }
-
-   public void addRole(final String user, final String role)
-   {
-      // NO-OP
-   }
-
-   public void addUser(final String user, final String password)
-   {
-      // NO-OP
-   }
-
-   public void removeRole(final String user, final String role)
-   {
-      // NO-OP
-   }
-
-   public void removeUser(final String user)
-   {
-      // NO-OP
-   }
-
-   public void setDefaultUser(final String username)
-   {
-      // NO-OP
-   }
-
-   private Set<Principal> getRolePrincipals(final CheckType checkType, final Set<Role> roles)
-   {
-      Set<Principal> principals = new HashSet<Principal>();
-      for (Role role : roles)
-      {
-         if (checkType.hasRole(role))
-         {
-            principals.add(new SimplePrincipal(role.getName()));
-         }
-      }
-      return principals;
-   }
-
-   public void setRealmMapping(final RealmMapping realmMapping)
-   {
-      this.realmMapping = realmMapping;
-   }
-
-   public void setAuthenticationManager(final AuthenticationManager authenticationManager)
-   {
-      this.authenticationManager = authenticationManager;
-   }
-
-   /**
-    * lifecycle method, needs to be called
-    *
-    * @throws Exception
-    */
-   public synchronized void start() throws Exception
-   {
-      if (started)
-      {
-         return;
-      }
-
-      InitialContext ic = new InitialContext();
-      authenticationManager = (AuthenticationManager)ic.lookup(securityDomainName);
-      realmMapping = (RealmMapping)authenticationManager;
-
-      started = true;
-   }
-
-   public synchronized void stop()
-   {
-      if (!started)
-      {
-         return;
-      }
-      started = false;
-   }
-
-   public synchronized boolean isStarted()
-   {
-      return started;
-   }
-
-   public void setSecurityDomainName(final String securityDomainName)
-   {
-      this.securityDomainName = securityDomainName;
-   }
-
-   public void setAs5(final boolean as5)
-   {
-      isAs5 = as5;
-   }
-
-   public void setAllowClientLogin(final boolean allowClientLogin)
-   {
-      this.allowClientLogin = allowClientLogin;
-   }
-
-   public void setAuthoriseOnClientLogin(final boolean authoriseOnClientLogin)
-   {
-      this.authoriseOnClientLogin = authoriseOnClientLogin;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/SecurityActions.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/SecurityActions.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/SecurityActions.java
deleted file mode 100644
index 006880d..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/security/SecurityActions.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss.security;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.apache.activemq.integration.jboss.ActiveMQJBossLogger;
-import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextAssociation;
-import org.jboss.security.SecurityContextFactory;
-
-/** A collection of privileged actions for this package
- * @author Scott.Stark@jboss.org
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @author <a her="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version $Revison: 1.0$
- */
-class SecurityActions
-{
-   interface PrincipalInfoAction
-   {
-      PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(final Principal principal,
-                          final Object credential,
-                          final Subject subject,
-                          final String securityDomain)
-         {
-            AccessController.doPrivileged(new PrivilegedAction<Object>()
-            {
-               public Object run()
-               {
-
-                  try
-                  {
-                     ActiveMQJBossLogger.LOGGER.settingSecuritySubject(subject);
-                     // SecurityAssociation.pushSubjectContext(subject, principal, credential);
-                     SecurityContext sc = SecurityContextAssociation.getSecurityContext();
-                     if (sc == null)
-                     {
-                        try
-                        {
-                           sc = SecurityContextFactory.createSecurityContext(principal,
-                                                                             credential,
-                                                                             subject,
-                                                                             securityDomain);
-                        }
-                        catch (Exception e)
-                        {
-                           throw new RuntimeException(e);
-                        }
-                     }
-                     else
-                     {
-                        sc.getUtil().createSubjectInfo(principal, credential, subject);
-                     }
-
-                     SecurityContextAssociation.setSecurityContext(sc);
-                  }
-                  catch (Throwable t)
-                  {
-                     ActiveMQJBossLogger.LOGGER.errorSettingSecurityContext(t);
-                  }
-
-                  return null;
-               }
-            });
-         }
-
-         public void pop()
-         {
-            AccessController.doPrivileged(new PrivilegedAction<Object>()
-            {
-               public Object run()
-               {
-                  // SecurityAssociation.popSubjectContext();
-                  SecurityContextAssociation.clearSecurityContext();
-                  return null;
-               }
-            });
-         }
-      };
-
-      PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(final Principal principal,
-                          final Object credential,
-                          final Subject subject,
-                          final String securityDomain)
-         {
-            // SecurityAssociation.pushSubjectContext(subject, principal, credential);
-            SecurityContext sc = SecurityContextAssociation.getSecurityContext();
-            if (sc == null)
-            {
-               try
-               {
-                  sc = SecurityContextFactory.createSecurityContext(principal, credential, subject, securityDomain);
-               }
-               catch (Exception e)
-               {
-                  throw new RuntimeException(e);
-               }
-            }
-            else
-            {
-               sc.getUtil().createSubjectInfo(principal, credential, subject);
-            }
-            SecurityContextAssociation.setSecurityContext(sc);
-         }
-
-         public void pop()
-         {
-            // SecurityAssociation.popSubjectContext();
-            SecurityContextAssociation.clearSecurityContext();
-         }
-      };
-
-      void push(Principal principal, Object credential, Subject subject, String securityDomain);
-
-      void pop();
-   }
-
-   static void pushSubjectContext(final Principal principal,
-                                  final Object credential,
-                                  final Subject subject,
-                                  final String securityDomainName)
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject, securityDomainName);
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject, securityDomainName);
-      }
-   }
-
-   static void popSubjectContext()
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.pop();
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.pop();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss4TransactionManagerLocator.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss4TransactionManagerLocator.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss4TransactionManagerLocator.java
deleted file mode 100644
index 17e6910..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss4TransactionManagerLocator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss.tm;
-
-import javax.transaction.TransactionManager;
-
-import org.jboss.tm.TransactionManagerLocator;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class JBoss4TransactionManagerLocator
-{
-   public TransactionManager getTm()
-   {
-      return TransactionManagerLocator.getInstance().locate();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss5TransactionManagerLocator.java
----------------------------------------------------------------------
diff --git a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss5TransactionManagerLocator.java b/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss5TransactionManagerLocator.java
deleted file mode 100644
index f5fa9dd..0000000
--- a/integration/activemq-jboss-as-integration/src/main/java/org/apache/activemq/integration/jboss/tm/JBoss5TransactionManagerLocator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF 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.jboss.tm;
-
-import javax.transaction.TransactionManager;
-
-import org.jboss.tm.TransactionManagerLocator;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class JBoss5TransactionManagerLocator
-{
-   public TransactionManager getTm()
-   {
-      return TransactionManagerLocator.locateTransactionManager();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c868686..664f238 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,6 +220,11 @@
             <artifactId>geronimo-jta_1.1_spec</artifactId>
             <version>1.1.1</version>
          </dependency>
+         <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+            <version>1.1.1</version>
+         </dependency>
 
          <!--this specifically for the JMS Bridge-->
          <dependency>
@@ -489,7 +494,6 @@
             <module>activemq-rest</module>
             <module>activemq-tools</module>
             <module>activemq-service-extensions</module>
-            <module>integration/activemq-jboss-as-integration</module>
             <module>integration/activemq-spring-integration</module>
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>
@@ -517,7 +521,6 @@
             <module>activemq-rest</module>
             <module>activemq-tools</module>
             <module>activemq-service-extensions</module>
-            <module>integration/activemq-jboss-as-integration</module>
             <module>integration/activemq-spring-integration</module>
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>
@@ -555,7 +558,6 @@
             <module>activemq-rest</module>
             <module>activemq-tools</module>
             <module>activemq-service-extensions</module>
-            <module>integration/activemq-jboss-as-integration</module>
             <module>integration/activemq-spring-integration</module>
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>
@@ -589,7 +591,6 @@
             <module>activemq-rest</module>
             <module>activemq-tools</module>
             <module>activemq-service-extensions</module>
-            <module>integration/activemq-jboss-as-integration</module>
             <module>integration/activemq-spring-integration</module>
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/ActiveMQMessageHandlerTest.java
----------------------------------------------------------------------
diff --git a/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/ActiveMQMessageHandlerTest.java b/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/ActiveMQMessageHandlerTest.java
index 0afbdf8..fe07bd0 100644
--- a/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/ActiveMQMessageHandlerTest.java
+++ b/tests/byteman-tests/src/test/java/org/apache/activemq/byteman/tests/ActiveMQMessageHandlerTest.java
@@ -90,9 +90,6 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
       ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter();
       resourceAdapter = qResourceAdapter;
 
-      qResourceAdapter.setTransactionManagerLocatorClass(DummyTMLocator.class.getName());
-      qResourceAdapter.setTransactionManagerLocatorMethod("getTM");
-
       MyBootstrapContext ctx = new MyBootstrapContext();
 
       qResourceAdapter.setConnectorClassName(NETTY_CONNECTOR_FACTORY);
@@ -170,9 +167,6 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
       ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter();
       resourceAdapter = qResourceAdapter;
 
-      qResourceAdapter.setTransactionManagerLocatorClass(DummyTMLocator.class.getName());
-      qResourceAdapter.setTransactionManagerLocatorMethod("getTM");
-
       MyBootstrapContext ctx = new MyBootstrapContext();
 
       qResourceAdapter.setConnectorClassName(NETTY_CONNECTOR_FACTORY);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/JMSBridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/JMSBridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/JMSBridgeTest.java
index bf83708..19dddd6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/JMSBridgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/bridge/JMSBridgeTest.java
@@ -2371,8 +2371,6 @@ public class JMSBridgeTest extends BridgeTestBase
                                     null,
                                     null,
                                     false);
-         bridge.setTransactionManagerLocatorClass(this.getClass().getName());
-         bridge.setTransactionManagerLocatorMethod("getNewTm");
          bridge.start();
       }
       finally

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQMessageHandlerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQMessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQMessageHandlerTest.java
index 9b072d2..cdf90f7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQMessageHandlerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQMessageHandlerTest.java
@@ -197,8 +197,6 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
    protected ActiveMQResourceAdapter newResourceAdapter()
    {
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
-      qResourceAdapter.setTransactionManagerLocatorClass("");
-      qResourceAdapter.setTransactionManagerLocatorMethod("");
       qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
       return qResourceAdapter;
    }
@@ -209,8 +207,6 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
       ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter();
       qResourceAdapter.setReconnectAttempts(-1);
       qResourceAdapter.setCallTimeout(500L);
-      qResourceAdapter.setTransactionManagerLocatorClass("");
-      qResourceAdapter.setTransactionManagerLocatorMethod("");
       qResourceAdapter.setRetryInterval(500L);
       MyBootstrapContext ctx = new MyBootstrapContext();
       qResourceAdapter.start(ctx);
@@ -551,8 +547,6 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
    public void testNonDurableSubscriptionDeleteAfterCrash() throws Exception
    {
       ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter();
-      qResourceAdapter.setTransactionManagerLocatorClass("");
-      qResourceAdapter.setTransactionManagerLocatorMethod("");
       MyBootstrapContext ctx = new MyBootstrapContext();
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
index 7778a45..307f827 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
@@ -99,9 +99,6 @@ public abstract class ActiveMQRATestBase extends JMSTestBase
    protected ActiveMQResourceAdapter newResourceAdapter()
    {
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
-      // We don't have a TM on these tests.. This would cause the lookup to take at least 10 seconds if we didn't set to ""
-      qResourceAdapter.setTransactionManagerLocatorClass("");
-      qResourceAdapter.setTransactionManagerLocatorMethod("");
       qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
       return qResourceAdapter;
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/JMSContextTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/JMSContextTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/JMSContextTest.java
index 0224c3f..aeed55c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/JMSContextTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/JMSContextTest.java
@@ -60,8 +60,6 @@ public class JMSContextTest extends ActiveMQRATestBase
       roles.add(role);
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);
       resourceAdapter = new ActiveMQResourceAdapter();
-      resourceAdapter.setTransactionManagerLocatorClass(JMSContextTest.class.getName());
-      resourceAdapter.setTransactionManagerLocatorMethod("getTm");
 
       resourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
       MyBootstrapContext ctx = new MyBootstrapContext();

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/OutgoingConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/OutgoingConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/OutgoingConnectionTest.java
index 9f0c3ef..4dbf1af 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/OutgoingConnectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/OutgoingConnectionTest.java
@@ -96,8 +96,6 @@ public class OutgoingConnectionTest extends ActiveMQRATestBase
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);
 
       resourceAdapter = new ActiveMQResourceAdapter();
-      resourceAdapter.setTransactionManagerLocatorClass(JMSContextTest.class.getName());
-      resourceAdapter.setTransactionManagerLocatorMethod("getTm");
       resourceAdapter.setEntries("[\"java://jmsXA\"]");
 
       resourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
@@ -288,8 +286,6 @@ public class OutgoingConnectionTest extends ActiveMQRATestBase
    {
       setupDLQ(10);
       resourceAdapter = newResourceAdapter();
-      resourceAdapter.setTransactionManagerLocatorClass(JMSContextTest.class.getName());
-      resourceAdapter.setTransactionManagerLocatorMethod("getTm");
       DummyTransactionManager.tm.tx = new DummyTransaction();
       MyBootstrapContext ctx = new MyBootstrapContext();
       resourceAdapter.start(ctx);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ResourceAdapterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ResourceAdapterTest.java
index 9387ab5..d9f7c69 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ResourceAdapterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ResourceAdapterTest.java
@@ -69,8 +69,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       ra.setConnectorClassName("org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory");
       ra.setUserName("userGlobal");
       ra.setPassword("passwordGlobal");
-      ra.setTransactionManagerLocatorClass("");
-      ra.setTransactionManagerLocatorMethod("");
       ra.start(new org.apache.activemq.tests.unit.ra.BootstrapContext());
 
       Connection conn = ra.getDefaultActiveMQConnectionFactory().createConnection();
@@ -131,7 +129,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectorClassName(UnitTestCase.INVM_CONNECTOR_FACTORY);
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -363,7 +360,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -390,7 +386,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -419,7 +414,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -446,7 +440,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setDiscoveryInitialWaitTimeout(1L);
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -469,10 +462,8 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();
       qResourceAdapter.setDiscoveryAddress("231.7.7.7");
 
-      // qResourceAdapter.getTransactionManagerLocatorClass
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
 
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
@@ -504,7 +495,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setHA(true);
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -528,7 +518,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -552,7 +541,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -577,7 +565,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setReconnectAttempts(100);
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -601,7 +588,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -625,7 +611,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setConnectionParameters("server-id=0");
       ActiveMQRATestBase.MyBootstrapContext ctx = new ActiveMQRATestBase.MyBootstrapContext();
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
       ActiveMQActivationSpec spec = new ActiveMQActivationSpec();
       spec.setResourceAdapter(qResourceAdapter);
@@ -654,7 +639,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
       qResourceAdapter.setUseMaskedPassword(true);
       qResourceAdapter.setPassword(mask);
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
 
       assertEquals("helloworld", qResourceAdapter.getPassword());
@@ -699,7 +683,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase
 
       qResourceAdapter.setPassword(mask);
 
-      qResourceAdapter.setTransactionManagerLocatorClass("");
       qResourceAdapter.start(ctx);
 
       assertEquals("helloworld", qResourceAdapter.getPassword());

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
index 5a7c4d1..4f3d414 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java
@@ -280,18 +280,6 @@ public class ActiveMQResourceAdapterConfigTest extends UnitTestCase
       "         <config-property-type>long</config-property-type>\n" +
       "         <config-property-value></config-property-value>\n" +
       "      </config-property>\n" +
-      "      <config-property>" +
-      "         <description></description>" +
-      "         <config-property-name>TransactionManagerLocatorMethod</config-property-name>" +
-      "         <config-property-type>java.lang.String</config-property-type>" +
-      "         <config-property-value></config-property-value>" +
-      "      </config-property>" +
-      "      <config-property>" +
-      "         <description></description>" +
-      "         <config-property-name>TransactionManagerLocatorClass</config-property-name>" +
-      "         <config-property-type>java.lang.String</config-property-type>" +
-      "         <config-property-value></config-property-value>" +
-      "      </config-property>" +
       "      <config-property>\n" +
       "         <description>How many attempts should be made when connecting the MDB</description>\n" +
       "         <config-property-name>SetupAttempts</config-property-name>\n" +

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e34fd09c/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ConnectionFactoryPropertiesTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ConnectionFactoryPropertiesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ConnectionFactoryPropertiesTest.java
index 9c68c13..481d969 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ConnectionFactoryPropertiesTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/ra/ConnectionFactoryPropertiesTest.java
@@ -50,8 +50,6 @@ public class ConnectionFactoryPropertiesTest extends UnitTestCase
       UNSUPPORTED_RA_PROPERTIES.add("discoveryInitialWaitTimeout");
       UNSUPPORTED_RA_PROPERTIES.add("connectionParameters");
       UNSUPPORTED_RA_PROPERTIES.add("connectorClassName");
-      UNSUPPORTED_RA_PROPERTIES.add("transactionManagerLocatorClass");
-      UNSUPPORTED_RA_PROPERTIES.add("transactionManagerLocatorMethod");
       UNSUPPORTED_RA_PROPERTIES.add("managedConnectionFactory");
       UNSUPPORTED_RA_PROPERTIES.add("jndiParams");
       UNSUPPORTED_RA_PROPERTIES.add("password");


Mime
View raw message