#import
Posts
-
Digging into Spring's Source 9: @Conditional, @Profile and @Import — Choosing Beans by Condition
How @Conditional and @Profile, which register a bean only when a condition holds, and @Import, which pulls in other configuration, are evaluated inside the container — when and how — explained for someone new to Spring. Why a condition is evaluated three times, the three kinds of @Import, what DeferredImportSelector "defers" and why, the ImportStack that catches circular imports, and why every @EnableXxx is just @Import in disguise, all checked against the real source and small runnable examples.