1 16 17 package org.springframework.transaction.interceptor; 18 19 import java.io.Serializable ; 20 import java.lang.reflect.Method ; 21 22 import org.springframework.util.ObjectUtils; 23 24 36 public class MatchAlwaysTransactionAttributeSource implements TransactionAttributeSource, Serializable { 37 38 private TransactionAttribute transactionAttribute = new DefaultTransactionAttribute(); 39 40 41 47 public void setTransactionAttribute(TransactionAttribute transactionAttribute) { 48 this.transactionAttribute = transactionAttribute; 49 } 50 51 52 public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) { 53 return this.transactionAttribute; 54 } 55 56 57 public boolean equals(Object other) { 58 if (this == other) { 59 return true; 60 } 61 if (!(other instanceof MatchAlwaysTransactionAttributeSource)) { 62 return false; 63 } 64 MatchAlwaysTransactionAttributeSource otherTas = (MatchAlwaysTransactionAttributeSource) other; 65 return ObjectUtils.nullSafeEquals(this.transactionAttribute, otherTas.transactionAttribute); 66 } 67 68 public int hashCode() { 69 return MatchAlwaysTransactionAttributeSource.class.hashCode(); 70 } 71 72 public String toString() { 73 return getClass().getName() + ": " + this.transactionAttribute; 74 } 75 76 } 77 | Popular Tags |