1 28 29 package com.caucho.transaction.cfg; 30 31 import com.caucho.config.ConfigException; 32 import com.caucho.transaction.TransactionManagerImpl; 33 import com.caucho.transaction.xalog.AbstractXALogManager; 34 import com.caucho.util.L10N; 35 import com.caucho.util.Log; 36 37 import java.io.IOException ; 38 import java.util.logging.Level ; 39 import java.util.logging.Logger ; 40 41 44 public class TransactionManagerConfig { 45 private static L10N L = new L10N(TransactionManagerConfig.class); 46 private static Logger log = Log.open(TransactionManagerConfig.class); 47 48 private AbstractXALogManager _xaLog; 49 50 53 public AbstractXALogManager createTransactionLog() 54 throws ConfigException 55 { 56 try { 57 Class cl = Class.forName("com.caucho.transaction.xalog.XALogManager"); 58 59 _xaLog = (AbstractXALogManager) cl.newInstance(); 60 } catch (Throwable e) { 61 log.log(Level.FINER, e.toString(), e); 62 } 63 64 if (_xaLog == null) 65 throw new ConfigException(L.l("<transaction-log> requires Resin Professional. See http://www.caucho.com for information and licensing.")); 66 67 return _xaLog; 68 } 69 70 73 public void start() 74 throws ConfigException 75 { 76 try { 77 TransactionManagerImpl tm = TransactionManagerImpl.getLocal(); 78 79 tm.setXALogManager(_xaLog); 80 81 _xaLog.start(); 82 } catch (IOException e) { 83 throw new ConfigException(e); 84 } 85 } 86 } 87 | Popular Tags |