接口的使用
org.springframework.transaction.interceptor.TransactionAttribute
使用TransactionAttribute的程序包 程序包 说明 org.springframework.test.context.transaction Transactional support classes for the Spring TestContext Framework.org.springframework.transaction.annotation Spring's support for annotation-based transaction demarcation.org.springframework.transaction.interceptor AOP-based solution for declarative transaction demarcation.org.springframework.test.context.transaction中TransactionAttribute的使用
返回TransactionAttribute的org.springframework.test.context.transaction中的方法 修饰符和类型 方法 说明 static TransactionAttributeTestContextTransactionUtils. createDelegatingTransactionAttribute(TestContext testContext, TransactionAttribute targetAttribute)Create a delegatingTransactionAttributefor the supplied targetTransactionAttributeandTestContext, using the names of the test class and test method to build the name of the transaction.参数类型为TransactionAttribute的org.springframework.test.context.transaction中的方法 修饰符和类型 方法 说明 static TransactionAttributeTestContextTransactionUtils. createDelegatingTransactionAttribute(TestContext testContext, TransactionAttribute targetAttribute)Create a delegatingTransactionAttributefor the supplied targetTransactionAttributeandTestContext, using the names of the test class and test method to build the name of the transaction.org.springframework.transaction.annotation中TransactionAttribute的使用
org.springframework.transaction.interceptor中TransactionAttribute的使用
实现TransactionAttribute的org.springframework.transaction.interceptor中的类 修饰符和类型 类 说明 classDefaultTransactionAttributeSpring's common transaction attribute implementation.classDelegatingTransactionAttributeTransactionAttributeimplementation that delegates all calls to a given targetTransactionAttributeinstance.classRuleBasedTransactionAttributeTransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative.返回TransactionAttribute的org.springframework.transaction.interceptor中的方法 修饰符和类型 方法 说明 protected TransactionAttributeAbstractFallbackTransactionAttributeSource. computeTransactionAttribute(Method method, Class<?> targetClass)Same signature asAbstractFallbackTransactionAttributeSource.getTransactionAttribute(java.lang.reflect.Method, java.lang.Class<?>), but doesn't cache the result.protected abstract TransactionAttributeAbstractFallbackTransactionAttributeSource. findTransactionAttribute(Class<?> clazz)Subclasses need to implement this to return the transaction attribute for the given class, if any.protected abstract TransactionAttributeAbstractFallbackTransactionAttributeSource. findTransactionAttribute(Method method)Subclasses need to implement this to return the transaction attribute for the given method, if any.TransactionAttributeAbstractFallbackTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)Determine the transaction attribute for this method invocation.TransactionAttributeCompositeTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)TransactionAttributeMatchAlwaysTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)TransactionAttributeMethodMapTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)TransactionAttributeNameMatchTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)TransactionAttributeTransactionAspectSupport.TransactionInfo. getTransactionAttribute()TransactionAttributeTransactionAttributeSource. getTransactionAttribute(Method method, Class<?> targetClass)Return the transaction attribute for the given method, ornullif the method is non-transactional.参数类型为TransactionAttribute的org.springframework.transaction.interceptor中的方法 修饰符和类型 方法 说明 voidMethodMapTransactionAttributeSource. addTransactionalMethod(Class<?> clazz, String mappedName, TransactionAttribute attr)Add an attribute for a transactional method.voidMethodMapTransactionAttributeSource. addTransactionalMethod(Method method, TransactionAttribute attr)Add an attribute for a transactional method.voidMethodMapTransactionAttributeSource. addTransactionalMethod(String name, TransactionAttribute attr)Add an attribute for a transactional method.voidNameMatchTransactionAttributeSource. addTransactionalMethod(String methodName, TransactionAttribute attr)Add an attribute for a transactional method.protected TransactionAspectSupport.TransactionInfoTransactionAspectSupport. createTransactionIfNecessary(PlatformTransactionManager tm, TransactionAttribute txAttr, String joinpointIdentification)Create a transaction if necessary based on the given TransactionAttribute.protected TransactionManagerTransactionAspectSupport. determineTransactionManager(TransactionAttribute txAttr)Determine the specific transaction manager to use for the given transaction.protected TransactionAspectSupport.TransactionInfoTransactionAspectSupport. prepareTransactionInfo(PlatformTransactionManager tm, TransactionAttribute txAttr, String joinpointIdentification, TransactionStatus status)Prepare a TransactionInfo for the given attribute and status object.voidMatchAlwaysTransactionAttributeSource. setTransactionAttribute(TransactionAttribute transactionAttribute)Allows a transaction attribute to be specified, using the String form, for example, "PROPAGATION_REQUIRED".类型变量类型为TransactionAttribute的org.springframework.transaction.interceptor中的方法参数 修饰符和类型 方法 说明 protected voidMethodMapTransactionAttributeSource. initMethodMap(Map<String,TransactionAttribute> methodMap)Initialize the specified"methodMap", if any.voidMethodMapTransactionAttributeSource. setMethodMap(Map<String,TransactionAttribute> methodMap)Set a name/attribute map, consisting of "FQCN.method" method names (e.g.voidNameMatchTransactionAttributeSource. setNameMap(Map<String,TransactionAttribute> nameMap)Set a name/attribute map, consisting of method names (e.g.参数类型为TransactionAttribute的org.springframework.transaction.interceptor中的构造器 构造器 说明 DefaultTransactionAttribute(TransactionAttribute other)Copy constructor.DelegatingTransactionAttribute(TransactionAttribute targetAttribute)Create a DelegatingTransactionAttribute for the given target attribute.TransactionInfo(PlatformTransactionManager transactionManager, TransactionAttribute transactionAttribute, String joinpointIdentification)