类 CompositeTransactionAttributeSource
- java.lang.Object
- org.springframework.transaction.interceptor.CompositeTransactionAttributeSource
- 所有已实现的接口:
Serializable,TransactionAttributeSource
public class CompositeTransactionAttributeSource extends Object implements TransactionAttributeSource, Serializable
CompositeTransactionAttributeSourceimplementation that iterates over a given array ofTransactionAttributeSourceinstances.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 CompositeTransactionAttributeSource(TransactionAttributeSource... transactionAttributeSources)Create a new CompositeTransactionAttributeSource for the given sources.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TransactionAttributegetTransactionAttribute(Method method, Class<?> targetClass)Return the transaction attribute for the given method, ornullif the method is non-transactional.TransactionAttributeSource[]getTransactionAttributeSources()Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.booleanisCandidateClass(Class<?> targetClass)Determine whether the given class is a candidate for transaction attributes in the metadata format of thisTransactionAttributeSource.
构造器详细资料
CompositeTransactionAttributeSource
public CompositeTransactionAttributeSource(TransactionAttributeSource... transactionAttributeSources)
Create a new CompositeTransactionAttributeSource for the given sources.- 参数:
transactionAttributeSources- the TransactionAttributeSource instances to combine
方法详细资料
getTransactionAttributeSources
public final TransactionAttributeSource[] getTransactionAttributeSources()
Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.
isCandidateClass
public boolean isCandidateClass(Class<?> targetClass)
从接口复制的说明:TransactionAttributeSourceDetermine whether the given class is a candidate for transaction attributes in the metadata format of thisTransactionAttributeSource.If this method returns
false, the methods on the given class will not get traversed forTransactionAttributeSource.getTransactionAttribute(java.lang.reflect.Method, java.lang.Class<?>)introspection. Returningfalseis therefore an optimization for non-affected classes, whereastruesimply means that the class needs to get fully introspected for each method on the given class individually.- 指定者:
isCandidateClass在接口中TransactionAttributeSource- 参数:
targetClass- the class to introspect- 返回:
falseif the class is known to have no transaction attributes at class or method level;trueotherwise. The default implementation returnstrue, leading to regular introspection.
getTransactionAttribute
@Nullable public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass)
从接口复制的说明:TransactionAttributeSourceReturn the transaction attribute for the given method, ornullif 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
nullif none found