1 package org.enhydra.shark.usertransaction; 2 3 import org.enhydra.dods.DODS; 4 import org.enhydra.shark.api.RootException; 5 import org.enhydra.shark.api.UserTransaction; 6 import org.enhydra.shark.api.TransactionException; 7 import org.enhydra.shark.api.internal.usertransaction.UserTransactionFactory; 8 import org.enhydra.shark.api.internal.working.CallbackUtilities; 9 10 15 public class DODSUserTransactionFactory implements UserTransactionFactory { 16 static boolean _debug_ = false; 17 18 private static final String DBG_PARAM_NAME = "DODSUserTransactionFactory.debug"; 19 20 29 public void configure (CallbackUtilities cus) throws RootException { 30 if (null == cus) 31 throw new RootException("Cannot configure without call back impl."); 32 _debug_ = Boolean 33 .valueOf(cus.getProperty(DBG_PARAM_NAME, "false")) 34 .booleanValue(); 35 } 36 37 44 public UserTransaction createTransaction () throws TransactionException { 45 try { 46 return new SharkDODSUserTransaction(DODS.getDatabaseManager().createTransaction()); 47 } catch (Exception ex) { 48 throw new TransactionException(ex); 49 } 50 } 51 } 52 53 | Popular Tags |