001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.geronimo.transaction.manager;
019
020 import java.util.ArrayList;
021 import java.util.Collection;
022 import java.util.List;
023 import javax.transaction.xa.XAException;
024
025 import org.apache.geronimo.gbean.GBeanInfo;
026 import org.apache.geronimo.gbean.GBeanInfoBuilder;
027 import org.apache.geronimo.gbean.ReferenceCollection;
028 import org.apache.geronimo.gbean.ReferenceCollectionEvent;
029 import org.apache.geronimo.gbean.ReferenceCollectionListener;
030 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
031
032 /**
033 * Simple implementation of a transaction manager. This does not include XATerminator or XAWork functionality:
034 * use GeronimoTransactionManagerGBean if you need to import transactions.
035 *
036 * @version $Rev: 706640 $ $Date: 2008-10-21 14:44:05 +0000 (Tue, 21 Oct 2008) $
037 */
038 public class TransactionManagerImplGBean extends TransactionManagerImpl {
039
040 /**
041 * TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot enforce this restriction!
042 */
043 public TransactionManagerImplGBean(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
044 super(defaultTransactionTimeoutSeconds, xidFactory, transactionLog);
045 }
046
047 public static final GBeanInfo GBEAN_INFO;
048
049 static {
050 GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(TransactionManagerImplGBean.class, NameFactory.JTA_RESOURCE);
051
052 infoBuilder.addAttribute("defaultTransactionTimeoutSeconds", int.class, true);
053 infoBuilder.addReference("XidFactory", XidFactory.class, NameFactory.XID_FACTORY);
054 infoBuilder.addReference("TransactionLog", TransactionLog.class, NameFactory.TRANSACTION_LOG);
055
056 infoBuilder.setConstructor(new String[]{
057 "defaultTransactionTimeoutSeconds",
058 "XidFactory",
059 "TransactionLog"});
060
061 GBEAN_INFO = infoBuilder.getBeanInfo();
062 }
063
064
065 public static GBeanInfo getGBeanInfo() {
066 return GBEAN_INFO;
067 }
068 }