类 MatchAlwaysTransactionAttributeSource
- java.lang.Object
- org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource
- 所有已实现的接口:
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.- 从以下版本开始:
- 15.10.2003
- 作者:
- Colin Sampaleanu
- 另请参阅:
TransactionProxyFactoryBean
,BeanNameAutoProxyCreator
, 序列化表格
构造器概要
构造器 构造器 说明 MatchAlwaysTransactionAttributeSource()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object other)
TransactionAttribute
getTransactionAttribute(Method method, Class<?> targetClass)
Return the transaction attribute for the given method, ornull
if the method is non-transactional.int
hashCode()
void
setTransactionAttribute(TransactionAttribute transactionAttribute)
Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".String
toString()
构造器详细资料
MatchAlwaysTransactionAttributeSource
public MatchAlwaysTransactionAttributeSource()
方法详细资料
setTransactionAttribute
public void setTransactionAttribute(TransactionAttribute transactionAttribute)
Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".- 参数:
transactionAttribute
- The String form of the transactionAttribute to use.- 另请参阅:
TransactionAttributeEditor
getTransactionAttribute
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass)
从接口复制的说明:TransactionAttributeSource
Return the transaction attribute for the given method, ornull
if the method is non-transactional.- 指定者:
getTransactionAttribute
在接口中TransactionAttributeSource
- 参数:
method
- the method to introspecttargetClass
- the target class (may benull
, in which case the declaring class of the method must be used)- 返回:
- the matching transaction attribute, or
null
if none found