1 /* 2 * Copyright 2002-2014 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springframework.transaction.config; 18 19 import org.w3c.dom.Element; 20 21 import org.springframework.beans.factory.support.AbstractBeanDefinition; 22 import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; 23 import org.springframework.beans.factory.xml.ParserContext; 24 25 /** 26 * Parser for the <tx:jta-transaction-manager/> XML configuration element, 27 * autodetecting WebLogic and WebSphere servers and exposing the corresponding 28 * {@link org.springframework.transaction.jta.JtaTransactionManager} subclass. 29 * 30 * @author Juergen Hoeller 31 * @author Christian Dupuis 32 * @since 2.5 33 * @see org.springframework.transaction.jta.WebLogicJtaTransactionManager 34 * @see org.springframework.transaction.jta.WebSphereUowTransactionManager 35 */ 36 public class JtaTransactionManagerBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { 37 38 @Override 39 protected String getBeanClassName(Element element) { 40 return JtaTransactionManagerFactoryBean.resolveJtaTransactionManagerClassName(); 41 } 42 43 @Override 44 protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) { 45 return TxNamespaceHandler.DEFAULT_TRANSACTION_MANAGER_BEAN_NAME; 46 } 47 48 }