01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.springframework.beans.factory.xml.NamespaceHandlerSupport;
20:
21: /**
22: * <code>NamespaceHandler</code> allowing for the configuration of
23: * declarative transaction management using either XML or using annotations.
24: *
25: * <p>This namespace handler is the central piece of functionality in the
26: * Spring 2 transaction management facilities and offers two appraoched
27: * to declaratively manage transactions.
28: *
29: * <p>One approach uses transaction semantics defined in XML using the
30: * <code><tx:advice></code> elements, the other uses annotations
31: * in combination with the <code><tx:annotation-driven></code> element.
32: * Both approached are detailed to great extent in the Spring reference manual.
33: *
34: * @author Rob Harrop
35: * @author Juergen Hoeller
36: * @since 2.0
37: */
38: public class TxNamespaceHandler extends NamespaceHandlerSupport {
39:
40: public void init() {
41: registerBeanDefinitionParser("advice",
42: new TxAdviceBeanDefinitionParser());
43: registerBeanDefinitionParser("annotation-driven",
44: new AnnotationDrivenBeanDefinitionParser());
45: registerBeanDefinitionParser("jta-transaction-manager",
46: new JtaTransactionManagerBeanDefinitionParser());
47: }
48:
49: }
|