Class AbstractFallbackTransactionAttributeSource

  • All Implemented Interfaces:
    TransactionAttributeSource
    Direct Known Subclasses:
    AnnotationTransactionAttributeSource

    public abstract class AbstractFallbackTransactionAttributeSource
    extends Object
    implements TransactionAttributeSource
    Abstract implementation of TransactionAttributeSource that caches attributes for methods and implements a fallback policy: 1. specific target method; 2. target class; 3. declaring method; 4. declaring class/interface.

    Defaults to using the target class's transaction attribute if none is associated with the target method. Any transaction attribute associated with the target method completely overrides a class transaction attribute. If none found on the target class, the interface that the invoked method has been called through (in case of a JDK proxy) will be checked.

    This implementation caches attributes by method after they are first used. If it is ever desirable to allow dynamic changing of transaction attributes (which is very unlikely), caching could be made configurable. Caching is desirable because of the cost of evaluating rollback rules.

    Since:
    1.1
    Author:
    Rod Johnson, Juergen Hoeller