|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
public class AnnotationTransactionAttributeSource
Implementation of the
TransactionAttributeSource
interface for working with transaction metadata in JDK 1.5+ annotation format.
This class reads Spring's JDK 1.5+ Transactional annotation and
exposes corresponding transaction attributes to Spring's transaction infrastructure.
Also supports EJB3's TransactionAttribute annotation (if present).
This class may also serve as base class for a custom TransactionAttributeSource,
or get customized through TransactionAnnotationParser strategies.
This is a direct alternative to
AttributesTransactionAttributeSource,
which is able to read in source-level attributes via Commons Attributes.
Transactional,
TransactionAnnotationParser,
SpringTransactionAnnotationParser,
Ejb3TransactionAnnotationParser,
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource),
TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource),
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource |
|---|
logger |
| Constructor Summary | |
|---|---|
AnnotationTransactionAttributeSource()
Create a default AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation
or the EJB3 TransactionAttribute annotation. |
|
AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
Create a custom AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation
or the EJB3 TransactionAttribute annotation. |
|
AnnotationTransactionAttributeSource(Set<TransactionAnnotationParser> annotationParsers)
Create a custom AnnotationTransactionAttributeSource. |
|
AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser)
Create a custom AnnotationTransactionAttributeSource. |
|
| Method Summary | |
|---|---|
protected boolean |
allowPublicMethodsOnly()
By default, only public methods can be made transactional. |
protected TransactionAttribute |
determineTransactionAttribute(AnnotatedElement ae)
Determine the transaction attribute for the given method or class. |
boolean |
equals(Object other)
|
protected TransactionAttribute |
findTransactionAttribute(Class clazz)
Subclasses need to implement this to return the transaction attribute for the given class, if any. |
protected TransactionAttribute |
findTransactionAttribute(Method method)
Subclasses need to implement this to return the transaction attribute for the given method, if any. |
int |
hashCode()
|
| Methods inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource |
|---|
getCacheKey, getTransactionAttribute |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationTransactionAttributeSource()
Transactional annotation
or the EJB3 TransactionAttribute annotation.
public AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
Transactional annotation
or the EJB3 TransactionAttribute annotation.
publicMethodsOnly - whether to support public methods that carry
the Transactional annotation only (typically for use
with proxy-based AOP), or protected/private methods as well
(typically used with AspectJ class weaving)public AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser)
annotationParser - the TransactionAnnotationParser to usepublic AnnotationTransactionAttributeSource(Set<TransactionAnnotationParser> annotationParsers)
annotationParsers - the TransactionAnnotationParsers to use| Method Detail |
|---|
protected TransactionAttribute findTransactionAttribute(Method method)
AbstractFallbackTransactionAttributeSource
findTransactionAttribute in class AbstractFallbackTransactionAttributeSourcemethod - the method to retrieve the attribute for
null if none)protected TransactionAttribute findTransactionAttribute(Class clazz)
AbstractFallbackTransactionAttributeSource
findTransactionAttribute in class AbstractFallbackTransactionAttributeSourceclazz - the class to retrieve the attribute for
null if none)protected TransactionAttribute determineTransactionAttribute(AnnotatedElement ae)
This implementation delegates to configured
TransactionAnnotationParsers
for parsing known annotations into Spring's metadata attribute class.
Returns null if it's not transactional.
Can be overridden to support custom annotations that carry transaction metadata.
ae - the annotated method or class
null if none was foundprotected boolean allowPublicMethodsOnly()
allowPublicMethodsOnly in class AbstractFallbackTransactionAttributeSourcepublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||