001/* 002 * Copyright 2002-2014 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.transaction.config; 018 019import org.w3c.dom.Element; 020 021import org.springframework.beans.factory.support.AbstractBeanDefinition; 022import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; 023import org.springframework.beans.factory.xml.ParserContext; 024 025/** 026 * Parser for the <tx:jta-transaction-manager/> XML configuration element, 027 * autodetecting WebLogic and WebSphere servers and exposing the corresponding 028 * {@link org.springframework.transaction.jta.JtaTransactionManager} subclass. 029 * 030 * @author Juergen Hoeller 031 * @author Christian Dupuis 032 * @since 2.5 033 * @see org.springframework.transaction.jta.WebLogicJtaTransactionManager 034 * @see org.springframework.transaction.jta.WebSphereUowTransactionManager 035 */ 036public class JtaTransactionManagerBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { 037 038 @Override 039 protected String getBeanClassName(Element element) { 040 return JtaTransactionManagerFactoryBean.resolveJtaTransactionManagerClassName(); 041 } 042 043 @Override 044 protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) { 045 return TxNamespaceHandler.DEFAULT_TRANSACTION_MANAGER_BEAN_NAME; 046 } 047 048}