|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.transaction.interceptor.RollbackRuleAttribute
public class RollbackRuleAttribute
Rule determining whether or not a given exception (and any subclasses) should cause a rollback. Multiple such rules can be applied to determine whether a transaction should commit or rollback after an exception has been thrown.
NoRollbackRuleAttribute
,
Serialized FormField Summary | |
---|---|
static RollbackRuleAttribute |
ROLLBACK_ON_RUNTIME_EXCEPTIONS
|
Constructor Summary | |
---|---|
RollbackRuleAttribute(Class clazz)
Preferred way to construct a RollbackRule, matching the exception class and subclasses. |
|
RollbackRuleAttribute(String exceptionName)
Construct a new RollbackRule for the given exception name. |
Method Summary | |
---|---|
boolean |
equals(Object other)
|
int |
getDepth(Throwable ex)
Return the depth to the superclass matching. 0 means ex matches exactly. |
String |
getExceptionName()
Return the pattern for the exception name. |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RollbackRuleAttribute ROLLBACK_ON_RUNTIME_EXCEPTIONS
Constructor Detail |
---|
public RollbackRuleAttribute(Class clazz)
clazz
- throwable classpublic RollbackRuleAttribute(String exceptionName)
javax.servlet.ServletException
and subclasses, for example.
NB: Consider carefully how specific the pattern is, and whether to include package information (which isn't mandatory). For example, "Exception" will match nearly anything, and will probably hide other rules. "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all checked exceptions. With more unusual exception names such as "BaseBusinessException" there's no need to use a FQN.
exceptionName
- the exception pattern
(can also be a fully qualified class name)Method Detail |
---|
public String getExceptionName()
public int getDepth(Throwable ex)
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |