OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | gotm-commits List | August 2005 Index

<--  Date Index  --> <--  Thread Index  -->

CVS update of gotm-jts (14 files)


    Date: Monday, August 8, 2005 @ 15:30:05
  Author: rouvoy
    Path: /cvsroot/gotm/gotm-jts

   Added: 
src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal
Modified: .settings/org.eclipse.core.resources.prefs
          
examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
          
          
examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
          
          examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
           src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal
          src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal
          src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal
          src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal
          src/java/org/objectweb/gotm/lib/JtsFactory.java
          
src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
           src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
          src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
          src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java

* Improving the JTS personality of GoTM,
* Updating JUNIT Test Suite.


-------------------------------------------------------------------------------+
 .settings/org.eclipse.core.resources.prefs                                   
 |    9 
 examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java    
 |   16 +
 
examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal 
|    2 
 examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java          
 |    6 
 src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal     
 |   25 ++
 src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal                    
 |   54 ++---
 src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal             
 |   10 -
 src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal                 
 |   47 ++--
 src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal                     
 |   90 +++++----
 src/java/org/objectweb/gotm/lib/JtsFactory.java                              
 |   28 ++
 src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java       
 |   14 -
 src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java                     
 |   33 ++-
 src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java              
 |   52 +++--
 src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java         
 |   96 +++++++++-
 14 files changed, 329 insertions(+), 153 deletions(-)


Index: gotm-jts/.settings/org.eclipse.core.resources.prefs
diff -u gotm-jts/.settings/org.eclipse.core.resources.prefs:1.8 
gotm-jts/.settings/org.eclipse.core.resources.prefs:1.9
--- gotm-jts/.settings/org.eclipse.core.resources.prefs:1.8     Mon Jul 18 
09:30:05 2005
+++ gotm-jts/.settings/org.eclipse.core.resources.prefs Mon Aug  8 15:30:05 
2005
@@ -1,11 +1,12 @@
-#Mon Jul 11 15:24:14 CEST 2005
+#Thu Aug 04 14:17:21 CEST 2005
 eclipse.preferences.version=1
-encoding//examples/benchmark/src/fractal/org/objectweb/gotm/jts/benchmark/FcApplication.fractal=ISO-8859-1
-encoding//examples/benchmark/src/fractal/org/objectweb/gotm/jts/benchmark/FcExplorer.fractal=ISO-8859-1
-encoding//examples/benchmark/src/fractal/org/objectweb/gotm/lib/FcBenchExplorer.fractal=ISO-8859-1
+encoding//examples/benchmark/src/fractal/org/objectweb/benchmark/FcBenchmark2PC.fractal=ISO-8859-1
+encoding//examples/benchmark/src/fractal/org/objectweb/benchmark/FcBenchmarkAPC.fractal=ISO-8859-1
+encoding//examples/benchmark/src/fractal/org/objectweb/benchmark/FcBenchmarkJTS.fractal=ISO-8859-1
 
encoding//examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal=ISO-8859-1
 
encoding//examples/local/src/fractal/org/objectweb/gotm/jts/local/FcExplorer.fractal=ISO-8859-1
 
encoding//examples/local/src/fractal/org/objectweb/gotm/lib/FcLocalExplorer.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal=ISO-8859-1
 
encoding//src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal=ISO-8859-1
 
encoding//src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal=ISO-8859-1
 
encoding//src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal=ISO-8859-1
Index: 
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
diff -u 
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java:1.1
 
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java:1.2
--- 
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java:1.1
      Mon Jul 18 09:30:05 2005
+++ 
gotm-jts/examples/junit/src/java/org/objectweb/gotm/jts/tck/GoTMLocalTestCase.java
  Mon Aug  8 15:30:05 2005
@@ -23,11 +23,12 @@
 Contributor(s): .
 
 ---------------------------------------------------------------------
-$Id: GoTMLocalTestCase.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+$Id: GoTMLocalTestCase.java,v 1.2 2005/08/08 13:30:05 rouvoy Exp $
 ====================================================================*/
 package org.objectweb.gotm.jts.tck;
 
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.transaction.TransactionManager;
 
@@ -37,14 +38,21 @@
 /**
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 12 juil. 2005
- * @modified $Date: 2005/07/18 07:30:05 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.2 $
  * @fractal.itf 
  */
 public class GoTMLocalTestCase
         extends LocalTestCase {
 
-    private static TransactionManager gotm = JtsFactory.create(new 
HashMap());
+    private static TransactionManager gotm ;
+
+    static {
+        Map ctx = new HashMap() ;
+        ctx.put("protocol", "org.objectweb.gotm.lib.protocol.Tp2PCNoLog");
+        
ctx.put("communication","org.objectweb.gotm.lib.event.TpEventBusSimple");
+        gotm = JtsFactory.create(ctx);
+    }
     
     /**
      * @param name the name of the test to execute.
Index: 
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
diff -u 
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal:1.2
 
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal:1.3
--- 
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal:1.2
  Mon Jul 11 10:27:08 2005
+++ 
gotm-jts/examples/local/src/fractal/org/objectweb/gotm/jts/local/FcApplication.fractal
      Mon Aug  8 15:30:04 2005
@@ -13,7 +13,7 @@
   <component name="FcCounter"
        definition="org.objectweb.gotm.jts.local.FcCounterImpl"/>
   <component name="FcTransactionManager"
-       definition="org.objectweb.gotm.lib.JtsTransactionManager"/>
+       
definition="org.objectweb.gotm.lib.JtsTransactionManager(org.objectweb.gotm.lib.protocol.Tp2PCNoLog,org.objectweb.gotm.lib.event.TpEventBusSimple)"/>
 
   <binding client="this.runnable"
            server="FcClient.runnable"/>
Index: 
gotm-jts/examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java
diff -u 
gotm-jts/examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java:1.1
 
gotm-jts/examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java:1.2
--- 
gotm-jts/examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java:1.1
    Tue Jun 28 10:02:27 2005
+++ 
gotm-jts/examples/local/src/java/org/objectweb/gotm/jts/local/JtaClient.java  
      Mon Aug  8 15:30:05 2005
@@ -22,7 +22,7 @@
  Contributor(s): ______________________________________.
 
  ---------------------------------------------------------------------
- $Id: JtaClient.java,v 1.1 2005/06/28 08:02:27 rouvoy Exp $
+ $Id: JtaClient.java,v 1.2 2005/08/08 13:30:05 rouvoy Exp $
  ====================================================================*/
 
 package org.objectweb.gotm.jts.local;
@@ -44,8 +44,8 @@
 /**
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 3 janv. 2005
- * @modified $Date: 2005/06/28 08:02:27 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.2 $
  * @fractal.itf name="runnable" signature="java.lang.Runnable"
  * @fractal.itf name="transaction-manager" role="client" 
signature="javax.transaction.TransactionManager"
  * @fractal.itf name="counter" role="client" 
signature="org.objectweb.fractal.api.Component"
Index: 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal
diff -u /dev/null 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal:1.1
--- /dev/null   Mon Aug  8 15:30:05 2005
+++ 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsAdaptiveTransactionManager.fractal
   Mon Aug  8 15:30:05 2005
@@ -0,0 +1,25 @@
+<?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">
+
+<definition name="org.objectweb.gotm.lib.JtsAdaptiveTransactionManager">
+  <interface name="transaction-manager" role="server"
+         signature="javax.transaction.TransactionManager"/>
+
+  <component name="FcMonitor"
+       definition="org.objectweb.gotm.lib.jta.FcTransactionManagerImpl"/>
+  <component name="FcCurrent"
+       
definition="org.objectweb.gotm.lib.context.FcConfigurableCurrentManager"/>
+  <component name="FcContext"
+       
definition="org.objectweb.gotm.lib.context.FcCommitProtocolAwareness"/>
+
+  <binding client="this.transaction-manager" 
+           server="FcMonitor.tx-manager"/>
+  <binding client="FcMonitor.current-manager"
+           server="FcCurrent.current-manager"/>
+  <binding client="FcCurrent.context-awareness"
+           server="FcContext.context-awareness"/>
+  <binding client="FcContext.configurable"
+           server="FcCurrent.configurable"/>
+</definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal
diff -u 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.2 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.3
--- gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal:1.2    
  Mon Jul 18 09:30:05 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransaction.fractal  Mon 
Aug  8 15:30:05 2005
@@ -3,48 +3,36 @@
           "-//objectweb.org//DTD Fractal ADL 2.0//EN" 
           "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
 
-<definition name="org.objectweb.gotm.lib.JtsTransaction" 
arguments="validation">
+<definition name="org.objectweb.gotm.lib.JtsTransaction" 
arguments="protocol,communication">
   <interface name="transaction" role="server"
          signature="javax.transaction.Transaction"/>
   <interface name="user-transaction" role="server"
          signature="javax.transaction.UserTransaction"/>
   <interface name="suspend-feature" role="server"
          signature="org.objectweb.gotm.lib.jta.Suspendable"/>
+  <interface name="subscribe" role="server"
+        signature="org.objectweb.transaction.api.event.SubscribeFeature"/>
          
-  <component name="FcAdapter"
+  <component name="AdapterJTS"
        definition="org.objectweb.gotm.lib.jta.TpTransactionImpl"/>
-  <component name="FcGoTM"
-       definition="org.objectweb.gotm.lib.TpTransaction(${validation})"/>
-  <component name="FcResource"
-       definition="org.objectweb.gotm.lib.TpResourceManager"/>
-  <component name="FcConverter"
+  <component name="ConverterJTS"
        definition="org.objectweb.gotm.lib.jta.TpStatusConverter"/>
+  <component name="Transaction"
+       
definition="org.objectweb.gotm.lib.TpTransaction(${protocol},${communication})"/>
+
+  <binding client="this.transaction"      server="AdapterJTS.transaction"/>
+  <binding client="this.user-transaction" 
server="AdapterJTS.user-transaction"/>
+  <binding client="this.suspend-feature"  
server="AdapterJTS.suspend-feature"/>
+  <binding client="this.subscribe"        server="Transaction.subscribe"/>
+  
+  <binding client="AdapterJTS.tx-state"         
server="Transaction.tx-state"/>
+  <binding client="AdapterJTS.commit-one"       server="Transaction.one-pc"/>
+  <binding client="AdapterJTS.commit"           server="Transaction.two-pc"/>
+  <binding client="AdapterJTS.rollback"         server="Transaction.abort"/>
+  <binding client="AdapterJTS.timeout-attr"     
server="Transaction.timeout-attr"/>
+  <binding client="AdapterJTS.synchronization"  
server="Transaction.synchronization"/>
+  <binding client="AdapterJTS.xa-resource"      
server="Transaction.xa-resource"/>
+  <binding client="AdapterJTS.status-converter" 
server="ConverterJTS.event-converter"/>
 
-  <binding client="this.transaction"
-           server="FcAdapter.transaction"/>
-  <binding client="this.user-transaction"
-           server="FcAdapter.user-transaction"/>
-  <binding client="this.suspend-feature"
-           server="FcAdapter.suspend-feature"/>
-           
-  <binding client="FcAdapter.tx-state"
-           server="FcGoTM.tx-state"/>
-  <binding client="FcAdapter.synchronization"
-           server="FcResource.synchronization"/>
-  <binding client="FcAdapter.xa-resource"
-           server="FcResource.xa-resource"/>
-  <binding client="FcResource.subscribe"
-           server="FcGoTM.subscribe"/>
-  <binding client="FcResource.tx-state"
-           server="FcGoTM.tx-state"/>
-  <binding client="FcAdapter.commit"
-           server="FcGoTM.process-twopc"/>
-  <binding client="FcAdapter.rollback"
-           server="FcGoTM.process-rollback"/>
-  <binding client="FcAdapter.status-converter"
-           server="FcConverter.event-converter"/>
-  <binding client="FcAdapter.timeout-attr"
-           server="FcGoTM.timeout-attr"/>
-           
   <template-controller desc="compositeTemplate" />
 </definition>
Index: 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal
diff -u 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal:1.1 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal:1.2
--- 
gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal:1.1 
      Mon Jul 11 10:27:08 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/JtsTransactionManager.fractal 
  Mon Aug  8 15:30:05 2005
@@ -3,17 +3,21 @@
           "-//objectweb.org//DTD Fractal ADL 2.0//EN" 
           "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
 
-<definition name="org.objectweb.gotm.lib.JtsTransactionManager">
+<definition name="org.objectweb.gotm.lib.JtsTransactionManager" 
arguments="protocol,communication">
   <interface name="transaction-manager" role="server"
          signature="javax.transaction.TransactionManager"/>
 
   <component name="FcMonitor"
        definition="org.objectweb.gotm.lib.jta.FcTransactionManagerImpl"/>
+  <component name="FcCurrent"
+       definition="org.objectweb.gotm.lib.FcStaticCurrentManager"/>
   <component name="FcTemplate"
-       
definition="org.objectweb.gotm.lib.JtsTransaction(org.objectweb.gotm.lib.coordination.Tp2PC)"/>
+       
definition="org.objectweb.gotm.lib.JtsTransaction(${protocol},${communication})"/>
 
   <binding client="this.transaction-manager" 
            server="FcMonitor.tx-manager"/>
-  <binding client="FcMonitor.factory"
+  <binding client="FcMonitor.current-manager"
+           server="FcCurrent.current-manager"/>
+  <binding client="FcCurrent.factory"
            server="FcTemplate.component"/>
 </definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal
diff -u 
gotm-jts/src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal:1.1 
gotm-jts/src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal:1.2
--- gotm-jts/src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal:1.1 
  Mon Jul 11 10:27:08 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/TpResourceManager.fractal     
  Mon Aug  8 15:30:05 2005
@@ -1,17 +1,26 @@
 <?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">
+          "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
 
-<definition name="org.objectweb.gotm.lib.TpResourceManager">
+<definition name="org.objectweb.gotm.lib.TpResourceManager" 
arguments="ResLog">
   <interface name="synchronization" role="server"
         signature="org.objectweb.gotm.lib.resource.ResourceManager"/>
   <interface name="xa-resource" role="server"
         signature="org.objectweb.gotm.lib.resource.ResourceManager"/>
+
   <interface name="subscribe" role="client"
         signature="org.objectweb.transaction.api.event.SubscribeFeature"/>
   <interface name="tx-state" role="client"
         
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
+  <interface name="xid-provider" role="client"
+        signature="org.objectweb.gotm.lib.xid.XidFeature"/>
+  <interface name="vote-log" role="client"
+        signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+  <interface name="commit-ack-log" role="client"
+        signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+  <interface name="abort-ack-log" role="client"
+        signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
 
   <component name="FcSynchronizationManager" 
        definition="org.objectweb.gotm.lib.resource.TpResourceManagerImpl"/>
@@ -22,8 +31,6 @@
        definition="org.objectweb.gotm.lib.resource.TpResourceManagerImpl"/>
   <component name="FcXAResourceActions"
        
definition="org.objectweb.gotm.lib.jta.xa.TpXAResourceActionProvider"/>
-  <component name="FcXidProvider"
-       definition="org.objectweb.gotm.lib.jta.xa.TpXidProvider"/>
 <!--
   <component name="FcThread"
        definition="org.objectweb.util.thread.comp.TpThreadManager(10,100)"/>
@@ -33,25 +40,21 @@
            server="FcThread.runnable-manager"/>
 -->
 
-  <binding client="this.synchronization" 
-           server="FcSynchronizationManager.resource"/>
+  <binding client="this.synchronization" 
server="FcSynchronizationManager.resource"/>
+  <binding client="this.xa-resource"     
server="FcXAResourceManager.resource"/>
+
   <binding client="FcSynchronizationManager.action-provider"
            server="FcSynchronizationActions.action-provider"/>
-  <binding client="FcSynchronizationManager.subscribe" 
-           server="this.subscribe"/>
-  <binding client="FcSynchronizationManager.tx-state" 
-           server="this.tx-state"/>
-
-  <binding client="this.xa-resource" 
-           server="FcXAResourceManager.resource"/>
-  <binding client="FcXAResourceManager.action-provider"
-           server="FcXAResourceActions.action-provider"/>
-  <binding client="FcXAResourceActions.xid-provider" 
-           server="FcXidProvider.xid-provider"/>
-  <binding client="FcXAResourceManager.subscribe" 
-           server="this.subscribe"/>
-  <binding client="FcXAResourceManager.tx-state" 
-           server="this.tx-state"/>
-         
+  <binding client="FcSynchronizationManager.subscribe" 
server="this.subscribe"/>
+  <binding client="FcSynchronizationManager.tx-state"  
server="this.tx-state"/>
+
+  <binding client="FcXAResourceManager.action-provider" 
server="FcXAResourceActions.action-provider"/>
+  <binding client="FcXAResourceManager.subscribe"       
server="this.subscribe"/>
+  <binding client="FcXAResourceManager.tx-state"        
server="this.tx-state"/>
+  <binding client="FcXAResourceActions.xid-provider"    
server="this.xid-provider"/>
+  <binding client="FcXAResourceActions.vote-log"        
server="this.vote-log"/>
+  <binding client="FcXAResourceActions.commit-ack-log"  
server="this.commit-ack-log"/>
+  <binding client="FcXAResourceActions.abort-ack-log"   
server="this.abort-ack-log"/>
+
   <template-controller desc="compositeTemplate" />
 </definition>
Index: gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal
diff -u gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal:1.2 
gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal:1.3
--- gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal:1.2     
  Mon Jul 18 16:33:37 2005
+++ gotm-jts/src/fractal/org/objectweb/gotm/lib/TpTransaction.fractal   Mon 
Aug  8 15:30:05 2005
@@ -3,53 +3,75 @@
           "-//objectweb.org//DTD Fractal ADL 2.0//EN"
           "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
 
-<definition name="org.objectweb.gotm.lib.TpTransaction" 
arguments="validation">
+<definition name="org.objectweb.gotm.lib.TpTransaction" 
arguments="protocol,communication">
   <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="process-twopc" role="server"
+  <interface name="one-pc" role="server"
         
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
-  <interface name="process-rollback" role="server"
+  <interface name="two-pc" role="server"
+        
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+  <interface name="abort" role="server"
         
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
   <interface name="subscribe" role="server"
         signature="org.objectweb.transaction.api.event.SubscribeFeature"/>
   <interface name="timeout-attr" role="server"
         signature="org.objectweb.gotm.lib.coordination.TimeoutAttribute"/>
+  <interface name="synchronization" role="server"
+        signature="org.objectweb.gotm.lib.resource.ResourceManager"/>
+  <interface name="xa-resource" role="server"
+        signature="org.objectweb.gotm.lib.resource.ResourceManager"/>
 
   <component name="TransactionState"
        
definition="org.objectweb.gotm.lib.transaction.TpTransactionStateAuto"/>
-  <component name="EventBus"
-       definition="org.objectweb.gotm.lib.event.TpEventBus"/>
-  <component name="ValidationProcotol"
-       definition="${validation}"/>
-  <component name="Logging"
-       definition="org.objectweb.gotm.lib.logging.TpLoggingHOWL"/>
-  <component name="Timeout"
-       definition="org.objectweb.gotm.lib.coordination.TpTimeoutImpl"/>
-  <component name="Xid"
+  <component name="CommitEngine"
+       definition="org.objectweb.gotm.lib.coordination.TpCommitEngine"/>
+  <component name="ResourceManager"
+       definition="org.objectweb.gotm.lib.TpResourceManager"/>
+  <component name="CommitProtocol"
+       definition="${protocol}"/>
+  <component name="LogManager"
+       
definition="org.objectweb.gotm.lib.logging.TpLogManagerHOWL(log-${protocol},output)"/>
+  <component name="CommunicationManager"
+       definition="${communication}"/>
+  <component name="XidFactory"
        definition="org.objectweb.gotm.lib.jta.xa.TpXidProvider"/>
 
-  <binding client="this.tx-state"         
server="TransactionState.tx-state"/>
-  <binding client="this.tx-status"        
server="TransactionState.tx-status"/>
-  <binding client="this.process-twopc"    
server="ValidationProcotol.commit"/>
-  <binding client="this.process-rollback" server="ValidationProcotol.abort"/>
-  <binding client="this.subscribe"        server="EventBus.subscribe"/>
-  <binding client="this.timeout-attr"     server="Timeout.timeout-attr"/>
-
-  <binding client="TransactionState.publish" server="EventBus.sync-publish"/>
-
-  <binding client="ValidationProcotol.tx-state"      
server="TransactionState.tx-state"/>
-  <binding client="ValidationProcotol.sync-publish"  
server="EventBus.sync-publish"/>
-  <binding client="ValidationProcotol.async-publish" 
server="EventBus.async-publish"/>
-  <binding client="ValidationProcotol.force"         server="Logging.force"/>
-  <binding client="ValidationProcotol.no-force"      
server="Logging.no-force"/>
-  <binding client="ValidationProcotol.empty"         server="Logging.empty"/>
-
-  <binding client="Logging.xid-provider" server="Xid.xid-provider"/>
-    
-  <binding client="Timeout.subscribe"     server="EventBus.subscribe"/>
-  <binding client="Timeout.coord-process" server="ValidationProcotol.abort"/>
+  <binding client="this.tx-state"        server="TransactionState.tx-state"/>
+  <binding client="this.two-pc"          server="CommitEngine.commit"/>
+  <binding client="this.one-pc"          server="CommitEngine.commit-one"/>
+  <binding client="this.abort"           server="CommitEngine.abort"/>
+  <binding client="this.timeout-attr"    server="CommitEngine.timeout-attr"/>
+  <binding client="this.subscribe"       
server="CommunicationManager.subscribe"/>
+  <binding client="this.synchronization" 
server="ResourceManager.synchronization"/>
+  <binding client="this.xa-resource"     
server="ResourceManager.xa-resource"/>
+
+  <binding client="TransactionState.publish" 
server="CommunicationManager.sync-publish"/>
+
+  <binding client="CommitEngine.tx-state"          
server="TransactionState.tx-state"/>
+  <binding client="CommitEngine.timeout-subscribe" 
server="CommunicationManager.subscribe"/>
+  <binding client="CommitEngine.prepare-decision"  
server="CommitProtocol.prepare-decision"/>
+  <binding client="CommitEngine.commit-decision"   
server="CommitProtocol.commit-decision"/>
+  <binding client="CommitEngine.abort-decision"    
server="CommitProtocol.abort-decision"/>
+  <binding client="CommitEngine.init-log"          
server="CommitProtocol.init-log"/>
+  <binding client="CommitEngine.commit-log"        
server="CommitProtocol.commit-log"/>
+  <binding client="CommitEngine.abort-log"         
server="CommitProtocol.abort-log"/>
+  <binding client="CommitEngine.commit-end-log"    
server="CommitProtocol.commit-end-log"/>
+  <binding client="CommitEngine.abort-end-log"     
server="CommitProtocol.abort-end-log"/>
+  
+  <binding client="ResourceManager.tx-state"       
server="TransactionState.tx-state"/>
+  <binding client="ResourceManager.subscribe"      
server="CommunicationManager.subscribe"/>
+  <binding client="ResourceManager.xid-provider"   
server="XidFactory.xid-provider"/>
+  <binding client="ResourceManager.vote-log"       
server="CommitProtocol.vote-log"/>
+  <binding client="ResourceManager.commit-ack-log" 
server="CommitProtocol.commit-ack-log"/>
+  <binding client="ResourceManager.abort-ack-log"  
server="CommitProtocol.abort-ack-log"/>
+
+  <binding client="CommitProtocol.sync-publish"  
server="CommunicationManager.sync-publish"/>
+  <binding client="CommitProtocol.async-publish" 
server="CommunicationManager.async-publish"/>
+  <binding client="CommitProtocol.force"         server="LogManager.force"/>
+  <binding client="CommitProtocol.no-force"      
server="LogManager.no-force"/>
+  <binding client="CommitProtocol.empty"         server="LogManager.empty"/>
+
+  <binding client="LogManager.xid-provider" 
server="XidFactory.xid-provider"/>
 
   <template-controller desc="compositeTemplate"/>
 </definition>
Index: gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java
diff -u gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java:1.1 
gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java:1.2
--- gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java:1.1        Mon 
Jul 18 09:30:05 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/JtsFactory.java    Mon Aug  8 
15:30:05 2005
@@ -23,7 +23,7 @@
 Contributor(s): .
 
 ---------------------------------------------------------------------
-$Id: JtsFactory.java,v 1.1 2005/07/18 07:30:05 rouvoy Exp $
+$Id: JtsFactory.java,v 1.2 2005/08/08 13:30:05 rouvoy Exp $
 ====================================================================*/
 package org.objectweb.gotm.lib;
 
@@ -31,13 +31,14 @@
 
 import javax.transaction.TransactionManager;
 
+import org.objectweb.fractal.api.Interface;
 import org.objectweb.gotm.Gotm;
 
 /**
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 11 juil. 2005
- * @modified $Date: 2005/07/18 07:30:05 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.2 $
  */
 public class JtsFactory {
     /** <code>DEFAULT_ADL</code> . */
@@ -49,7 +50,24 @@
      * @param context
      * @return an instance of transaction manager.
      */
-    public static TransactionManager create(Map context) {
-        return (TransactionManager)Gotm.create(DEFAULT_ADL, context, 
DEFAULT_ITF);
+    public static final TransactionManager create(Map context) {
+        return create(DEFAULT_ADL,context);
+    }
+
+    /**
+     * @param desc 
+     * @param context
+     * @return an instance of transaction manager.
+     */
+    public static final TransactionManager create(String desc, Map context) {
+        return (TransactionManager)Gotm.create(desc, context, DEFAULT_ITF);
+    }
+
+    /**
+     * Stops the transaction manager.
+     * @param tm the transaction manager to stop.
+     */
+    public static final void stop(TransactionManager tm) {
+        Gotm.stop((Interface)tm);
     }
 }
Index: 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
diff -u 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.4
 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.5
--- 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java:1.4
 Mon Jul 18 16:33:37 2005
+++ 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/SynchronizationActionProvider.java
     Mon Aug  8 15:30:05 2005
@@ -22,7 +22,7 @@
  Contributor(s): ______________________________________.
 
  ---------------------------------------------------------------------
- $Id: SynchronizationActionProvider.java,v 1.4 2005/07/18 14:33:37 rouvoy 
Exp $
+ $Id: SynchronizationActionProvider.java,v 1.5 2005/08/08 13:30:05 rouvoy 
Exp $
  ====================================================================*/
 package org.objectweb.gotm.lib.jta;
 
@@ -35,17 +35,17 @@
 import org.objectweb.gotm.lib.resource.ActionProviderAbstract;
 import org.objectweb.gotm.lib.resource.Action;
 import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
-import org.objectweb.transaction.lib.transaction.TransactionStatusCommitting;
+import 
org.objectweb.transaction.lib.transaction.TransactionStatusMarkedRollback;
 import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
-import 
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
+import 
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
 
 /**
  * Implementation of a <code>ResourceManagerWithPool</code> for the 
  * <code>Synchronization</code> object.
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 22 déc. 2004
- * @modified $Date: 2005/07/18 14:33:37 $
- * @version $Revision: 1.4 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.5 $
  * @fractal.itf name="sync-action-provider" 
signature="org.objectweb.gotm.lib.resource.ActionProvider"
  */
 public class SynchronizationActionProvider 
@@ -89,9 +89,9 @@
      */
     protected Map declareActions() {
         Map a = new HashMap();
-        a.put(TransactionStatusCommitting.status,
+        a.put(TransactionStatusTransactionActive.leaves,
                 new BeforeCompletion());
-        a.put(TransactionStatusRollingBack.status,
+        a.put(TransactionStatusMarkedRollback.leaves,
                 new BeforeCompletion());
         a.put(TransactionStatusCommitted.status,
                 new AfterCompletion(Status.STATUS_COMMITTED));
Index: gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java
diff -u 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.11 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.12
--- gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java:1.11    
  Mon Jul 18 16:33:37 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionImpl.java   Mon 
Aug  8 15:30:05 2005
@@ -22,7 +22,7 @@
  Contributor(s): ______________________________________.
  
  ---------------------------------------------------------------------
- $Id: TransactionImpl.java,v 1.11 2005/07/18 14:33:37 rouvoy Exp $
+ $Id: TransactionImpl.java,v 1.12 2005/08/08 13:30:05 rouvoy Exp $
  ====================================================================*/
 
 package org.objectweb.gotm.lib.jta;
@@ -57,11 +57,12 @@
  * Adapter for the Java Transaction API (JTA).
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 24 déc. 2004
- * @modified $Date: 2005/07/18 14:33:37 $
- * @version $Revision: 1.11 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.12 $
  * @fractal.itf name="transaction" signature="javax.transaction.Transaction"
  * @fractal.itf name="user-transaction" 
signature="javax.transaction.UserTransaction"
  * @fractal.itf name="commit" role="client" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
+ * @fractal.itf name="commit-one" role="client" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
  * @fractal.itf name="rollback" role="client" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
  * @fractal.itf name="synchronization" role="client" 
signature="org.objectweb.gotm.lib.resource.ResourceManager"
  * @fractal.itf name="xa-resource" role="client" 
signature="org.objectweb.gotm.lib.resource.ResourceManager"
@@ -75,6 +76,9 @@
     /** Fractal ADL Identifier for the <code>COMMIT</code> interface. */
     public static final String COMMIT = "commit";
 
+    /** Fractal ADL Identifier for the <code>COMMIT</code> interface. */
+    public static final String COMMIT_ONE = "commit-one";
+
     /** Fractal ADL Identifier for the <code>ROLLBACK</code> interface. */
     public static final String ROLLBACK = "rollback";
 
@@ -93,7 +97,7 @@
      * @see org.objectweb.fractal.api.control.BindingController#listFc()
      */
     public String[] clientFc() {
-        return new String[] { COMMIT, ROLLBACK,
+        return new String[] { COMMIT, ROLLBACK,COMMIT_ONE,
                 TransactionState.TRANSACTION_STATE, SYNCHRONIZATION, 
RESOURCE,
                 STATUS_CONVERTER, TimeoutAttribute.TIMEOUT_ATTRIBUTE };
     }
@@ -101,21 +105,28 @@
     /**
      * @return the commit coordination process.
      */
-    protected CoordinationFeature getTxCommit() {
+    protected final CoordinationFeature getTxCommit() {
         return (CoordinationFeature) fcBindings.get(COMMIT);
     }
 
     /**
+     * @return the commit coordination process.
+     */
+    protected final CoordinationFeature getTxCommitOne() {
+        return (CoordinationFeature) fcBindings.get(COMMIT_ONE);
+    }
+    
+    /**
      * @return the rollback coordination process.
      */
-    protected CoordinationFeature getTxRollback() {
+    protected final CoordinationFeature getTxRollback() {
         return (CoordinationFeature) fcBindings.get(ROLLBACK);
     }
 
     /**
      * @return Returns the txState.
      */
-    protected TransactionState getTxState() {
+    protected final TransactionState getTxState() {
         return (TransactionState) fcBindings
                 .get(TransactionState.TRANSACTION_STATE);
     }
@@ -123,25 +134,25 @@
     /**
      * @return Returns the syncEnlist.
      */
-    protected ResourceManager getSynchronization() {
+    protected final ResourceManager getSynchronization() {
         return (ResourceManager) fcBindings.get(SYNCHRONIZATION);
     }
 
     /**
      * @return Returns the resEnlist.
      */
-    protected ResourceManager getResource() {
+    protected final ResourceManager getResource() {
         return (ResourceManager) fcBindings.get(RESOURCE);
     }
 
     /**
      * @return Returns the event converter.
      */
-    protected EventConverter getStatusConverter() {
+    protected final EventConverter getStatusConverter() {
         return (EventConverter) fcBindings.get(STATUS_CONVERTER);
     }
 
-    protected TimeoutAttribute getTimeout() {
+    protected final TimeoutAttribute getTimeout() {
         return (TimeoutAttribute) fcBindings
                 .get(TimeoutAttribute.TIMEOUT_ATTRIBUTE);
     }
Index: 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java
diff -u 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.5 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.6
--- 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java:1.5  
      Mon Jul 18 09:30:04 2005
+++ gotm-jts/src/java/org/objectweb/gotm/lib/jta/TransactionManagerImpl.java  
  Mon Aug  8 15:30:05 2005
@@ -22,7 +22,7 @@
  Contributor(s): ______________________________________.
 
  ---------------------------------------------------------------------
- $Id: TransactionManagerImpl.java,v 1.5 2005/07/18 07:30:04 rouvoy Exp $
+ $Id: TransactionManagerImpl.java,v 1.6 2005/08/08 13:30:05 rouvoy Exp $
  ====================================================================*/
 
 package org.objectweb.gotm.lib.jta;
@@ -39,19 +39,21 @@
 
 import org.objectweb.fractal.api.Interface;
 import org.objectweb.fractal.api.NoSuchInterfaceException;
-import org.objectweb.gotm.lib.CurrentHandler;
+import org.objectweb.fractal.lib.BindablePrimitive;
+import org.objectweb.gotm.lib.CurrentManager;
 
 /**
  * Implementation of the <code>javax.transaction.TransactionManager</code> 
  * interface based on the GoTM library.
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 3 janv. 2005
- * @modified $Date: 2005/07/18 07:30:04 $
- * @version $Revision: 1.5 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.6 $
  * @fractal.itf name="tx-manager" 
signature="javax.transaction.TransactionManager"
+ * @fractal.itf name="current-manager" role="client" 
signature="org.objectweb.gotm.lib.CurrentManager"
  */
 public class TransactionManagerImpl
-        extends CurrentHandler
+extends BindablePrimitive
         implements TransactionManager {
 
     /** The default timeout. */
@@ -71,15 +73,29 @@
         this.txTimeout = txTimeout;
     }
 
+    /* (non-Javadoc)
+     * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
+     */
+    protected String[] clientFc() {
+        return new String[]{CurrentManager.CURRENT_MANAGER};
+    }
+    
+    /**
+     * @return the instance of current manager associated to the current 
transaction manager
+     */
+    protected CurrentManager manager() {
+        return (CurrentManager) 
fcBindings.get(CurrentManager.CURRENT_MANAGER);
+    }
+    
     /**
      * @return Returns the currentTx.
      * @throws SystemException
      * @throws NotSupportedException
      */
-    protected UserTransaction getCurrentUserTx() throws SystemException,
+    protected final UserTransaction getCurrentUserTx() throws 
SystemException,
             NotSupportedException {
         try {
-            return (UserTransaction) getCurrentFc().getFcInterface(
+            return (UserTransaction) manager().getCurrentFc().getFcInterface(
                     "user-transaction");
         } catch (NoSuchInterfaceException e) {
             throw new NotSupportedException(e.getClass() + ": "
@@ -94,9 +110,9 @@
      * @throws SystemException this exception is thrown if no current 
      * transaction is available.
      */
-    protected Transaction getCurrentTx() throws SystemException {
+    protected final Transaction getCurrentTx() throws SystemException {
         try {
-            return (Transaction) 
getCurrentFc().getFcInterface("transaction");
+            return (Transaction) 
manager().getCurrentFc().getFcInterface("transaction");
         } catch (Exception e) {
             throw new SystemException("No current transaction");
         }
@@ -106,9 +122,9 @@
      * @return Returns the suspend feature of the transaction. 
      * @throws SystemException
      */
-    protected Suspendable getTxSuspendable() throws SystemException{
+    protected final Suspendable getTxSuspendable() throws SystemException{
         try {
-            return (Suspendable) 
getCurrentFc().getFcInterface(Suspendable.SUSPENDABLE);
+            return (Suspendable) 
manager().getCurrentFc().getFcInterface(Suspendable.SUSPENDABLE);
         } catch (Exception e) {
             throw new SystemException("Transaction can not be 
suspended/resumed");
         }
@@ -118,9 +134,9 @@
      * @see javax.transaction.TransactionManager#begin()
      */
     public void begin() throws NotSupportedException, SystemException {
-        if (checkCurrent())
+        if (manager().checkCurrent())
             throw new NotSupportedException("A transaction is still 
active.");
-        loadCurrent();
+        manager().loadCurrent();
         getCurrentUserTx().setTransactionTimeout(getTxTimeout());
         getCurrentUserTx().begin();
     }
@@ -156,7 +172,7 @@
             return null;
         }
         getTxSuspendable().suspend();
-        setCurrentFc(null);
+        manager().setCurrentFc(null);
         return tx;
     }
 
@@ -164,9 +180,9 @@
      * @see 
javax.transaction.TransactionManager#resume(javax.transaction.Transaction)
      */
     public void resume(Transaction arg0) throws SystemException {
-        if (checkCurrent())
+        if (manager().checkCurrent())
             throw new IllegalStateException("A transaction is currently 
active.");
-        setCurrentFc(((Interface) arg0).getFcItfOwner());
+        manager().setCurrentFc(((Interface) arg0).getFcItfOwner());
         getTxSuspendable().resume();
     }
 
@@ -190,7 +206,7 @@
     public void rollback() throws IllegalStateException, SecurityException,
             SystemException {
         getCurrentTx().rollback();
-        clearCurrentFc();
+        manager().clearCurrentFc();
     }
 
     /* (non-Javadoc)
@@ -204,7 +220,7 @@
         } catch (IllegalStateException e) {
             throw new RollbackException(e.getMessage());
         } finally {
-            clearCurrentFc();
+            manager().clearCurrentFc();
         }
     }
 }
\ No newline at end of file
Index: 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java
diff -u 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.3
 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.4
--- 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java:1.3
   Mon Jul 18 16:33:37 2005
+++ 
gotm-jts/src/java/org/objectweb/gotm/lib/jta/xa/XAResourceActionProvider.java 
      Mon Aug  8 15:30:05 2005
@@ -22,7 +22,7 @@
  Contributor(s): ______________________________________.
 
  ---------------------------------------------------------------------
- $Id: XAResourceActionProvider.java,v 1.3 2005/07/18 14:33:37 rouvoy Exp $
+ $Id: XAResourceActionProvider.java,v 1.4 2005/08/08 13:30:05 rouvoy Exp $
  ====================================================================*/
 package org.objectweb.gotm.lib.jta.xa;
 
@@ -39,6 +39,7 @@
 import org.objectweb.gotm.lib.resource.ResourceDelistEvent;
 import org.objectweb.gotm.lib.resource.ResourceEnlistEvent;
 import org.objectweb.gotm.lib.xid.XidFeature;
+import org.objectweb.transaction.api.logging.LoggerFeature;
 import org.objectweb.transaction.api.resource.ResourceVote;
 import org.objectweb.transaction.lib.resource.ResourceEventCommit;
 import org.objectweb.transaction.lib.resource.ResourceEventRollback;
@@ -46,39 +47,73 @@
 import org.objectweb.transaction.lib.resource.ResourceVoteCommit;
 import org.objectweb.transaction.lib.resource.ResourceVoteReadOnly;
 import org.objectweb.transaction.lib.resource.ResourceVoteRollback;
+import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
 import org.objectweb.transaction.lib.transaction.TransactionStatusCommitting;
 import 
org.objectweb.transaction.lib.transaction.TransactionStatusNoTransaction;
+import org.objectweb.transaction.lib.transaction.TransactionStatusRolledBack;
 import 
org.objectweb.transaction.lib.transaction.TransactionStatusRollingBack;
 import 
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionInactive;
 
 /**
+ * Implementation of the XA Resource specification.
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 3 janv. 2005
- * @modified $Date: 2005/07/18 14:33:37 $
- * @version $Revision: 1.3 $
+ * @modified $Date: 2005/08/08 13:30:05 $
+ * @version $Revision: 1.4 $
  * @fractal.itf name="xa-action-provider"
  *              signature="org.objectweb.gotm.lib.resource.ActionProvider"
  * @fractal.itf name="xid-provider" role="client"
  *              signature="org.objectweb.gotm.lib.xid.XidFeature"
+ * @fractal.itf name="vote-log" role="client" 
signature="org.objectweb.transaction.api.logging.LoggerFeature"
+ * @fractal.itf name="commit-ack-log" role="client" 
signature="org.objectweb.transaction.api.logging.LoggerFeature"
+ * @fractal.itf name="abort-ack-log" role="client" 
signature="org.objectweb.transaction.api.logging.LoggerFeature"
  */
 public class XAResourceActionProvider
         extends ActionProviderAbstract {
+    /** <code>VOTE_LOG</code> . */
+    public static final String VOTE_LOG = "vote-log";
+    /** <code>COMMIT_ACK_LOG</code> . */
+    public static final String COMMIT_ACK_LOG = "commit-ack-log";
+    /** <code>ABORT_ACK_LOG</code> . */
+    public static final String ABORT_ACK_LOG = "abort-ack-log";
+    
     /*
      * (non-Javadoc)
      * 
      * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
      */
     protected String[] clientFc() {
-        return new String[] { XidFeature.XID_PROVIDER };
+        return new String[] { 
XidFeature.XID_PROVIDER,VOTE_LOG,COMMIT_ACK_LOG,ABORT_ACK_LOG };
     }
 
     /**
      * @return the associated XID.
      */
-    protected Xid getXid() {
+    protected final Xid getXid() {
         return ((XidFeature) fcBindings.get(XidFeature.XID_PROVIDER)).xid();
     }
 
+    /**
+     * @return the vote logger.
+     */
+    protected final LoggerFeature getVoteLog() {
+        return (LoggerFeature) fcBindings.get(VOTE_LOG);
+    }
+    
+    /**
+     * @return the commit ack logger.
+     */
+    protected final LoggerFeature getCommitAckLog() {
+        return (LoggerFeature) fcBindings.get(COMMIT_ACK_LOG);
+    }
+    
+    /**
+     * @return the abort ack logger.
+     */
+    protected final LoggerFeature getAbortAckLog() {
+        return (LoggerFeature) fcBindings.get(ABORT_ACK_LOG);
+    }
+    
     /*
      * (non-Javadoc)
      * 
@@ -104,6 +139,14 @@
         return a;
     }
 
+    /**
+     * Implementation of the XA Start Action.
+     * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
+     * @created 1 août 2005
+     * @modified $Date: 2005/08/08 13:30:05 $
+     * @version $Revision: 1.4 $
+     * @fractal.itf 
+     */
     private final class StartAction
             implements Action {
         private int flag;
@@ -130,6 +173,14 @@
         }
     }
 
+    /**
+     * Implementation of the XA End Action.
+     * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
+     * @created 1 août 2005
+     * @modified $Date: 2005/08/08 13:30:05 $
+     * @version $Revision: 1.4 $
+     * @fractal.itf 
+     */
     private final class EndAction
             implements Action {
         private int status;
@@ -152,6 +203,14 @@
         }
     }
 
+    /**
+     * Implementation of the XA Prepare Action.
+     * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
+     * @created 1 août 2005
+     * @modified $Date: 2005/08/08 13:30:05 $
+     * @version $Revision: 1.4 $
+     * @fractal.itf 
+     */
     private final class PrepareAction
             implements Action {
         /**
@@ -172,17 +231,28 @@
         public void execute(Map context, Object resource) throws Exception {
             try {
                 int vote = ((XAResource) resource).prepare(getXid());
-                if (vote == XAResource.XA_OK)
+                if (vote == XAResource.XA_OK) {
+                    
getVoteLog().log((resource.toString()+ResourceVoteCommit.vote.toString()).getBytes());
                     vote(ResourceVoteCommit.vote, context, resource);
-                else
+                } else {
+                    
getVoteLog().log((resource.toString()+ResourceVoteReadOnly.vote.toString()).getBytes());
                     vote(ResourceVoteReadOnly.vote, context, resource);
+                }
             } catch (XAException e) {
+                
getVoteLog().log((resource.toString()+ResourceVoteRollback.vote.toString()).getBytes());
                 vote(ResourceVoteRollback.vote, context, resource);
-                // throw e;
             }
         }
     }
 
+    /**
+     * Implementation of the XA Commit Action.
+     * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
+     * @created 1 août 2005
+     * @modified $Date: 2005/08/08 13:30:05 $
+     * @version $Revision: 1.4 $
+     * @fractal.itf 
+     */
     private final class CommitAction
             implements Action {
         /*
@@ -196,9 +266,18 @@
                 ((XAResource) resource).commit(getXid(), true);
             else
                 ((XAResource) resource).commit(getXid(), false);
+            
getCommitAckLog().log((resource.toString()+TransactionStatusCommitted.status.getLabel()).getBytes());
         }
     }
 
+    /**
+     * Implementation of the XA Rollback Action.
+     * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
+     * @created 1 août 2005
+     * @modified $Date: 2005/08/08 13:30:05 $
+     * @version $Revision: 1.4 $
+     * @fractal.itf 
+     */
     private final class RollbackAction
             implements Action {
         /*
@@ -209,6 +288,7 @@
          */
         public void execute(Map context, Object resource) throws Exception {
             ((XAResource) resource).rollback(getXid());
+            
getAbortAckLog().log((resource.toString()+TransactionStatusRolledBack.status.getLabel()).getBytes());
         }
     }
 }



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.