File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
spring-framework-reference/src Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2959,6 +2959,16 @@ public class Account {
2959
2959
2960
2960
< /bean> </programlisting >
2961
2961
2962
+ <note >
2963
+ <para >Do not activate <interfacename >@Configurable</interfacename >
2964
+ processing through the bean configurer aspect unless you really
2965
+ mean to rely on its semantics at runtime. In particular, make sure
2966
+ that you do not use <interfacename >@Configurable</interfacename >
2967
+ on bean classes which are registered as regular Spring beans with
2968
+ the container: You would get double initialization otherwise, once
2969
+ through the container and once through the aspect.</para >
2970
+ </note >
2971
+
2962
2972
<section id =" aop-configurable-testing" >
2963
2973
<title >Unit testing <interfacename >@Configurable</interfacename >
2964
2974
objects</title >
Original file line number Diff line number Diff line change @@ -553,6 +553,17 @@ public void doSomething() {
553
553
and must not expect any arguments. If the method needs to interact with
554
554
other objects from the Application Context, then those would typically
555
555
have been provided through dependency injection.</para >
556
+
557
+ <note >
558
+ <para >Make sure that you are not initializing multiple instances
559
+ of the same @Scheduled annotation class at runtime, unless you do
560
+ want to schedule callbacks to each such instance. Related to this,
561
+ make sure that you do not use @Configurable on bean classes which
562
+ are annotated with @Scheduled and registered as regular Spring beans
563
+ with the container: You would get double initialization otherwise,
564
+ once through the container and once through the @Configurable aspect,
565
+ with the consequence of each @Scheduled method being invoked twice.</para >
566
+ </note >
556
567
</section >
557
568
558
569
<section id =" scheduling-annotation-support-async" >
You can’t perform that action at this time.
0 commit comments