File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
spring-context/src/main/java/org/springframework/context/annotation Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 40
40
import org .springframework .util .Assert ;
41
41
42
42
/**
43
- * Enhances {@link Configuration} classes by generating a CGLIB subclass capable of
44
- * interacting with the Spring container to respect bean semantics.
43
+ * Enhances {@link Configuration} classes by generating a CGLIB subclass which
44
+ * interacts with the Spring container to respect bean scoping semantics for
45
+ * {@code @Bean} methods. Each such {@code @Bean} method will be overridden in
46
+ * the generated subclass, only delegating to the actual {@code @Bean} method
47
+ * implementation if the container actually requests the construction of a new
48
+ * instance. Otherwise, a call to such an {@code @Bean} method serves as a
49
+ * reference back to the container, obtaining the corresponding bean by name.
45
50
*
46
51
* @author Chris Beams
47
52
* @author Juergen Hoeller
@@ -104,7 +109,7 @@ public Class<?> enhance(Class<?> configClass) {
104
109
private Enhancer newEnhancer (Class <?> superclass ) {
105
110
Enhancer enhancer = new Enhancer ();
106
111
enhancer .setSuperclass (superclass );
107
- enhancer .setInterfaces (new Class <?>[]{EnhancedConfiguration .class });
112
+ enhancer .setInterfaces (new Class <?>[] {EnhancedConfiguration .class });
108
113
enhancer .setUseFactory (false );
109
114
enhancer .setNamingPolicy (SpringNamingPolicy .INSTANCE );
110
115
enhancer .setCallbackFilter (CALLBACK_FILTER );
You can’t perform that action at this time.
0 commit comments