Top Description Fields Constructors Methods
org.springframework.transaction.interceptor

public Class CompositeTransactionAttributeSource

extends Object
implements TransactionAttributeSource, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttributeSource
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.lang.reflect.Method, org.springframework.lang.Nullable, org.springframework.util.Assert

Composite TransactionAttributeSource implementation that iterates over a given array of TransactionAttributeSource instances.
Author
Juergen Hoeller
Since
2.0

Field Summary

Modifier and TypeField and Description
private final TransactionAttributeSource[]

Constructor Summary

AccessConstructor and Description
public
CompositeTransactionAttributeSource(TransactionAttributeSource...
the TransactionAttributeSource instances to combine
transactionAttributeSources
)

Create a new CompositeTransactionAttributeSource for the given sources.

Method Summary

Modifier and TypeMethod and Description
public TransactionAttribute
getTransactionAttribute(Method
the method to introspect
method
,
Class<?>
the target class (may be null, in which case the declaring class of the method must be used)
targetClass
)

Implements org.springframework.transaction.interceptor.TransactionAttributeSource.getTransactionAttribute.

Return the transaction attribute for the given method, or null if the method is non-transactional.

public final TransactionAttributeSource[]
getTransactionAttributeSources()

Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.

public boolean
isCandidateClass(Class<?>
the class to introspect
targetClass
)

Overrides default org.springframework.transaction.interceptor.TransactionAttributeSource.isCandidateClass.

Determine whether the given class is a candidate for transaction attributes in the metadata format of this TransactionAttributeSource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transactionAttributeSourcesback to summary
private final TransactionAttributeSource[] transactionAttributeSources

Constructor Detail

CompositeTransactionAttributeSourceback to summary
public CompositeTransactionAttributeSource(TransactionAttributeSource... transactionAttributeSources)

Create a new CompositeTransactionAttributeSource for the given sources.

Parameters
transactionAttributeSources:TransactionAttributeSource[]

the TransactionAttributeSource instances to combine

Method Detail

getTransactionAttributeback to summary
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass)

Implements org.springframework.transaction.interceptor.TransactionAttributeSource.getTransactionAttribute.

Doc from org.springframework.transaction.interceptor.TransactionAttributeSource.getTransactionAttribute.

Return the transaction attribute for the given method, or null if the method is non-transactional.

Parameters
method:Method

the method to introspect

targetClass:Class<?>

the target class (may be null, in which case the declaring class of the method must be used)

Returns:TransactionAttribute

the matching transaction attribute, or null if none found

Annotations
@Override
@Nullable
getTransactionAttributeSourcesback to summary
public final TransactionAttributeSource[] getTransactionAttributeSources()

Return the TransactionAttributeSource instances that this CompositeTransactionAttributeSource combines.

isCandidateClassback to summary
public boolean isCandidateClass(Class<?> targetClass)

Overrides default org.springframework.transaction.interceptor.TransactionAttributeSource.isCandidateClass.

Doc from org.springframework.transaction.interceptor.TransactionAttributeSource.isCandidateClass.

Determine whether the given class is a candidate for transaction attributes in the metadata format of this TransactionAttributeSource.

If this method returns false, the methods on the given class will not get traversed for getTransactionAttribute introspection. Returning false is therefore an optimization for non-affected classes, whereas true simply means that the class needs to get fully introspected for each method on the given class individually.

Parameters
targetClass:Class<?>

the class to introspect

Returns:boolean

false if the class is known to have no transaction attributes at class or method level; true otherwise. The default implementation returns true, leading to regular introspection.

Annotations
@Override