|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
Can also be used as base class for a custom annotation-based TransactionAttributeSource.
This is a direct alternative to
AttributesTransactionAttributeSource
,
which is able to read in source-level attributes via Commons Attributes.
Transactional
,
findTransactionAttribute(java.util.Collection)
,
TransactionAspectSupport.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)
,
TransactionProxyFactoryBean.setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource)
,
AttributesTransactionAttributeSource
,
CommonsAttributes
,
Serialized FormField 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. |
|
AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
Create a custom AnnotationTransactionAttributeSource. |
Method Summary | |
---|---|
protected boolean |
allowPublicMethodsOnly()
By default, only public methods can be made transactional using Transactional . |
boolean |
equals(Object other)
|
protected Collection |
findAllAttributes(Class clazz)
Returns all JDK 1.5+ annotations found for the given class. |
protected Collection |
findAllAttributes(Method method)
Returns all JDK 1.5+ annotations found for the given method. |
protected TransactionAttribute |
findTransactionAttribute(Collection atts)
Return the transaction attribute, given this set of attributes attached to a method or class. |
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.
public AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
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)Method Detail |
---|
protected Collection findAllAttributes(Method method)
findAllAttributes
in class AbstractFallbackTransactionAttributeSource
method
- the method to retrieve attributes for
null
)protected Collection findAllAttributes(Class clazz)
findAllAttributes
in class AbstractFallbackTransactionAttributeSource
clazz
- class to retrieve attributes for
null
)protected TransactionAttribute findTransactionAttribute(Collection atts)
This implementation converts Spring's Transactional
annotation
to the Spring metadata classes. Returns null
if it's not transactional.
Can be overridden to support custom annotations that carry transaction metadata.
findTransactionAttribute
in class AbstractFallbackTransactionAttributeSource
atts
- attributes attached to a method or class. May be null
,
in which case a null
TransactionAttribute will be returned.
null
if none was foundTransactional
protected boolean allowPublicMethodsOnly()
Transactional
.
allowPublicMethodsOnly
in class AbstractFallbackTransactionAttributeSource
public boolean equals(Object other)
equals
in class Object
public 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 |