ozeigermann    2004/04/01 23:57:20

  Modified:    src/share/org/apache/slide/common Tag: SLIDE_2_1_EXTERNAL_TX
                        NamespaceAccessTokenImpl.java AbstractService.java
                        AbstractSimpleService.java
                        NamespaceAccessToken.java
  Log:
  Initial external transaction implementation
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.25.2.1  +9 -4      
jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java
  
  Index: NamespaceAccessTokenImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v
  retrieving revision 1.25
  retrieving revision 1.25.2.1
  diff -u -r1.25 -r1.25.2.1
  --- NamespaceAccessTokenImpl.java     11 Feb 2004 12:58:29 -0000      1.25
  +++ NamespaceAccessTokenImpl.java     2 Apr 2004 07:57:19 -0000       1.25.2.1
  @@ -31,6 +31,8 @@
   import javax.transaction.NotSupportedException;
   import javax.transaction.RollbackException;
   import javax.transaction.SystemException;
  +import javax.transaction.Transaction;
  +import javax.transaction.TransactionManager;
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   import org.apache.slide.content.Content;
  @@ -489,6 +491,9 @@
           namespace.getTransactionManager().setTransactionTimeout(seconds);
       }
       
  +    public TransactionManager getTransactionManager() {
  +        return namespace.getTransactionManager();
  +    }
       
   }
   
  
  
  
  1.8.2.1   +20 -10    
jakarta-slide/src/share/org/apache/slide/common/AbstractService.java
  
  Index: AbstractService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/AbstractService.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- AbstractService.java      11 Feb 2004 11:30:11 -0000      1.8
  +++ AbstractService.java      2 Apr 2004 07:57:19 -0000       1.8.2.1
  @@ -80,7 +80,8 @@
        */
       public void commit(Xid xid, boolean onePhase)
           throws XAException {
  -        
  +
  +/*        
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -108,7 +109,7 @@
           }
           
           currentContexts.remove(Thread.currentThread());
  -        
  +  */      
       }
       
       
  @@ -134,6 +135,7 @@
       public void end(Xid xid, int flags)
           throws XAException {
           
  +        /*
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -153,7 +155,7 @@
           if (flags == XAResource.TMFAIL)
               ((ContextTuple) currentContexts.get(Thread.currentThread()))
                   .setRollbackOnly(true);
  -        
  +        */
       }
       
       
  @@ -168,6 +170,7 @@
       public void forget(Xid xid)
           throws XAException {
           
  +        /*
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -182,6 +185,7 @@
               throw new XAException(XAException.XAER_PROTO);
           
           currentContexts.remove(Thread.currentThread());
  +        */
           
       }
       
  @@ -243,7 +247,7 @@
        */
       public int prepare(Xid xid)
           throws XAException {
  -        
  +        /*
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -269,6 +273,7 @@
           }
           
           currentContextTuple.setStatus(TX_PREPARED);
  +        */
           
           return XAResource.XA_OK;
           
  @@ -318,7 +323,8 @@
        */
       public void rollback(Xid xid)
           throws XAException {
  -        
  +
  +/*        
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -333,6 +339,7 @@
               throw new XAException(XAException.XAER_PROTO);
           
           currentContexts.remove(Thread.currentThread());
  +        */
           
       }
       
  @@ -348,9 +355,10 @@
        */
       public boolean setTransactionTimeout(int seconds)
           throws XAException {
  -            
  +            /*
           ((ContextTuple) currentContexts.get(Thread.currentThread()))
               .setTransactionTimeout(seconds);
  +        */
           return true;
           
       }
  @@ -375,6 +383,7 @@
       public void start(Xid xid, int flags)
           throws XAException {
           
  +        /*
           ContextTuple currentContextTuple =
               (ContextTuple) currentContexts.get(Thread.currentThread());
           Xid currentContext =
  @@ -414,6 +423,7 @@
               currentContextTuple.setStatus(TX_IDLE);
               break;
           }
  +        */
           
       }
       
  
  
  
  1.7.2.1   +9 -5      
jakarta-slide/src/share/org/apache/slide/common/AbstractSimpleService.java
  
  Index: AbstractSimpleService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/AbstractSimpleService.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- AbstractSimpleService.java        11 Feb 2004 11:30:11 -0000      1.7
  +++ AbstractSimpleService.java        2 Apr 2004 07:57:19 -0000       1.7.2.1
  @@ -145,6 +145,8 @@
       public void end(Xid xid, int flags)
           throws XAException {
           
  +        /*
  +        
           if (currentContext == null)
               throw new XAException(XAException.XAER_NOTA);
        if (xid == null)
  @@ -158,6 +160,7 @@
           
           if (flags == XAResource.TMFAIL)
               rollbackOnly = true;
  +            */
           
       }
       
  @@ -356,6 +359,7 @@
        */
       public void start(Xid xid, int flags)
           throws XAException {
  +            /*
           
        if (xid == null)
            throw new XAException(XAException.XAER_INVAL);
  @@ -385,7 +389,7 @@
               status = TX_IDLE;
               break;
           }
  -        
  +*/        
       }
       
       
  
  
  
  1.19.2.1  +9 -4      
jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java
  
  Index: NamespaceAccessToken.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- NamespaceAccessToken.java 11 Feb 2004 11:30:11 -0000      1.19
  +++ NamespaceAccessToken.java 2 Apr 2004 07:57:20 -0000       1.19.2.1
  @@ -27,6 +27,8 @@
   import java.io.Reader;
   import java.io.Writer;
   
  +import javax.transaction.Transaction;
  +import javax.transaction.TransactionManager;
   import javax.transaction.UserTransaction;
   
   import org.apache.slide.content.Content;
  @@ -203,6 +205,9 @@
        * @return The logger associated with the namespace.
        */
       Logger getLogger();
  +
  +    public TransactionManager getTransactionManager();
  +
   
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to