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