Mail Archive Home | gotm-commits List | July 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Monday, July 18, 2005 @ 09:30:05
Author: rouvoy
Path: /cvsroot/gotm/gotm-jts
Added: examples/junit/.cvsignore examples/junit/build.xml
examples/junit/lib/commons/commons-logging.jar
examples/junit/lib/junit/junit.jar
examples/junit/src/cfg/log4j.properties
examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
examples/junit/src/java/org/objectweb/jts/tck/JtsTest.java
examples/junit/src/java/org/objectweb/jts/tck/LocalTestCase.java
examples/junit/src/java/org/objectweb/jts/tck/Trace.java
examples/junit/src/java/org/objectweb/jts/tck/xa/XABoolean.java
examples/junit/src/java/org/objectweb/jts/tck/xa/XAInteger.java
examples/junit/src/java/org/objectweb/jts/tck/xa/XAObject.java
src/java/org/objectweb/gotm/lib/JtsFactory.java
src/java/org/objectweb/gotm/lib/jta/Suspendable.java
Modified: .classpath .settings/org.eclipse.core.resources.prefs
examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java
src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal
src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java
Removed:
examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal
test/java/org/objectweb/gotm/jts/xa/XABoolean.java
test/java/org/objectweb/gotm/jts/xa/XAInteger.java
test/java/org/objectweb/gotm/jts/xa/XAObject.java
* Adding support for JTS compatibility,
* Introducing Local JTS JUnit tests as an example.
-------------------------------------------------------------------------------+
.classpath
| 6
.settings/org.eclipse.core.resources.prefs
| 2
examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java
| 13
examples/junit/.cvsignore
| 1
examples/junit/build.xml
| 94 +
examples/junit/lib/commons/commons-logging.jar
| <<Binary file>>
examples/junit/lib/junit/junit.jar
| <<Binary file>>
examples/junit/src/cfg/log4j.properties
| 45
examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
| 63
examples/junit/src/java/org/objectweb/jts/tck/JtsTest.java
| 76
examples/junit/src/java/org/objectweb/jts/tck/LocalTestCase.java
| 781 ++++++++++
examples/junit/src/java/org/objectweb/jts/tck/Trace.java
| 74
examples/junit/src/java/org/objectweb/jts/tck/xa/XABoolean.java
| 93 +
examples/junit/src/java/org/objectweb/jts/tck/xa/XAInteger.java
| 93 +
examples/junit/src/java/org/objectweb/jts/tck/xa/XAObject.java
| 378 ++++
examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
| 14
src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal
| 4
src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal
| 57
src/java/org/objectweb/gotm/lib/JtsFactory.java
| 55
src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
| 9
src/java/org/objectweb/gotm/lib/jta/Suspendable.java
| 53
src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
| 16
src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
| 67
src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
| 157 +-
src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java
| 84 -
test/java/org/objectweb/gotm/jts/xa/XABoolean.java
| 93 -
test/java/org/objectweb/gotm/jts/xa/XAInteger.java
| 93 -
test/java/org/objectweb/gotm/jts/xa/XAObject.java
| 371 ----
28 files changed, 2039 insertions(+), 753 deletions(-)
Index: gotm-jts/.classpath
diff -u gotm-jts/.classpath:1.9 gotm-jts/.classpath:1.10
--- gotm-jts/.classpath:1.9 Mon Jul 11 10:27:09 2005
+++ gotm-jts/.classpath Mon Jul 18 09:30:05 2005
@@ -4,9 +4,9 @@
<classpathentry kind="src" path="src/fractal"/>
<classpathentry kind="src" path="examples/benchmark/src/fractal"/>
<classpathentry kind="src" path="examples/benchmark/src/java"/>
+ <classpathentry kind="src" path="examples/junit/src/java"/>
<classpathentry kind="src" path="examples/local/src/fractal"/>
<classpathentry kind="src" path="examples/local/src/java"/>
- <classpathentry kind="src" path="test/java"/>
<classpathentry kind="src" path="/ow-transaction"/>
<classpathentry kind="src" path="/gotm"/>
<classpathentry kind="src" path="/gotm-explorer"/>
@@ -15,12 +15,14 @@
<classpathentry kind="lib" path="lib/jta/jta-1_01.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/fractal/fractal.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/utils/ow_util_trace.jar"/>
- <classpathentry kind="lib"
path="/fractal-import/lib/fractal-adl/fractal-adl.jar"/>
+ <classpathentry
sourcepath="D:/rouvoy/Mes-workspaces/gotm-workspace/julia/src" kind="lib"
path="/fractal-import/lib/fractal-adl/fractal-adl.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/monolog/ow_monolog.jar"/>
<classpathentry kind="src" path="/fractal-template"/>
<classpathentry kind="lib"
path="/fractal-import/lib/fractal-explorer/browser.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/fractal-explorer/fractal-browser.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/fractal-explorer/fractal-plugin.jar"/>
<classpathentry kind="lib"
path="examples/benchmark/lib/jotm/jotm.jar"/>
+ <classpathentry kind="lib"
path="examples/junit/lib/commons/commons-logging.jar"/>
+ <classpathentry kind="lib" path="examples/junit/lib/junit/junit.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Index: gotm-jts/.settings/org.eclipse.core.resources.prefs
diff -u gotm-jts/.settings/org.eclipse.core.resources.prefs:1.7
gotm-jts/.settings/org.eclipse.core.resources.prefs:1.8
--- gotm-jts/.settings/org.eclipse.core.resources.prefs:1.7 Mon Jul 11
10:27:08 2005
+++ gotm-jts/.settings/org.eclipse.core.resources.prefs Mon Jul 18 09:30:05
2005
@@ -1,4 +1,4 @@
-#Tue Jul 05 11:19:09 CEST 2005
+#Mon Jul 11 15:24:14 CEST 2005
eclipse.preferences.version=1
encoding//examples/benchmark/src/fractal/org/objectweb/gotm/jts/benchmark/FcApplication.fractal=ISO-8859-1
encoding//examples/benchmark/src/fractal/org/objectweb/gotm/jts/benchmark/FcExplorer.fractal=ISO-8859-1
Index:
gotm-jts/examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java
diff -u
gotm-jts/examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java:1.1
gotm-jts/examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java:1.2
---
gotm-jts/examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java:1.1
Tue Jun 28 10:02:28 2005
+++
gotm-jts/examples/benchmark/src/java/org/objectweb/gotm/jts/benchmark/tools/Serie.java
Mon Jul 18 09:30:04 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: Serie.java,v 1.1 2005/06/28 08:02:28 rouvoy Exp $
+$Id: Serie.java,v 1.2 2005/07/18 07:30:04 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.jts.benchmark.tools;
@@ -33,8 +33,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 21 janv. 2005
- * @modified $Date: 2005/06/28 08:02:28 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.2 $
*/
public class Serie {
private final Vector data ;
@@ -83,12 +83,13 @@
public String toString() {
StringBuffer buffer = new StringBuffer(this.topic+": ");
SerieVisitor v = new SerieMin();
-// accept(v);
-// v.setName(" MIN");
-// buffer.append(v.compute().values());
v = new SerieAverage();
accept(v);
v.setName(" AVG");
+ buffer.append(v.compute().values());
+ v = new SerieMin();
+ accept(v);
+ v.setName(" MIN");
buffer.append(v.compute().values());
v = new SerieMax();
accept(v);
Index: gotm-jts/examples/junit/.cvsignore
diff -u /dev/null gotm-jts/examples/junit/.cvsignore:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/.cvsignore Mon Jul 18 09:30:04 2005
@@ -0,0 +1 @@
+output
Index: gotm-jts/examples/junit/build.xml
diff -u /dev/null gotm-jts/examples/junit/build.xml:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/build.xml Mon Jul 18 09:30:04 2005
@@ -0,0 +1,94 @@
+<!-- ==================================================================== -->
+
+<!-- ObjectWeb GoTM is an open Tx Monitor Project -->
+<!-- Contact: http://www.objectweb.org -->
+
+<!-- This library 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 any later version. -->
+
+<!-- This library 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 library; if not, write to the Free Software -->
+<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -->
+<!-- USA -->
+
+<!-- Initial developer(s): Romain Rouvoy. -->
+<!-- Contributor(s): ______________________________________. -->
+
+<!-- $Id: build.xml,v 1.1 2005/07/18 07:30:04 rouvoy Exp $ -->
+<!-- ==================================================================== -->
+
+<project name="JTS JUnit" default="all">
+ <description>GoTM JTS JUnit [gotm.objectweb.org] - GoTM is an open
Transaction Monitor</description>
+
+ <!-- ==================== -->
+ <!-- PROPERTY DEFINITIONS -->
+ <!-- ==================== -->
+ <import file="${basedir}/../../../fractal-import/build.xml" />
+ <property name="examples.jar" value="ow_gotm_jts_junit.jar" />
+ <property name="examples.version" value="0.1" />
+ <property name="dist.name" value="GoTM-JTS-JUnit" />
+
+ <!-- ================ -->
+ <!-- PATH DEFINITIONS -->
+ <!-- ================ -->
+ <path id="classpath">
+ <fileset dir="${build.dir}/${lib.dir}" includes="**/*.jar" />
+ </path>
+
+ <!-- ================== -->
+ <!-- TARGET DEFINITIONS -->
+ <!-- ================== -->
+ <target name="all" description="clean + execute">
+ <antcall target="clean" />
+ <antcall target="execute" />
+ </target>
+
+ <target name="-junit-prepare" >
+ <copy todir="${build.dir}/${lib.dir}">
+ <mapper type="flatten"/>
+ <fileset dir="${basedir}/${lib.dir}" includes="**/*.*"/>
+ </copy>
+ </target>
+
+ <target name="junit-compile" depends="-gotm.jts,-junit-prepare">
+ <mkdir dir="${build.dir}/${class.dir}" />
+ <java.c srcdir="${basedir}/${src.dir}/${java.dir}" />
+<!-- <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${src.dir}/${cfg.dir}"
includes="*.properties"/>
+ </copy>-->
+ </target>
+
+ <target name="junit-build" depends="junit-compile,fractal-adl">
+ <mkdir dir="${build.dir}/${lib.dir}" />
+ <jar destfile="${build.dir}/${lib.dir}/${examples.jar}">
+ <fileset dir="${build.dir}/${class.dir}" includes="**/*.*" />
+ </jar>
+ </target>
+
+ <target name="import" depends="junit-build,clear" />
+
+ <target name="execute" depends="import" description="Run JUnit Tests">
+ <property name="julia.cfg" value="${build.dir}/${lib.dir}/julia.cfg" />
+ <property name="cache.cfg" value="${build.dir}/${lib.dir}/cache.cfg" />
+
+ <junit fork="yes" haltonfailure="no" haltonerror="no">
+ <classpath refid="classpath"/>
+ <formatter type="brief" usefile="no"/>
+ <sysproperty key="fractal.provider"
+ value="org.objectweb.fractal.julia.Julia"/>
+ <sysproperty key="julia.loader"
+ value="org.objectweb.fractal.julia.loader.DynamicLoader" />
+ <sysproperty key="julia.config"
+ value="${julia.cfg},${cache.cfg}" />
+
+ <test name="org.objectweb.gotm.jts.tck.GoTMLocalTestCase"/>
+ </junit>
+ </target>
+</project>
\ No newline at end of file
Index: gotm-jts/examples/junit/lib/commons/commons-logging.jar
cvs rdiff: failed to read diff file header /tmp/cvsUb2w1a for
commons-logging.jar,v: end of file
Index: gotm-jts/examples/junit/lib/junit/junit.jar
cvs rdiff: failed to read diff file header /tmp/cvsDWUH6b for junit.jar,v:
end of file
Index: gotm-jts/examples/junit/src/cfg/log4j.properties
diff -u /dev/null gotm-jts/examples/junit/src/cfg/log4j.properties:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/cfg/log4j.properties Mon Jul 18 09:30:05
2005
@@ -0,0 +1,45 @@
+##########################
+# Log configuration file #
+##########################
+
+# $Id: log4j.properties,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+
+# Set the options for the Console appender.
+# Console's layout is a PatternLayout, using the conversion pattern
+# %d: current date in ISO8601 format
+# %c: category name
+# %p: priority of the logging event
+# %m: the message
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d %c{1} %p - %m\n
+
+log4j.appender.Requests=org.apache.log4j.RollingFileAppender
+log4j.appender.Requests.File=jotm.log
+log4j.appender.Requests.MaxFileSize=100MB
+log4j.appender.Requests.MaxBackupIndex=5
+log4j.appender.Requests.layout=org.apache.log4j.PatternLayout
+log4j.appender.Requests.layout.ConversionPattern=%10r [%-5c{1}] %7p -
%C{1}.%M(%L) : %m\n
+
+# Root logger set to ERROR using the Console appender defined above.
+log4j.rootLogger=INFO, Console
+
+######################
+# Logger definitions #
+######################
+
+# JOTM #
+log4j.logger.org.objectweb.gotm=DEBUG, Requests
+log4j.additivity.org.objectweb.gotm=false
+
+log4j.logger.org.objectweb.gotm.jta.=DEBUG, Requests
+log4j.additivity.org.objectweb.gotm.jta=false
+
+log4j.logger.org.objectweb.gotm.recovery=DEBUG, Requests
+log4j.additivity.org.objectweb.gotm.recovery=false
+
+log4j.logger.org.objectweb.gotm.junit=DEBUG, Requests
+log4j.additivity.org.objectweb.gotm.junit=false
+
+log4j.logger.org.objectweb.gotm.tests.xaobj=DEBUG, Requests
+log4j.additivity.org.objectweb.gotm.tests.xaobj=false
\ No newline at end of file
Index:
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
Mon Jul 18 09:30:05 2005
@@ -0,0 +1,63 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library 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 any later version.
+
+This library 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 library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: GoTMLocalTestCase.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.jts.tck;
+
+import java.util.HashMap;
+
+import javax.transaction.TransactionManager;
+
+import org.objectweb.gotm.lib.JtsFactory;
+import org.objectweb.jts.tck.LocalTestCase;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 12 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:05 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public class GoTMLocalTestCase
+ extends LocalTestCase {
+
+ private static TransactionManager gotm = JtsFactory.create(new
HashMap());
+
+ /**
+ * @param name the name of the test to execute.
+ */
+ public GoTMLocalTestCase(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ setTransactionManager(gotm);
+ }
+}
\ No newline at end of file
Index: gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/JtsTest.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/JtsTest.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/JtsTest.java Mon
Jul 18 09:30:05 2005
@@ -0,0 +1,76 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library 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 any later version.
+
+This library 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 library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: JtsTest.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+====================================================================*/
+package org.objectweb.jts.tck;
+
+import javax.transaction.TransactionManager;
+
+import junit.framework.TestCase;
+
+/**
+ * Generic Test Case for JTS.
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 12 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:05 $
+ * @version $Revision: 1.1 $
+ */
+public class JtsTest
+ extends TestCase {
+
+ /**
+ * @param name
+ */
+ public JtsTest(String name) {
+ super(name);
+ }
+
+ /** <code>transactionManager</code> instance of transaction manager to
test. */
+ protected TransactionManager transactionManager = null;
+
+ /**
+ * @param tm the transaction manager to test.
+ */
+ public void setTransactionManager(TransactionManager tm) {
+ this.transactionManager = tm;
+ }
+
+ /**
+ * @return the transaction manager to test.
+ */
+ public TransactionManager getTransactionManager() {
+ return this.transactionManager;
+ }
+
+ /**
+ * Compares the current transaction status with the parameter.
+ * @param s the status to compare.
+ * @throws Exception assertion failed.
+ */
+ public void assertStatus(int s) throws Exception {
+ assertEquals("Transaction
status",s,getTransactionManager().getStatus());
+ }
+}
\ No newline at end of file
Index:
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/LocalTestCase.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/LocalTestCase.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/LocalTestCase.java
Mon Jul 18 09:30:05 2005
@@ -0,0 +1,781 @@
+/*
+ * @(#) LocalTestCase.java
+ *
+ * JOTM: Java Open Transaction Manager
+ *
+ *
+ * This module was orginally developed by
+ *
+ * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
+ * (http://www.objectweb.org)
+ *
+ * --------------------------------------------------------------------------
+ * The original code and portions created by INRIA are
+ * Copyright (c) 2001 INRIA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
met:
+ *
+ * -Redistributions of source code must retain the above copyright notice,
this
+ * list of conditions and the following disclaimer.
+ *
+ * -Redistributions in binary form must reproduce the above copyright
notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * --------------------------------------------------------------------------
+ * Contributor(s):
+ *
+ * @author Christophe Ney
+ * Created on Oct 15, 2001
+
*-----------------------------------------------------------------------------
+ * $Id: LocalTestCase.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+
*-----------------------------------------------------------------------------
+ */
+package org.objectweb.jts.tck;
+
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.objectweb.jts.tck.xa.XAInteger;
+
+/**
+ * A test case of the JTS transaction manager in a local configuration: The
+ * transaction factory is local and all calls are made from the JVM.
+ *
+ * @created 12 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:05 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public class LocalTestCase
+ extends JtsTest {
+
+ /**
+ * Default constructor.
+ *
+ * @param name
+ * method name of the test to execute.
+ */
+ public LocalTestCase(String name) {
+ super(name);
+ }
+
+
+ //
*************************************************************************
+ // JUnit JTS Transaction Manager Empty Tests
+ //
*************************************************************************
+
+ /**
+ * testing sucessful one phase commit.
+ *
+ * @throws Exception
+ * exception thrown by the transaction manager.
+ */
+ public void testEmptyCommit() throws Exception {
+ System.err.println("--> testEmptyCommit");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptyCommit");
+ }
+
+ /**
+ * testing sucessful one phase rollback
+ *
+ * @throws Exception
+ */
+ public void testEmptyRollback() throws Exception {
+ System.err.println("--> testEmptyRollback");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.rollback();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptyRollback");
+ }
+
+ /**
+ * testing sucessful one phase rollback
+ *
+ * @throws Exception
+ */
+ public void testEmptyRollbackOnly() throws Exception {
+ System.err.println("--> testEmptyRollbackOnly");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.setRollbackOnly();
+ assertStatus(Status.STATUS_MARKED_ROLLBACK);
+ try {
+ tm.commit();
+ fail("A RollbackException should be raised! (cf JTA commit
operation specification)");
+ }catch(RollbackException e) {
+ // normal behavior
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptyRollbackOnly");
+ }
+ }
+
+ /**
+ * testing sucessful one phase suspend resume
+ *
+ * @throws Exception
+ */
+ public void testEmptySuspendResume() throws Exception {
+ System.err.println("--> testEmptySuspendResume");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Transaction t1 = tm.getTransaction();
+ tm.suspend();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.resume(t1);
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptySuspendResume");
+ }
+
+ /**
+ * testing one phase commit timeout
+ *
+ * @throws Exception
+ */
+ public void testEmptyCommitTimeout() throws Exception {
+ System.err.println("--> testEmptyCommitTimeout");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ try {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(5);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ long start = System.currentTimeMillis();
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ long delta = System.currentTimeMillis() - start;
+ if (delta < 4000) {
+ Thread.sleep(4000 - delta); // wait till 4s before commit
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ } else {
+ fail("Failed to run timeout test in given time");
+ }
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(0); // timeout set to default
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptyCommitTimeout");
+ }
+ }
+
+ /**
+ * testing one phase commit timeout failure
+ *
+ * @throws Exception
+ */
+ public void testEmptyCommitTimeoutFailure() throws Exception {
+ System.err.println("--> testEmptyCommitTimeoutFailure");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ try {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(5); // timeout after 5 second
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Thread.sleep(6000); // sleep 6 sec
+ try {
+ assertStatus(Status.STATUS_ROLLEDBACK);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ } catch (RollbackException e) {
+ return;
+ }
+ fail("Transaction timeout should have expired");
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(0); // timeout set to default
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ System.err.println("<-- testEmptyCommitTimeoutFailure");
+ }
+ }
+
+
+ //
*************************************************************************
+ // JUnit JTS Transaction Manager 1PC Tests
+ //
*************************************************************************
+
+ /**
+ * testing sucessful one phase commit
+ *
+ * @throws Exception
+ */
+ public void test1PCCommit() throws Exception {
+ System.err.println("--> test1PCCommit");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ assertEquals("Initial persisted state", 1,
b1.getPersistentInteger());
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ b1.setCurrentInteger(2);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 2,
b1.getPersistentInteger());
+ System.err.println("<-- test1PCCommit");
+ }
+
+ /**
+ * testing unsucessful one phase commit
+ *
+ * @throws Exception
+ */
+ public void test1PCCommitFailure() throws Exception {
+ System.err.println("--> test1PCCommitFailure");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1, true);
+ assertEquals("Initial persisted state", 1,
b1.getPersistentInteger());
+ // commit fails
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ b1.setCurrentInteger(2);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ try {
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ fail("An HeuristicRollbackException exception should be raised!
(cf JTA commit operation specification)");
+ } catch (HeuristicRollbackException e) {
+ // normal behavior
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 1, b1
+ .getPersistentInteger());
+ System.err.println("<-- test1PCCommitFailure");
+ }
+ }
+
+ /**
+ * testing one phase commit timeout
+ *
+ * @throws Exception
+ */
+ public void test1PCCommitTimeout() throws Exception {
+ System.err.println("--> test1PCCommitTimeout");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ try {
+ tm.setTransactionTimeout(5); // timeout after 5 second
+ XAInteger b1 = new XAInteger(1);
+ assertEquals("Initial persisted state", 1, b1
+ .getPersistentInteger());
+ long start = System.currentTimeMillis();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ b1.setCurrentInteger(2);
+ long delta = System.currentTimeMillis() - start;
+ if (delta < 4000) {
+ Thread.sleep(4000 - delta); // wait till 4s before commit
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ } else {
+ fail("Failed to run timeout test in given time");
+ }
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(0); // timeout set to default
+ System.err.println("<-- test1PCCommitTimeout");
+ }
+ }
+
+ /**
+ * testing one phase commit timeout failure
+ *
+ * @throws Exception
+ */
+ public void test1PCCommitTimeoutFailure() throws Exception {
+ System.err.println("--> test1PCCommitTimeoutFailure");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ try {
+ tm.setTransactionTimeout(5); // timeout after 5 second
+ XAInteger b1 = new XAInteger(1);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ b1.setCurrentInteger(3);
+ Thread.sleep(6000); // sleep 6 sec
+ try {
+ assertStatus(Status.STATUS_ROLLEDBACK);
+ tm.commit();
+ fail("A RollbackException should be raised! (cf JTA commit
operation specification)");
+ } catch (RollbackException e) {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit with timeout", 1,
b1
+ .getPersistentInteger());
+ return;
+ }
+ fail("Transaction timeout should have expired");
+ } finally {
+ tm.setTransactionTimeout(0); // timeout set to default
+ System.err.println("<-- test1PCCommitTimeoutFailure");
+ }
+ }
+
+ /**
+ * testing sucessful one phase rollback
+ *
+ * @throws Exception
+ */
+ public void test1PCRollback() throws Exception {
+ System.err.println("--> test1PCRollback");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ b1.setCurrentInteger(2);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.rollback();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 1, b1
+ .getPersistentInteger());
+ System.err.println("<-- test1PCRollback");
+ }
+
+ /**
+ * testing sucessful one phase suspend resume
+ *
+ * @throws Exception
+ */
+ public void test1PCSuspendResume() throws Exception {
+ System.err.println("--> test1PCSuspendResume");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Transaction t1 = tm.getTransaction();
+ t1.enlistResource(b1);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ b1.setCurrentInteger(2);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.suspend();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after suspend", 1, b1
+ .getPersistentInteger());
+ // commit after a suspend and before a resume
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Transaction t2 = tm.getTransaction();
+ t2.enlistResource(b1);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ b1.setCurrentInteger(3);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 3, b1
+ .getPersistentInteger());
+ // resume
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.resume(t1);
+ assertStatus(Status.STATUS_ACTIVE);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 2, b1
+ .getPersistentInteger());
+ System.err.println("<-- test1PCSuspendResume");
+ }
+
+ /**
+ * @throws Exception
+ */
+ public void test1PCRollbackOnlyEnlistResource() throws Exception {
+ System.err.println("--> test1PCRollbackOnlyEnlistResource");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.setRollbackOnly();
+ assertStatus(Status.STATUS_MARKED_ROLLBACK);
+ try {
+ tm.getTransaction().enlistResource(b1);
+ fail("should throw a RollbackException");
+ } catch (RollbackException e) {
+ // ignored
+ }
+ tm.rollback();
+ System.err.println("<-- test1PCRollbackOnlyEnlistResource");
+ }
+
+ /**
+ * testing sucessful two phase commit
+ *
+ * @throws Exception
+ */
+ public void test2PCCommit() throws Exception {
+ System.err.println("--> test2PCCommit");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ XAInteger b10 = new XAInteger(10);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ tm.getTransaction().enlistResource(b10);
+ b1.setCurrentInteger(2);
+ b10.setCurrentInteger(20);
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 2, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit", 20, b10
+ .getPersistentInteger());
+ System.err.println("<-- test2PCCommit");
+ }
+
+ /**
+ * testing sucessful two phase rollback
+ *
+ * @throws Exception
+ */
+ public void test2PCRollback() throws Exception {
+ System.err.println("--> test2PCRollback");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ XAInteger b10 = new XAInteger(10);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ tm.getTransaction().enlistResource(b10);
+ b1.setCurrentInteger(2);
+ b10.setCurrentInteger(20);
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.rollback();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 1, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit", 10, b10
+ .getPersistentInteger());
+ System.err.println("<-- test2PCRollback");
+ }
+
+ /**
+ * testing sucessful two phase suspend resume
+ *
+ * @throws Exception
+ */
+ public void test2PCSuspendResume() throws Exception {
+ System.err.println("--> test2PCSuspendResume");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ XAInteger b10 = new XAInteger(10);
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Transaction t1 = tm.getTransaction();
+ t1.enlistResource(b1);
+ t1.enlistResource(b10);
+ b1.setCurrentInteger(2);
+ b10.setCurrentInteger(20);
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.suspend();
+ assertEquals("persisted state after suspend", 1, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after suspend", 10, b10
+ .getPersistentInteger());
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ Transaction t2 = tm.getTransaction();
+ t2.enlistResource(b1);
+ t2.enlistResource(b10);
+ assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ assertTrue("XA resource should not be dirty ", !b10.isDirty());
+ b1.setCurrentInteger(3);
+ b10.setCurrentInteger(30);
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 3, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit", 30, b10
+ .getPersistentInteger());
+ // resume
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.resume(t1);
+ assertTrue("XA resource should be dirty ", b1.isDirty());
+ assertTrue("XA resource should be dirty ", b10.isDirty());
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 2, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit", 20, b10
+ .getPersistentInteger());
+ System.err.println("<-- test2PCSuspendResume");
+ }
+
+ /**
+ * testing unsucessful two phase commit
+ *
+ * @throws Exception
+ */
+ public void test2PCCommitFailure() throws Exception {
+ System.err.println("--> test2PCCommitFailure");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ XAInteger b1 = new XAInteger(1);
+ XAInteger b10 = new XAInteger(10, true); // fails on commit
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ tm.getTransaction().enlistResource(b10);
+ b1.setCurrentInteger(2);
+ b10.setCurrentInteger(20);
+ try {
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.commit();
+ fail("A rollback exception should have been raised");
+ } catch (HeuristicRollbackException e) {
+ return; // a rollback exception should have been raised
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit", 1, b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit", 10, b10
+ .getPersistentInteger());
+ System.err.println("<-- test2PCCommitFailure");
+ }
+ }
+
+ /**
+ * testing two phase commit timeout
+ *
+ * @throws Exception
+ */
+ public void test2PCCommitTimeout() throws Exception {
+ System.err.println("--> test2PCCommitTimeout");
+ TransactionManager tm = getTransactionManager();
+ assertNotNull(tm);
+ try {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(5); // timeout after 5 second
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ XAInteger b1 = new XAInteger(1);
+ XAInteger b10 = new XAInteger(10);
+ assertEquals("Initial persisted state", 1, b1
+ .getPersistentInteger());
+ assertEquals("Initial persisted state", 10, b10
+ .getPersistentInteger());
+ // commit
+ long start = System.currentTimeMillis();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ tm.getTransaction().enlistResource(b10);
+// System.err.println("b1: "+b1);
+// System.err.println("b10: "+b1);
+ b1.setCurrentInteger(2);
+ b10.setCurrentInteger(20);
+// System.err.println("b1: "+b1);
+// System.err.println("b10: "+b1);
+ assertStatus(Status.STATUS_ACTIVE);
+ long delta = System.currentTimeMillis() - start;
+ if (delta < 4000) {
+ Thread.sleep(4000 - delta); // wait till 4s before commit
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ assertEquals("persisted state after commit with timeout", 2,
b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit with timeout", 20,
+ b10.getPersistentInteger());
+ } else {
+ fail("Failed to run timeout test in given time");
+ }
+ tm.setTransactionTimeout(5); // timeout after 5 second
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.begin();
+ assertStatus(Status.STATUS_ACTIVE);
+ tm.getTransaction().enlistResource(b1);
+ tm.getTransaction().enlistResource(b10);
+// System.err.println("b1: "+b1);
+// System.err.println("b10: "+b1);
+ b1.setCurrentInteger(3);
+ b10.setCurrentInteger(30);
+// System.err.println("b1: "+b1);
+// System.err.println("b10: "+b1);
+ Thread.sleep(6000); // sleep 6 sec
+ try {
+ assertStatus(Status.STATUS_ROLLEDBACK);
+ tm.commit();
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ } catch (RollbackException e) {
+// System.err.println("b1: "+b1);
+// System.err.println("b10: "+b1);
+ assertEquals("persisted state after commit with timeout", 2,
b1
+ .getPersistentInteger());
+ assertEquals("persisted state after commit with timeout", 20,
+ b10.getPersistentInteger());
+ return;
+ }
+ fail("Transaction timeout should have expired");
+ } finally {
+ assertStatus(Status.STATUS_NO_TRANSACTION);
+ tm.setTransactionTimeout(0); // timeout set to default
+ System.err.println("<-- test2PCCommitTimeout");
+ }
+ }
+
+ // /**
+ // * testing sucessful two phase commit with transaction context
+ // * propagation between 2 threads in the same VM.
+ // * This test use the explicite context propagation.
+ // * For Implicit propagation the tread have to discuss via rmi
+ // *
+ // * This test isn't madatory for Transaction Manager
+ // * @throws Exception
+ // */
+ // public void testTransactionPropagation() throws Exception {
+ // Trace.tests.info("--> testTransactionPropagation");
+ // XAInteger b1 = new XAInteger(1);
+ // assertEquals("Initial persisted state", 1, b1.getPersistentInteger());
+ // tm.begin();
+ // tm.getTransaction().enlistResource(b1);
+ // assertTrue("XA resource should not be dirty ", !b1.isDirty());
+ // b1.setCurrentInteger(2);
+ // assertTrue("XA resource should be dirty ", b1.isDirty());
+ //
+ // // sending a request
+ // TransactionContext pctx = ((Current) tm).getPropagationContext(true);
+ // ServerInvocation si = new ServerInvocation(pctx, 10, 20);
+ // si.start();
+ // while (si.isAlive()) {
+ // Thread.yield();
+ // }
+ // // receiving a reply
+ // pctx = si.getTransactionContextReply();
+ // ((Current) tm).setPropagationContext(pctx, true);
+ // tm.commit();
+ // assertEquals("persisted state after commit", 2,
+ // b1.getPersistentInteger());
+ // assertEquals("persisted state after commit", 20,
+ // si.getServerPersistentValue());
+ // Trace.tests.info("<-- testTransactionPropagation");
+ // }
+ //
+ // /**
+ // * utility class for emulating local server invocation
+ // */
+ // class ServerInvocation extends Thread {
+ // TransactionContext pctx;
+ // XAInteger b;
+ // int currentValue;
+ // Exception e = null;
+ //
+ // /**
+ // * @param pctx
+ // * @param persistentValue
+ // * @param currentValue
+ // */
+ // public ServerInvocation(TransactionContext pctx, int persistentValue,
int
+ // currentValue) {
+ // super("ServerInvocation");
+ // this.pctx = pctx;
+ // b = new XAInteger(persistentValue);
+ // this.currentValue = currentValue;
+ // }
+ //
+ // public void run() {
+ // try {
+ // // receiving a request
+ // ((Current) tm).setPropagationContext(pctx, false);
+ // tm.getTransaction().enlistResource(b);
+ // b.setCurrentInteger(currentValue);
+ // assertTrue("XA resource should be dirty ", b.isDirty());
+ // pctx = ((Current) tm).getPropagationContext(false);
+ // } catch (Exception e) {
+ // this.e = e;
+ // }
+ // }
+ //
+ // /**
+ // * @return
+ // * @throws Exception
+ // */
+ // public int getServerPersistentValue() throws Exception {
+ // if (e != null)
+ // throw e;
+ // return b.getPersistentInteger();
+ // }
+ //
+ // /**
+ // * @return
+ // * @throws Exception
+ // */
+ // public TransactionContext getTransactionContextReply() throws
Exception {
+ // if (e != null)
+ // throw e;
+ // return pctx;
+ // }
+ //
+ // }
+}
\ No newline at end of file
Index: gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/Trace.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/Trace.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/Trace.java Mon
Jul 18 09:30:05 2005
@@ -0,0 +1,74 @@
+/*
+ * @(#) Trace.java
+ *
+ * JOTM: Java Open Transaction Manager
+ *
+ *
+ * This module was orginally developed by
+ *
+ * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
+ * (http://www.objectweb.org)
+ *
+ * --------------------------------------------------------------------------
+ * The original code and portions created by INRIA are
+ * Copyright (c) 2003 INRIA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
met:
+ *
+ * -Redistributions of source code must retain the above copyright notice,
this
+ * list of conditions and the following disclaimer.
+ *
+ * -Redistributions in binary form must reproduce the above copyright
notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * --------------------------------------------------------------------------
+ * Contributor(s):
+ *
+ * @author jmesnil March 17, 2003
+ * --------------------------------------------------------------------------
+ * $Id: Trace.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+ * --------------------------------------------------------------------------
+ */
+package org.objectweb.jts.tck;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.impl.NoOpLog;
+
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 12 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:05 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public class Trace {
+ /** TEST_LOG_PREFIX used to identify JOTM tests logger */
+ public static final String TEST_LOG_PREFIX =
"org.objectweb.gotm.junit";
+
+ static Log tests = new NoOpLog();
+
+ /**
+ * Configure the log for JOTM.
+ * Log configuration is stored in a property file,
<code>trace.properties</code>,
+ * which should be available from the classpath.
+ */
+ public static void configure() {
+ tests = LogFactory.getLog(TEST_LOG_PREFIX);
+ }
+}
Index:
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XABoolean.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XABoolean.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XABoolean.java
Mon Jul 18 09:30:05 2005
@@ -0,0 +1,93 @@
+/*
+ * @(#) XABoolean.java
+ *
+ * JOTM: Java Open Transaction LoggerManager
+ *
+ *
+ * This module was orginally developed by
+ *
+ * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
+ * (http://www.objectweb.org)
+ *
+ * --------------------------------------------------------------------------
+ * The original code and portions created by INRIA are
+ * Copyright (c) 2001 INRIA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
met:
+ *
+ * -Redistributions of source code must retain the above copyright notice,
this
+ * list of conditions and the following disclaimer.
+ *
+ * -Redistributions in binary form must reproduce the above copyright
notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * --------------------------------------------------------------------------
+ * Contributor(s):
+ *
+ * @author Christophe Ney
+ * Created on Oct 15, 2001
+
*-----------------------------------------------------------------------------
+ * $Id: XABoolean.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+
*-----------------------------------------------------------------------------
+ */
+package org.objectweb.jts.tck.xa;
+
+import javax.transaction.xa.XAException;
+
+/**
+ * A boolean object that supports the 2-PC XA protocol
+ */
+public class XABoolean extends XAObject {
+
+ /**
+ * @param value
+ * @param failOnCommit
+ */
+ public XABoolean(boolean value, boolean failOnCommit) {
+ super(new Boolean(value), failOnCommit);
+ }
+
+ /**
+ * @param value
+ */
+ public XABoolean(boolean value) {
+ this(value, false);
+ }
+
+ /**
+ * @param value
+ * @throws XAException
+ */
+ public void setCurrentBoolean(boolean value) throws XAException {
+ super.setCurrentValue(new Boolean(value));
+ }
+
+ /**
+ * @return Persistent Boolean value
+ */
+ public boolean getPersistentBoolean() {
+ return ((Boolean) super.getPersistentValue()).booleanValue();
+ }
+
+ /**
+ * @return current boolean
+ * @throws XAException
+ */
+ public boolean getCurrentBoolean() throws XAException {
+ return ((Boolean) super.getCurrentValue()).booleanValue();
+ }
+}
Index:
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAInteger.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAInteger.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAInteger.java
Mon Jul 18 09:30:05 2005
@@ -0,0 +1,93 @@
+/*
+ * @(#) XAInteger.java
+ *
+ * JOTM: Java Open Transaction LoggerManager
+ *
+ *
+ * This module was orginally developed by
+ *
+ * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
+ * (http://www.objectweb.org)
+ *
+ * --------------------------------------------------------------------------
+ * The original code and portions created by INRIA are
+ * Copyright (c) 2001 INRIA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
met:
+ *
+ * -Redistributions of source code must retain the above copyright notice,
this
+ * list of conditions and the following disclaimer.
+ *
+ * -Redistributions in binary form must reproduce the above copyright
notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * --------------------------------------------------------------------------
+ * Contributor(s):
+ *
+ * @author Christophe Ney
+ * Created on Oct 15, 2001 *
+
*-----------------------------------------------------------------------------
+ * $Id: XAInteger.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+
*-----------------------------------------------------------------------------
+ */
+package org.objectweb.jts.tck.xa;
+
+import javax.transaction.xa.XAException;
+
+/**
+ * An integer that supports the 2-PC XA protocol
+ */
+public class XAInteger extends XAObject {
+
+ /**
+ * @param value
+ * @param failOnCommit
+ */
+ public XAInteger(int value, boolean failOnCommit) {
+ super(new Integer(value), failOnCommit);
+ }
+
+ /**
+ * @param value
+ */
+ public XAInteger(int value) {
+ this(value, false);
+ }
+
+ /**
+ * @param value
+ * @throws XAException
+ */
+ public void setCurrentInteger(int value) throws XAException {
+ super.setCurrentValue(new Integer(value));
+ }
+
+ /**
+ * @return persistent integer value
+ */
+ public int getPersistentInteger() {
+ return ((Integer) super.getPersistentValue()).intValue();
+ }
+
+ /**
+ * @return current integer
+ * @throws XAException
+ */
+ public int getCurrentInteger() throws XAException {
+ return ((Integer) super.getCurrentValue()).intValue();
+ }
+}
Index: gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAObject.java
diff -u /dev/null
gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAObject.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/examples/junit/src/java/org/objectweb/jts/tck/xa/XAObject.java
Mon Jul 18 09:30:05 2005
@@ -0,0 +1,378 @@
+/*====================================================================
+
+ObjectWeb GoTM project - http://gotm.objectweb.org
+Contact: gotm@xxxxxxxxxxxxx
+
+This library 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 any later version.
+
+This library 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 library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): ______________________________________.
+
+---------------------------------------------------------------------
+$Id: XAObject.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+====================================================================*/
+
+package org.objectweb.jts.tck.xa;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import java.util.Hashtable;
+
+/**
+ * An object that supports the 2-PC XA protocol
+ */
+public class XAObject
+ implements XAResource
+{
+ /** commited value held by the XAResource. */
+ private Object persistentValue;
+
+ /** current value held by the XAResource. */
+ private Object currentValue;
+
+ /** XID of the current transaction. */
+ private Xid currentXid = null;
+
+ /** XAResource started. */
+ private boolean isStarted = false;
+
+ /** Holds value of property transactionTimeout. (seconds) */
+ private int transactionTimeout = 0; // default value
+
+ /** hashtable of values for suspended transactions */
+ private Hashtable suspendedValues;
+
+ /** a false value makes perpare/commit to fail */
+ private boolean failOnCommit;
+
+ /**
+ * Creates new XAObject
+ * @param value the original value of the boolean
+ * (a negative value makes prepare and commit fail)
+ * @param failOnCommit
+ */
+ public XAObject(Object value, boolean failOnCommit) {
+ setPersistentValue(value);
+ this.currentValue = value;
+ setSuspendedValues(new Hashtable());
+ setFailOnCommit(failOnCommit);
+ }
+
+ /**
+ * Inform the resource manager to roll back work done on behalf
+ * of a transaction branch
+ * rollback is performed after end is called
+ * @param xid
+ * @throws XAException
+ */
+ public void rollback(Xid xid) throws XAException {
+// System.err.println("rollback("+xid+")");
+// log.debug("xares="+ this);
+// log.debug("xid="+ xid);
+ if (xid == null) {
+ throw new XAException("XAObject:rollback(" + xid + ") called
with null xid");
+ }
+ if (getCurrentXid() == null) {
+ throw new XAException("XAObject:rollback(" + xid + ") called
with currentXid==null");
+ }
+ // mixed transaction
+ if (!this.currentXid.equals(xid)) {
+ throw new XAException("Mixted Transaction not allowed :" +
"XAObject:commit(" + xid + ") called with currentXid==" + this.currentXid);
+ }
+ this.currentValue = this.persistentValue;
+ }
+
+ /**
+ * Commit the global transaction specified by xid.
+ * commit is performed after end is called
+ * @param xid
+ * @param onePhase
+ * @throws XAException
+ */
+ public void commit(Xid xid, boolean onePhase) throws XAException {
+// System.err.println("commit("+xid+", "+onePhase+")");
+// log.debug("xares="+ this);
+// log.debug("xid=" + xid + ", onePhase="+ onePhase);
+ if (xid == null) {
+ throw new XAException("XAObject:commit(" + xid + "," +
(onePhase?"true":"false") + ") called with null xid");
+ }
+ if (getCurrentXid() == null) {
+ throw new XAException("XAObject:commit(" + xid + "," +
(onePhase?"true":"false") + ") called with currentXid==null");
+ }
+ // mixed transaction
+ if (!this.currentXid.equals(xid)) {
+ throw new XAException("Mixted Transaction not allowed :" +
"XAObject:commit(" + xid + "," + (onePhase?"true":"false") + ") called with
currentXid==" + this.currentXid);
+ }
+ if (onePhase && isFailOnCommit()) {
+ throw new XAException(XAException.XA_RBROLLBACK);
+ }
+ this.persistentValue = this.currentValue;
+ }
+
+ /**
+ * Tell the resource manager to forget about a heuristically
+ * completed transaction branch. NOT IMPLEMENTED
+ * @param xid
+ */
+ public void forget(Xid xid) {
+// System.err.println("forget("+xid+")");
+// log.debug("xares="+ this);
+// log.debug("xid="+ xid);
+// log.warn("method not implemented");
+ this.currentXid = null;
+ }
+
+ /**
+ * Obtain a list of prepared transaction branches from a resource
+ * manager. NOT IMPLEMENTED
+ * @param flag
+ * @return Xid
+ */
+ public Xid[] recover(int flag) {
+// log.debug("flag="+ flag);
+// log.warn("method not implemented");
+ return null;
+ }
+
+
+ /** Determine if the resource manager instance represented by the
+ * target object is the same as the resource manager instance
+ * represented by the parameter xares
+ *
+ * @param xares An XAResource object
+ * @return true if same RM instance, otherwise false.
+ */
+ public boolean isSameRM(XAResource xares) {
+// log.debug("xares="+ this);
+// log.debug("other xares="+ xares);
+ // in this case, there is one RM per XAResource since
+ // commit/rollback must be called on each XAResource
+ boolean ret = xares.equals(this);
+// log.debug("returns "+ ret);
+ return ret;
+ }
+
+ /**
+ * Ask the resource manager to prepare for a transaction commit
+ * of the transaction specified in xid.
+ * @param xid
+ * @return XA_OK
+ * @throws XAException
+ */
+ public int prepare(Xid xid) throws XAException {
+// System.err.println("prepare("+xid+")");
+// log.debug("xares="+ this);
+// log.debug("xid="+ xid);
+ if (this.failOnCommit)
+ throw new XAException(XAException.XA_RBROLLBACK);
+ return XA_OK;
+ }
+
+
+ public void start(Xid xid, int flags) throws XAException {
+// System.err.println("Start("+xid+", "+flags+")");
+// log.debug("xares="+ this);
+// log.debug("xid="+ xid +", flags="+ flags);
+ if (this.isStarted) {
+ throw new XAException("start(" + xid + "," + flags + ") called
before end");
+ }
+ if (xid == null) {
+ throw new XAException("start(" + xid + "," + flags + ") called
with null xid");
+ }
+
+ this.currentXid = xid;
+ this.isStarted = true;
+ if (flags == XAResource.TMRESUME) {
+ Object v = this.suspendedValues.get(xid);
+ if (v == null) {
+ throw new XAException("start(" + xid + "," + flags + ")
called for resume before end(" + xid + "," + XAResource.TMSUSPEND + ") called
by suspend");
+ }
+ this.currentValue = v;
+ } else {
+ this.currentValue = this.persistentValue;
+ }
+ }
+
+
+ /**
+ * Ends the work performed on behalf of a transaction branch.
+ * @param xid
+ * @param flags
+ * @throws XAException
+ */
+ public void end(Xid xid, int flags) throws XAException {
+// System.err.println("end("+xid+", "+flags+")");
+// log.debug("xares="+ this);
+// log.debug("xid="+ xid +", flags="+ flags);
+ if (!this.isStarted) {
+ throw new XAException("end(" + xid + "," + flags + ") called
before start");
+ }
+ if (this.currentXid == null) {
+ throw new XAException("end(" + xid + "," + flags + ") called
with currentXid==null");
+ }
+ if (xid == null) {
+ throw new XAException("end(" + xid + "," + flags + ") called
with null xid");
+ }
+
+ // mixed transaction
+ if (!this.currentXid.equals(xid)) {
+ throw new XAException("Mixted Transaction not allowed : " +
"end(" + xid + "," + flags + ") called with for currentXId==" +
this.currentXid);
+ }
+ if (flags == XAResource.TMSUSPEND) {
+ this.suspendedValues.put(xid, this.currentValue);
+ }
+ this.isStarted = false;
+ }
+
+ /** Getter for property transactionTimeout.
+ * @return Value of property transactionTimeout.
+ */
+ public int getTransactionTimeout() {
+// log.debug("returned " + transactionTimeout);
+ return this.transactionTimeout;
+ }
+
+ /** Setter for property transactionTimeout.
+ * @param transactionTimeout New value of property transactionTimeout.
+ * @return true
+ */
+ public boolean setTransactionTimeout(int transactionTimeout) {
+// log.debug("transactionTimeout=" + transactionTimeout);
+ this.transactionTimeout = transactionTimeout;
+ return true;
+ }
+
+ /** Setter for property value.
+ * @param value New value of property value.
+ * @throws XAException
+ */
+ public void setCurrentValue(Object value) throws XAException {
+ if (!this.isStarted) {
+ throw new XAException("setValue(" + value.toString() + ") called
before start");
+ }
+ if (this.currentXid == null) {
+ throw new XAException("setValue(" + value.toString() + ") called
with currentXid==null");
+ }
+ this.currentValue = value;
+ }
+
+ /**
+ * Human readable representation of the object
+ * @return String
+ */
+ public String toString() {
+ return "XAObject[currentValue="
+ + this.currentValue.toString()
+ + ", persistentValue="
+ + this.persistentValue.toString()
+ + ", currentXid="
+ + this.currentXid
+ + ", failOnCommit="
+ + this.failOnCommit
+ + "]";
+ }
+
+ /**
+ * is the persistent value set to true
+ * @return Persistent Value
+ */
+ public Object getPersistentValue() {
+ return this.persistentValue;
+ }
+
+ /**
+ * is the current value set to true
+ * @return is the current value set to true
+ * @throws XAException
+ */
+ public Object getCurrentValue() throws XAException {
+ if (!this.isStarted) {
+ throw new XAException("getCurrentValue() called before start");
+ }
+ if (this.currentXid == null) {
+ throw new XAException("getCurrentValue() called with
currentXid==null");
+ }
+ return this.currentValue;
+ }
+
+ /**
+ * is the object dirty. (persistent != current)
+ * @return persistent != current
+ * @throws XAException
+ */
+ public boolean isDirty() throws XAException {
+ if (this.currentXid == null) {
+ throw new XAException("isDirty() called with currentXid==null");
+ }
+ return !this.persistentValue.equals(this.currentValue);
+ }
+ /**
+ * @return Returns the currentXid.
+ */
+ public Xid getCurrentXid() {
+ return this.currentXid;
+ }
+ /**
+ * @param currentXid The currentXid to set.
+ */
+ public void setCurrentXid(Xid currentXid) {
+ this.currentXid = currentXid;
+ }
+ /**
+ * @return Returns the failOnCommit.
+ */
+ public boolean isFailOnCommit() {
+ return this.failOnCommit;
+ }
+ /**
+ * @param failOnCommit The failOnCommit to set.
+ */
+ public void setFailOnCommit(boolean failOnCommit) {
+ this.failOnCommit = failOnCommit;
+ }
+ /**
+ * @return Returns the isStarted.
+ */
+ public boolean isStarted() {
+ return this.isStarted;
+ }
+ /**
+ * @param isStarted The isStarted to set.
+ */
+ public void setStarted(boolean isStarted) {
+ this.isStarted = isStarted;
+ }
+ /**
+ * @return Returns the suspendedValues.
+ */
+ public Hashtable getSuspendedValues() {
+ return this.suspendedValues;
+ }
+ /**
+ * @param suspendedValues The suspendedValues to set.
+ */
+ public void setSuspendedValues(Hashtable suspendedValues) {
+ this.suspendedValues = suspendedValues;
+ }
+ /**
+ * @param persistentValue The persistentValue to set.
+ */
+ public void setPersistentValue(Object persistentValue) {
+ this.persistentValue = persistentValue;
+ }
+}
Index:
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
diff -u
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal:1.2
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal:removed
---
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal:1.2
Mon Jul 11 10:27:08 2005
+++
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
Mon Jul 18 09:30:05 2005
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/adl/xml/standard.dtd">
-<!--<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/adl/xml/basic.dtd">-->
-
-<definition name="org.objectweb.gotm.lib.FcLocalExplorer">
- <interface name="fcAppl" role="client"
- signature="org.objectweb.fractal.api.Component" />
-
- <content class="BrowserImpl"/>
-
- <attributes signature="BrowserAttributes">
- <attribute value="local.xml" name="ConfigFiles"/>
- </attributes>
-</definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal
diff -u
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.1
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.2
--- gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.1
Mon Jul 11 10:27:08 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal Mon
Jul 18 09:30:05 2005
@@ -8,6 +8,8 @@
signature="javax.transaction.Transaction"/>
<interface name="user-transaction" role="server"
signature="javax.transaction.UserTransaction"/>
+ <interface name="suspend-feature" role="server"
+ signature="org.objectweb.gotm.lib.jta.Suspendable"/>
<component name="FcAdapter"
definition="org.objectweb.gotm.lib.jta.TpTransactionImpl"/>
@@ -22,6 +24,8 @@
server="FcAdapter.transaction"/>
<binding client="this.user-transaction"
server="FcAdapter.user-transaction"/>
+ <binding client="this.suspend-feature"
+ server="FcAdapter.suspend-feature"/>
<binding client="FcAdapter.tx-state"
server="FcGoTM.tx-state"/>
Index: gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal
diff -u
gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal:1.1
gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal:removed
--- gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal:1.1
Wed Feb 23 18:39:46 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTerminatorImpl.fractal
Mon Jul 18 09:30:05 2005
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE definition PUBLIC
- "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/adl/xml/basic.dtd">
-
-<definition name="org.objectweb.gotm.lib.TpTerminatorImpl">
- <interface name="process-twopc" role="server"
-
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
- <interface name="process-commit" role="server"
-
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
- <interface name="process-rollback" role="server"
-
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
-
- <interface name="publish" role="client"
- signature="org.objectweb.transaction.api.event.PublishFeature"/>
- <interface name="subscribe" role="client"
- signature="org.objectweb.transaction.api.event.SubscribeFeature"/>
- <interface name="tx-status" role="client"
-
signature="org.objectweb.transaction.api.transaction.TransactionStatusFeature"/>
- <interface name="tx-state" role="client"
-
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
-
- <component name="Fc2PC"
-
definition="org.objectweb.gotm.lib.coordination.TpAtomicTwoPCCoordinationFeature"/>
- <component name="Fc1PC"
-
definition="org.objectweb.gotm.lib.coordination.TpOnePCCoordinationFeature"/>
- <component name="FcRollback"
-
definition="org.objectweb.gotm.lib.coordination.TpRollbackCoordinationFeature"/>
- <component name="FcDaemon"
- definition="org.objectweb.gotm.lib.coordination.TpDaemonImpl(100)"/>
- <component name="FcChecker"
- definition="org.objectweb.gotm.lib.coordination.TpStatusChecker"/>
-
- <binding client="this.process-twopc" server="FcChecker.coord-process"/>
- <binding client="this.process-commit" server="Fc1PC.coord-process"/>
- <binding client="this.process-rollback" server="FcRollback.coord-process"/>
-
- <binding client="Fc2PC.valid" server="Fc1PC.coord-process"/>
- <binding client="Fc2PC.cancel" server="FcRollback.coord-process"/>
- <binding client="Fc2PC.publish" server="this.publish"/>
- <binding client="Fc2PC.tx-state" server="this.tx-state"/>
-
- <binding client="Fc1PC.publish" server="this.publish"/>
- <binding client="Fc1PC.tx-state" server="this.tx-state"/>
-
- <binding client="FcRollback.publish" server="this.publish"/>
- <binding client="FcRollback.tx-state" server="this.tx-state"/>
-
- <binding client="FcDaemon.subscribe" server="this.subscribe"/>
- <binding client="FcDaemon.coord-process"
server="FcRollback.coord-process"/>
-
- <binding client="FcChecker.commit" server="Fc2PC.coord-process"/>
- <binding client="FcChecker.rollback" server="FcRollback.coord-process"/>
- <binding client="FcChecker.tx-status" server="this.tx-status"/>
-
- <template-controller desc="compositeTemplate" />
-</definition>
Index: gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java
diff -u /dev/null gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java Mon Jul 18
09:30:05 2005
@@ -0,0 +1,55 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library 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 any later version.
+
+This library 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 library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: JtsFactory.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib;
+
+import java.util.Map;
+
+import javax.transaction.TransactionManager;
+
+import org.objectweb.gotm.Gotm;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 11 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:05 $
+ * @version $Revision: 1.1 $
+ */
+public class JtsFactory {
+ /** <code>DEFAULT_ADL</code> . */
+ public static final String DEFAULT_ADL=
"org.objectweb.gotm.lib.JtsTransactionManager";
+ /** <code>DEFAULT_ITF</code> . */
+ public static final String DEFAULT_ITF = "transaction-manager";
+
+ /**
+ * @param context
+ * @return an instance of transaction manager.
+ */
+ public static TransactionManager create(Map context) {
+ return (TransactionManager)Gotm.create(DEFAULT_ADL, context,
DEFAULT_ITF);
+ }
+}
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
diff -u gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java:1.3
gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java:1.4
--- gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java:1.3
Wed Feb 23 18:39:45 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java Mon
Jul 18 09:30:04 2005
@@ -22,7 +22,7 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: StatusConverter.java,v 1.3 2005/02/23 17:39:45 rouvoy Exp $
+ $Id: StatusConverter.java,v 1.4 2005/07/18 07:30:04 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.jta;
@@ -39,6 +39,7 @@
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
import org.objectweb.transaction.lib.transaction.TransactionStatusUnknown;
/**
@@ -46,8 +47,8 @@
* <code>TransactionStatus</code>.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 22 déc. 2004
- * @modified $Date: 2005/02/23 17:39:45 $
- * @version $Revision: 1.3 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.4 $
* @fractal.itf
*/
public class StatusConverter
@@ -61,6 +62,8 @@
new Integer(Status.STATUS_NO_TRANSACTION));
getValues().put(TransactionStatusTransactionActive.status,
new Integer(Status.STATUS_ACTIVE));
+ getValues().put(TransactionStatusTransactionInactive.status,
+ new Integer(Status.STATUS_NO_TRANSACTION));
getValues().put(TransactionStatusPreparing.status,
new Integer(Status.STATUS_PREPARING));
getValues().put(TransactionStatusPrepared.status,
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/Suspendable.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/lib/jta/Suspendable.java:1.1
--- /dev/null Mon Jul 18 09:30:05 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/Suspendable.java Mon
Jul 18 09:30:04 2005
@@ -0,0 +1,53 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+This library 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 any later version.
+
+This library 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 library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: Suspendable.java,v 1.1 2005/07/18 07:30:04 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.jta;
+
+import org.objectweb.transaction.api.Feature;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 13 juil. 2005
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="suspend-feature"
+ */
+public interface Suspendable
+ extends Feature {
+ /** Fractal ADL Identifier for the <code>Suspendable</code> interface. */
+ public static final String SUSPENDABLE = "suspend-feature";
+
+ /**
+ * Suspends the transaction.
+ */
+ public void suspend();
+
+ /**
+ * Resumes the transaction.
+ */
+ public void resume();
+}
Index:
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
diff -u
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.2
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.3
---
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.2
Mon Jul 11 10:27:08 2005
+++
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
Mon Jul 18 09:30:04 2005
@@ -22,7 +22,7 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: SynchronizationActionProvider.java,v 1.2 2005/07/11 08:27:08 rouvoy
Exp $
+ $Id: SynchronizationActionProvider.java,v 1.3 2005/07/18 07:30:04 rouvoy
Exp $
====================================================================*/
package org.objectweb.gotm.lib.jta;
@@ -32,23 +32,25 @@
import javax.transaction.Status;
import javax.transaction.Synchronization;
-import org.objectweb.gotm.lib.resource.AbstractActionProvider;
+import org.objectweb.gotm.lib.resource.ActionProviderAbstract;
import org.objectweb.gotm.lib.resource.Action;
import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitting;
import org.objectweb.transaction.lib.transaction.TransactionStatusPrepared;
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
/**
* Implementation of a <code>ResourceManagerWithPool</code> for the
* <code>Synchronization</code> object.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 22 déc. 2004
- * @modified $Date: 2005/07/11 08:27:08 $
- * @version $Revision: 1.2 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.3 $
* @fractal.itf name="sync-action-provider"
signature="org.objectweb.gotm.lib.resource.ActionProvider"
*/
public class SynchronizationActionProvider
- extends AbstractActionProvider
+ extends ActionProviderAbstract
{
/** Fractal ADL Identifier for the
<code>SynchronizationActionProvider</code> class. */
public static final String SYNCHRONIZATION = "synchronization";
@@ -88,7 +90,9 @@
*/
protected Map declareActions() {
Map a = new HashMap();
- a.put(TransactionStatusPrepared.status,
+ a.put(TransactionStatusCommitting.status,
+ new BeforeCompletion());
+ a.put(TransactionStatusRollingBack.status,
new BeforeCompletion());
a.put(TransactionStatusCommitted.status,
new AfterCompletion(Status.STATUS_COMMITTED));
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
diff -u gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.9
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.10
--- gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.9
Mon Jul 11 10:27:08 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java Mon
Jul 18 09:30:04 2005
@@ -22,13 +22,14 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: TransactionImpl.java,v 1.9 2005/07/11 08:27:08 rouvoy Exp $
+ $Id: TransactionImpl.java,v 1.10 2005/07/18 07:30:04 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.jta;
import java.util.HashMap;
+import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
@@ -47,16 +48,18 @@
import org.objectweb.transaction.api.transaction.TransactionState;
import org.objectweb.transaction.api.transaction.TransactionStatus;
import
org.objectweb.transaction.lib.transaction.TransactionStatusMarkedRollback;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusNoTransaction;
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
/**
* Adapter for the Java Transaction API (JTA).
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 24 déc. 2004
- * @modified $Date: 2005/07/11 08:27:08 $
- * @version $Revision: 1.9 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.10 $
* @fractal.itf name="transaction" signature="javax.transaction.Transaction"
* @fractal.itf name="user-transaction"
signature="javax.transaction.UserTransaction"
* @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
@@ -69,7 +72,7 @@
*/
public class TransactionImpl
extends BindablePrimitive
- implements Transaction, UserTransaction {
+ implements Transaction, UserTransaction, Suspendable {
/** Fractal ADL Identifier for the <code>COMMIT</code> interface. */
public static final String COMMIT = "commit";
@@ -147,12 +150,20 @@
/* (non-Javadoc)
* @see javax.transaction.Transaction#commit()
*/
- public void commit() throws SecurityException, IllegalStateException {
+ public void commit() throws SecurityException, IllegalStateException,
RollbackException, HeuristicRollbackException {
try {
getTxCommit().process(new HashMap());
- } catch (InvalidStateException e) {
+ } catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
+ throw new RollbackException("Transaction has rolled back.");
+ } catch (Exception e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new IllegalStateException(e);
}
+ if (getTxState().checkStatus(TransactionStatusRolledBack.status))
+ throw new HeuristicRollbackException("Transaction has rolled
back.");
}
/* (non-Javadoc)
@@ -164,8 +175,12 @@
getResource().delResource(arg0);
return true;
} catch (InvalidStateException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new IllegalStateException(e);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new SystemException(e.getMessage());
}
}
@@ -179,6 +194,8 @@
getResource().addResource(arg0);
return true;
} catch (InvalidStateException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
TransactionStatus[] rollback = new TransactionStatus[] {
TransactionStatusMarkedRollback.status,
TransactionStatusRolledBack.status,
@@ -188,6 +205,8 @@
"Transaction is marked for Rollback.");
throw new IllegalStateException(e);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new SystemException(e.getMessage());
}
}
@@ -199,6 +218,8 @@
try {
return getStatusConverter().toValue(getTxState().getStatus());
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new SystemException(e.getMessage());
}
}
@@ -211,6 +232,8 @@
try {
getSynchronization().addResource(arg0);
} catch (InvalidStateException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
TransactionStatus[] rollback = new TransactionStatus[] {
TransactionStatusMarkedRollback.status,
TransactionStatusRolledBack.status,
@@ -220,6 +243,8 @@
"Transaction is marked for Rollback.");
throw new IllegalStateException(e);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new SystemException(e.getMessage());
}
}
@@ -231,6 +256,8 @@
try {
getTxRollback().process(new HashMap());
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new IllegalStateException(e);
}
}
@@ -242,6 +269,8 @@
try {
getTxState().setStatus(TransactionStatusMarkedRollback.status);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new IllegalStateException(e);
}
}
@@ -253,6 +282,8 @@
try {
getTxState().setStatus(TransactionStatusTransactionActive.status);
} catch (InvalidTransitionException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new NotSupportedException("Transaction Already Active.");
}
}
@@ -264,7 +295,31 @@
try {
getTimeout().setTimeout(arg0);
} catch (InvalidStateException e) {
+ if (getLogger().isLoggable(ERROR))
+ getLogger().log(ERROR, e.getMessage());
throw new SystemException(e.getMessage());
}
+ }
+
+ private TransactionStatus tx_status ;
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.jta.Suspendable#suspend()
+ */
+ public void suspend() {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Suspending the transaction...");
+ tx_status = getTxState().getStatus();
+ getTxState().setStatus(TransactionStatusTransactionInactive.status);
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.jta.Suspendable#resume()
+ */
+ public void resume() {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Resuming the transaction...");
+ getTxState().setStatus(tx_status);
+ tx_status = null;
}
}
Index:
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
diff -u
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.4
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.5
---
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.4
Wed Feb 23 18:39:45 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
Mon Jul 18 09:30:04 2005
@@ -22,7 +22,7 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: TransactionManagerImpl.java,v 1.4 2005/02/23 17:39:45 rouvoy Exp $
+ $Id: TransactionManagerImpl.java,v 1.5 2005/07/18 07:30:04 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.jta;
@@ -31,6 +31,7 @@
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
+import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@@ -45,18 +46,17 @@
* interface based on the GoTM library.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 3 janv. 2005
- * @modified $Date: 2005/02/23 17:39:45 $
- * @version $Revision: 1.4 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="tx-manager"
signature="javax.transaction.TransactionManager"
*/
public class TransactionManagerImpl
- extends CurrentHandler
- implements TransactionManager
-{
-
+ extends CurrentHandler
+ implements TransactionManager {
+
/** The default timeout. */
- private int txTimeout = 0 ;
-
+ private int txTimeout = 0;
+
/**
* @return Returns the txTimeout.
*/
@@ -70,130 +70,141 @@
protected void setTxTimeout(int txTimeout) {
this.txTimeout = txTimeout;
}
-
+
/**
* @return Returns the currentTx.
* @throws SystemException
* @throws NotSupportedException
*/
- protected UserTransaction getCurrentUserTx()
- throws SystemException,
- NotSupportedException
- {
+ protected UserTransaction getCurrentUserTx() throws SystemException,
+ NotSupportedException {
try {
- return (UserTransaction)
getCurrentFc().getFcInterface("user-transaction");
+ return (UserTransaction) getCurrentFc().getFcInterface(
+ "user-transaction");
} catch (NoSuchInterfaceException e) {
- throw new NotSupportedException(e.getClass()+":
"+e.getMessage());
+ throw new NotSupportedException(e.getClass() + ": "
+ + e.getMessage());
} catch (NullPointerException e) {
throw new SystemException("No current transaction");
}
}
-
-
+
/**
* @return Returns the currentTx.
* @throws SystemException this exception is thrown if no current
* transaction is available.
*/
- protected Transaction getCurrentTx()
- throws SystemException
- {
+ protected Transaction getCurrentTx() throws SystemException {
try {
return (Transaction)
getCurrentFc().getFcInterface("transaction");
} catch (Exception e) {
throw new SystemException("No current transaction");
}
}
+
+ /**
+ * @return Returns the suspend feature of the transaction.
+ * @throws SystemException
+ */
+ protected Suspendable getTxSuspendable() throws SystemException{
+ try {
+ return (Suspendable)
getCurrentFc().getFcInterface(Suspendable.SUSPENDABLE);
+ } catch (Exception e) {
+ throw new SystemException("Transaction can not be
suspended/resumed");
+ }
+ }
/* (non-Javadoc)
* @see javax.transaction.TransactionManager#begin()
*/
- public void begin()
- throws NotSupportedException,
- SystemException
- {
- createCurrentFc();
+ public void begin() throws NotSupportedException, SystemException {
+ if (checkCurrent())
+ throw new NotSupportedException("A transaction is still
active.");
+ loadCurrent();
getCurrentUserTx().setTransactionTimeout(getTxTimeout());
getCurrentUserTx().begin();
}
/* (non-Javadoc)
- * @see javax.transaction.TransactionManager#commit()
- */
- public void commit()
- throws RollbackException,
- HeuristicMixedException,
- HeuristicRollbackException,
- SecurityException,
- IllegalStateException,
- SystemException
- {
- getCurrentTx().commit();
- clearCurrentFc();
- }
-
- /* (non-Javadoc)
* @see javax.transaction.TransactionManager#getStatus()
*/
- public int getStatus()
- throws SystemException
- {
- return getCurrentTx().getStatus();
+ public int getStatus() {
+ try {
+ return getCurrentTx().getStatus();
+ } catch (Exception e) {
+ return Status.STATUS_NO_TRANSACTION;
+ }
}
/* (non-Javadoc)
* @see javax.transaction.TransactionManager#getTransaction()
*/
- public Transaction getTransaction()
- throws SystemException
- {
+ public Transaction getTransaction() throws SystemException {
return getCurrentTx();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.transaction.TransactionManager#suspend()
+ */
+ public Transaction suspend() throws SystemException {
+ Transaction tx = null;
+ try {
+ tx = getCurrentTx();
+ } catch (Exception e) {
+ return null;
+ }
+ getTxSuspendable().suspend();
+ setCurrentFc(null);
+ return tx;
+ }
+
/* (non-Javadoc)
* @see
javax.transaction.TransactionManager#resume(javax.transaction.Transaction)
*/
- public void resume(Transaction arg0) {
- setCurrentFc(((Interface)arg0).getFcItfOwner());
+ public void resume(Transaction arg0) throws SystemException {
+ if (checkCurrent())
+ throw new IllegalStateException("A transaction is currently
active.");
+ setCurrentFc(((Interface) arg0).getFcItfOwner());
+ getTxSuspendable().resume();
}
/* (non-Javadoc)
- * @see javax.transaction.TransactionManager#rollback()
+ * @see javax.transaction.TransactionManager#setTransactionTimeout(int)
*/
- public void rollback()
- throws IllegalStateException,
- SecurityException,
- SystemException
- {
- getCurrentTx().rollback();
- clearCurrentFc();
+ public void setTransactionTimeout(int arg0) {
+ setTxTimeout(arg0);
}
/* (non-Javadoc)
* @see javax.transaction.TransactionManager#setRollbackOnly()
*/
- public void setRollbackOnly()
- throws IllegalStateException,
- SystemException
- {
+ public void setRollbackOnly() throws IllegalStateException,
SystemException {
getCurrentTx().setRollbackOnly();
}
/* (non-Javadoc)
- * @see javax.transaction.TransactionManager#setTransactionTimeout(int)
+ * @see javax.transaction.TransactionManager#rollback()
*/
- public void setTransactionTimeout(int arg0) {
- setTxTimeout(arg0);
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException {
+ getCurrentTx().rollback();
+ clearCurrentFc();
}
/* (non-Javadoc)
- * @see javax.transaction.TransactionManager#suspend()
+ * @see javax.transaction.TransactionManager#commit()
*/
- public Transaction suspend()
- throws SystemException
- {
- Transaction tx = getCurrentTx() ;
- setCurrentFc(null);
- return tx;
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+ try {
+ getCurrentTx().commit();
+ } catch (IllegalStateException e) {
+ throw new RollbackException(e.getMessage());
+ } finally {
+ clearCurrentFc();
+ }
}
-}
+}
\ No newline at end of file
Index:
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java
diff -u
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.1
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.2
---
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.1
Mon Jul 11 10:27:08 2005
+++
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java
Mon Jul 18 09:30:04 2005
@@ -22,7 +22,7 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: XAResourceActionProvider.java,v 1.1 2005/07/11 08:27:08 rouvoy Exp $
+ $Id: XAResourceActionProvider.java,v 1.2 2005/07/18 07:30:04 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.jta.xa;
@@ -34,8 +34,10 @@
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
-import org.objectweb.gotm.lib.resource.AbstractActionProvider;
+import org.objectweb.gotm.lib.resource.ActionProviderAbstract;
import org.objectweb.gotm.lib.resource.Action;
+import org.objectweb.gotm.lib.resource.ResourceDelistEvent;
+import org.objectweb.gotm.lib.resource.ResourceEnlistEvent;
import org.objectweb.gotm.lib.xid.XidFeature;
import org.objectweb.transaction.api.resource.ResourceVote;
import org.objectweb.transaction.lib.resource.ResourceEventCommit;
@@ -45,22 +47,28 @@
import org.objectweb.transaction.lib.resource.ResourceVoteReadOnly;
import org.objectweb.transaction.lib.resource.ResourceVoteRollback;
import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitting;
import
org.objectweb.transaction.lib.transaction.TransactionStatusNoTransaction;
import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 3 janv. 2005
- * @modified $Date: 2005/07/11 08:27:08 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 07:30:04 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="xa-action-provider"
* signature="org.objectweb.gotm.lib.resource.ActionProvider"
- * @fractal.itf name="xid-provider" role="client"
signature="org.objectweb.gotm.lib.xid.XidFeature"
+ * @fractal.itf name="xid-provider" role="client"
+ * signature="org.objectweb.gotm.lib.xid.XidFeature"
*/
public class XAResourceActionProvider
- extends AbstractActionProvider {
- /* (non-Javadoc)
+ extends ActionProviderAbstract {
+ /*
+ * (non-Javadoc)
+ *
* @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
*/
protected String[] clientFc() {
@@ -81,16 +89,20 @@
*/
protected Map declareActions() {
Map a = new HashMap();
- a.put(TransactionStatusTransactionActive.status, new StartAction(
- XAResource.TMNOFLAGS));
- a.put(TransactionStatusRolledBack.status, new StopAction(
- XAResource.TMFAIL));
- a.put(TransactionStatusCommitted.status, new StopAction(
- XAResource.TMSUCCESS));
- a.put(TransactionStatusNoTransaction.status, new StopAction(
- XAResource.TMSUSPEND));
+ a.put(ResourceEnlistEvent.event, new
StartAction(XAResource.TMNOFLAGS));
+ a.put(ResourceDelistEvent.event, new
EndAction(XAResource.TMNOFLAGS));
+ a.put(TransactionStatusNoTransaction.leaves,
+ new StartAction(XAResource.TMNOFLAGS));
+ a.put(TransactionStatusTransactionInactive.status,
+ new EndAction(XAResource.TMSUSPEND));
+ a.put(TransactionStatusTransactionInactive.leaves,
+ new StartAction(XAResource.TMRESUME));
a.put(ResourceEventVote.event, new PrepareAction());
+ a.put(TransactionStatusCommitting.status,
+ new EndAction(XAResource.TMSUCCESS));
a.put(ResourceEventCommit.event, new CommitAction());
+ a.put(TransactionStatusRollingBack.status,
+ new EndAction(XAResource.TMFAIL));
a.put(ResourceEventRollback.event, new RollbackAction());
return a;
}
@@ -100,28 +112,35 @@
private int flag;
/**
- * @param flag
+ * @param flag
*/
public StartAction(int flag) {
this.flag = flag;
}
- /* (non-Javadoc)
- * @see
org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
+ * java.lang.Object)
*/
public void execute(Map context, Object resource) throws Exception {
((XAResource) resource).start(getXid(), this.flag);
+ // List removed =
+ // (List)context.get(ResourceManagerAbstract.RESOURCE_REMOVED);
+ // if (removed.contains(resource))
+ // ((XAResource) resource).isSameRM(arg0);
}
}
- private final class StopAction
+ private final class EndAction
implements Action {
private int status;
/**
* @param status
*/
- public StopAction(int status) {
+ public EndAction(int status) {
this.status = status;
}
@@ -141,14 +160,17 @@
/**
* @param evt
* @param ctx
- * @param resource
+ * @param resource
*/
protected void vote(ResourceVote evt, Map ctx, Object resource) {
((List) ctx.get(evt)).add(resource);
}
- /* (non-Javadoc)
- * @see
org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
+ * java.lang.Object)
*/
public void execute(Map context, Object resource) throws Exception {
try {
@@ -159,15 +181,18 @@
vote(ResourceVoteReadOnly.vote, context, resource);
} catch (XAException e) {
vote(ResourceVoteRollback.vote, context, resource);
- throw e;
+ // throw e;
}
}
}
private final class CommitAction
implements Action {
- /* (non-Javadoc)
- * @see
org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
+ * java.lang.Object)
*/
public void execute(Map context, Object resource) throws Exception {
if (context.get("onePhase") == Boolean.TRUE)
@@ -179,8 +204,11 @@
private final class RollbackAction
implements Action {
- /* (non-Javadoc)
- * @see
org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.Action#execute(java.util.Map,
+ * java.lang.Object)
*/
public void execute(Map context, Object resource) throws Exception {
((XAResource) resource).rollback(getXid());
Index: gotm-jts/test/java/org/objectweb/gotm/jts/xa/XABoolean.java
diff -u gotm-jts/test/java/org/objectweb/gotm/jts/xa/XABoolean.java:1.4
gotm-jts/test/java/org/objectweb/gotm/jts/xa/XABoolean.java:removed
--- gotm-jts/test/java/org/objectweb/gotm/jts/xa/XABoolean.java:1.4 Mon
Jul 11 10:27:08 2005
+++ gotm-jts/test/java/org/objectweb/gotm/jts/xa/XABoolean.java Mon Jul 18
09:30:05 2005
@@ -1,93 +0,0 @@
-/*
- * @(#) XABoolean.java
- *
- * JOTM: Java Open Transaction LoggerManager
- *
- *
- * This module was orginally developed by
- *
- * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
- * (http://www.objectweb.org)
- *
- * --------------------------------------------------------------------------
- * The original code and portions created by INRIA are
- * Copyright (c) 2001 INRIA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
met:
- *
- * -Redistributions of source code must retain the above copyright notice,
this
- * list of conditions and the following disclaimer.
- *
- * -Redistributions in binary form must reproduce the above copyright
notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
- * POSSIBILITY OF SUCH DAMAGE.
- * --------------------------------------------------------------------------
- * Contributor(s):
- *
- * @author Christophe Ney
- * Created on Oct 15, 2001
-
*-----------------------------------------------------------------------------
- * $Id: XABoolean.java,v 1.4 2005/07/11 08:27:08 rouvoy Exp $
-
*-----------------------------------------------------------------------------
- */
-package org.objectweb.gotm.jts.xa;
-
-import javax.transaction.xa.XAException;
-
-/**
- * A boolean object that supports the 2-PC XA protocol
- */
-public class XABoolean extends XAObject {
-
- /**
- * @param value
- * @param failOnCommit
- */
- public XABoolean(boolean value, boolean failOnCommit) {
- super(new Boolean(value), failOnCommit);
- }
-
- /**
- * @param value
- */
- public XABoolean(boolean value) {
- this(value, false);
- }
-
- /**
- * @param value
- * @throws XAException
- */
- public void setCurrentBoolean(boolean value) throws XAException {
- super.setCurrentValue(new Boolean(value));
- }
-
- /**
- * @return Persistent Boolean value
- */
- public boolean getPersistentBoolean() {
- return ((Boolean) super.getPersistentValue()).booleanValue();
- }
-
- /**
- * @return current boolean
- * @throws XAException
- */
- public boolean getCurrentBoolean() throws XAException {
- return ((Boolean) super.getCurrentValue()).booleanValue();
- }
-}
Index: gotm-jts/test/java/org/objectweb/gotm/jts/xa/XAInteger.java
diff -u gotm-jts/test/java/org/objectweb/gotm/jts/xa/XAInteger.java:1.4
gotm-jts/test/java/org/objectweb/gotm/jts/xa/XAInteger.java:removed
--- gotm-jts/test/java/org/objectweb/gotm/jts/xa/XAInteger.java:1.4 Mon
Jul 11 10:27:08 2005
+++ gotm-jts/test/java/org/objectweb/gotm/jts/xa/XAInteger.java Mon Jul 18
09:30:05 2005
@@ -1,93 +0,0 @@
-/*
- * @(#) XAInteger.java
- *
- * JOTM: Java Open Transaction LoggerManager
- *
- *
- * This module was orginally developed by
- *
- * - INRIA (www.inria.fr)inside the ObjectWeb Consortium
- * (http://www.objectweb.org)
- *
- * --------------------------------------------------------------------------
- * The original code and portions created by INRIA are
- * Copyright (c) 2001 INRIA
- * All rights reserved.
- *
- * Redistribution and use in source and binary fo