View Javadoc
1   /*
2    * Copyright 2002-2012 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.transaction.interceptor;
18  
19  import org.springframework.transaction.TransactionDefinition;
20  
21  /**
22   * This interface adds a {@code rollbackOn} specification to {@link TransactionDefinition}.
23   * As custom {@code rollbackOn} is only possible with AOP, this class resides
24   * in the AOP transaction package.
25   *
26   * @author Rod Johnson
27   * @author Juergen Hoeller
28   * @since 16.03.2003
29   * @see DefaultTransactionAttribute
30   * @see RuleBasedTransactionAttribute
31   */
32  public interface TransactionAttribute extends TransactionDefinition {
33  
34  	/**
35  	 * Return a qualifier value associated with this transaction attribute.
36  	 * <p>This may be used for choosing a corresponding transaction manager
37  	 * to process this specific transaction.
38  	 */
39  	String getQualifier();
40  
41  	/**
42  	 * Should we roll back on the given exception?
43  	 * @param ex the exception to evaluate
44  	 * @return whether to perform a rollback or not
45  	 */
46  	boolean rollbackOn(Throwable ex);
47  
48  }