1 10 11 package org.mule.providers.gs; 12 13 import net.jini.core.transaction.server.TransactionManager; 14 15 import org.mule.config.i18n.Message; 16 import org.mule.config.i18n.Messages; 17 import org.mule.umo.TransactionException; 18 import org.mule.umo.UMOTransaction; 19 import org.mule.umo.UMOTransactionFactory; 20 21 29 public class JiniTransactionFactory implements UMOTransactionFactory 30 { 31 32 protected TransactionManager transactionManager = null; 33 protected long transactionTimeout = 3200 * 1000; 34 35 42 public UMOTransaction beginTransaction() throws TransactionException 43 { 44 try 49 { 50 JiniTransaction jtx = new JiniTransaction(transactionTimeout); 51 jtx.begin(); 52 return jtx; 53 } 54 catch (Exception e) 55 { 56 throw new TransactionException(new Message(Messages.TX_CANT_START_X_TRANSACTION, "Jini"), e); 57 } 58 } 59 60 67 public boolean isTransacted() 68 { 69 return true; 70 } 71 72 public TransactionManager getTransactionManager() 73 { 74 return transactionManager; 75 } 76 77 public void setTransactionManager(TransactionManager transactionManager) 78 { 79 this.transactionManager = transactionManager; 80 } 81 82 public long getTransactionTimeout() 83 { 84 return transactionTimeout; 85 } 86 87 public void setTransactionTimeout(long transactionTimeout) 88 { 89 this.transactionTimeout = transactionTimeout; 90 } 91 } 92 | Popular Tags |