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