1 23 package com.sun.enterprise.transaction; 24 25 import javax.transaction.*; 26 import com.sun.enterprise.*; 27 28 33 34 public class TransactionManagerHelper implements TransactionManager { 35 36 public void begin() throws NotSupportedException, SystemException { 37 Switch.getSwitch().getTransactionManager().begin(); 38 } 39 40 41 public void commit() throws RollbackException, 42 HeuristicMixedException, HeuristicRollbackException, SecurityException , 43 IllegalStateException , SystemException { 44 Switch.getSwitch().getTransactionManager().commit(); 45 } 46 47 public int getStatus() throws SystemException { 48 return Switch.getSwitch().getTransactionManager().getStatus(); 49 } 50 51 public Transaction getTransaction() throws SystemException { 52 return Switch.getSwitch().getTransactionManager().getTransaction(); 53 } 54 55 56 public void resume(Transaction tobj) 57 throws InvalidTransactionException, IllegalStateException , 58 SystemException { 59 Switch.getSwitch().getTransactionManager().resume(tobj); 60 } 61 62 63 public void rollback() throws IllegalStateException , SecurityException , 64 SystemException { 65 Switch.getSwitch().getTransactionManager().rollback(); 66 } 67 68 public void setRollbackOnly() throws IllegalStateException , SystemException { 69 Switch.getSwitch().getTransactionManager().setRollbackOnly(); 70 } 71 72 public void setTransactionTimeout(int seconds) throws SystemException { 73 Switch.getSwitch().getTransactionManager().setTransactionTimeout(seconds); 74 } 75 76 public Transaction suspend() throws SystemException { 77 return Switch.getSwitch().getTransactionManager().suspend(); 78 } 79 80 public static TransactionManager getTransactionManager() { 81 return tmHelper; 82 } 83 84 private static TransactionManagerHelper tmHelper = new TransactionManagerHelper(); 85 86 } 87 | Popular Tags |