Go to file
Chris Beams a456a1a0e3 Improve annotation processing thread-safety
Commit http://bit.ly/nXumTs ensured that component methods and fields
marked with 'common annotations' such as @Resource, @PostConstruct and
@PreDestroy are invoked/assigned once and only once, even if multiple
instances of the CommonAnnotationBeanPostProcessor are processing the
same bean factory.

The implementation works against the InjectionMetadata API, adding and
removing these members from sets that track whether they are already
'externally managed', i.e. that another CABPP has already handled them,
thus avoiding redundant processing.

Prior to this change, the #remove operations against these sets were
not synchronized. In a single-threaded context this is fine thanks to
logic in AbstractAutowireCapableBeanFactory#doCreateBean that checks to
see whether a given bean definition has already been post processed.
However, as reported by SPR-8598, certain cases involving multiple
threads and annotated prototype-scoped beans can cause concurrent
modification exceptions during the #remove operation (ostensibly because
another thread is attempting to do the same removal at the same time,
though this has yet to be reproduced in isolation).

Now the sets originally introduced by the commit above are decorated
with Collections#synchronizedSet and any iterations over those sets
are synchronized properly. This change should have low performance
impact as such processing happens at container startup time (save for
non-singleton lookups at runtime), and there should be little
contention in any case.

Issue: SPR-8598
2011-09-12 23:05:01 +00:00
build-spring-framework [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.aop [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.asm Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
org.springframework.aspects SPR-8653 2011-09-02 15:37:42 +00:00
org.springframework.beans Improve annotation processing thread-safety 2011-09-12 23:05:01 +00:00
org.springframework.context Fix handling of @EnableLoadTimeWeaving AUTODETECT 2011-09-03 22:37:16 +00:00
org.springframework.context.support [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.core [SPR-8644] Introduced a failing (ignored) test that demonstrates that findMethod() does not currently support var-args. 2011-08-30 14:05:51 +00:00
org.springframework.expression [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.instrument Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.instrument.tomcat Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.integration-tests [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.jdbc Fix Javadoc error in JdbcOperations 2011-09-03 20:07:08 +00:00
org.springframework.jms [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.orm Include javax.jdo 3.x in spring-orm template.mf 2011-09-04 01:06:35 +00:00
org.springframework.oxm [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.spring-library Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
org.springframework.spring-parent [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.test [SPR-8644][SPR-8633] introduced failing (ignored) test regarding support for invoking methods that accept var-args. 2011-08-30 14:20:12 +00:00
org.springframework.transaction [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.web SPR-5973: Using UriComponents in more places, replaced UriBuilder by UriComponentsBuilder, UriComponents is now immutable. 2011-09-12 14:39:58 +00:00
org.springframework.web.portlet [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
org.springframework.web.servlet SPR-5973: Using UriComponents in more places, replaced UriBuilder by UriComponentsBuilder, UriComponents is now immutable. 2011-09-12 14:39:58 +00:00
org.springframework.web.struts [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
spring-framework-reference Fix typo in cache abstraction reference doc 2011-09-06 21:03:02 +00:00
.gitignore Add ignorable log file to .gitignore 2011-06-05 21:01:37 +00:00
build.properties Reorganize and add comments to build.properties 2011-08-20 03:02:05 +00:00
build.versions [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
ci-build.properties adding properties file to simplify ant use in Bamboo CI build 2008-12-17 15:47:14 +00:00
eclipse-code-formatter.xml h2 embedded db support; updated formatting conventions not to auto-format javadoc; added hsqldb and h2 to jdbc maven pom as optional deps 2009-05-09 22:27:05 +00:00
spring-framework.ipr copy txt files as well 2011-07-26 09:25:22 +00:00
spring-framework.psf Renamed org.springframework.instrument.classloading module to org.springframework.instrument.tomcat 2009-09-25 12:51:58 +00:00