1 23 24 package com.sun.enterprise.connectors; 25 26 import com.sun.enterprise.Switch; 27 import com.sun.enterprise.connectors.work.WorkManagerFactory; 28 import com.sun.logging.LogDomains; 29 import java.util.Timer ; 30 import java.util.logging.*; 31 import javax.resource.spi.BootstrapContext ; 32 import javax.resource.spi.XATerminator ; 33 import javax.resource.spi.work.WorkManager ; 34 35 36 43 public class BootstrapContextImpl implements BootstrapContext { 44 45 private WorkManager wm; 47 private XATerminator xa; 48 private String moduleName; 49 private String poolId; 50 private static Logger logger = 51 LogDomains.getLogger(LogDomains.RSR_LOGGER); 52 53 60 public BootstrapContextImpl () throws ConnectorRuntimeException{ 61 wm = WorkManagerFactory.getWorkManager(null); 62 } 63 64 71 public BootstrapContextImpl (String poolId) 72 throws ConnectorRuntimeException{ 73 this.poolId = poolId; 74 wm = WorkManagerFactory.getWorkManager(poolId); 75 } 76 77 84 public Timer createTimer() { 85 return new Timer (); 86 } 87 88 95 public WorkManager getWorkManager() { 96 if (wm == null) { 97 try { 98 wm = WorkManagerFactory.getWorkManager(poolId); 99 } catch(Exception e) { 100 logger.log(Level.SEVERE, "workmanager.instantiation_error", e); 101 } 102 } 103 return wm; 104 } 105 106 109 public XATerminator getXATerminator() { 110 if (xa == null) { 111 xa = Switch.getSwitch().getTransactionManager().getXATerminator(); 112 } 113 return xa; 114 } 115 } 116 | Popular Tags |