org.springframework.transaction.interceptor
Class RuleBasedTransactionAttribute

org.springframework.transaction.support.DefaultTransactionDefinition
  |
  +--org.springframework.transaction.interceptor.DefaultTransactionAttribute
        |
        +--org.springframework.transaction.interceptor.RuleBasedTransactionAttribute

public class RuleBasedTransactionAttribute
extends DefaultTransactionAttribute

TransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative. If no rules are relevant to the exception, it behaves like DefaultTransactionAttribute (rolling back on runtime exceptions).
The TransactionAttributeEditor property editor creates objects of this class.

Author:
Rod Johnson
Version: $Id: RuleBasedTransactionAttribute.java,v 1.2 2003/08/18 16:22:09 jhoeller Exp $
Since: 09-Apr-2003

Fields inherited from class org.springframework.transaction.interceptor.DefaultTransactionAttribute
COMMIT_RULE_PREFIX, ROLLBACK_RULE_PREFIX

Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
READ_ONLY_MARKER, TIMEOUT_PREFIX

Constructor Summary
RuleBasedTransactionAttribute()
           
RuleBasedTransactionAttribute(int propagationBehavior, List rollbackRules)
           

Method Summary
 ListgetRollbackRules()
           
 booleanrollbackOn(Throwable t)
          Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception).
 voidsetRollbackRules(List rollbackRules)
           
 StringtoString()
           

Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
equals, getIsolationLevel, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout

Constructor Detail

RuleBasedTransactionAttribute

public RuleBasedTransactionAttribute()

RuleBasedTransactionAttribute

public RuleBasedTransactionAttribute(int propagationBehavior, List rollbackRules)
Method Detail

getRollbackRules

public List getRollbackRules()

rollbackOn

public boolean rollbackOn(Throwable t)
Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception). If no rule applies (-1), return false.
See Also:
TransactionAttribute.rollbackOn(java.lang.Throwable)

setRollbackRules

public void setRollbackRules(List rollbackRules)

toString

public String toString()

Association Links

to Class java.util.List