类 RollbackRuleAttribute

    • 构造器详细资料

      • RollbackRuleAttribute

        public RollbackRuleAttribute​(Class<?> clazz)
        Create a new instance of the RollbackRuleAttribute class.

        This is the preferred way to construct a rollback rule that matches the supplied Exception class (and subclasses).

        参数:
        clazz - throwable class; must be Throwable or a subclass of Throwable
        抛出:
        IllegalArgumentException - if the supplied clazz is not a Throwable type or is null
      • RollbackRuleAttribute

        public RollbackRuleAttribute​(String exceptionName)
        Create a new instance of the RollbackRuleAttribute class for the given exceptionName.

        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 is not 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 fully package-qualified name.

        参数:
        exceptionName - the exception name pattern; can also be a fully package-qualified class name
        抛出:
        IllegalArgumentException - if the supplied exceptionName is null or empty