1 22 package org.jboss.test.tm.test; 23 24 import javax.transaction.Transaction ; 25 import javax.transaction.TransactionManager ; 26 27 import org.jboss.tm.TransactionLocal; 28 import org.jboss.tm.TransactionManagerLocator; 29 30 36 public class AbstractTransactionLocalStressTest extends AbstractConcurrentStressTest 37 { 38 protected TransactionManager tm = TransactionManagerLocator.getInstance().locate(); 39 protected TransactionLocal local = new TransactionLocal(tm); 40 41 public abstract class ConcurrentTransactionLocalRunnable extends ConcurrentRunnable 42 { 43 protected Transaction tx; 44 public ConcurrentTransactionLocalRunnable(Transaction tx) 45 { 46 this.tx = tx; 47 } 48 49 public void doStart() 50 { 51 try 52 { 53 tm.resume(tx); 54 } 55 catch (Throwable t) 56 { 57 failure = t; 58 } 59 } 60 61 public void doEnd() 62 { 63 try 64 { 65 tm.suspend(); 66 } 67 catch (Throwable t) 68 { 69 failure = t; 70 } 71 } 72 } 73 74 public AbstractTransactionLocalStressTest(String name) 75 { 76 super(name); 77 } 78 } 79 | Popular Tags |