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.annotation;
18:
19: import java.lang.reflect.AnnotatedElement;
20:
21: import org.springframework.transaction.interceptor.TransactionAttribute;
22:
23: /**
24: * Strategy interface for parsing known transaction annotation types.
25: * {@link AnnotationTransactionAttributeSource} delegates to such
26: * parsers for supporting specific annotation types such as Spring's own
27: * {@link Transactional} or EJB3's {@link javax.ejb.TransactionAttribute}.
28: *
29: * @author Juergen Hoeller
30: * @since 2.5
31: * @see AnnotationTransactionAttributeSource
32: * @see SpringTransactionAnnotationParser
33: * @see Ejb3TransactionAnnotationParser
34: */
35: public interface TransactionAnnotationParser {
36:
37: /**
38: * Parse the transaction attribute for the given method or class,
39: * based on a known annotation type.
40: * <p>This essentially parses a known transaction annotation into Spring's
41: * metadata attribute class. Returns <code>null</code> if the method/class
42: * is not transactional.
43: * @param ae the annotated method or class
44: * @return TransactionAttribute the configured transaction attribute,
45: * or <code>null</code> if none was found
46: * @see AnnotationTransactionAttributeSource#determineTransactionAttribute
47: */
48: TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae);
49:
50: }
|