1 17 18 package org.apache.geronimo.connector; 19 20 import java.util.Timer ; 21 22 import javax.resource.spi.UnavailableException ; 23 import javax.resource.spi.XATerminator ; 24 import javax.resource.spi.work.WorkManager ; 25 26 import org.apache.geronimo.gbean.GBeanInfo; 27 import org.apache.geronimo.gbean.GBeanInfoBuilder; 28 29 35 public class BootstrapContext implements javax.resource.spi.BootstrapContext { 36 private final WorkManager workManager; 37 private final XATerminator xATerminator; 38 39 42 public BootstrapContext() { 43 workManager = null; 44 xATerminator = null; 45 } 46 47 52 public BootstrapContext(final WorkManager workManager, final XATerminator xaTerminator) { 53 this.workManager = workManager; 54 this.xATerminator = xaTerminator; 55 } 56 57 58 61 public WorkManager getWorkManager() { 62 return workManager; 63 } 64 65 68 public XATerminator getXATerminator() { 69 return xATerminator; 70 } 71 72 75 public Timer createTimer() throws UnavailableException { 76 return new Timer (); 77 } 78 79 public static final GBeanInfo GBEAN_INFO; 80 81 static { 82 GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(BootstrapContext.class); 83 86 infoFactory.addOperation("createTimer"); 87 infoFactory.addOperation("getWorkManager"); 88 infoFactory.addOperation("getXATerminator"); 89 90 infoFactory.addReference("WorkManager", WorkManager .class); 91 infoFactory.addReference("XATerminator", XATerminator .class); 92 93 infoFactory.setConstructor(new String []{"WorkManager", "XATerminator"}); 94 95 GBEAN_INFO = infoFactory.getBeanInfo(); 96 } 97 98 public static GBeanInfo getGBeanInfo() { 99 return GBEAN_INFO; 100 } 101 102 } 103 | Popular Tags |