KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.Conventions;
20 import org.springframework.util.ClassUtils;
21
22 /**
23  * @author Rob Harrop
24  * @author Juergen Hoeller
25  * @since 2.0
26  */

27 class TxNamespaceUtils {
28
29     public static final String JavaDoc TRANSACTION_MANAGER_ATTRIBUTE = "transaction-manager";
30
31     public static final String JavaDoc TRANSACTION_MANAGER_PROPERTY =
32             Conventions.attributeNameToPropertyName(TRANSACTION_MANAGER_ATTRIBUTE);
33
34     public static final String JavaDoc TRANSACTION_ATTRIBUTE_SOURCE = "transactionAttributeSource";
35
36     private static final String JavaDoc ANNOTATION_TRANSACTION_ATTRIBUTE_SOURCE_CLASS_NAME =
37             "org.springframework.transaction.annotation.AnnotationTransactionAttributeSource";
38
39
40     public static Class JavaDoc getAnnotationTransactionAttributeSourceClass() {
41         try {
42             return ClassUtils.forName(ANNOTATION_TRANSACTION_ATTRIBUTE_SOURCE_CLASS_NAME);
43         }
44         catch (Throwable JavaDoc ex) {
45             throw new IllegalStateException JavaDoc(
46                     "Unable to load class [" + ANNOTATION_TRANSACTION_ATTRIBUTE_SOURCE_CLASS_NAME +
47                     "]. Are you running on Java 1.5+? Root cause: " + ex);
48         }
49     }
50
51 }
52
Popular Tags