1 16 17 package org.springframework.jca.support; 18 19 import java.util.Timer ; 20 21 import javax.resource.spi.BootstrapContext ; 22 import javax.resource.spi.UnavailableException ; 23 import javax.resource.spi.XATerminator ; 24 import javax.resource.spi.work.WorkManager ; 25 26 38 public class SimpleBootstrapContext implements BootstrapContext { 39 40 private WorkManager workManager; 41 42 private XATerminator xaTerminator; 43 44 45 50 public SimpleBootstrapContext(WorkManager workManager) { 51 this.workManager = workManager; 52 } 53 54 59 public SimpleBootstrapContext(WorkManager workManager, XATerminator xaTerminator) { 60 this.workManager = workManager; 61 this.xaTerminator = xaTerminator; 62 } 63 64 65 public WorkManager getWorkManager() { 66 if (this.workManager == null) { 67 throw new IllegalStateException ("No WorkManager available"); 68 } 69 return this.workManager; 70 } 71 72 public XATerminator getXATerminator() { 73 return this.xaTerminator; 74 } 75 76 public Timer createTimer() throws UnavailableException { 77 return new Timer (); 78 } 79 80 } 81 | Popular Tags |