[jboss-cvs] JBoss Messaging SVN: r1654 - branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 29 20:51:00 EST 2006


Author: juha at jboss.org
Date: 2006-11-29 20:50:58 -0500 (Wed, 29 Nov 2006)
New Revision: 1654

Added:
   branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util/TransactionManagerLocator.java
Log:
This should be parameterized so that the unit test suite can be run against either JbossTM or JBossTS implementation. JBossTM would basically just delegate to the existing locator

Added: branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util/TransactionManagerLocator.java
===================================================================
--- branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util/TransactionManagerLocator.java	2006-11-30 01:24:06 UTC (rev 1653)
+++ branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util/TransactionManagerLocator.java	2006-11-30 01:50:58 UTC (rev 1654)
@@ -0,0 +1,61 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.test.messaging.util;
+
+import javax.transaction.TransactionManager;
+
+
+/**
+ * Mimics the JBossTM locator API with creation of JBossTS implementation.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>
+ *
+ * @version $Revision: $
+ */
+public class TransactionManagerLocator
+{
+   private static TransactionManagerLocator instance = new TransactionManagerLocator();
+
+   private TransactionManager tm;
+
+
+   private TransactionManagerLocator()
+   {}
+
+
+   public static TransactionManagerLocator getInstance()
+   {
+      return instance;
+   }
+
+   public synchronized TransactionManager locate()
+   {
+      if (tm != null)
+         return tm;
+
+      tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+
+      return tm;
+   }
+
+
+}


Property changes on: branches/Branch_1_0_XARecovery/tests/src/org/jboss/test/messaging/util/TransactionManagerLocator.java
___________________________________________________________________
Name: svn:executable
   + *




More information about the jboss-cvs-commits mailing list