1 /** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one or more 4 * contributor license agreements. See the NOTICE file distributed with 5 * this work for additional information regarding copyright ownership. 6 * The ASF licenses this file to You under the Apache License, Version 2.0 7 * (the "License"); you may not use this file except in compliance with 8 * the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.apache.geronimo.timer.vm; 20 21 import javax.transaction.TransactionManager; 22 23 import edu.emory.mathcs.backport.java.util.concurrent.Executor; 24 25 import org.apache.geronimo.gbean.GBeanInfo; 26 import org.apache.geronimo.gbean.GBeanInfoBuilder; 27 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 28 import org.apache.geronimo.timer.NontransactionalExecutorTaskFactory; 29 import org.apache.geronimo.timer.PersistentTimer; 30 import org.apache.geronimo.timer.ThreadPooledTimer; 31 32 /** 33 * 34 * 35 * @version $Rev: 470597 $ $Date: 2006-11-02 15:30:55 -0800 (Thu, 02 Nov 2006) $ 36 * 37 * */ 38 public class VMStoreThreadPooledNonTransactionalTimer extends ThreadPooledTimer { 39 40 public VMStoreThreadPooledNonTransactionalTimer(TransactionManager transactionManager, Executor threadPool) { 41 super(new NontransactionalExecutorTaskFactory(), 42 new VMWorkerPersistence(), threadPool, transactionManager); 43 } 44 45 46 public static final GBeanInfo GBEAN_INFO; 47 48 static { 49 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(VMStoreThreadPooledNonTransactionalTimer.class); 50 infoFactory.addInterface(PersistentTimer.class); 51 52 infoFactory.addReference("ThreadPool", Executor.class, NameFactory.GERONIMO_SERVICE); 53 infoFactory.addReference("TransactionManager", TransactionManager.class, NameFactory.TRANSACTION_MANAGER); 54 55 infoFactory.setConstructor(new String[] {"TransactionManager", "ThreadPool"}); 56 GBEAN_INFO = infoFactory.getBeanInfo(); 57 } 58 59 public static GBeanInfo getGBeanInfo() { 60 return GBEAN_INFO; 61 } 62 }