package org.jboss.webbeans.transaction;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.webbeans.Produces;

public class Transaction
{

   @Produces
   public UserTransaction getCurrentTransaction()
   {
      return new UTTransaction(new javax.transaction.UserTransaction()
      {
         
         public void begin() throws NotSupportedException, SystemException
         {
            
         }
         
         public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
         {
            
         }
         
         public int getStatus() throws SystemException
         {
            return javax.transaction.Status.STATUS_UNKNOWN;
         }
         
         public void rollback() throws IllegalStateException, SecurityException, SystemException
         {
            
         }
         
         public void setRollbackOnly() throws IllegalStateException, SystemException
         {
            
         }
         
         public void setTransactionTimeout(int arg0) throws SystemException
         {
            
         }
         
         
         
      });
   }
   
}

@@ -51,414 +51,267 @@
 vax.
-transaction.HeuristicMixedException;%0Aimport javax.transaction.HeuristicRollbackException;%0Aimport javax.transaction.NotSupportedException;%0Aimport javax.transaction.RollbackException;%0Aimport javax.transaction.SystemException;%0Aimport javax.webbeans.Produces;%0A%0Apublic class Transaction%0A%7B%0A%0A   @Produces%0A   public UserTransaction getCurrentTransaction()%0A   %7B%0A      return new UTTransaction(new javax.transaction.
+webbeans.Current;%0Aimport javax.webbeans.Produces;%0A%0Aimport org.jboss.webbeans.ManagerImpl;%0A%0A/**%0A * Transaction manager component%0A * %0A * @author Pete Muir%0A *%0A */%0Apublic class Transaction%0A%7B%0A %0A   public static final String USER_TRANSACTION_JNDI_NAME = %22java:comp/
 User
@@ -325,453 +325,140 @@
 tion
-()%0A  
+%22;%0A
    
- %7B
 %0A   
-      %0A         public void begin() throws NotSupportedException, SystemException%0A         %7B%0A            %0A         %7D%0A         %0A         public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException%0A         %7B%0A            %0A         %7D%0A         %0A         public int getStatus() throws SystemException%0A         %7B%0A  
+@Current ManagerImpl manager;%0A   %0A   @Produces%0A   public UserTransaction getCurrentTransaction()%0A   %7B%0A
       
-    
 return 
-javax.t
+new UTT
 rans
@@ -467,349 +467,86 @@
 tion
-.Status.STATUS_UNKNOWN;%0A         %7D%0A         %0A         public void rollback() throws IllegalStateException, SecurityException, SystemException%0A         %7B%0A            %0A         %7D%0A         %0A         public void setRollbackOnly() throws IllegalStateException, SystemException%0A         %7B%0A            %0A         %7D%0A         %0A         public void set
+(manager.getNaming().lookup(USER_TRANSACTION_JNDI_NAME, javax.transaction.User
 Tran
@@ -556,121 +556,15 @@
 tion
-Timeout(int arg0) throws SystemException%0A         %7B%0A            %0A         %7D%0A         %0A         %0A         %0A      %7D
+.class)
 );%0A 

Actually return the underlying TX