KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > transaction > config > TxNamespaceHandler


1 /*
2  * Copyright 2002-2006 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.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  * 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  * One approach uses transaction semantics defined in XML using the
30  * <code>&lt;tx:advice&gt;</code> elements, the other uses annotations
31  * in combination with the <code>&lt;tx:annotation-driven&gt;</code> element.
32  * Both approached are detailed to great extent in the Spring reference manual.
33  *
34  * @author Rob Harrop
35  * @since 2.0
36  */

37 public class TxNamespaceHandler extends NamespaceHandlerSupport {
38
39     public void init() {
40         registerBeanDefinitionParser("advice", new TxAdviceBeanDefinitionParser());
41         registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser());
42     }
43
44 }
45
Popular Tags