Class MatchAlwaysTransactionAttributeSource
java.lang.Object
org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
- All Implemented Interfaces:
- Serializable,- TransactionAttributeSource
public class MatchAlwaysTransactionAttributeSource
extends Object
implements TransactionAttributeSource, Serializable
Very simple implementation of TransactionAttributeSource which will always return
 the same TransactionAttribute for all methods fed to it. The TransactionAttribute
 may be specified, but will otherwise default to PROPAGATION_REQUIRED. This may be
 used in the cases where you want to use the same transaction attribute with all
 methods being handled by a transaction interceptor.
- Since:
- 15.10.2003
- Author:
- Colin Sampaleanu, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleangetTransactionAttribute(Method method, @Nullable Class<?> targetClass) Return the transaction attribute for the given method, ornullif the method is non-transactional.inthashCode()voidsetTransactionAttribute(TransactionAttribute transactionAttribute) Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.transaction.interceptor.TransactionAttributeSourcehasTransactionAttribute, isCandidateClass
- 
Constructor Details- 
MatchAlwaysTransactionAttributeSourcepublic MatchAlwaysTransactionAttributeSource()
 
- 
- 
Method Details- 
setTransactionAttributeAllows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".- Parameters:
- transactionAttribute- the String form of the transactionAttribute to use.
- See Also:
 
- 
getTransactionAttributepublic @Nullable TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass) Description copied from interface:TransactionAttributeSourceReturn the transaction attribute for the given method, ornullif the method is non-transactional.- Specified by:
- getTransactionAttributein interface- TransactionAttributeSource
- Parameters:
- method- the method to introspect
- targetClass- the target class (can be- null, in which case the declaring class of the method must be used)
- Returns:
- the matching transaction attribute, or nullif none found
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-