1 17 18 package org.apache.geronimo.timer.vm; 19 20 import javax.transaction.TransactionManager ; 21 22 import edu.emory.mathcs.backport.java.util.concurrent.Executor; 23 24 import org.apache.geronimo.gbean.GBeanInfo; 25 import org.apache.geronimo.gbean.GBeanInfoBuilder; 26 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 27 import org.apache.geronimo.timer.PersistentTimer; 28 import org.apache.geronimo.timer.ThreadPooledTimer; 29 import org.apache.geronimo.timer.TransactionalExecutorTaskFactory; 30 31 34 public class VMStoreThreadPooledTransactionalTimer extends ThreadPooledTimer { 35 36 public VMStoreThreadPooledTransactionalTimer(int repeatCount, 37 TransactionManager transactionManager, 38 Executor threadPool) { 39 super(new TransactionalExecutorTaskFactory(transactionManager, repeatCount), 40 new VMWorkerPersistence(), threadPool, transactionManager); 41 } 42 43 44 public static final GBeanInfo GBEAN_INFO; 45 46 static { 47 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(VMStoreThreadPooledTransactionalTimer.class); 48 infoFactory.addInterface(PersistentTimer.class); 49 50 infoFactory.addAttribute("repeatCount", int.class, true); 51 infoFactory.addReference("TransactionManager", TransactionManager .class, NameFactory.TRANSACTION_MANAGER); 52 infoFactory.addReference("ThreadPool", Executor.class, NameFactory.GERONIMO_SERVICE); 53 54 infoFactory.setConstructor(new String [] {"repeatCount", "TransactionManager", "ThreadPool"}); 55 GBEAN_INFO = infoFactory.getBeanInfo(); 56 } 57 58 public static GBeanInfo getGBeanInfo() { 59 return GBEAN_INFO; 60 } 61 } 62 | Popular Tags |