optimized AnnotationTransactionAspect pointcut to avoid runtime checks (SPR-8890)

This commit is contained in:
Juergen Hoeller 2011-12-06 20:48:49 +00:00
parent d050a472a2
commit a347e4d3c2
1 changed files with 4 additions and 4 deletions

View File

@ -27,10 +27,10 @@ import org.springframework.transaction.annotation.Transactional;
* the class implements. AspectJ follows Java's rule that annotations on * the class implements. AspectJ follows Java's rule that annotations on
* interfaces are <i>not</i> inherited. * interfaces are <i>not</i> inherited.
* *
* <p>A @Transactional annotation on a class specifies the default transaction * <p>An @Transactional annotation on a class specifies the default transaction
* semantics for the execution of any <b>public</b> operation in the class. * semantics for the execution of any <b>public</b> operation in the class.
* *
* <p>A @Transactional annotation on a method within the class overrides the * <p>An @Transactional annotation on a method within the class overrides the
* default transaction semantics given by the class annotation (if present). * default transaction semantics given by the class annotation (if present).
* Any method may be annotated (regardless of visibility). * Any method may be annotated (regardless of visibility).
* Annotating non-public methods directly is the only way * Annotating non-public methods directly is the only way
@ -54,14 +54,14 @@ public aspect AnnotationTransactionAspect extends AbstractTransactionAspect {
* Transactional annotation. * Transactional annotation.
*/ */
private pointcut executionOfAnyPublicMethodInAtTransactionalType() : private pointcut executionOfAnyPublicMethodInAtTransactionalType() :
execution(public * ((@Transactional *)+).*(..)) && @this(Transactional); execution(* *(..)) && within(@Transactional *);
/** /**
* Matches the execution of any method with the * Matches the execution of any method with the
* Transactional annotation. * Transactional annotation.
*/ */
private pointcut executionOfTransactionalMethod() : private pointcut executionOfTransactionalMethod() :
execution(* *(..)) && @annotation(Transactional); execution(@Transactional * *(..));
/** /**
* Definition of pointcut from super aspect - matched join points * Definition of pointcut from super aspect - matched join points