01: /*
02: * Copyright 2002-2006 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: * 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><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: * @since 2.0
36: */
37: public class TxNamespaceHandler extends NamespaceHandlerSupport {
38:
39: public void init() {
40: registerBeanDefinitionParser("advice",
41: new TxAdviceBeanDefinitionParser());
42: registerBeanDefinitionParser("annotation-driven",
43: new AnnotationDrivenBeanDefinitionParser());
44: }
45:
46: }
|