1 7 package org.enhydra.pim.spec; 8 9 import org.enhydra.pim.business.TransactionContextI; 10 import org.enhydra.pim.exception.EnhydraPimException; 11 12 17 public class TransactionContextFactory { 18 19 22 23 public static TransactionContextI getTransactionContext() throws EnhydraPimException { 24 25 TransactionContextI result = null; 26 27 Class objectClass = null; 28 29 try { 30 if (SpecUtil.useEjb) { 31 objectClass = Class.forName("org.enhydra.pim.data.JtaTransactionContext"); 32 result = (TransactionContextI) objectClass.newInstance(); 33 } else { 34 objectClass = Class.forName("org.enhydra.pim.data.TransactionContext"); 35 result = (TransactionContextI) objectClass.newInstance(); 36 } 37 } catch (Exception ex) { 38 System.out.println("Error on creating the TransactionContext object" + ex); 39 } 40 return result; 41 } 42 } | Popular Tags |