| java.lang.Object org.springframework.transaction.interceptor.RollbackRuleAttribute
All known Subclasses: org.springframework.transaction.interceptor.NoRollbackRuleAttribute,
RollbackRuleAttribute | public class RollbackRuleAttribute implements Serializable(Code) | | 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.
author: Rod Johnson since: 09.04.2003 See Also: NoRollbackRuleAttribute |
Constructor Summary | |
public | RollbackRuleAttribute(Class clazz) Preferred way to construct a RollbackRule, matching the exception class and
subclasses. | public | RollbackRuleAttribute(String exceptionName) Construct a new RollbackRule for the given exception name.
This can be a substring, with no wildcard support at present.
A value of "ServletException" would match
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). |
RollbackRuleAttribute | public RollbackRuleAttribute(Class clazz)(Code) | | Preferred way to construct a RollbackRule, matching the exception class and
subclasses. The exception class must be Throwable or a subclass of Throwable.
Parameters: clazz - throwable class |
RollbackRuleAttribute | public RollbackRuleAttribute(String exceptionName)(Code) | | Construct a new RollbackRule for the given exception name.
This can be a substring, with no wildcard support at present.
A value of "ServletException" would match
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.
Parameters: exceptionName - the exception pattern(can also be a fully qualified class name) |
getDepth | public int getDepth(Throwable ex)(Code) | | Return the depth to the superclass matching.
0 means ex matches exactly. Returns -1 if there's no match.
Otherwise, returns depth. Lowest depth wins.
|
getExceptionName | public String getExceptionName()(Code) | | Return the pattern for the exception name.
|
hashCode | public int hashCode()(Code) | | |
|
|