spring-framework/org.springframework.context
Chris Beams 26a0e223a4 Fix @Autowired+@PostConstruct+@Configuration issue
A subtle issue existed with the way we relied on isCurrentlyInCreation
to determine whether a @Bean method is being called by the container
or by user code.  This worked in most cases, but in the particular
scenario laid out by SPR-8080, this approach was no longer sufficient.

This change introduces a ThreadLocal that contains the factory method
currently being invoked by the container, such that enhanced @Bean
methods can check against it to see if they are being called by the
container or not.  If so, that is the cue that the user-defined @Bean
method implementation should be invoked in order to actually create
the bean for the first time.  If not, then the cached instance of
the already-created bean should be looked up and returned.

See ConfigurationClassPostConstructAndAutowiringTests for
reproduction cases and more detail.

Issue: SPR-8080

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4296 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 12:28:13 +00:00
..
.settings
src Fix @Autowired+@PostConstruct+@Configuration issue 2011-05-12 12:28:13 +00:00
.classpath
.project
.springBeans Remove "Feature" support introduced in 3.1 M1 2011-05-06 19:03:52 +00:00
build.xml
context.iml
ivy.xml
pom.xml Sync pom.xml deps with ivy.xml changes since 3.0.5 2011-02-09 06:56:53 +00:00
template.mf SPR-6416, initial commit for the conversation management 2011-04-12 13:21:18 +00:00