From 3d3f8f3219d9e6e0af0bbea5260ebdf70035efe2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 11 Jun 2010 13:28:14 +0000 Subject: [PATCH] added explicit section on autodetecting aspects through component scanning (SPR-7246) --- spring-framework-reference/src/aop.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spring-framework-reference/src/aop.xml b/spring-framework-reference/src/aop.xml index 76ccf963e6..62bf969ee4 100644 --- a/spring-framework-reference/src/aop.xml +++ b/spring-framework-reference/src/aop.xml @@ -391,7 +391,20 @@ public class NotVeryUsefulAspect { introduction (inter-type) declarations. - Advising aspects + Autodetecting aspects through component scanning + + You may register aspect classes as regular beans in your Spring + XML configuration, or autodetect them throuch classpath scanning - + just like any other Spring-managed bean. However, note that the + @Aspect annotation is not + sufficient for autodetection in the classpath: For that purpose, + you need to add a separate @Component annotation + (or alternatively a custom stereotype annotation that qualifies, + as per the rules of Spring's component scanner). + + + + Advising aspects with other aspects? In Spring AOP, it is not possible to have aspects themselves be the target of advice from other aspects. The