Skip to content

Commit 3d3f8f3

Browse files
committed
added explicit section on autodetecting aspects through component scanning (SPR-7246)
1 parent 28a765f commit 3d3f8f3

File tree

1 file changed

+14
-1
lines changed
  • spring-framework-reference/src

1 file changed

+14
-1
lines changed

spring-framework-reference/src/aop.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,20 @@ public class NotVeryUsefulAspect {
391391
introduction (inter-type) declarations.</para>
392392

393393
<note>
394-
<title>Advising aspects</title>
394+
<title>Autodetecting aspects through component scanning</title>
395+
396+
<para>You may register aspect classes as regular beans in your Spring
397+
XML configuration, or autodetect them throuch classpath scanning -
398+
just like any other Spring-managed bean. However, note that the
399+
<emphasis>@Aspect</emphasis> annotation is <emphasis>not</emphasis>
400+
sufficient for autodetection in the classpath: For that purpose,
401+
you need to add a separate <emphasis>@Component</emphasis> annotation
402+
(or alternatively a custom stereotype annotation that qualifies,
403+
as per the rules of Spring's component scanner).</para>
404+
</note>
405+
406+
<note>
407+
<title>Advising aspects with other aspects?</title>
395408

396409
<para>In Spring AOP, it is <emphasis>not</emphasis> possible to have
397410
aspects themselves be the target of advice from other aspects. The

0 commit comments

Comments
 (0)