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.transaction.manager;
17:
18: import java.util.ArrayList;
19: import java.util.Collection;
20: import java.util.List;
21: import javax.transaction.xa.XAException;
22:
23: import org.apache.geronimo.gbean.GBeanInfo;
24: import org.apache.geronimo.gbean.GBeanInfoBuilder;
25: import org.apache.geronimo.gbean.ReferenceCollection;
26: import org.apache.geronimo.gbean.ReferenceCollectionEvent;
27: import org.apache.geronimo.gbean.ReferenceCollectionListener;
28: import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
29:
30: /**
31: * Simple implementation of a transaction manager. This does not include XATerminator or XAWork functionality:
32: * use GeronimoTransactionManagerGBean if you need to import transactions.
33: *
34: * @version $Rev: 584390 $ $Date: 2007-10-13 04:46:59 -0700 (Sat, 13 Oct 2007) $
35: */
36: public class TransactionManagerImplGBean extends TransactionManagerImpl {
37:
38: /**
39: * TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot enforce this restriction!
40: */
41: public TransactionManagerImplGBean(
42: int defaultTransactionTimeoutSeconds,
43: XidFactory xidFactory, TransactionLog transactionLog)
44: throws XAException {
45: super (defaultTransactionTimeoutSeconds, xidFactory,
46: transactionLog);
47: }
48:
49: public static final GBeanInfo GBEAN_INFO;
50:
51: static {
52: GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(
53: TransactionManagerImplGBean.class,
54: NameFactory.JTA_RESOURCE);
55:
56: infoBuilder.addAttribute("defaultTransactionTimeoutSeconds",
57: int.class, true);
58: infoBuilder.addReference("XidFactory", XidFactory.class,
59: NameFactory.XID_FACTORY);
60: infoBuilder.addReference("TransactionLog",
61: TransactionLog.class, NameFactory.TRANSACTION_LOG);
62:
63: infoBuilder.setConstructor(new String[] {
64: "defaultTransactionTimeoutSeconds", "XidFactory",
65: "TransactionLog" });
66:
67: GBEAN_INFO = infoBuilder.getBeanInfo();
68: }
69:
70: public static GBeanInfo getGBeanInfo() {
71: return GBEAN_INFO;
72: }
73: }
|