public class BindableRuleBasedTransactionAttribute extends DefaultTransactionAttribute
RuleBasedTransactionAttribute
so that it can be bound
from annotation metadata and defaults to rollback on all exception types apart from those configured.PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
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 and Description |
---|
BindableRuleBasedTransactionAttribute() |
Modifier and Type | Method and 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.
|
getAttributeDescription, getDescriptor, getQualifier, setDescriptor, setQualifier
equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly, withDefaults
public BindableRuleBasedTransactionAttribute()
public final void setNoRollbackFor(java.lang.Class<? extends java.lang.Throwable>... exceptions)
exceptions
- The exceptions not to rollback forpublic final void setRollbackFor(java.lang.Class<? extends java.lang.Throwable>... exceptions)
exceptions
- The exceptions to rollback forpublic final java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getNoRollbackFor()
public final java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getRollbackFor()
public final boolean rollbackOn(java.lang.Throwable ex)
rollbackOn
in interface TransactionAttribute
rollbackOn
in class DefaultTransactionAttribute