Class BindableRuleBasedTransactionAttribute
- java.lang.Object
-
- org.springframework.transaction.support.DefaultTransactionDefinition
-
- org.springframework.transaction.interceptor.DefaultTransactionAttribute
-
- io.micronaut.spring.tx.annotation.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
ExtendsRuleBasedTransactionAttribute
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
-
-
Constructor Summary
Constructors Constructor Description BindableRuleBasedTransactionAttribute()
-
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
-
-
-
-
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 interfaceorg.springframework.transaction.interceptor.TransactionAttribute
- Overrides:
rollbackOn
in classorg.springframework.transaction.interceptor.DefaultTransactionAttribute
-
-