org.springframework.transaction.annotation

Class AnnotationTransactionAttributeSource

    • Constructor Detail

      • AnnotationTransactionAttributeSource

        public AnnotationTransactionAttributeSource()
        Create a default AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
      • AnnotationTransactionAttributeSource

        public AnnotationTransactionAttributeSource(boolean publicMethodsOnly)
        Create a custom AnnotationTransactionAttributeSource, supporting public methods that carry the Transactional annotation or the EJB3 TransactionAttribute annotation.
        Parameters:
        publicMethodsOnly - whether to support public methods that carry the Transactional annotation only (typically for use with proxy-based AOP), or protected/private methods as well (typically used with AspectJ class weaving)
      • AnnotationTransactionAttributeSource

        public AnnotationTransactionAttributeSource(TransactionAnnotationParser annotationParser)
        Create a custom AnnotationTransactionAttributeSource.
        Parameters:
        annotationParser - the TransactionAnnotationParser to use
      • AnnotationTransactionAttributeSource

        public AnnotationTransactionAttributeSource(TransactionAnnotationParser... annotationParsers)
        Create a custom AnnotationTransactionAttributeSource.
        Parameters:
        annotationParsers - the TransactionAnnotationParsers to use
      • AnnotationTransactionAttributeSource

        public AnnotationTransactionAttributeSource(java.util.Set<TransactionAnnotationParser> annotationParsers)
        Create a custom AnnotationTransactionAttributeSource.
        Parameters:
        annotationParsers - the TransactionAnnotationParsers to use
    • Method Detail

      • determineTransactionAttribute

        @Nullable
        protected TransactionAttribute determineTransactionAttribute(java.lang.reflect.AnnotatedElement element)
        Determine the transaction attribute for the given method or class.

        This implementation delegates to configured TransactionAnnotationParsers for parsing known annotations into Spring's metadata attribute class. Returns null if it's not transactional.

        Can be overridden to support custom annotations that carry transaction metadata.

        Parameters:
        element - the annotated method or class
        Returns:
        the configured transaction attribute, or null if none was found
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object