Mail Archive Home | gotm-commits List | July 2004 Index
| <-- Date Index | <-- Thread Index |
Date: Friday, July 30, 2004 @ 18:46:11
Author: rouvoy
Path: /cvsroot/gotm/gotm-jts
Added: .classpath .cvsignore .project build.xml
example/local/.cvsignore example/local/build.xml
example/local/src/config/local.xml
example/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
example/local/src/fractal/org/objectweb/gotm/jts/local/FcCounterImpl.fractal
example/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal
example/local/src/fractal/org/objectweb/gotm/jts/local/FcJtaClient.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcActivationFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcCoordinatorFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcInterruptionFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcJTSFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcManagerFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcTerminatorFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionFctr.fractal
example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal
example/local/src/java/org/objectweb/gotm/jts/local/Counter.java
example/local/src/java/org/objectweb/gotm/jts/local/CounterAttributes.java
example/local/src/java/org/objectweb/gotm/jts/local/CounterImpl.java
example/local/src/java/org/objectweb/gotm/jts/local/InvokeRunnableAction.java
example/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
example/local/src/java/org/objectweb/gotm/jts/remote/ServerLauncher.java
example/local/src/java/org/objectweb/gotm/jts/remote/TransactionTest.java
externals/jta/jta-1_01.jar src/config/JTA.xml
src/fractal/org/objectweb/gotm/api/jta/FcSynchronization.fractal
src/fractal/org/objectweb/gotm/api/jta/FcTransaction.fractal
src/fractal/org/objectweb/gotm/api/jta/FcTransactionManager.fractal
src/fractal/org/objectweb/gotm/api/jta/FcUserTransaction.fractal
src/fractal/org/objectweb/gotm/api/jta/FcXAResource.fractal
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionFctr.fractal
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionImpl.fractal
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionManagerImpl.fractal
src/java/org/objectweb/gotm/browser/jta/TransactionCommitAction.java
src/java/org/objectweb/gotm/browser/jta/TransactionPanel.java
src/java/org/objectweb/gotm/browser/jta/TransactionRollbackAction.java
src/java/org/objectweb/gotm/browser/jta/TransactionSetRollbackOnlyAction.java
src/java/org/objectweb/gotm/lib/jta/Action.java
src/java/org/objectweb/gotm/lib/jta/EventConverter.java
src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
src/java/org/objectweb/gotm/lib/jta/SynchronizationImpl.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/WrapperImpl.java
src/java/org/objectweb/gotm/lib/jta/XAFlagsConverter.java
src/java/org/objectweb/gotm/lib/jta/XAResourceImpl.java
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
* Initial Release of the Java Transaction Service (JTS) Personality for the
GoTM framework.
-----------------------------------------------------------------------------------+
.classpath
| 22
.cvsignore
| 1
.project
| 20
build.xml
| 98 ++
example/local/.cvsignore
| 1
example/local/build.xml
| 192 +++++
example/local/src/config/local.xml
| 18
example/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
| 24
example/local/src/fractal/org/objectweb/gotm/jts/local/FcCounterImpl.fractal
| 17
example/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal
| 14
example/local/src/fractal/org/objectweb/gotm/jts/local/FcJtaClient.fractal
| 16
example/local/src/fractal/org/objectweb/gotm/lib/FcActivationFctr.fractal
| 30
example/local/src/fractal/org/objectweb/gotm/lib/FcCoordinatorFctr.fractal
| 21
example/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
| 14
example/local/src/fractal/org/objectweb/gotm/lib/FcInterruptionFctr.fractal
| 21
example/local/src/fractal/org/objectweb/gotm/lib/FcJTSFctr.fractal
| 33
example/local/src/fractal/org/objectweb/gotm/lib/FcManagerFctr.fractal
| 45 +
example/local/src/fractal/org/objectweb/gotm/lib/FcTerminatorFctr.fractal
| 57 +
example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionFctr.fractal
| 41 +
example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal
| 17
example/local/src/java/org/objectweb/gotm/jts/local/Counter.java
| 53 +
example/local/src/java/org/objectweb/gotm/jts/local/CounterAttributes.java
| 51 +
example/local/src/java/org/objectweb/gotm/jts/local/CounterImpl.java
| 189 +++++
example/local/src/java/org/objectweb/gotm/jts/local/InvokeRunnableAction.java
| 69 +
example/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
| 204 +++++
example/local/src/java/org/objectweb/gotm/jts/remote/ServerLauncher.java
| 43 +
example/local/src/java/org/objectweb/gotm/jts/remote/TransactionTest.java
| 46 +
externals/jta/jta-1_01.jar
| <<Binary file>>
src/config/JTA.xml
| 25
src/fractal/org/objectweb/gotm/api/jta/FcSynchronization.fractal
| 11
src/fractal/org/objectweb/gotm/api/jta/FcTransaction.fractal
| 11
src/fractal/org/objectweb/gotm/api/jta/FcTransactionManager.fractal
| 11
src/fractal/org/objectweb/gotm/api/jta/FcUserTransaction.fractal
| 11
src/fractal/org/objectweb/gotm/api/jta/FcXAResource.fractal
| 11
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionFctr.fractal
| 10
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionImpl.fractal
| 23
src/fractal/org/objectweb/gotm/lib/jta/FcTransactionManagerImpl.fractal
| 12
src/java/org/objectweb/gotm/browser/jta/TransactionCommitAction.java
| 74 ++
src/java/org/objectweb/gotm/browser/jta/TransactionPanel.java
| 120 +++
src/java/org/objectweb/gotm/browser/jta/TransactionRollbackAction.java
| 73 ++
src/java/org/objectweb/gotm/browser/jta/TransactionSetRollbackOnlyAction.java
| 73 ++
src/java/org/objectweb/gotm/lib/jta/Action.java
| 44 +
src/java/org/objectweb/gotm/lib/jta/EventConverter.java
| 44 +
src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
| 103 ++
src/java/org/objectweb/gotm/lib/jta/SynchronizationImpl.java
| 102 ++
src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
| 282 ++++++++
src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
| 261 +++++++
src/java/org/objectweb/gotm/lib/jta/WrapperImpl.java
| 84 ++
src/java/org/objectweb/gotm/lib/jta/XAFlagsConverter.java
| 79 ++
src/java/org/objectweb/gotm/lib/jta/XAResourceImpl.java
| 195 +++++
test/java/org/objectweb/gotm/jts/xa/XABoolean.java
| 75 ++
test/java/org/objectweb/gotm/jts/xa/XAInteger.java
| 75 ++
test/java/org/objectweb/gotm/jts/xa/XAObject.java
| 349 ++++++++++
53 files changed, 3515 insertions(+)
Index: gotm-jts/.classpath
diff -u /dev/null gotm-jts/.classpath:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/.classpath Fri Jul 30 18:46:11 2004
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="src" path="src/fractal"/>
+ <classpathentry kind="src" path="example/local/src/java"/>
+ <classpathentry kind="src" path="example/local/src/fractal"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="/gotm"/>
+ <classpathentry kind="lib" path="externals/jta/jta-1_01.jar"/>
+ <classpathentry kind="lib"
path="/gotm/externals/fractal/fractal.jar"/>
+ <classpathentry kind="src" path="/ow-transaction"/>
+ <classpathentry kind="lib"
path="/gotm/externals/fractal-adl/fractal-adl.jar"/>
+ <classpathentry kind="lib"
path="/gotm/externals/monolog/ow_monolog.jar"/>
+ <classpathentry kind="lib"
path="/Users/rouvoy/workspace/gotm-workspace/gotm-explorer/externals/browser/fractal-plugin.jar"/>
+ <classpathentry kind="lib"
path="/Users/rouvoy/workspace/gotm-workspace/gotm-explorer/externals/browser/fractal-browser.jar"/>
+ <classpathentry kind="lib"
path="/Users/rouvoy/workspace/gotm-workspace/gotm-explorer/externals/browser/browser.jar"/>
+ <classpathentry kind="src" path="/gotm-explorer"/>
+ <classpathentry kind="src" path="test/java"/>
+ <classpathentry kind="lib"
path="/gotm/externals/utils/ow_util_trace.jar"/>
+ <classpathentry kind="lib"
path="/gotm/externals/fractal-rmi/fractal-rmi.jar"/>
+ <classpathentry kind="output" path="build/class"/>
+</classpath>
Index: gotm-jts/.cvsignore
diff -u /dev/null gotm-jts/.cvsignore:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/.cvsignore Fri Jul 30 18:46:11 2004
@@ -0,0 +1 @@
+build
Index: gotm-jts/.project
diff -u /dev/null gotm-jts/.project:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/.project Fri Jul 30 18:46:11 2004
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gotm-jts</name>
+ <comment></comment>
+ <projects>
+ <project>ow-transaction</project>
+ <project>gotm</project>
+ <project>gotm-explorer</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Index: gotm-jts/build.xml
diff -u /dev/null gotm-jts/build.xml:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/build.xml Fri Jul 30 18:46:11 2004
@@ -0,0 +1,98 @@
+<!-- ==================================================================== -->
+
+<!-- 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 2004/07/30 16:46:11 rouvoy Exp $ -->
+<!-- ==================================================================== -->
+
+<project name="gotm-jts" default="jts-all">
+ <description>GoTM Project [gotm.objectweb.org] - GoTM is an open
Transaction Monitor - Java Personalities</description>
+
+ <property name="src.dir" value="src"/>
+ <property name="fractal.dir" value="${src.dir}/fractal"/>
+ <property name="java.dir" value="${src.dir}/java"/>
+ <property name="log.dir" value="${src.dir}/log"/>
+ <property name="cfg.dir" value="${src.dir}/config"/>
+
+ <property name="class.dir" value="class"/>
+ <property name="lib.dir" value="lib"/>
+
+ <property name="build.dir" value="${basedir}/build"/>
+
+ <property name="gotm.jar" value="ow_gotm_jts.jar"/>
+ <property name="gotm.version" value="0.1a"/>
+ <property name="dist.name" value="GoTM-JTS"/>
+
+ <path id="classpath">
+ <fileset dir="${build.dir}/${lib.dir}" includes="**/*.jar"/>
+ <pathelement location="${build.dir}/${class.dir}"/>
+ </path>
+
+
+ <target name="jts-all" description="jts-clean + jts-build">
+ <antcall target="jts-clean"/>
+ <antcall target="jts-build"/>
+ </target>
+
+ <target name="jts-prepare">
+ <ant dir="${basedir}/../gotm-explorer" target="explorer-build"/>
+ <copy todir="${build.dir}/${lib.dir}">
+ <mapper type="flatten"/>
+ <fileset dir="${basedir}/externals" includes="**/*"/>
+ </copy>
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${cfg.dir}" includes="**/*"/>
+ </copy>
+ </target>
+
+ <target name="jts-compile" depends="jts-prepare"
+ description="Compiles GoTM Java personalities">
+ <mkdir dir="${build.dir}/${class.dir}"/>
+ <javac srcdir="${basedir}/${java.dir}"
+ destdir="${build.dir}/${class.dir}"
+ debug="on">
+ <classpath refid="classpath"/>
+ <include name="org/objectweb/gotm/**/*.java"/>
+ </javac>
+ </target>
+
+ <target name="jts-fractal" depends="jts-compile">
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${fractal.dir}">
+ <include name="**/*.fractal"/>
+ </fileset>
+ </copy>
+
+ </target>
+
+ <target name="jts-build" depends="jts-fractal"
+ description="build GoTM Java personalities">
+ <jar destfile="${build.dir}/${lib.dir}/${gotm.jar}">
+ <fileset dir="${build.dir}/${class.dir}" includes="**/*"/>
+ </jar>
+ </target>
+
+ <target name="jts-clean"
+ description="clean GoTM Java personalities">
+ <delete dir="${build.dir}" failonerror="no"/>
+ </target>
+</project>
\ No newline at end of file
Index: gotm-jts/example/local/.cvsignore
diff -u /dev/null gotm-jts/example/local/.cvsignore:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/example/local/.cvsignore Fri Jul 30 18:46:11 2004
@@ -0,0 +1 @@
+build
Index: gotm-jts/example/local/build.xml
diff -u /dev/null gotm-jts/example/local/build.xml:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/example/local/build.xml Fri Jul 30 18:46:11 2004
@@ -0,0 +1,192 @@
+<!-- ==================================================================== -->
+
+<!-- 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 2004/07/30 16:46:11 rouvoy Exp $ -->
+<!-- ==================================================================== -->
+
+<project name="gotm-jts-examples" default="local-all">
+ <description>GoTM JTS Examples [gotm.objectweb.org] - GoTM is an open
Transaction Monitor</description>
+
+ <property name="src.dir" value="src"/>
+ <property name="fractal.dir" value="${src.dir}/fractal"/>
+ <property name="java.dir" value="${src.dir}/java"/>
+ <property name="cfg.dir" value="${src.dir}/config"/>
+
+ <property name="class.dir" value="class"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="julia.dir" value="julia"/>
+
+ <property name="build.dir" value="${basedir}/build"/>
+
+ <property name="examples.jar" value="ow_gotm_jts_examples.jar"/>
+ <property name="examples.version" value="0.1a"/>
+ <property name="dist.name" value="GoTM-JTS-Examples"/>
+
+ <path id="classpath">
+ <fileset dir="${build.dir}/${lib.dir}" includes="**/*.jar"/>
+ <pathelement location="${build.dir}/${class.dir}"/>
+ </path>
+
+
+
+ <target name="local-all" description="local-clean + local-run">
+ <antcall target="local-clean"/>
+ <antcall target="local-run"/>
+ </target>
+
+
+ <target name="local-prepare">
+ <ant dir="${basedir}/../.." target="jts-build"/>
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${cfg.dir}" includes="**/*"/>
+ </copy>
+ </target>
+
+ <target name="local-compile" depends="local-prepare">
+ <javac srcdir="${basedir}/${java.dir}"
+ destdir="${build.dir}/${class.dir}"
+ debug="on">
+ <classpath refid="classpath"/>
+ <include name="**/*.java"/>
+ </javac>
+ </target>
+
+ <target name="local-fractal" depends="local-compile">
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${fractal.dir}">
+ <include name="**/*.fractal"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="local-build" depends="local-fractal"
+ description="build local JTS example">
+ <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="local-run" depends="local-build"
+ description="run local JTS example">
+ <property name="julia.cfg" value="${build.dir}/${julia.dir}/julia.cfg"/>
+ <property name="gotm.cfg" value="${build.dir}/${julia.dir}/gotm.cfg"/>
+ <java classname="org.objectweb.fractal.adl.Launcher"
+ classpathref="classpath"
+ fork="yes"
+ failonerror="yes">
+ <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},${gotm.cfg}" />
+ <arg line="-fractal org.objectweb.gotm.jts.local.FcExplorer r"/>
+<!-- <arg line="-fractal org.objectweb.gotm.lib.xid.FcXidStateFctr r"/> -->
+ </java>
+ </target>
+
+ <target name="local-test" depends="local-build">
+ <property name="julia.cfg" value="${build.dir}/${julia.dir}/julia.cfg"/>
+ <property name="gotm.cfg" value="${build.dir}/${julia.dir}/gotm.cfg"/>
+ <java classname="Test"
+ classpathref="classpath"
+ fork="yes"
+ failonerror="yes">
+ <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},${gotm.cfg}" />
+ </java>
+ </target>
+
+ <target name="distributed" depends="local-build">
+ </target>
+
+ <property name="julia.cfg" value="${build.dir}/${julia.dir}/julia.cfg"/>
+ <property name="gotm.cfg" value="${build.dir}/${julia.dir}/gotm.cfg"/>
+ <property name="policy" value="${build.dir}/${julia.dir}/java.policy"/>
+
+ <target name="registry">
+ <java classname="org.objectweb.fractal.rmi.registry.Registry"
+ classpathref="classpath"
+ fork="yes"
+ failonerror="yes">
+ <sysproperty key="java.security.policy"
+ value="${policy}"/>
+ <sysproperty key="fractal.provider"
+ value="org.objectweb.fractal.julia.Julia"/>
+ <sysproperty key="julia.loader"
+ value="org.objectweb.fractal.julia.loader.DynamicLoader" />
+ <sysproperty key="julia.loader.use-context-class-loader"
+ value="true" />
+ <sysproperty key="julia.config"
+ value="${julia.cfg},${gotm.cfg}" />
+ </java>
+ </target>
+
+ <target name="client" depends="local-build">
+ <java classname="org.objectweb.gotm.examples.TransactionTest"
+ classpathref="classpath"
+ fork="yes"
+ failonerror="yes">
+ <sysproperty key="java.security.policy"
+ value="${policy}"/>
+ <sysproperty key="java.rmi.server.codebase"
+ value="file:build/class/"/>
+ <sysproperty key="fractal.provider"
+ value="org.objectweb.fractal.julia.Julia"/>
+ <sysproperty key="julia.loader"
+ value="org.objectweb.fractal.julia.loader.DynamicLoader" />
+ <sysproperty key="julia.loader.use-context-class-loader"
+ value="true" />
+ <sysproperty key="julia.config"
+ value="${julia.cfg},${gotm.cfg}" />
+ </java>
+ </target>
+
+ <target name="server" depends="local-build">
+ <java classname="org.objectweb.gotm.examples.ServerLauncher"
+ classpathref="classpath"
+ fork="yes"
+ failonerror="yes">
+ <sysproperty key="java.security.policy"
+ value="${policy}"/>
+ <sysproperty key="fractal.provider"
+ value="org.objectweb.fractal.julia.Julia"/>
+ <sysproperty key="julia.loader"
+ value="org.objectweb.fractal.julia.loader.DynamicLoader" />
+ <sysproperty key="julia.loader.use-context-class-loader"
+ value="true" />
+ <sysproperty key="julia.config"
+ value="${julia.cfg},${gotm.cfg}" />
+ </java>
+ </target>
+
+
+ <target name="local-clean" description="clean JTS examples">
+ <delete dir="${build.dir}" failonerror="no"/>
+ </target>
+</project>
\ No newline at end of file
Index: gotm-jts/example/local/src/config/local.xml
diff -u /dev/null gotm-jts/example/local/src/config/local.xml:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/example/local/src/config/local.xml Fri Jul 30 18:46:10 2004
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<browser>
+
+ <include url="JTA.xml" />
+
+ <!-- ================================================================= -->
+ <!-- Main -->
+ <!-- ================================================================= -->
+ <node type-name="java.lang.Runnable">
+ <menu>
+ <item label="Run">
+ <code>org.objectweb.gotm.jts.local.InvokeRunnableAction</code>
+ </item>
+ </menu>
+ </node>
+
+</browser>
\ No newline at end of file
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,24 @@
+<?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.jts.local.FcApplication">
+
+ <interface name="runnable" role="server"
+ signature="java.lang.Runnable"/>
+
+ <component name="FcClient"
+ definition="org.objectweb.gotm.jts.local.FcJtaClient"/>
+ <component name="FcCounter"
+ definition="org.objectweb.gotm.jts.local.FcCounterImpl"/>
+ <component name="FcTransactionManager"
+ definition="org.objectweb.gotm.lib.FcTransactionManagerImpl"/>
+
+ <binding client="this.runnable"
+ server="FcClient.runnable"/>
+ <binding client="FcClient.transaction-manager"
+ server="FcTransactionManager.transaction-manager"/>
+ <binding client="FcClient.counter"
+ server="FcCounter.component"/>
+</definition>
\ No newline at end of file
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcCounterImpl.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcCounterImpl.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcCounterImpl.fractal
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,17 @@
+<?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.jts.local.FcCounterImpl"
+
extends="org.objectweb.gotm.api.jta.FcSynchronization,org.objectweb.gotm.api.jta.FcXAResource">
+
+ <interface name="counter" role="server"
+ signature="org.objectweb.gotm.jts.local.Counter"/>
+
+ <content class="org.objectweb.gotm.jts.local.CounterImpl"/>
+
+ <attributes signature="org.objectweb.gotm.jts.local.CounterAttributes">
+ <attribute name="counter" value="0"/>
+ </attributes>
+</definition>
\ No newline at end of file
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,14 @@
+<?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.jts.local.FcExplorer">
+ <component name="FcExplorer"
+ definition="org.objectweb.gotm.lib.FcExplorerImpl"/>
+ <component name="FcApplication"
+ definition="org.objectweb.gotm.jts.local.FcApplication"/>
+
+ <binding client="FcExplorer.fcAppl"
+ server="FcApplication.component"/>
+</definition>
\ No newline at end of file
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcJtaClient.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcJtaClient.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/jts/local/FcJtaClient.fractal
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,16 @@
+<?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.jts.local.FcJtaClient">
+
+ <interface name="runnable" role="server"
+ signature="java.lang.Runnable"/>
+ <interface name="transaction-manager" role="client"
+ signature="javax.transaction.TransactionManager"/>
+ <interface name="counter" role="client"
+ signature="org.objectweb.fractal.api.Component"/>
+
+ <content class="org.objectweb.gotm.jts.local.JtaClient"/>
+</definition>
\ No newline at end of file
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcActivationFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcActivationFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcActivationFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,30 @@
+<?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.FcActivationFctr">
+ <interface name="tx-activation" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionActivationFeature"/>
+
+ <interface name="coord-commit" role="client"
+
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+ <interface name="coord-rollback" role="client"
+
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+
+ <component name="FcState"
+
definition="org.objectweb.gotm.lib.transaction.FcTransactionStateFctr"/>
+ <component name="FcActivate"
+
definition="org.objectweb.gotm.lib.transaction.FcTransactionActivationFeatureFctr"/>
+
+ <binding client="this.tx-activation"
+ server="FcActivate.tx-activation"/>
+ <binding client="FcActivate.tx-state"
+ server="FcState.tx-state"/>
+ <binding client="FcActivate.coord-commit"
+ server="this.coord-commit"/>
+ <binding client="FcActivate.coord-rollback"
+ server="this.coord-rollback"/>
+
+ <template-controller desc="compositeTemplate" />
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcCoordinatorFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcCoordinatorFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcCoordinatorFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,21 @@
+<?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.FcCoordinatorFctr">
+ <interface name="subscribe" role="server"
+ signature="org.objectweb.gotm.lib.topic.SubscribeFeature"/>
+ <interface name="publish" role="server"
+ signature="org.objectweb.gotm.lib.topic.PublishFeature"/>
+
+ <component name="FcTopics"
+ definition="org.objectweb.gotm.lib.topic.FcTopicManagerFctr"/>
+
+ <binding client="this.subscribe"
+ server="FcTopics.subscribe"/>
+ <binding client="this.publish"
+ server="FcTopics.publish"/>
+
+ <template-controller desc="compositeTemplate" />
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,14 @@
+<?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.FcExplorerImpl">
+ <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/example/local/src/fractal/org/objectweb/gotm/lib/FcInterruptionFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcInterruptionFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcInterruptionFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,21 @@
+<?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.FcInterruptionFctr">
+ <interface name="tx-interruption" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionInterruptionFeature"/>
+
+ <component name="FcState"
+
definition="org.objectweb.gotm.lib.transaction.FcTransactionStateFctr"/>
+ <component name="FcInterrupt"
+
definition="org.objectweb.gotm.lib.transaction.FcTransactionInterruptionFeatureFctr"/>
+
+ <binding client="this.tx-interruption"
+ server="FcInterrupt.tx-interruption"/>
+ <binding client="FcInterrupt.tx-state"
+ server="FcState.tx-state"/>
+
+ <template-controller desc="compositeTemplate" />
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcJTSFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcJTSFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcJTSFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,33 @@
+<?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.FcJTSFctr"
+
extends="org.objectweb.gotm.api.jta.FcTransaction,org.objectweb.gotm.api.jta.FcUserTransaction">
+
+ <component name="FcAdapter"
+ definition="org.objectweb.gotm.lib.jta.FcTransactionFctr"/>
+ <component name="FcGoTM"
+ definition="org.objectweb.gotm.lib.FcTransactionFctr"/>
+
+ <binding client="this.transaction"
+ server="FcAdapter.transaction"/>
+ <binding client="this.user-transaction"
+ server="FcAdapter.user-transaction"/>
+
+ <binding client="FcAdapter.tx-state"
+ server="FcGoTM.tx-state"/>
+ <binding client="FcAdapter.tx-status"
+ server="FcGoTM.tx-status"/>
+ <binding client="FcAdapter.tx-activation"
+ server="FcGoTM.tx-activation"/>
+ <binding client="FcAdapter.tx-interruption"
+ server="FcGoTM.tx-interruption"/>
+ <binding client="FcAdapter.sync-subscribe"
+ server="FcGoTM.subscribe"/>
+ <binding client="FcAdapter.res-subscribe"
+ server="FcGoTM.subscribe"/>
+
+ <template-controller desc="compositeTemplate" />
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcManagerFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcManagerFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcManagerFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,45 @@
+<?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.FcManagerFctr">
+ <interface name="tx-state" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
+ <interface name="tx-status" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionStatusFeature"/>
+ <interface name="tx-activation" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionActivationFeature"/>
+ <interface name="tx-interruption" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionInterruptionFeature"/>
+
+ <interface name="tx-valid" role="client"
+
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+ <interface name="tx-cancel" role="client"
+
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+ <interface name="publish" role="client"
+ signature="org.objectweb.gotm.lib.topic.PublishFeature"/>
+
+ <component name="FcState"
+
definition="org.objectweb.gotm.lib.transaction.FcTransactionStateFctr"/>
+ <component name="FcActivation"
+ definition="org.objectweb.gotm.lib.FcActivationFctr">
+ <component name="FcState" definition="./FcState"/>
+ </component>
+ <component name="FcInterruption"
+ definition="org.objectweb.gotm.lib.FcInterruptionFctr">
+ <component name="FcState" definition="./FcState"/>
+ </component>
+
+ <binding client="this.tx-state" server="FcState.tx-state"/>
+ <binding client="this.tx-status" server="FcState.tx-status"/>
+ <binding client="this.tx-activation"
server="FcActivation.tx-activation"/>
+ <binding client="this.tx-interruption"
server="FcInterruption.tx-interruption"/>
+
+ <binding client="FcActivation.coord-commit" server="this.tx-valid"/>
+ <binding client="FcActivation.coord-rollback" server="this.tx-cancel"/>
+
+ <binding client="FcState.publish" server="this.publish"/>
+
+ <template-controller desc="compositeTemplate" />
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTerminatorFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTerminatorFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTerminatorFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,57 @@
+<?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.FcTerminatorFctr">
+ <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.gotm.lib.topic.PublishFeature"/>
+ <interface name="subscribe" role="client"
+ signature="org.objectweb.gotm.lib.topic.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.FcAtomicTwoPCCoordinationFeatureFctr"/>
+ <component name="Fc1PC"
+
definition="org.objectweb.gotm.lib.coordination.FcOnePCCoordinationFeatureFctr"/>
+ <component name="FcRollback"
+
definition="org.objectweb.gotm.lib.coordination.FcRollbackCoordinationFeatureFctr"/>
+ <component name="FcDaemon"
+ definition="org.objectweb.gotm.lib.coordination.FcDaemonFctr(10)"/>
+ <component name="FcChecker"
+ definition="org.objectweb.gotm.lib.coordination.FcStatusCheckerFctr"/>
+
+ <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/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionFctr.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,41 @@
+<?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.FcTransactionFctr">
+ <interface name="tx-state" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
+ <interface name="tx-status" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionStatusFeature"/>
+ <interface name="tx-activation" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionActivationFeature"/>
+ <interface name="tx-interruption" role="server"
+
signature="org.objectweb.transaction.api.transaction.TransactionInterruptionFeature"/>
+ <interface name="subscribe" role="server"
+ signature="org.objectweb.gotm.lib.topic.SubscribeFeature"/>
+
+ <component name="FcManager"
+ definition="org.objectweb.gotm.lib.FcManagerFctr"/>
+ <component name="FcCoordinator"
+ definition="org.objectweb.gotm.lib.FcCoordinatorFctr"/>
+ <component name="FcTerminator"
+ definition="org.objectweb.gotm.lib.FcTerminatorFctr"/>
+
+ <binding client="this.tx-state" server="FcManager.tx-state"/>
+ <binding client="this.tx-status" server="FcManager.tx-status"/>
+ <binding client="this.tx-activation" server="FcManager.tx-activation"/>
+ <binding client="this.tx-interruption" server="FcManager.tx-interruption"/>
+ <binding client="this.subscribe" server="FcCoordinator.subscribe"/>
+
+ <binding client="FcManager.tx-valid" server="FcTerminator.process-twopc"/>
+ <binding client="FcManager.tx-cancel"
server="FcTerminator.process-rollback"/>
+ <binding client="FcManager.publish" server="FcCoordinator.publish"/>
+
+ <binding client="FcTerminator.publish" server="FcCoordinator.publish"/>
+ <binding client="FcTerminator.subscribe" server="FcCoordinator.subscribe"/>
+ <binding client="FcTerminator.tx-status" server="FcManager.tx-status"/>
+ <binding client="FcTerminator.tx-state" server="FcManager.tx-state"/>
+
+ <template-controller desc="compositeTemplate"/>
+</definition>
Index:
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal
diff -u /dev/null
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,17 @@
+<?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.FcTransactionManagerImpl"
+ extends="org.objectweb.gotm.api.jta.FcTransactionManager">
+ <component name="FcMonitor"
+ definition="org.objectweb.gotm.lib.jta.FcTransactionManagerImpl"/>
+ <component name="FcTemplate"
+ definition="org.objectweb.gotm.lib.FcJTSFctr"/>
+
+ <binding client="this.transaction-manager"
+ server="FcMonitor.transaction-manager"/>
+ <binding client="FcMonitor.tx-factory"
+ server="FcTemplate.component"/>
+</definition>
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/Counter.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/Counter.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/Counter.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,53 @@
+/*====================================================================
+
+ 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: Counter.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.jts.local;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public interface Counter {
+ /** Comment for <code>COUNTER</code>. */
+ public static final String COUNTER = "counter";
+
+ /**
+ * Initialize the counter value.
+ */
+ public void init();
+
+ /**
+ * Increment the value of the counter.
+ */
+ public void incr();
+
+ /**
+ * @return the value of the counter.
+ */
+ public int value();
+}
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterAttributes.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterAttributes.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterAttributes.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,51 @@
+/*====================================================================
+
+ 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: CounterAttributes.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.jts.local;
+
+import org.objectweb.fractal.api.control.AttributeController;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public interface CounterAttributes
+ extends AttributeController
+{
+ /**
+ * @return the value of the counter.
+ */
+ public int getCounter() ;
+
+
+ /**
+ * Defines the value of the counter.
+ * @param value the value to set
+ */
+ public void setCounter(int value) ;
+}
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterImpl.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterImpl.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/CounterImpl.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,189 @@
+/*====================================================================
+
+ 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: CounterImpl.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.jts.local;
+
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.objectweb.gotm.lib.BasicFeature;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class CounterImpl
+ extends BasicFeature
+ implements Synchronization,
+ XAResource,
+ Counter,
+ CounterAttributes
+{
+ int counter ;
+ int clone ;
+
+ public CounterImpl() {
+ counter = clone = 0 ;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.Synchronization#beforeCompletion()
+ */
+ public void beforeCompletion() {
+ getTrace().info("Receiving beforeCompletion()...");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.Synchronization#afterCompletion(int)
+ */
+ public void afterCompletion(int arg0) {
+ getTrace().info("Receiving afterCompletion("+arg0+")...");
+ if (arg0 == Status.STATUS_COMMITTED) {
+ counter += clone ;
+ }
+ clone = 0 ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.jts.local.Counter#init()
+ */
+ public void init() {
+ counter = clone = 0 ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.jts.local.Counter#incr()
+ */
+ public void incr() {
+ clone++ ;
+ }
+
+ public String toString() {
+ return ""+counter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.jts.local.CounterAttributes#getCounter()
+ */
+ public int getCounter() {
+ return counter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.jts.local.CounterAttributes#setCounter(int)
+ */
+ public void setCounter(int value) {
+ counter = value ;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.jts.local.Counter#value()
+ */
+ public int value() {
+ return counter+clone;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#commit(javax.transaction.xa.Xid,
boolean)
+ */
+ public void commit(Xid arg0, boolean arg1) throws XAException {
+ getTrace().debug("Receiving setTransactionTimeout("+arg0+")");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#end(javax.transaction.xa.Xid,
int)
+ */
+ public void end(Xid arg0, int arg1) throws XAException {
+ getTrace().debug("Receiving end("+arg0+", "+arg1+")");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#forget(javax.transaction.xa.Xid)
+ */
+ public void forget(Xid arg0) throws XAException {
+ getTrace().debug("Receiving forget("+arg0+")");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#getTransactionTimeout()
+ */
+ public int getTransactionTimeout() throws XAException {
+ getTrace().debug("Receiving getTransactionTimeout()");
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.transaction.xa.XAResource#isSameRM(javax.transaction.xa.XAResource)
+ */
+ public boolean isSameRM(XAResource arg0) throws XAException {
+ getTrace().debug("Receiving setTransactionTimeout("+arg0+")");
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#prepare(javax.transaction.xa.Xid)
+ */
+ public int prepare(Xid arg0) throws XAException {
+ getTrace().debug("Receiving prepare("+arg0+")");
+ return XA_OK;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#recover(int)
+ */
+ public Xid[] recover(int arg0) throws XAException {
+ getTrace().debug("Receiving recover("+arg0+")");
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.transaction.xa.XAResource#rollback(javax.transaction.xa.Xid)
+ */
+ public void rollback(Xid arg0) throws XAException {
+ getTrace().debug("Receiving rollback("+arg0+")");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#setTransactionTimeout(int)
+ */
+ public boolean setTransactionTimeout(int arg0) throws XAException {
+ getTrace().debug("Receiving setTransactionTimeout("+arg0+")");
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.xa.XAResource#start(javax.transaction.xa.Xid,
int)
+ */
+ public void start(Xid arg0, int arg1) throws XAException {
+ getTrace().debug("Receiving start("+arg0+", "+arg1+")");
+ }
+
+}
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/InvokeRunnableAction.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/InvokeRunnableAction.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/InvokeRunnableAction.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,69 @@
+/*===========================================================================
+
+ObjectWeb Naming Context Framework
+Copyright (C) 2003 USTL - LIFL - GOAL
+Contact: openccm-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): Jerome Moroy.
+Contributor(s): ______________________________________.
+
+===========================================================================*/
+
+package org.objectweb.gotm.jts.local;
+import org.objectweb.util.browser.api.MenuItem;
+import org.objectweb.util.browser.api.MenuItemTreeView;
+import org.objectweb.util.browser.api.TreeView;
+
+/**
+ * This action allows to invoke the main method of the demo.
+ *
+ * @author <a href="mailto:Jerome.Moroy@xxxxxxx">Jerome Moroy</a>
+ * @version 0.1
+ */
+public class InvokeRunnableAction
+ implements MenuItem
+{
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.api.MenuItem#actionPerformed(org.objectweb.util.browser.api.MenuItemTreeView)
+ */
+ public void actionPerformed(MenuItemTreeView e) {
+ Runnable m = (Runnable)e.getSelectedObject();
+ InvokeThread t = new InvokeThread(m);
+ t.start();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.api.MenuItem#getStatus(org.objectweb.util.browser.api.TreeView)
+ */
+ public int getStatus(TreeView treeView) {
+ return MenuItem.ENABLED_STATUS;
+ }
+
+ public class InvokeThread extends Thread {
+
+ protected Runnable m_ = null;
+
+ public InvokeThread(Runnable m) {
+ m_ = m;
+ }
+
+ public void run() {
+ m_.run();
+ }
+ }
+}
\ No newline at end of file
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,204 @@
+/*====================================================================
+
+ 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: JtaClient.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.jts.local;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+
+import org.objectweb.fractal.api.Component;
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.gotm.lib.BindingFeature;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class JtaClient
+ extends BindingFeature
+ implements Runnable
+{
+ public static final String TX_MANAGER = "transaction-manager";
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.BindingFeature#clientFc()
+ */
+ public String[] clientFc() {
+ return new String[] {TX_MANAGER, Counter.COUNTER};
+ }
+
+ /**
+ * @return
+ */
+ protected TransactionManager getTransactionManager() {
+ try {
+ return (TransactionManager) lookupFc(TX_MANAGER);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return
+ */
+ protected Counter getCounter() {
+ try {
+ return (Counter)
((Component)lookupFc(Counter.COUNTER)).getFcInterface(Counter.COUNTER);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ protected Synchronization getSynchronization() {
+ try {
+ return (Synchronization)
((Component)lookupFc(Counter.COUNTER)).getFcInterface("synchronization");
+ } catch (NoSuchInterfaceException e) {
+ e.printStackTrace();
+ return null ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ protected XAResource getXAResource() {
+ try {
+ return (XAResource)
((Component)lookupFc(Counter.COUNTER)).getFcInterface("xa-resource");
+ } catch (NoSuchInterfaceException e) {
+ e.printStackTrace();
+ return null ;
+ }
+ }
+
+
+ /**
+ *
+ */
+ protected void commit() {
+ getTrace().info("==> Testing Commit");
+ getTrace().info("Counter == "+getCounter().value());
+ getTrace().info("Beginning a transaction");
+ try {
+ getTransactionManager().begin();
+ try {
+ getTrace().info("Registering synchronization");
+
getTransactionManager().getTransaction().registerSynchronization(getSynchronization());
+
getTransactionManager().getTransaction().enlistResource(getXAResource());
+ } catch (IllegalStateException e2) {
+ e2.printStackTrace();
+ } catch (RollbackException e2) {
+ e2.printStackTrace();
+ }
+ getTrace().info("Applying modifications");
+ } catch (NotSupportedException e) {
+ e.printStackTrace();
+ } catch (SystemException e) {
+ e.printStackTrace();
+ }
+ getCounter().incr(); ;
+ getTrace().info("Counter == "+getCounter().value());
+ try {
+ getTrace().info("Committing the transaction");
+ getTransactionManager().commit();
+ } catch (SecurityException e1) {
+ e1.printStackTrace();
+ } catch (IllegalStateException e1) {
+ e1.printStackTrace();
+ } catch (RollbackException e1) {
+ e1.printStackTrace();
+ } catch (HeuristicMixedException e1) {
+ e1.printStackTrace();
+ } catch (HeuristicRollbackException e1) {
+ e1.printStackTrace();
+ } catch (SystemException e1) {
+ e1.printStackTrace();
+ }
+ getTrace().info("Counter == "+getCounter().value());
+ }
+
+ /**
+ *
+ */
+ protected void rollback() {
+ getTrace().info("==> Testing Rollback");
+ getTrace().info("Counter == "+getCounter().value());
+ getTrace().info("Beginning a transaction");
+ try {
+ getTransactionManager().begin();
+ try {
+ getTrace().info("Registering synchronization");
+
getTransactionManager().getTransaction().registerSynchronization(getSynchronization());
+
getTransactionManager().getTransaction().enlistResource(getXAResource());
+ } catch (IllegalStateException e2) {
+ e2.printStackTrace();
+ } catch (RollbackException e2) {
+ e2.printStackTrace();
+ }
+ getTrace().info("Applying modifications");
+ } catch (NotSupportedException e) {
+ e.printStackTrace();
+ } catch (SystemException e) {
+ e.printStackTrace();
+ }
+ getCounter().incr(); ;
+ getTrace().info("Counter == "+getCounter().value());
+ try {
+ getTrace().info("Rolling back the transaction");
+ getTransactionManager().rollback();
+ } catch (SecurityException e1) {
+ e1.printStackTrace();
+ } catch (IllegalStateException e1) {
+ e1.printStackTrace();
+ } catch (SystemException e) {
+ e.printStackTrace();
+ }
+ getTrace().info("Counter == "+getCounter().value());
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ System.out.println("** JTA Client **");
+ getTrace().info("Starting the client");
+ commit();
+ rollback();
+ getTrace().info("Stopping the client");
+ }
+}
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/ServerLauncher.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/ServerLauncher.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/ServerLauncher.java
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,43 @@
+/***
+ * Julia: France Telecom's implementation of the Fractal API
+ * Copyright (C) 2001-2002 France Telecom R&D
+ *
+ * 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 of the License, or (at your option) 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
+ *
+ * Contact: Eric.Bruneton@xxxxxxxxxxxxxxxxxxxx
+ *
+ * Author: Eric Bruneton, Romain Rouvoy
+ */
+
+package org.objectweb.gotm.jts.remote;
+
+import org.objectweb.fractal.rmi.registry.NamingService;
+import org.objectweb.fractal.rmi.registry.Registry;
+
+import org.objectweb.fractal.util.Fractal;
+
+public class ServerLauncher {
+
+ public static void main (final String[] args) throws Exception {
+ // the RMI class loader does not work if there is no security manager
+ System.setSecurityManager(new SecurityManager());
+
+ String name = args.length>=1?args[0]:"server-host";
+ NamingService ns = Registry.getRegistry();
+ ns.bind(name, Fractal.getBootstrapComponent());
+
+ System.err.println("Server " + name + " ready.");
+ }
+}
Index:
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/TransactionTest.java
diff -u /dev/null
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/TransactionTest.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/example/local/src/java/org/objectweb/gotm/jts/remote/TransactionTest.java
Fri Jul 30 18:46:11 2004
@@ -0,0 +1,46 @@
+package org.objectweb.gotm.jts.remote;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.objectweb.fractal.rmi.registry.NamingService;
+import org.objectweb.fractal.rmi.registry.Registry;
+
+/**
+ * @author rouvoy
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class TransactionTest {
+ public static void main(String[] args) {
+ // the RMI class loader does not work if there is no security manager
+ System.setSecurityManager(new SecurityManager());
+
+ System.out.println("Launching GoTM...");
+ NamingService ns=null;
+ try {
+ ns = Registry.getRegistry();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ Map context = new HashMap();
+// context.put("resource-node", ns.lookup("server-host"));
+ context.put("transaction-node", ns.lookup("server-host"));
+
+// try {
+// context.put("browser-node", Fractal.getBootstrapComponent());
+// } catch (InstantiationException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// }
+
+
//Gotm.getFactory().create("org.objectweb.gotm.lib.FcGoTMBrowserImpl",context);
+ //Gotm.create("org.objectweb.gotm.lib.xid.FcXidStateImpl");
+ //Gotm.create("org.objectweb.gotm.lib.FcTransactionManagerImpl");
+
+ System.out.println("Browser created!");
+ }
+}
Index: gotm-jts/externals/jta/jta-1_01.jar
cvs rdiff: failed to read diff file header /tmp/cvseu5PQz for jta-1_01.jar,v:
end of file
Index: gotm-jts/src/config/JTA.xml
diff -u /dev/null gotm-jts/src/config/JTA.xml:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/config/JTA.xml Fri Jul 30 18:46:10 2004
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<browser>
+ <include url="GoTM.xml"/>
+
+ <!-- ================================================================= -->
+ <!-- Transaction -->
+ <!-- ================================================================= -->
+
+ <node type-name="javax.transaction.Transaction">
+
<panel><code>org.objectweb.gotm.browser.jta.TransactionPanel</code></panel>
+ <menu>
+ <item label="Commit">
+ <code>org.objectweb.gotm.browser.jta.TransactionCommitAction</code>
+ </item>
+ <item label="Rollback">
+
<code>org.objectweb.gotm.browser.jta.TransactionRollbackAction</code>
+ </item>
+ <item label="Set Rollback Only">
+
<code>org.objectweb.gotm.browser.jta.TransactionSetRollbackOnlyAction</code>
+ </item>
+ </menu>
+ </node>
+
+</browser>
\ No newline at end of file
Index:
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcSynchronization.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcSynchronization.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcSynchronization.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,11 @@
+<?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.api.jta.FcSynchronization">
+
+ <interface name="synchronization" role="server"
+ signature="javax.transaction.Synchronization"/>
+
+</definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransaction.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransaction.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransaction.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,11 @@
+<?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.api.jta.FcTransaction">
+
+ <interface name="transaction" role="server"
+ signature="javax.transaction.Transaction"/>
+
+</definition>
Index:
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransactionManager.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransactionManager.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcTransactionManager.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,11 @@
+<?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.api.jta.FcTransactionManager">
+
+ <interface name="transaction-manager" role="server"
+ signature="javax.transaction.TransactionManager"/>
+
+</definition>
Index:
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcUserTransaction.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcUserTransaction.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcUserTransaction.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,11 @@
+<?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.api.jta.FcUserTransaction">
+
+ <interface name="user-transaction" role="server"
+ signature="javax.transaction.UserTransaction"/>
+
+</definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcXAResource.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcXAResource.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/api/jta/FcXAResource.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,11 @@
+<?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.api.jta.FcXAResource">
+
+ <interface name="xa-resource" role="server"
+ signature="javax.transaction.xa.XAResource"/>
+
+</definition>
Index:
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionFctr.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionFctr.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionFctr.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,10 @@
+<?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.jta.FcTransactionFctr"
+ extends="org.objectweb.gotm.lib.jta.FcTransactionImpl">
+
+ <template-controller desc="primitiveTemplate"/>
+</definition>
Index:
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionImpl.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionImpl.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionImpl.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,23 @@
+<?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.jta.FcTransactionImpl"
+
extends="org.objectweb.gotm.api.jta.FcTransaction,org.objectweb.gotm.api.jta.FcUserTransaction">
+
+ <interface name="tx-state" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
+ <interface name="tx-status" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionStatusFeature"/>
+ <interface name="tx-activation" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionActivationFeature"/>
+ <interface name="tx-interruption" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionInterruptionFeature"/>
+ <interface name="sync-subscribe" role="client"
+ signature="org.objectweb.gotm.lib.topic.SubscribeFeature"/>
+ <interface name="res-subscribe" role="client"
+ signature="org.objectweb.gotm.lib.topic.SubscribeFeature"/>
+
+ <content class="org.objectweb.gotm.lib.jta.TransactionImpl"/>
+</definition>
Index:
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionManagerImpl.fractal
diff -u /dev/null
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionManagerImpl.fractal:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/src/fractal/org/objectweb/gotm/lib/jta/FcTransactionManagerImpl.fractal
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,12 @@
+<?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.jta.FcTransactionManagerImpl"
+ extends="org.objectweb.gotm.api.jta.FcTransactionManager">
+ <interface name="tx-factory" role="client"
+ signature="org.objectweb.fractal.api.Component"/>
+
+ <content class="org.objectweb.gotm.lib.jta.TransactionManagerImpl"/>
+</definition>
Index:
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionCommitAction.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionCommitAction.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionCommitAction.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,74 @@
+/*====================================================================
+
+ 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: TransactionCommitAction.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.browser.jta;
+
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+
+import org.objectweb.fractal.api.Interface;
+import org.objectweb.fractal.api.control.LifeCycleController;
+import org.objectweb.util.browser.api.MenuItem;
+import org.objectweb.util.browser.api.MenuItemTreeView;
+import org.objectweb.util.browser.api.TreeView;
+import org.objectweb.util.browser.plugins.fractal.FcBrowser;
+import
org.objectweb.util.browser.plugins.fractal.menu.DefaultFractalMenuItem;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class TransactionCommitAction
+ extends DefaultFractalMenuItem
+{
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.api.MenuItem#getStatus(org.objectweb.util.browser.api.TreeView)
+ */
+ public int getStartedStatus(TreeView arg0) {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ if (FcBrowser.getLifeCycleState((Interface)tx) ==
LifeCycleController.STOPPED)
+ return getStoppedStatus(arg0);
+ try {
+ if (tx.getStatus() == Status.STATUS_NO_TRANSACTION)
+ return MenuItem.DISABLED_STATUS;
+ } catch (SystemException e) {
+ return MenuItem.DISABLED_STATUS;
+ }
+ return MenuItem.ENABLED_STATUS;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.DefaultFractalMenuItem#actionStartedPerformed(org.objectweb.util.browser.api.MenuItemEvent)
+ */
+ public void actionStartedPerformed(MenuItemTreeView arg0) throws
Exception {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ tx.commit();
+ }
+}
\ No newline at end of file
Index: gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionPanel.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionPanel.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionPanel.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,120 @@
+/*====================================================================
+
+ 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: TransactionPanel.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.browser.jta;
+
+import java.awt.Color;
+
+import javax.swing.Box;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+
+import org.objectweb.util.browser.api.TreeView;
+import org.objectweb.util.browser.gui.lib.LabelBox;
+import
org.objectweb.util.browser.plugins.fractal.panel.DefaultFractalViewPanel;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class TransactionPanel
+ extends DefaultFractalViewPanel
+{
+ protected JPanel my_panel_ ;
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.panel.FractalViewPanel#selectedStarted(org.objectweb.util.browser.api.TreeView)
+ */
+ public void selectedStarted(TreeView arg0) {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ my_panel_ = new JPanel();
+ my_panel_.setBackground(Color.white);
+ my_panel_.setBorder(new TitledBorder(null,"JTA Transaction
attributes ",TitledBorder.CENTER,TitledBorder.TOP));
+
+ Box box = Box.createVerticalBox();
+
+ String status = "" ;
+
+ try {
+ switch (tx.getStatus()) {
+ case Status.STATUS_ACTIVE:
+ status = "Active" ;
+ break;
+ case Status.STATUS_COMMITTED:
+ status = "Committed" ;
+ break;
+ case Status.STATUS_COMMITTING:
+ status = "Committing" ;
+ break;
+ case Status.STATUS_MARKED_ROLLBACK:
+ status = "Marked Rollback" ;
+ break;
+ case Status.STATUS_NO_TRANSACTION:
+ status = "No Transaction" ;
+ break;
+ case Status.STATUS_PREPARED:
+ status = "Prepared" ;
+ break;
+ case Status.STATUS_PREPARING:
+ status = "Preparing" ;
+ break;
+ case Status.STATUS_ROLLEDBACK:
+ status = "Rolled Back" ;
+ break;
+ case Status.STATUS_ROLLING_BACK:
+ status = "Rolling Back" ;
+ break;
+ default:
+ status = "Unknown" ;
+ }
+ } catch (SystemException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ LabelBox status_label = new LabelBox("Status",status);
+ box.add(status_label);
+ my_panel_.add(box);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.panel.FractalViewPanel#getStartedPanel()
+ */
+ public JPanel getStartedPanel() {
+ return my_panel_;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.panel.FractalViewPanel#unselectedStarted(org.objectweb.util.browser.api.TreeView)
+ */
+ public void unselectedStarted(TreeView arg0) {
+ }
+}
\ No newline at end of file
Index:
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionRollbackAction.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionRollbackAction.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionRollbackAction.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,73 @@
+/*====================================================================
+
+ 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: TransactionRollbackAction.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.browser.jta;
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+
+import org.objectweb.fractal.api.Interface;
+import org.objectweb.fractal.api.control.LifeCycleController;
+import org.objectweb.util.browser.api.MenuItem;
+import org.objectweb.util.browser.api.MenuItemTreeView;
+import org.objectweb.util.browser.api.TreeView;
+import org.objectweb.util.browser.plugins.fractal.FcBrowser;
+import
org.objectweb.util.browser.plugins.fractal.menu.DefaultFractalMenuItem;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class TransactionRollbackAction
+ extends DefaultFractalMenuItem
+{
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.api.MenuItem#getStatus(org.objectweb.util.browser.api.TreeView)
+ */
+ public int getStartedStatus(TreeView arg0) {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ if (FcBrowser.getLifeCycleState((Interface)tx) ==
LifeCycleController.STOPPED)
+ return getStoppedStatus(arg0);
+ try {
+ if (tx.getStatus() == Status.STATUS_NO_TRANSACTION)
+ return MenuItem.DISABLED_STATUS;
+ } catch (SystemException e) {
+ return MenuItem.DISABLED_STATUS;
+ }
+ return MenuItem.ENABLED_STATUS;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.DefaultFractalMenuItem#actionStartedPerformed(org.objectweb.util.browser.api.MenuItemEvent)
+ */
+ public void actionStartedPerformed(MenuItemTreeView arg0) throws
Exception {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ tx.rollback();
+ }
+}
\ No newline at end of file
Index:
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionSetRollbackOnlyAction.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionSetRollbackOnlyAction.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++
gotm-jts/src/java/org/objectweb/gotm/browser/jta/TransactionSetRollbackOnlyAction.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,73 @@
+/*====================================================================
+
+ 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: TransactionSetRollbackOnlyAction.java,v 1.1 2004/07/30 16:46:10 rouvoy
Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.browser.jta;
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+
+import org.objectweb.fractal.api.Interface;
+import org.objectweb.fractal.api.control.LifeCycleController;
+import org.objectweb.util.browser.api.MenuItem;
+import org.objectweb.util.browser.api.MenuItemTreeView;
+import org.objectweb.util.browser.api.TreeView;
+import org.objectweb.util.browser.plugins.fractal.FcBrowser;
+import
org.objectweb.util.browser.plugins.fractal.menu.DefaultFractalMenuItem;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class TransactionSetRollbackOnlyAction
+ extends DefaultFractalMenuItem
+{
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.api.MenuItem#getStatus(org.objectweb.util.browser.api.TreeView)
+ */
+ public int getStartedStatus(TreeView arg0) {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ if (FcBrowser.getLifeCycleState((Interface)tx) ==
LifeCycleController.STOPPED)
+ return getStoppedStatus(arg0);
+ try {
+ if (tx.getStatus() == Status.STATUS_NO_TRANSACTION)
+ return MenuItem.DISABLED_STATUS;
+ } catch (SystemException e) {
+ return MenuItem.DISABLED_STATUS;
+ }
+ return MenuItem.ENABLED_STATUS;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.browser.plugins.fractal.DefaultFractalMenuItem#actionStartedPerformed(org.objectweb.util.browser.api.MenuItemEvent)
+ */
+ public void actionStartedPerformed(MenuItemTreeView arg0) throws
Exception {
+ Transaction tx = (Transaction) arg0.getSelectedObject();
+ tx.setRollbackOnly();
+ }
+}
\ No newline at end of file
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/Action.java
diff -u /dev/null gotm-jts/src/java/org/objectweb/gotm/lib/jta/Action.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/Action.java Fri Jul 30
18:46:10 2004
@@ -0,0 +1,44 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2000-2004 INRIA & 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: Action.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+====================================================================*/
+
+package org.objectweb.gotm.lib.jta;
+
+import java.util.Map;
+
+/**
+ * Configurable actions.
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public interface Action {
+ /**
+ * Executes the current action.
+ * @param ctx the parameters for the action.
+ */
+ public void execute(Map ctx);
+}
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/EventConverter.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/lib/jta/EventConverter.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/EventConverter.java Fri
Jul 30 18:46:10 2004
@@ -0,0 +1,44 @@
+/*====================================================================
+
+ 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: EventConverter.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.lib.jta;
+
+import org.objectweb.transaction.api.Feature;
+import org.objectweb.transaction.api.event.Event;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public interface EventConverter
+ extends Feature
+{
+ public static final String EVENT_CONVERTER = "event-converter";
+
+ public int toValue(Event evt) ;
+}
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/StatusConverter.java Fri
Jul 30 18:46:10 2004
@@ -0,0 +1,103 @@
+/*====================================================================
+
+ 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: StatusConverter.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.lib.jta;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.transaction.Status;
+
+import org.objectweb.gotm.lib.BasicFeature;
+import org.objectweb.transaction.api.event.Event;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitting;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusMarkedRollback;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusNoTransaction;
+import org.objectweb.transaction.lib.transaction.TransactionStatusPrepared;
+import org.objectweb.transaction.lib.transaction.TransactionStatusPreparing;
+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.TransactionStatusUnknown;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class StatusConverter
+ extends BasicFeature
+ implements EventConverter
+{
+ private Map values ;
+
+ public StatusConverter() {
+ setValues(new HashMap());
+ getValues().put(TransactionStatusNoTransaction.status,
+ new Integer(Status.STATUS_NO_TRANSACTION));
+ getValues().put(TransactionStatusTransactionActive.status,
+ new Integer(Status.STATUS_ACTIVE));
+ getValues().put(TransactionStatusPreparing.status,
+ new Integer(Status.STATUS_PREPARING));
+ getValues().put(TransactionStatusPrepared.status,
+ new Integer(Status.STATUS_PREPARED));
+ getValues().put(TransactionStatusCommitting.status,
+ new Integer(Status.STATUS_COMMITTING));
+ getValues().put(TransactionStatusCommitted.status,
+ new Integer(Status.STATUS_COMMITTED));
+ getValues().put(TransactionStatusRollingBack.status,
+ new Integer(Status.STATUS_ROLLING_BACK));
+ getValues().put(TransactionStatusRolledBack.status,
+ new Integer(Status.STATUS_ROLLEDBACK));
+ getValues().put(TransactionStatusMarkedRollback.status,
+ new Integer(Status.STATUS_MARKED_ROLLBACK));
+ getValues().put(TransactionStatusUnknown.status,
+ new Integer(Status.STATUS_UNKNOWN));
+ }
+
+ /**
+ * @return Returns the values.
+ */
+ protected Map getValues() {
+ return values;
+ }
+
+ /**
+ * @param values The values to set.
+ */
+ protected void setValues(Map values) {
+ this.values = values;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.gotm.lib.jta.EventConverter#toValue(org.objectweb.transaction.api.event.Event)
+ */
+ public int toValue(Event evt) {
+ return ((Integer)getValues().get(evt)).intValue();
+ }
+}
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationImpl.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationImpl.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationImpl.java
Fri Jul 30 18:46:10 2004
@@ -0,0 +1,102 @@
+/*====================================================================
+
+ 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: SynchronizationImpl.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.lib.jta;
+
+
+import java.util.Map;
+
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
+import org.objectweb.transaction.lib.transaction.TransactionStatusPrepared;
+import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class SynchronizationImpl
+ extends WrapperImpl
+{
+ public static final String SYNCHRONIZATION = "synchronization";
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.BindingFeature#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {SYNCHRONIZATION};
+ }
+
+ protected Synchronization getSynchronization() {
+ try {
+ return (Synchronization) lookupFc(SYNCHRONIZATION);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.jta.WrapperImpl#declare()
+ */
+ protected void declare() {
+ putAction(TransactionStatusPrepared.status.getLabel(),
+ new BeforeCompletion());
+ putAction(TransactionStatusCommitted.status.getLabel(),
+ new AfterCompletion(Status.STATUS_COMMITTED));
+ putAction(TransactionStatusRolledBack.status.getLabel(),
+ new AfterCompletion(Status.STATUS_ROLLEDBACK));
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ try {
+ return
getSynchronization().equals(((SynchronizationImpl)obj).getSynchronization());
+ } catch (ClassCastException ex) {
+ return false;
+ }
+ }
+
+ private class BeforeCompletion implements Action {
+ public void execute(Map context) {
+ SynchronizationImpl.this.getSynchronization().beforeCompletion();
+ }
+ }
+ private class AfterCompletion implements Action {
+ private int status ;
+ public AfterCompletion(int status) { this.status = status;}
+ public void execute(Map context) {
+
SynchronizationImpl.this.getSynchronization().afterCompletion(status);
+ }
+ }
+}
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
diff -u /dev/null
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.1
--- /dev/null Fri Jul 30 18:46:11 2004
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java Fri
Jul 30 18:46:10 2004
@@ -0,0 +1,282 @@
+/*====================================================================
+
+ 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: TransactionImpl.java,v 1.1 2004/07/30 16:46:10 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.lib.jta;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
+import javax.transaction.xa.XAResource;
+
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.fractal.api.control.BindingController;
+import org.objectweb.fractal.api.control.IllegalBindingException;
+import org.objectweb.fractal.api.control.IllegalLifeCycleException;
+import org.objectweb.gotm.lib.BindingFeature;
+import org.objectweb.gotm.lib.topic.SubscribeFeature;
+import
org.objectweb.transaction.api.transaction.TransactionActivationFeature;
+import
org.objectweb.transaction.api.transaction.TransactionInterruptionFeature;
+import org.objectweb.transaction.api.transaction.TransactionState;
+import org.objectweb.transaction.api.transaction.TransactionStatusFeature;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusMarkedRollback;
+
+/**
+ *
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @version 0.1
+ */
+public class TransactionImpl
+ extends BindingFeature
+ implements Transaction,
+ UserTransaction,
+ BindingController
+{
+ public static final String SYNCHRONIZATION ="sync-subscribe" ;
+ public static final String RESOURCE = "res-subscribe";
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.BindingController#listFc()
+ */
+ public String[] clientFc() {
+ return new String[] {
+ TransactionStatusFeature.STATUS_FEATURE,
+ TransactionActivationFeature.TX_ACTIVATION_FEATURE,
+
TransactionInterruptionFeature.TRANSACTION_INTERRUPTION_FEATURE,
+ TransactionState.TRANSACTION_STATE,
+ SYNCHRONIZATION,
+ RESOURCE,
+ EventConverter.EVENT_CONVERTER
+ };
+ }
+
+ /**
+ * @return Returns the txStatus.
+ */
+ protected TransactionStatusFeature getTxStatus() {
+ try {
+ return (TransactionStatusFeature)
lookupFc(TransactionStatusFeature.STATUS_FEATURE);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the txActivation.
+ */
+ protected TransactionActivationFeature getTxActivation() {
+ try {
+ return (TransactionActivationFeature)
lookupFc(TransactionActivationFeature.TX_ACTIVATION_FEATURE);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the txInterruption.
+ */
+ protected TransactionInterruptionFeature getTxInterruption() {
+ try {
+ return (TransactionInterruptionFeature)
lookupFc(TransactionInterruptionFeature.TRANSACTION_INTERRUPTION_FEATURE);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the txState.
+ */
+ protected TransactionState getTxState() {
+ try {
+ return (TransactionState)
lookupFc(TransactionState.TRANSACTION_STATE);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the syncEnlist.
+ */
+ protected SubscribeFeature getSyncSubscribe() {
+ try {
+ return (SubscribeFeature) lookupFc(SYNCHRONIZATION);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the resEnlist.
+ */
+ protected SubscribeFeature getResSubscribe() {
+ try {
+ return (SubscribeFeature) lookupFc(RESOURCE);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * @return Returns the event converter.
+ */
+ protected EventConverter getEventConverter() {
+ try {
+ return (EventConverter) lookupFc(SYNCHRONIZATION);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.Transaction#commit()
+ */
+ public void commit()
+ throws RollbackException,
+ HeuristicMixedException,
+ HeuristicRollbackException,
+ SecurityException,
+ IllegalStateException,
+ SystemException
+ {
+ getTxActivation().commit();
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.transaction.Transaction#delistResource(javax.transaction.xa.XAResource,
int)
+ */
+ public boolean delistResource(XAResource arg0, int arg1)
+ throws IllegalStateException,
+ SystemException
+ {
+ // TODO Implement resource unregistration.
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.transaction.Transaction#enlistResource(javax.transaction.xa.XAResource)
+ */
+ public boolean enlistResource(XAResource arg0)
+ throws RollbackException,
+ IllegalStateException,
+ SystemException
+ {
+ XAResourceImpl res = new XAResourceImpl();
+ try {
+ res.bindFc("xa-resource",arg0);
+ } catch (NoSuchInterfaceException e) {
+ getTrace().debug(e.getMessage());
+
+ } catch (IllegalBindingException e) {
+ getTrace().debug(e.getMessage());
+
+ } catch (IllegalLifeCycleException e) {
+ getTrace().debug(e.getMessage());
+ }
+ res.configure(getResSubscribe());
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.transaction.Transaction#getStatus()
+ */
+ public int getStatus()
+ throws SystemException
+ {
+ return getEventConverter().toValue(getTxStatus().getStatus()) ;
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.transaction.Transaction#registerSynchronization(javax.transaction.Synchronization)
+ */
+ public void registerSynchronization(Synchronization arg0)
+ throws RollbackException,
+ IllegalStateException,
+ SystemException
+ {//TODO: Instance of Fractal component.
+ SynchronizationImpl sync = new SynchronizationImpl();
+ try {
+ sync.bindFc("synchronizatio