[jboss-cvs] JBossAS SVN: r63828 - in trunk: aspects/src/main/org/jboss/aspects/tx and 18 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 4 14:32:33 EDT 2007
Author: adrian at jboss.org
Date: 2007-07-04 14:32:32 -0400 (Wed, 04 Jul 2007)
New Revision: 63828
Removed:
trunk/transaction/src/main/org/jboss/tm/JBossXATerminator.java
trunk/transaction/src/main/org/jboss/tm/LastResource.java
trunk/transaction/src/main/org/jboss/tm/TransactionDemarcationSupport.java
trunk/transaction/src/main/org/jboss/tm/TransactionLocal.java
trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegate.java
trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegateImpl.java
trunk/transaction/src/main/org/jboss/tm/TransactionManagerFactory.java
trunk/transaction/src/main/org/jboss/tm/TransactionManagerLocator.java
trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextFactory.java
trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextImporter.java
trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextUtil.java
trunk/transaction/src/main/org/jboss/tm/TransactionTimeoutConfiguration.java
trunk/transaction/src/main/org/jboss/tm/TxUtils.java
trunk/transaction/src/main/org/jboss/tm/XAExceptionFormatter.java
trunk/transaction/src/main/org/jboss/tm/usertx/client/ServerVMClientUserTransaction.java
Modified:
trunk/aspects/.classpath
trunk/aspects/build-test.xml
trunk/aspects/build-test50.xml
trunk/aspects/build.xml
trunk/aspects/src/main/org/jboss/aspects/tx/TxManagerTimeOutReader.java
trunk/build/build-distr.xml
trunk/build/build-thirdparty.xml
trunk/cluster/.classpath
trunk/cluster/build.xml
trunk/connector/.classpath
trunk/connector/build.xml
trunk/ejb3/.classpath
trunk/ejb3/build-test.xml
trunk/ejb3/build.xml
trunk/embedded/build.xml
trunk/hibernate-int/.classpath
trunk/hibernate-int/build.xml
trunk/iiop/.classpath
trunk/iiop/build.xml
trunk/jbossmq/.classpath
trunk/jbossmq/build.xml
trunk/jbossmq/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java
trunk/jbossmq/src/main/org/jboss/mq/sm/jdbc/JDBCStateManager.java
trunk/messaging/.classpath
trunk/server/.classpath
trunk/server/build.xml
trunk/testsuite/.classpath
trunk/testsuite/build.xml
trunk/tomcat/.classpath
trunk/tomcat/build.xml
trunk/transaction/.classpath
trunk/transaction/build.xml
trunk/varia/.classpath
trunk/varia/build.xml
Log:
[JBAS-4516] - Moved tranasction spi to jboss-integration
Modified: trunk/aspects/.classpath
===================================================================
--- trunk/aspects/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/aspects/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -6,7 +6,6 @@
<classpathentry kind="src" path="/j2se"/>
<classpathentry kind="src" path="/jmx"/>
<classpathentry kind="src" path="/system"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry excluding="org/jboss/test/aop/test/AOPTestSetup.java|org/jboss/test/asynch/" kind="src" path="src/test"/>
<classpathentry kind="src" path="src/test50"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
@@ -35,5 +34,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-deployer-jdk50.jar" sourcepath="/thirdparty/jboss/aop/lib/jboss-asintegration-src.zip"/>
<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-standalone-aspect-library-jdk50.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/aspects/build-test.xml
===================================================================
--- trunk/aspects/build-test.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/aspects/build-test.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -113,7 +113,6 @@
<path refid="jboss.security.classpath"/>
<path refid="jboss.system.classpath"/>
<path refid="jboss.cluster.classpath"/>
- <path refid="jboss.transaction.classpath"/>
<path refid="jboss.aop.classpath"/>
<path refid="jboss.server.classpath"/>
<path refid="jboss.test.classpath"/>
Modified: trunk/aspects/build-test50.xml
===================================================================
--- trunk/aspects/build-test50.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/aspects/build-test50.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -116,7 +116,6 @@
<path refid="jboss.system.classpath"/>
<path refid="jboss.jmx.classpath"/>
<path refid="jboss.naming.classpath"/>
- <path refid="jboss.transaction.classpath"/>
<path refid="jboss.security.classpath"/>
<!-- this is for the NonSerializableFactory -->
<path refid="jboss.server.classpath"/>
Modified: trunk/aspects/build.xml
===================================================================
--- trunk/aspects/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/aspects/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -79,6 +79,7 @@
<path refid="jboss.jboss.vfs.classpath"/>
<path refid="jboss.aop.classpath"/>
<path refid="jboss.test.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- Configure modules -->
@@ -97,7 +98,6 @@
<path refid="jboss.j2se.classpath"/>
<path refid="jboss.system.classpath"/>
<path refid="jboss.cluster.classpath"/>
- <path refid="jboss.transaction.classpath"/>
</path>
<!-- ===== -->
Modified: trunk/aspects/src/main/org/jboss/aspects/tx/TxManagerTimeOutReader.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/tx/TxManagerTimeOutReader.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/aspects/src/main/org/jboss/aspects/tx/TxManagerTimeOutReader.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -23,6 +23,8 @@
import javax.transaction.TransactionManager;
+import org.jboss.tm.TransactionTimeoutConfiguration;
+
/**
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -32,9 +34,16 @@
{
public int getTransactionTimeOut(TransactionManager tm)
{
- if (tm instanceof org.jboss.tm.TxManager)
+ if (tm instanceof TransactionTimeoutConfiguration)
{
- return ((org.jboss.tm.TxManager)tm).getTransactionTimeout();
+ try
+ {
+ return ((TransactionTimeoutConfiguration)tm).getTransactionTimeout();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error retrieving transaction timeout", e);
+ }
}
return 0;
}
Modified: trunk/build/build-distr.xml
===================================================================
--- trunk/build/build-distr.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/build/build-distr.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1839,6 +1839,9 @@
<fileset dir="${jboss.jboss.javaee.lib}">
<include name="jboss-javaee.jar"/>
</fileset>
+ <fileset dir="${jboss.integration.lib}">
+ <include name="jboss-integration.jar"/>
+ </fileset>
<fileset dir="${jboss.jbossws.spi.lib}">
<include name="jbossws-spi.jar"/>
</fileset>
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/build/build-thirdparty.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -89,6 +89,7 @@
<componentref name="jboss/common-logging-log4j" version="2.0.2.GA"/>
<componentref name="jboss/common-logging-jdk" version="2.0.2.GA"/>
<componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
+ <componentref name="jboss/integration" version="snapshot"/>
<componentref name="jboss/jaxr" version="1.2.0.GA"/>
<componentref name="jboss/jboss-javaee" version="5.0.0-SNAPSHOT"/>
<componentref name="jboss/jboss-jaspi-api" version="1.0-SNAPSHOT"/>
Modified: trunk/cluster/.classpath
===================================================================
--- trunk/cluster/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/cluster/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -6,7 +6,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="src" path="/server"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="src" path="/naming"/>
<classpathentry kind="src" path="/messaging"/>
<classpathentry kind="lib" path="/thirdparty/jgroups/lib/jgroups.jar"/>
@@ -24,5 +23,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/cluster/build.xml
===================================================================
--- trunk/cluster/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/cluster/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -81,6 +81,7 @@
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -102,7 +103,6 @@
<path refid="jboss.server.classpath"/>
<path refid="jboss.security.classpath"/>
<path refid="jboss.j2se.classpath"/>
- <path refid="jboss.transaction.classpath"/>
</path>
<!-- ===== -->
Modified: trunk/connector/.classpath
===================================================================
--- trunk/connector/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/connector/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -8,7 +8,6 @@
<classpathentry kind="src" path="/system"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-xerces/lib/xml-apis.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-javamail/lib/mail.jar"/>
@@ -35,5 +34,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-metatype.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-metatype-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-managed.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-managed-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/quartz/lib/quartz-all.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/connector/build.xml
===================================================================
--- trunk/connector/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/connector/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -83,6 +83,7 @@
<path refid="jboss.jboss.vfs.classpath"/>
<path refid="sun.jaxb.classpath"/>
<path refid="sun.jaf.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -105,7 +106,6 @@
<path refid="jboss.systemjmx.classpath"/>
<path refid="jboss.profileservice.classpath"/>
<path refid="jboss.j2se.classpath"/>
- <path refid="jboss.transaction.classpath"/>
<path refid="jboss.serialization.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="jboss.aop.classpath"/>
Modified: trunk/ejb3/.classpath
===================================================================
--- trunk/ejb3/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/ejb3/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -58,5 +58,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/quartz/lib/quartz-all.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/ejb3/build-test.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -152,6 +152,7 @@
<path refid="jboss.jbossxb.classpath"/>
<path refid="hsqldb.hsqldb.classpath"/>
<path refid="jboss.jboss.vfs.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
Modified: trunk/ejb3/build.xml
===================================================================
--- trunk/ejb3/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/ejb3/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -106,6 +106,7 @@
<path refid="dom4j.dom4j.classpath"/>
<!-- FIXME: temporary for EJBTHREE-485 -->
<path refid="cglib.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
Modified: trunk/embedded/build.xml
===================================================================
--- trunk/embedded/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/embedded/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -354,6 +354,7 @@
<zipfileset src="${jboss.ejb3.lib}/jboss-ejb3.jar"/>
<zipfileset src="${jboss.ejb3.lib}/jboss-annotations-ejb3.jar"/>
<zipfileset src="${jboss.jboss.javaee.lib}/jboss-javaee.jar"/>
+ <zipfileset src="${jboss.integration.lib}/jboss-integration.jar"/>
<zipfileset src="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
<zipfileset src="${jboss.aop.lib}/jboss-aop-deployer-jdk50.jar"/>
<zipfileset src="${jboss.varia.lib}/hsqldb-plugin.jar"/>
Modified: trunk/hibernate-int/.classpath
===================================================================
--- trunk/hibernate-int/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/hibernate-int/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -6,7 +6,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="src" path="/server"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="lib" path="/thirdparty/dom4j/lib/dom4j.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/jgroups/lib/jgroups.jar"/>
@@ -17,5 +16,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/system"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/hibernate-int/build.xml
===================================================================
--- trunk/hibernate-int/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/hibernate-int/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -77,6 +77,7 @@
<path refid="odmg.classpath"/>
<path refid="cglib.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -96,7 +97,6 @@
<path refid="jboss.server.classpath"/>
<path refid="jboss.system.classpath"/>
<path refid="jboss.systemjmx.classpath"/>
- <path refid="jboss.transaction.classpath"/>
</path>
<!-- Where source files live -->
Modified: trunk/iiop/.classpath
===================================================================
--- trunk/iiop/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/iiop/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -21,5 +21,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/iiop/build.xml
===================================================================
--- trunk/iiop/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/iiop/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -80,6 +80,7 @@
<path refid="jacorb.jacorb.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
Modified: trunk/jbossmq/.classpath
===================================================================
--- trunk/jbossmq/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/jbossmq/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -8,7 +8,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="src" path="/server"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
<classpathentry kind="src" path="/j2se"/>
@@ -16,5 +15,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/security-spi/lib/jboss-security-spi.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/system-jmx"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/jbossmq/build.xml
===================================================================
--- trunk/jbossmq/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/jbossmq/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -68,6 +68,7 @@
<path refid="apache.commons.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="junit.junit.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -88,7 +89,6 @@
<path refid="jboss.j2se.classpath"/>
<path refid="jboss.security.classpath"/>
<path refid="jboss.security.spi.classpath"/>
- <path refid="jboss.transaction.classpath"/>
</path>
<!-- ===== -->
Modified: trunk/jbossmq/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java
===================================================================
--- trunk/jbossmq/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/jbossmq/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -61,7 +61,7 @@
import org.jboss.mq.server.MessageCache;
import org.jboss.mq.server.MessageReference;
import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.tm.TransactionManagerService;
+import org.jboss.tm.TransactionManagerLocator;
import org.jboss.tm.TransactionTimeoutConfiguration;
import org.jboss.util.UnreachableStatementException;
@@ -1835,7 +1835,7 @@
datasource = (DataSource) ctx.lookup(dsName);
//Get the Transaction Manager so we can control the jdbc tx
- tm = (TransactionManager) ctx.lookup(TransactionManagerService.JNDI_NAME);
+ tm = TransactionManagerLocator.locateTransactionManager();
}
public Object getInstance()
Modified: trunk/jbossmq/src/main/org/jboss/mq/sm/jdbc/JDBCStateManager.java
===================================================================
--- trunk/jbossmq/src/main/org/jboss/mq/sm/jdbc/JDBCStateManager.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/jbossmq/src/main/org/jboss/mq/sm/jdbc/JDBCStateManager.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -53,7 +53,7 @@
import org.jboss.mq.SpyTopic;
import org.jboss.mq.sm.AbstractStateManager;
import org.jboss.mq.sm.StateManager;
-import org.jboss.tm.TransactionManagerService;
+import org.jboss.tm.TransactionManagerLocator;
/**
* A state manager that stores state in the database.
@@ -381,7 +381,7 @@
try
{
dataSource = (DataSource) ctx.lookup(dsName);
- tm = (TransactionManager) ctx.lookup(TransactionManagerService.JNDI_NAME);
+ tm = TransactionManagerLocator.locateTransactionManager();
}
finally
{
Modified: trunk/messaging/.classpath
===================================================================
--- trunk/messaging/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/messaging/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -7,7 +7,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="src" path="/server"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
<classpathentry kind="src" path="/j2se"/>
Modified: trunk/server/.classpath
===================================================================
--- trunk/server/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/server/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -43,5 +43,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/server/build.xml
===================================================================
--- trunk/server/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/server/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -83,6 +83,7 @@
<path refid="gnu.getopt.classpath"/>
<path refid="ibm.wsdl4j.classpath"/>
<path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.integration.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="jboss.jbossws.classpath"/>
<path refid="jboss.jbossws.spi.classpath"/>
Modified: trunk/testsuite/.classpath
===================================================================
--- trunk/testsuite/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/testsuite/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -91,5 +91,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/testsuite/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -131,6 +131,7 @@
<path refid="jboss.jbossws.classpath"/>
<path refid="jbossws.integration.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.integration.classpath"/>
<!-- needed for messaging JMS provider tests -->
<path refid="jboss.messaging.classpath"/>
<!-- needed for proxy tests -->
Modified: trunk/tomcat/.classpath
===================================================================
--- trunk/tomcat/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/tomcat/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -19,7 +19,6 @@
<classpathentry kind="lib" path="/thirdparty/apache-logging/lib/commons-logging.jar"/>
<classpathentry kind="src" path="/aspects"/>
<classpathentry kind="src" path="/j2se"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="lib" path="/thirdparty/jboss/cache/lib/pojocache.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/cache/lib/jbosscache.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-xacml/lib/sunxacml.jar"/>
@@ -55,5 +54,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/tomcat/build.xml
===================================================================
--- trunk/tomcat/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/tomcat/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -66,6 +66,7 @@
<path refid="jboss.serialization.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
<path refid="jboss.jboss.vfs.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -90,7 +91,6 @@
<path refid="jboss.aspects.classpath"/>
<path refid="jboss.ejb3.classpath"/>
<path refid="jboss.jca.classpath"/>
- <path refid="jboss.transaction.classpath"/>
<path refid="jboss.test.classpath" />
</path>
Modified: trunk/transaction/.classpath
===================================================================
--- trunk/transaction/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -11,5 +11,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/system"/>
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/transaction/build.xml
===================================================================
--- trunk/transaction/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -78,6 +78,7 @@
<path refid="apache.commons.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
Deleted: trunk/transaction/src/main/org/jboss/tm/JBossXATerminator.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/JBossXATerminator.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/JBossXATerminator.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,73 +0,0 @@
-/*
- * 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.tm;
-
-import javax.resource.spi.XATerminator;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkCompletedException;
-import javax.transaction.xa.Xid;
-
-/**
- * Extends XATerminator to include registration calls
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public interface JBossXATerminator extends XATerminator
-{
- /**
- * Invoked for transaction inflow of work
- *
- * @param work the work starting
- * @param xid the xid of the work
- * @param timeout the transaction timeout
- * @throws WorkCompletedException with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED
- * when work is already present for the xid or whose completion is in progress, only
- * the global part of the xid must be used for this check.
- */
- void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException;
-
- /**
- * Invoked for transaction inflow of work
- *
- * @param work the work starting
- * @param xid the xid of the work
- * @throws WorkCompletedException with error code WorkException.TX_RECREATE_FAILED if it is unable to recreate the transaction context
- */
- void startWork(Work work, Xid xid) throws WorkCompletedException;
-
- /**
- * Invoked when transaction inflow work ends
- *
- * @param work the work ending
- * @param xid the xid of the work
- */
- void endWork(Work work, Xid xid);
-
- /**
- * Invoked when the work fails
- *
- * @param work the work ending
- * @param xid the xid of the work
- */
- void cancelWork(Work work, Xid xid);
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/LastResource.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/LastResource.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/LastResource.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,36 +0,0 @@
-/*
- * 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.tm;
-
-/**
- * A tagging interface to identify an XAResource that does
- * not support prepare and should be used in the last resource
- * gambit. i.e. It is committed after the resources are
- * prepared. If it fails to commit, roll everybody back.
- *
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- * @version $Revision$
- */
-public interface LastResource
-{
-}
-
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionDemarcationSupport.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionDemarcationSupport.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionDemarcationSupport.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,84 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.jboss.util.NestedRuntimeException;
-
-/**
- * A simple helper for transaction demarcation.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class TransactionDemarcationSupport
-{
- private static final TransactionManagerLocator locator = TransactionManagerLocator.getInstance();
-
- /**
- * Suspend any transaction associated with the thread
- *
- * @return any suspended transaction or null if there was no transaction
- */
- public static Transaction suspendAnyTransaction()
- {
- TransactionManager tm = locator.locate();
- try
- {
- return tm.suspend();
- }
- catch (SystemException e)
- {
- throw new NestedRuntimeException("Unable to suspend transaction", e);
- }
- }
-
- /**
- * Resume any transaction
- *
- * @param tx the transaction to resume
- */
- public static void resumeAnyTransaction(Transaction tx)
- {
- // Nothing to do
- if (tx == null)
- return;
-
- TransactionManager tm = locator.locate();
- try
- {
- tm.resume(tx);
- }
- catch (InvalidTransactionException e)
- {
- throw new NestedRuntimeException("Unable to resume an invalid transaction", e);
- }
- catch (SystemException e)
- {
- throw new NestedRuntimeException("Unable to suspend transaction", e);
- }
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionLocal.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionLocal.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionLocal.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,311 +0,0 @@
-/*
- * 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.tm;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-/**
- * A TransactionLocal is similar to ThreadLocal except it is keyed on the
- * Transactions. A transaction local variable is cleared after the transaction
- * completes.
- *
- * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class TransactionLocal
-{
-
- /**
- * To simplify null values handling in the preloaded data pool we use
- * this value instead of 'null'
- */
- private static final Object NULL_VALUE = new Object();
-
- /**
- * The transaction manager is maintained by the system and
- * manges the assocation of transaction to threads.
- */
- protected final TransactionManager transactionManager;
-
- /**
- * The delegate
- */
- protected TransactionLocalDelegate delegate;
-
- /**
- * Creates a thread local variable.
- * @throws IllegalStateException if there is no system transaction manager
- */
- public TransactionLocal()
- {
- try
- {
- InitialContext context = new InitialContext();
- transactionManager = (TransactionManager) context.lookup("java:/TransactionManager");
- }
- catch(NamingException e)
- {
- throw new IllegalStateException(
- "An error occured while looking up the transaction manager: " + e
- );
- }
- initDelegate();
- }
-
- /**
- * Creates a transaction local variable. Using the given transaction manager
- *
- * @param tm the transaction manager
- */
- public TransactionLocal(TransactionManager tm)
- {
- if (tm == null)
- throw new IllegalArgumentException("Null transaction manager");
- this.transactionManager = tm;
- initDelegate();
- }
-
- /**
- * Lock the TransactionLocal using the current transaction<p>
- *
- * WARN: The current implemention just "locks the transactions"
- *
- * @throws IllegalStateException if the transaction is not active
- * @throws InterruptedException if the thread is interrupted
- */
- public void lock() throws InterruptedException
- {
- lock(getTransaction());
- }
-
- /**
- * Lock the TransactionLocal using the provided transaction<p>
- *
- * WARN: The current implemention just "locks the transactions"
- *
- * @param transaction the transaction
- * @throws IllegalStateException if the transaction is not active
- * @throws InterruptedException if the thread is interrupted
- */
- public void lock(Transaction transaction) throws InterruptedException
- {
- // ignore when there is no transaction
- if (transaction == null)
- return;
-
- delegate.lock(this, transaction);
- }
-
- /**
- * Unlock the TransactionLocal using the current transaction
- */
- public void unlock()
- {
- unlock(getTransaction());
- }
-
- /**
- * Unlock the ThreadLocal using the provided transaction
- *
- * @param transaction the transaction
- */
- public void unlock(Transaction transaction)
- {
- // ignore when there is no transaction
- if (transaction == null)
- return;
-
- delegate.unlock(this, transaction);
- }
-
- /**
- * Returns the initial value for this thransaction local. This method
- * will be called once per accessing transaction for each TransactionLocal,
- * the first time each transaction accesses the variable with get or set.
- * If the programmer desires TransactionLocal variables to be initialized to
- * some value other than null, TransactionLocal must be subclassed, and this
- * method overridden. Typically, an anonymous inner class will be used.
- * Typical implementations of initialValue will call an appropriate
- * constructor and return the newly constructed object.
- *
- * @return the initial value for this TransactionLocal
- */
- protected Object initialValue()
- {
- return null;
- }
-
-
- /**
- * get the transaction local value.
- */
- protected Object getValue(Transaction tx)
- {
- return delegate.getValue(this, tx);
- }
-
- /**
- * put the value in the TransactionImpl map
- */
- protected void storeValue(Transaction tx, Object value)
- {
- delegate.storeValue(this, tx, value);
- }
-
- /**
- * does Transaction contain object?
- */
- protected boolean containsValue(Transaction tx)
- {
- return delegate.containsValue(this, tx);
- }
-
- /**
- * Returns the value of this TransactionLocal variable associated with the
- * thread context transaction. Creates and initializes the copy if this is
- * the first time the method is called in a transaction.
- *
- * @return the value of this TransactionLocal
- */
- public Object get()
- {
- return get(getTransaction());
- }
-
-
- /**
- * Returns the value of this TransactionLocal variable associated with the
- * specified transaction. Creates and initializes the copy if this is the
- * first time the method is called in a transaction.
- *
- * @param transaction the transaction for which the variable it to
- * be retrieved
- * @return the value of this TransactionLocal
- * @throws IllegalStateException if an error occures while registering
- * a synchronization callback with the transaction
- */
- public Object get(Transaction transaction)
- {
- if (transaction == null) return initialValue();
-
- Object value = getValue(transaction);
-
- // is we didn't get a value initalize this object with initialValue()
- if(value == null)
- {
- // get the initial value
- value = initialValue();
-
- // if value is null replace it with the null value standin
- if(value == null)
- {
- value = NULL_VALUE;
- }
-
- // store the value
- storeValue(transaction, value);
- }
-
- // if the value is the null standin return null
- if(value == NULL_VALUE)
- {
- return null;
- }
-
- // finall return the value
- return value;
- }
-
- /**
- * Sets the value of this TransactionLocal variable associtated with the
- * thread context transaction. This is only used to change the value from
- * the one assigned by the initialValue method, and many applications will
- * have no need for this functionality.
- *
- * @param value the value to be associated with the thread context
- * transactions's TransactionLocal
- */
- public void set(Object value)
- {
- set(getTransaction(), value);
- }
-
- /**
- * Sets the value of this TransactionLocal variable associtated with the
- * specified transaction. This is only used to change the value from
- * the one assigned by the initialValue method, and many applications will
- * have no need for this functionality.
- *
- * @param transaction the transaction for which the value will be set
- * @param value the value to be associated with the thread context
- * transactions's TransactionLocal
- */
- public void set(Transaction transaction, Object value)
- {
- if (transaction == null) throw new IllegalStateException("there is no transaction");
- // If this transaction is unknown, register for synchroniztion callback,
- // and call initialValue to give subclasses a chance to do some
- // initialization.
- if(!containsValue(transaction))
- {
- initialValue();
- }
-
- // if value is null replace it with the null value standin
- if(value == null)
- {
- value = NULL_VALUE;
- }
-
- // finally store the value
- storeValue(transaction, value);
- }
-
- public Transaction getTransaction()
- {
- try
- {
- return transactionManager.getTransaction();
- }
- catch(SystemException e)
- {
- throw new IllegalStateException("An error occured while getting the " +
- "transaction associated with the current thread: " + e);
- }
- }
-
- /**
- * Initialise the delegate
- */
- protected void initDelegate()
- {
- if (transactionManager instanceof TransactionLocalDelegate)
- delegate = (TransactionLocalDelegate) transactionManager;
- else
- delegate = new TransactionLocalDelegateImpl(transactionManager);
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegate.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegate.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegate.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,61 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.Transaction;
-
-/**
- * The interface to implementated for a transaction local implementation
- *
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- * @version $Revision$
- */
-public interface TransactionLocalDelegate
-{
- /**
- * get the transaction local value.
- */
- Object getValue(TransactionLocal local, Transaction tx);
-
- /**
- * put the value in the transaction local
- */
- void storeValue(TransactionLocal local, Transaction tx, Object value);
-
- /**
- * does Transaction contain object?
- */
- boolean containsValue(TransactionLocal local, Transaction tx);
-
- /**
- * Lock the transaction local in the context of this transaction
- *
- * @throws IllegalStateException if the transaction is not active
- * @throws InterruptedException if the thread is interrupted
- */
- void lock(TransactionLocal local, Transaction tx) throws InterruptedException;
-
- /**
- * Unlock the transaction local in the context of this transaction
- */
- void unlock(TransactionLocal local, Transaction tx);
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegateImpl.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegateImpl.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionLocalDelegateImpl.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,205 +0,0 @@
-/*
- * 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.tm;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.transaction.RollbackException;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.jboss.util.NestedRuntimeException;
-
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-import EDU.oswego.cs.dl.util.concurrent.ReentrantLock;
-
-/**
- * An implementation of the transaction local implementation
- * using Transaction synchronizations.
- *
- * There is one of these per transaction local
- *
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- * @version $Revision$
- */
-public class TransactionLocalDelegateImpl
- implements TransactionLocalDelegate
-{
- // Attributes ----------------------------------------------------
-
- /** The transaction manager */
- protected TransactionManager manager;
-
- // Static --------------------------------------------------------
-
- /** The synchronizations for each transaction */
- protected static ConcurrentHashMap synchronizationsByTransaction = new ConcurrentHashMap();
-
- /**
- * Retrieve a synchronization for the transaction
- *
- * @param tx the transaction
- * @param create whether to create a synchronization if one doesn't exist
- */
- protected static TransactionLocalSynchronization getSynchronization(Transaction tx, boolean create)
- {
- synchronized (tx)
- {
- TransactionLocalSynchronization result = (TransactionLocalSynchronization) synchronizationsByTransaction.get(tx);
- if (result == null && create == true)
- {
- result = new TransactionLocalSynchronization(tx);
- try
- {
- tx.registerSynchronization(result);
- }
- catch (RollbackException e)
- {
- throw new IllegalStateException("Transaction already rolled back or marked for rollback");
- }
- catch (SystemException e)
- {
- throw new NestedRuntimeException(e);
- }
- synchronizationsByTransaction.put(tx, result);
- }
- return result;
- }
- }
-
- /**
- * Remove a synchronization
- *
- * @param tx the transaction to remove
- */
- protected static void removeSynchronization(Transaction tx)
- {
- synchronizationsByTransaction.remove(tx);
- }
-
- // Constructor ---------------------------------------------------
-
- /**
- * Construct a new delegate for the given transaction manager
- *
- * @param manager the transaction manager
- */
- public TransactionLocalDelegateImpl(TransactionManager manager)
- {
- this.manager = manager;
- }
-
- public void lock(TransactionLocal local, Transaction tx) throws InterruptedException
- {
- TransactionLocalSynchronization sync = getSynchronization(tx, true);
- sync.lock(local);
- }
-
- public void unlock(TransactionLocal local, Transaction tx)
- {
- TransactionLocalSynchronization sync = getSynchronization(tx, false);
- if (sync != null)
- sync.unlock(local);
- else
- throw new IllegalStateException("No synchronization found tx=" + tx + " local=" + local);
- }
-
- public Object getValue(TransactionLocal local, Transaction tx)
- {
- TransactionLocalSynchronization sync = getSynchronization(tx, false);
- if (sync == null)
- return null;
- return sync.getValue(local);
- }
-
- public void storeValue(TransactionLocal local, Transaction tx, Object value)
- {
- TransactionLocalSynchronization sync = getSynchronization(tx, true);
- sync.setValue(local, value);
- }
-
- public boolean containsValue(TransactionLocal local, Transaction tx)
- {
- TransactionLocalSynchronization sync = getSynchronization(tx, false);
- if (sync == null)
- return false;
- return sync.containsValue(local);
- }
-
- // InnerClasses ---------------------------------------------------
-
- protected static class TransactionLocalSynchronization
- implements Synchronization
- {
- protected Transaction tx;
-
- private Map valuesByLocal = Collections.synchronizedMap(new HashMap());
-
- protected ReentrantLock reentrantLock = new ReentrantLock();
-
- public TransactionLocalSynchronization(Transaction tx)
- {
- this.tx = tx;
- }
-
- public void beforeCompletion()
- {
- }
-
- public void afterCompletion(int status)
- {
- removeSynchronization(tx);
- valuesByLocal.clear(); // Help the GC
- }
-
- public void lock(Object local) throws InterruptedException
- {
- boolean locked = reentrantLock.attempt(60000);
- if (locked == false)
- throw new IllegalStateException("Failed to acquire lock within 60 seconds.");
- }
-
- public void unlock(Object local)
- {
- reentrantLock.release();
- }
-
- public Object getValue(Object local)
- {
- return valuesByLocal.get(local);
- }
-
- public void setValue(Object local, Object value)
- {
- valuesByLocal.put(local, value);
- }
-
- public boolean containsValue(Object local)
- {
- return valuesByLocal.containsKey(local);
- }
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionManagerFactory.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionManagerFactory.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionManagerFactory.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,41 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.TransactionManager;
-
-/**
- * A TransactionManager factory.
- *
- * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @version $Revision$
- */
-public interface TransactionManagerFactory
-{
- /**
- * Gets the TransactionManager
- *
- * @return the TransactionManager
- */
- TransactionManager getTransactionManager();
-
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionManagerLocator.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionManagerLocator.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionManagerLocator.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,119 +0,0 @@
-/*
- * 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.tm;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.TransactionManager;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NestedRuntimeException;
-
-/**
- * Locates the transaction manager.
- *
- * @todo this really belongs in some integration layer with
- * a more pluggable implementation
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class TransactionManagerLocator
-{
- /** Logger */
- private static final Logger log = Logger.getLogger(TransactionManagerLocator.class);
-
- /** The instance */
- private static TransactionManagerLocator instance = new TransactionManagerLocator();
-
- /** The transaction manager */
- private TransactionManager tm;
-
- /**
- * No external construction
- */
- private TransactionManagerLocator()
- {
- }
-
- /**
- * Get the the locator
- *
- * @return the locator
- */
- public static TransactionManagerLocator getInstance()
- {
- return instance;
- }
-
- /**
- * Locate the transaction manager
- *
- * @return the transaction manager
- */
- public TransactionManager locate()
- {
- if (tm != null)
- return tm;
-
- TransactionManager result = tryJNDI();
- if (result == null)
- result = usePrivateAPI();
- if (result == null)
- throw new NestedRuntimeException("Unable to locate the transaction manager");
-
- return result;
- }
-
- /**
- * Locate the transaction manager in the well known jndi binding for JBoss
- *
- * @return the tm from jndi
- */
- protected TransactionManager tryJNDI()
- {
- try
- {
- InitialContext ctx = new InitialContext();
- tm = (TransactionManager) ctx.lookup(TransactionManagerService.JNDI_NAME);
- if (log.isTraceEnabled())
- log.trace("Got a transaction manager from jndi " + tm);
- }
- catch (NamingException e)
- {
- log.trace("Unable to lookup: " + TransactionManagerService.JNDI_NAME, e);
- }
- return tm;
- }
-
- /**
- * Use the private api<p>
- *
- * This is a fallback method for non JBossAS use.
- *
- * @return the tm from the private api
- */
- protected TransactionManager usePrivateAPI()
- {
- log.trace("Using the JBoss transaction manager");
- return TxManager.getInstance();
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextFactory.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextFactory.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextFactory.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,61 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.Transaction;
-
-
-/**
- * Implementations of this interface are used for getting
- * a transaction propagation context at the client-side.
- * We need a specific implementation of this interface for
- * each kind of DTM we are going to interoperate with. (So
- * we may have 20 new classes if we are going to interoperate
- * with 20 different kinds of distributed transaction
- * managers.)
- * The reason for having the methods in this interface return
- * Object is that we do not really know what kind of transaction
- * propagation context is returned.
- *
- * @see TransactionPropagationContextImporter
- * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
- * @version $Revision$
- */
-public interface TransactionPropagationContextFactory
-{
- /**
- * Return a transaction propagation context for the transaction
- * currently associated with the invoking thread, or <code>null</code>
- * if the invoking thread is not associated with a transaction.
- */
- public Object getTransactionPropagationContext();
-
- /**
- * Return a transaction propagation context for the transaction
- * given as an argument, or <code>null</code>
- * if the argument is <code>null</code> or of a type unknown to
- * this factory.
- */
- public Object getTransactionPropagationContext(Transaction tx);
-
-}
-
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextImporter.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextImporter.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextImporter.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,49 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.Transaction;
-
-
-/**
- * Implementations of this interface are used for importing a transaction
- * propagation context into the transaction manager.
- *
- * @see TransactionPropagationContextFactory
- * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
- * @version $Revision$
- */
-public interface TransactionPropagationContextImporter
-{
- /**
- * Import the transaction propagation context into the transaction
- * manager, and return the resulting transaction.
- * If this transaction propagation context has already been imported
- * into the transaction manager, this method simply returns the
- * <code>Transaction</code> representing the transaction propagation
- * context in the local VM.
- * Returns <code>null</code> if the transaction propagation context is
- * <code>null</code>, or if it represents a <code>null</code> transaction.
- */
- public Transaction importTransactionPropagationContext(Object tpc);
-}
-
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextUtil.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextUtil.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionPropagationContextUtil.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,96 +0,0 @@
-/*
- * 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.tm;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.Transaction;
-
-/**
- * Comment
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class TransactionPropagationContextUtil
-{
- private static TransactionPropagationContextFactory tpcFactory;
- private static TransactionPropagationContextImporter tpcImporter;
-
- public static TransactionPropagationContextFactory getTPCFactoryClientSide()
- {
- return tpcFactory;
- }
-
- public static TransactionPropagationContextFactory getTPCFactory()
- {
- if (tpcFactory == null)
- {
- try
- {
- InitialContext ctx = new InitialContext();
- // Get the transaction propagation context factory
- tpcFactory = (TransactionPropagationContextFactory)
- ctx.lookup("java:/TransactionPropagationContextExporter");
- }
- catch (NamingException e)
- {
- throw new RuntimeException(e);
- }
- }
- return tpcFactory;
- }
-
- public static void setTPCFactory(TransactionPropagationContextFactory tpcFactory)
- {
- TransactionPropagationContextUtil.tpcFactory = tpcFactory;
- }
-
- public static TransactionPropagationContextImporter getTPCImporter()
- {
- if (tpcImporter == null)
- {
- try
- {
- InitialContext ctx = new InitialContext();
- // and the transaction propagation context importer
- tpcImporter = (TransactionPropagationContextImporter)
- ctx.lookup("java:/TransactionPropagationContextImporter");
- }
- catch (NamingException e)
- {
- throw new RuntimeException(e);
- }
- }
- return tpcImporter;
- }
-
- public static void setTPCImporter(TransactionPropagationContextImporter importer)
- {
- tpcImporter = importer;
- }
-
- public static Transaction importTPC(Object tpc)
- {
- return getTPCImporter().importTransactionPropagationContext(tpc);
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TransactionTimeoutConfiguration.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TransactionTimeoutConfiguration.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TransactionTimeoutConfiguration.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,54 +0,0 @@
-/*
- * 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.tm;
-
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-
-/**
- * The interface to implementated by a transaction manager
- * that supports retrieving the current threads transaction timeout
- *
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- * @version $Revision$
- */
-public interface TransactionTimeoutConfiguration
-{
- /**
- * Get the transaction timeout.
- *
- * @return the timeout in seconds associated with this thread
- * @throws SystemException for any error
- */
- int getTransactionTimeout() throws SystemException;
-
- /**
- * Get the time left before transaction timeout
- *
- * @param errorRollback throw an error if the transaction is marked for rollback
- * @return the remaining in the current transaction or -1
- * if there is no transaction
- * @throws RollbackException if the transaction is marked for rollback and
- * errorRollback is true
- */
- long getTimeLeftBeforeTransactionTimeout(boolean errorRollback) throws RollbackException;
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/TxUtils.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/TxUtils.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/TxUtils.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,396 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.tm;
-
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-
-import org.jboss.util.NestedRuntimeException;
-
-/**
- * TxUtils.java has utility methods for determining transaction status
- * in various useful ways.
- *
- * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @version $Revision$
- */
-public class TxUtils
-{
- /** Transaction Status Strings */
- private static final String[] TxStatusStrings =
- {
- "STATUS_ACTIVE",
- "STATUS_MARKED_ROLLBACK",
- "STATUS_PREPARED",
- "STATUS_COMMITTED",
- "STATUS_ROLLEDBACK",
- "STATUS_UNKNOWN",
- "STATUS_NO_TRANSACTION",
- "STATUS_PREPARING",
- "STATUS_COMMITTING",
- "STATUS_ROLLING_BACK"
- };
-
- /**
- * Do now allow instances of this class
- */
- private TxUtils()
- {
-
- }
-
- public static boolean isActive(Transaction tx)
- {
- if (tx == null)
- return false;
-
- try
- {
- int status = tx.getStatus();
- return isActive(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isActive(TransactionManager tm)
- {
- try
- {
- return isActive(tm.getTransaction());
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isActive(UserTransaction ut)
- {
- try
- {
- int status = ut.getStatus();
- return isActive(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isActive(int status)
- {
- return status == Status.STATUS_ACTIVE;
- }
-
- public static boolean isUncommitted(Transaction tx)
- {
- if (tx == null)
- return false;
-
- try
- {
- int status = tx.getStatus();
- return isUncommitted(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isUncommitted(TransactionManager tm)
- {
- try
- {
- return isUncommitted(tm.getTransaction());
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isUncommitted(UserTransaction ut)
- {
- try
- {
- int status = ut.getStatus();
- return isUncommitted(status);
-
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isUncommitted(int status)
- {
- return status == Status.STATUS_ACTIVE
- || status == Status.STATUS_MARKED_ROLLBACK;
- }
-
- public static boolean isCompleted(Transaction tx)
- {
- if (tx == null)
- return true;
-
- try
- {
- int status = tx.getStatus();
- return isCompleted(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isCompleted(TransactionManager tm)
- {
- try
- {
- return isCompleted(tm.getTransaction());
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isCompleted(UserTransaction ut)
- {
- try
- {
- int status = ut.getStatus();
- return isCompleted(status);
-
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isCompleted(int status)
- {
- return status == Status.STATUS_COMMITTED
- || status == Status.STATUS_ROLLEDBACK
- || status == Status.STATUS_NO_TRANSACTION;
- }
-
- public static boolean isRollback(Transaction tx)
- {
- if (tx == null)
- return false;
-
- try
- {
- int status = tx.getStatus();
- return isRollback(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isRollback(TransactionManager tm)
- {
- try
- {
- return isRollback(tm.getTransaction());
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isRollback(UserTransaction ut)
- {
- try
- {
- int status = ut.getStatus();
- return isRollback(status);
- }
- catch (SystemException error)
- {
- throw new NestedRuntimeException(error);
- }
- }
-
- public static boolean isRollback(int status)
- {
- return status == Status.STATUS_MARKED_ROLLBACK
- || status == Status.STATUS_ROLLING_BACK
- || status == Status.STATUS_ROLLEDBACK;
- }
-
- /**
- * Converts a tx Status index to a String
- *
- * @see javax.transaction.Status
- *
- * @param status the Status index
- * @return status as String or "STATUS_INVALID(value)"
- */
- public static String getStatusAsString(int status)
- {
- if (status >= Status.STATUS_ACTIVE && status <= Status.STATUS_ROLLING_BACK)
- {
- return TxStatusStrings[status];
- }
- else
- {
- return "STATUS_INVALID(" + status + ")";
- }
- }
-
- /**
- * Converts a XAResource flag to a String
- *
- * @see javax.transaction.xa.XAResource
- *
- * @param flags the flags passed in to start(), end(), recover()
- * @return the flags in String form
- */
- public static String getXAResourceFlagsAsString(int flags)
- {
- if (flags == XAResource.TMNOFLAGS)
- {
- return "|TMNOFLAGS";
- }
- else
- {
- StringBuffer sbuf = new StringBuffer(64);
-
- if ((flags & XAResource.TMONEPHASE) != 0)
- {
- sbuf.append("|TMONEPHASE");
- }
- if ((flags & XAResource.TMJOIN) != 0)
- {
- sbuf.append("|TMJOIN");
- }
- if ((flags & XAResource.TMRESUME) != 0)
- {
- sbuf.append("|TMRESUME");
- }
- if ((flags & XAResource.TMSUCCESS) != 0)
- {
- sbuf.append("|TMSUCCESS");
- }
- if ((flags & XAResource.TMFAIL) != 0)
- {
- sbuf.append("|TMFAIL");
- }
- if ((flags & XAResource.TMSUSPEND) != 0)
- {
- sbuf.append("|TMSUSPEND");
- }
- if ((flags & XAResource.TMSTARTRSCAN) != 0)
- {
- sbuf.append("|TMSTARTRSCAN");
- }
- if ((flags & XAResource.TMENDRSCAN) != 0)
- {
- sbuf.append("|TMENDRSCAN");
- }
- return sbuf.toString();
- }
- }
-
- /**
- * Converts a XAException error code to a string.
- *
- * @see javax.transaction.xa.XAException
- *
- * @param errorCode an XAException error code
- * @return the error code in String form.
- *
- */
- public static String getXAErrorCodeAsString(int errorCode)
- {
- switch (errorCode)
- {
- case XAException.XA_HEURCOM:
- return "XA_HEURCOM";
- case XAException.XA_HEURHAZ:
- return "XA_HEURHAZ";
- case XAException.XA_HEURMIX:
- return "XA_HEURMIX";
- case XAException.XA_HEURRB:
- return "XA_HEURRB";
- case XAException.XA_NOMIGRATE:
- return "XA_NOMIGRATE";
- case XAException.XA_RBCOMMFAIL:
- return "XA_RBCOMMFAIL";
- case XAException.XA_RBDEADLOCK:
- return "XA_RBDEADLOCK";
- case XAException.XA_RBINTEGRITY:
- return "XA_RBINTEGRITY";
- case XAException.XA_RBOTHER:
- return "XA_RBOTHER";
- case XAException.XA_RBPROTO:
- return "XA_RBPROTO";
- case XAException.XA_RBROLLBACK:
- return "XA_RBROLLBACK";
- case XAException.XA_RBTIMEOUT:
- return "XA_RBTIMEOUT";
- case XAException.XA_RBTRANSIENT:
- return "XA_RBTRANSIENT";
- case XAException.XA_RDONLY:
- return "XA_RDONLY";
- case XAException.XA_RETRY:
- return "XA_RETRY";
- case XAException.XAER_ASYNC:
- return "XAER_ASYNC";
- case XAException.XAER_DUPID:
- return "XAER_DUPID";
- case XAException.XAER_INVAL:
- return "XAER_INVAL";
- case XAException.XAER_NOTA:
- return "XAER_NOTA";
- case XAException.XAER_OUTSIDE:
- return "XAER_OUTSIDE";
- case XAException.XAER_PROTO:
- return "XAER_PROTO";
- case XAException.XAER_RMERR:
- return "XAER_RMERR";
- case XAException.XAER_RMFAIL:
- return "XAER_RMFAIL";
- default:
- return "XA_UNKNOWN(" + errorCode + ")";
- }
- }
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/XAExceptionFormatter.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/XAExceptionFormatter.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/XAExceptionFormatter.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,42 +0,0 @@
-/*
- * 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.tm;
-
-import org.jboss.logging.Logger;
-import javax.transaction.xa.XAException;
-
-/**
- * XAExceptionFormatter
- *
- * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
- * @version $Revision$
- */
-public interface XAExceptionFormatter
-{
- /**
- * Format the exception and log it
- *
- * @param xae the exception
- * @param log the log
- */
- void formatXAException(XAException xae, Logger log);
-}
Deleted: trunk/transaction/src/main/org/jboss/tm/usertx/client/ServerVMClientUserTransaction.java
===================================================================
--- trunk/transaction/src/main/org/jboss/tm/usertx/client/ServerVMClientUserTransaction.java 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/transaction/src/main/org/jboss/tm/usertx/client/ServerVMClientUserTransaction.java 2007-07-04 18:32:32 UTC (rev 63828)
@@ -1,174 +0,0 @@
-/*
- * 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.tm.usertx.client;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.Iterator;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-
-/**
- * The client-side UserTransaction implementation for clients
- * operating in the same VM as the server.
- * This will delegate all UserTransaction calls to the
- * <code>TransactionManager</code> of the server.
- *
- * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
- * @version $Revision$
- */
-public class ServerVMClientUserTransaction
- implements UserTransaction
-{
- // Static --------------------------------------------------------
-
- /**
- * Our singleton instance.
- */
- private final static ServerVMClientUserTransaction singleton = new ServerVMClientUserTransaction();
-
-
- /**
- * The <code>TransactionManagerz</code> we delegate to.
- */
- private final TransactionManager tm;
-
-
- private final Collection listeners = new ArrayList();
-
- /**
- * Return a reference to the singleton instance.
- */
- public static ServerVMClientUserTransaction getSingleton()
- {
- return singleton;
- }
-
-
- // Constructors --------------------------------------------------
-
- /**
- * Create a new instance.
- */
- private ServerVMClientUserTransaction()
- {
- // Lookup the local TM
- TransactionManager local = null;
- try {
- local = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
-
- } catch (NamingException ex)
- {
- //throw new RuntimeException("TransactionManager not found: " + ex);
- }
- tm = local;
- }
- //public constructor for TESTING ONLY
- public ServerVMClientUserTransaction(final TransactionManager tm)
- {
- this.tm = tm;
- }
-
- // Public --------------------------------------------------------
-
- //Registration for TransactionStartedListeners.
-
- public void registerTxStartedListener(UserTransactionStartedListener txStartedListener)
- {
- listeners.add(txStartedListener);
- }
-
- public void unregisterTxStartedListener(UserTransactionStartedListener txStartedListener)
- {
- listeners.remove(txStartedListener);
- }
-
- //
- // implements interface UserTransaction
- //
-
- public void begin()
- throws NotSupportedException, SystemException
- {
- tm.begin();
- for (Iterator i = listeners.iterator(); i.hasNext(); )
- {
- ((UserTransactionStartedListener)i.next()).userTransactionStarted();
- } // end of for ()
-
- }
-
- public void commit()
- throws RollbackException,
- HeuristicMixedException,
- HeuristicRollbackException,
- SecurityException,
- IllegalStateException,
- SystemException
- {
- tm.commit();
- }
-
- public void rollback()
- throws SecurityException,
- IllegalStateException,
- SystemException
- {
- tm.rollback();
- }
-
- public void setRollbackOnly()
- throws IllegalStateException,
- SystemException
- {
- tm.setRollbackOnly();
- }
-
- public int getStatus()
- throws SystemException
- {
- return tm.getStatus();
- }
-
- public void setTransactionTimeout(int seconds)
- throws SystemException
- {
- tm.setTransactionTimeout(seconds);
- }
-
- public interface UserTransactionStartedListener extends EventListener
- {
- void userTransactionStarted() throws SystemException;
- }
-
-
-}
Modified: trunk/varia/.classpath
===================================================================
--- trunk/varia/.classpath 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/varia/.classpath 2007-07-04 18:32:32 UTC (rev 63828)
@@ -8,7 +8,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
<classpathentry kind="src" path="/cluster"/>
<classpathentry kind="src" path="/server"/>
- <classpathentry kind="src" path="/transaction"/>
<classpathentry kind="src" path="/naming"/>
<classpathentry kind="lib" path="/thirdparty/apache-bsf/lib/bsf.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
@@ -39,5 +38,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/beanshell/lib/bsh.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/varia/build.xml
===================================================================
--- trunk/varia/build.xml 2007-07-04 17:42:26 UTC (rev 63827)
+++ trunk/varia/build.xml 2007-07-04 18:32:32 UTC (rev 63828)
@@ -94,6 +94,7 @@
<path refid="jboss.microcontainer.classpath"/>
<path refid="jboss.jbossws.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.integration.classpath"/>
</path>
<!-- ======= -->
@@ -116,7 +117,6 @@
<path refid="jboss.naming.classpath"/>
<path refid="jboss.server.classpath"/>
<path refid="jboss.security.classpath"/>
- <path refid="jboss.transaction.classpath"/>
<path refid="jboss.mq.classpath"/>
</path>
More information about the jboss-cvs-commits
mailing list