jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r582264 - in /jackrabbit/trunk/jackrabbit-core: pom.xml src/main/java/org/apache/jackrabbit/core/TransactionContext.java src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
Date Fri, 05 Oct 2007 13:38:37 GMT
Author: jukka
Date: Fri Oct  5 06:38:35 2007
New Revision: 582264

URL: http://svn.apache.org/viewvc?rev=582264&view=rev
Log:
JCR-564 - Remove geronimo JTA as a runtime dependency

Modified:
    jackrabbit/trunk/jackrabbit-core/pom.xml
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java

Modified: jackrabbit/trunk/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/pom.xml?rev=582264&r1=582263&r2=582264&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/pom.xml Fri Oct  5 06:38:35 2007
@@ -255,10 +255,6 @@
       <artifactId>commons-collections</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
-    </dependency>
-    <dependency>
       <groupId>javax.jcr</groupId>
       <artifactId>jcr</artifactId>
     </dependency>
@@ -299,6 +295,11 @@
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java?rev=582264&r1=582263&r2=582264&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransactionContext.java
Fri Oct  5 06:38:35 2007
@@ -21,7 +21,6 @@
 import org.apache.jackrabbit.util.Timer;
 
 import javax.transaction.xa.XAException;
-import javax.transaction.Status;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,6 +39,13 @@
      */
     private static final Logger log = LoggerFactory.getLogger(TransactionContext.class);
 
+    private static final int STATUS_PREPARING = 1;
+    private static final int STATUS_PREPARED = 2;
+    private static final int STATUS_COMMITTING = 3;
+    private static final int STATUS_COMMITTED = 4;
+    private static final int STATUS_ROLLING_BACK = 5;
+    private static final int STATUS_ROLLED_BACK = 6;
+
     /**
      * Create a global timer for all transaction contexts.
      */
@@ -123,7 +129,7 @@
      * @throws XAException if an error occurs
      */
     public synchronized void prepare() throws XAException {
-        status = Status.STATUS_PREPARING;
+        status = STATUS_PREPARING;
         beforeOperation();
 
         TransactionException txe = null;
@@ -137,7 +143,7 @@
         }
 
         afterOperation();
-        status = Status.STATUS_PREPARED;
+        status = STATUS_PREPARED;
 
         if (txe != null) {
             // force immediate rollback on error.
@@ -163,10 +169,10 @@
      * @throws XAException if an error occurs
      */
     public synchronized void commit() throws XAException {
-        if (status == Status.STATUS_ROLLEDBACK) {
+        if (status == STATUS_ROLLED_BACK) {
             throw new XAException(XAException.XA_RBTIMEOUT);
         }
-        status = Status.STATUS_COMMITTING;
+        status = STATUS_COMMITTING;
         beforeOperation();
 
         TransactionException txe = null;
@@ -187,7 +193,7 @@
             }
         }
         afterOperation();
-        status = Status.STATUS_COMMITTED;
+        status = STATUS_COMMITTED;
 
         // cancel the rollback task
         cancel();
@@ -205,10 +211,10 @@
      * @throws XAException if an error occurs
      */
     public synchronized void rollback() throws XAException {
-        if (status == Status.STATUS_ROLLEDBACK) {
+        if (status == STATUS_ROLLED_BACK) {
             throw new XAException(XAException.XA_RBTIMEOUT);
         }
-        status = Status.STATUS_ROLLING_BACK;
+        status = STATUS_ROLLING_BACK;
         beforeOperation();
 
         int errors = 0;
@@ -222,7 +228,7 @@
             }
         }
         afterOperation();
-        status = Status.STATUS_ROLLEDBACK;
+        status = STATUS_ROLLED_BACK;
 
         // cancel the rollback task
         cancel();
@@ -238,7 +244,7 @@
      */
     public void run() {
         synchronized (this) {
-            if (status == Status.STATUS_PREPARED) {
+            if (status == STATUS_PREPARED) {
                 try {
                     rollback();
                 } catch (XAException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java?rev=582264&r1=582263&r2=582264&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
Fri Oct  5 06:38:35 2007
@@ -25,7 +25,6 @@
 
 import javax.jcr.RepositoryException;
 import javax.jcr.lock.LockException;
-import javax.transaction.Status;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.List;
@@ -41,6 +40,13 @@
      */
     private static final Logger log = LoggerFactory.getLogger(XAEnvironment.class);
 
+    private static final int STATUS_PREPARING = 1;
+    private static final int STATUS_PREPARED = 2;
+    private static final int STATUS_COMMITTING = 3;
+    private static final int STATUS_COMMITTED = 4;
+    private static final int STATUS_ROLLING_BACK = 5;
+    private static final int STATUS_ROLLED_BACK = 6;
+
     /**
      * Global lock manager.
      */
@@ -256,7 +262,7 @@
      * unlock operations.
      */
     public void prepare() throws TransactionException {
-        status = Status.STATUS_PREPARING;
+        status = STATUS_PREPARING;
         if (!operations.isEmpty()) {
             lockMgr.beginUpdate();
 
@@ -285,7 +291,7 @@
                 }
             }
         }
-        status = Status.STATUS_PREPARED;
+        status = STATUS_PREPARED;
     }
 
     /**
@@ -295,14 +301,14 @@
     public void commit() {
         int oldStatus = status;
 
-        status = Status.STATUS_COMMITTING;
-        if (oldStatus == Status.STATUS_PREPARED) {
+        status = STATUS_COMMITTING;
+        if (oldStatus == STATUS_PREPARED) {
             if (!operations.isEmpty()) {
                 lockMgr.endUpdate();
                 reset();
             }
         }
-        status = Status.STATUS_COMMITTED;
+        status = STATUS_COMMITTED;
     }
 
     /**
@@ -312,8 +318,8 @@
     public void rollback() {
         int oldStatus = status;
 
-        status = Status.STATUS_ROLLING_BACK;
-        if (oldStatus == Status.STATUS_PREPARED) {
+        status = STATUS_ROLLING_BACK;
+        if (oldStatus == STATUS_PREPARED) {
             if (!operations.isEmpty()) {
                 while (opIndex > 0) {
                     try {
@@ -328,7 +334,7 @@
                 reset();
             }
         }
-        status = Status.STATUS_ROLLEDBACK;
+        status = STATUS_ROLLED_BACK;
     }
 
     /**
@@ -429,8 +435,8 @@
          * associated lock information is subject to change.
          */
         public boolean mayChange() {
-            if (status != Status.STATUS_COMMITTED
-                    && status != Status.STATUS_ROLLEDBACK) {
+            if (status != STATUS_COMMITTED
+                    && status != STATUS_ROLLED_BACK) {
                 return true;
             }
             return super.mayChange();



Mime
View raw message