diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java index 86c6b528124..01dbf705e6d 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +103,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran } else { if (logger.isDebugEnabled()) { - logger.debug("Adding transactional method [" + method.getName() + "] with attribute [" + txAtt + "]"); + logger.debug("Adding transactional method '" + method.getName() + "' with attribute: " + txAtt); } this.attributeCache.put(cacheKey, txAtt); } diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java index d9a9cf515e7..3bae2f663d0 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,4 +94,17 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im return (ex instanceof RuntimeException || ex instanceof Error); } + + /** + * Return an identifying description for this transaction attribute. + *

Available to subclasses, for inclusion in their toString() result. + */ + protected final StringBuilder getAttributeDescription() { + StringBuilder result = getDefinitionDescription(); + if (this.qualifier != null) { + result.append("; '").append(this.qualifier).append("'"); + } + return result; + } + } diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java index 87a5da02041..d67368843f3 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; * both positive and negative. If no rules are relevant to the exception, it * behaves like DefaultTransactionAttribute (rolling back on runtime exceptions). * - *

TransactionAttributeEditor creates objects of this class. + *

{@link TransactionAttributeEditor} creates objects of this class. * * @author Rod Johnson * @author Juergen Hoeller @@ -159,7 +159,7 @@ public class RuleBasedTransactionAttribute extends DefaultTransactionAttribute i @Override public String toString() { - StringBuilder result = getDefinitionDescription(); + StringBuilder result = getAttributeDescription(); if (this.rollbackRules != null) { for (RollbackRuleAttribute rule : this.rollbackRules) { String sign = (rule instanceof NoRollbackRuleAttribute ? PREFIX_COMMIT_RULE : PREFIX_ROLLBACK_RULE); diff --git a/org.springframework.transaction/src/test/resources/log4j.xml b/org.springframework.transaction/src/test/resources/log4j.xml index 767b96d6206..e684ff2b7e9 100644 --- a/org.springframework.transaction/src/test/resources/log4j.xml +++ b/org.springframework.transaction/src/test/resources/log4j.xml @@ -15,7 +15,7 @@ - +