Class BindableRuleBasedTransactionAttribute

  • All Implemented Interfaces:
    java.io.Serializable, org.springframework.transaction.interceptor.TransactionAttribute, org.springframework.transaction.TransactionDefinition

    public class BindableRuleBasedTransactionAttribute
    extends org.springframework.transaction.interceptor.DefaultTransactionAttribute
    Extends RuleBasedTransactionAttribute so that it can be bound from annotation metadata and defaults to rollback on all exception types apart from those configured.
    Since:
    1.0
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition

        PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
      • Fields inherited from interface org.springframework.transaction.TransactionDefinition

        ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getNoRollbackFor()  
      java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getRollbackFor()  
      boolean rollbackOn​(java.lang.Throwable ex)  
      void setNoRollbackFor​(java.lang.Class<? extends java.lang.Throwable>... exceptions)
      Configures the exceptions to not rollback for.
      void setRollbackFor​(java.lang.Class<? extends java.lang.Throwable>... exceptions)
      Configures the exceptions to rollback for.
      • Methods inherited from class org.springframework.transaction.interceptor.DefaultTransactionAttribute

        getAttributeDescription, getDescriptor, getLabels, getQualifier, getTimeoutString, resolveAttributeStrings, setDescriptor, setLabels, setQualifier, setTimeoutString
      • Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition

        equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.springframework.transaction.TransactionDefinition

        getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly
    • Constructor Detail

      • BindableRuleBasedTransactionAttribute

        public BindableRuleBasedTransactionAttribute()
    • Method Detail

      • setNoRollbackFor

        public final void setNoRollbackFor​(java.lang.Class<? extends java.lang.Throwable>... exceptions)
        Configures the exceptions to not rollback for.
        Parameters:
        exceptions - The exceptions not to rollback for
      • setRollbackFor

        public final void setRollbackFor​(java.lang.Class<? extends java.lang.Throwable>... exceptions)
        Configures the exceptions to rollback for.
        Parameters:
        exceptions - The exceptions to rollback for
      • getNoRollbackFor

        public final java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getNoRollbackFor()
        Returns:
        An unmodifiable set of exceptions to not rollback for.
      • getRollbackFor

        public final java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getRollbackFor()
        Returns:
        An unmodifiable set of exceptions to rollback for.
      • rollbackOn

        public final boolean rollbackOn​(java.lang.Throwable ex)
        Specified by:
        rollbackOn in interface org.springframework.transaction.interceptor.TransactionAttribute
        Overrides:
        rollbackOn in class org.springframework.transaction.interceptor.DefaultTransactionAttribute