Touch up embedded containers blog post #5

Closed
wants to merge 80 commits into
from

Projects

None yet

7 participants

@cbeams

No description provided.

cbeams and others added some commits Dec 13, 2012
@cbeams cbeams Increment version to 3.3.0.BUILD-SNAPSHOT 3d3469c
@sbrannen sbrannen Fix typo in 3.2 migration guide
- @WebApplicationContext --> @WebAppConfiguration
62e9d6b
Craig Walls Fix JavaDoc in MockRestServiceServer bf8a339
@cbeams cbeams Handle non-void write methods deterministically
This change resolves a specific issue with processing
java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
constellation of #setScale methods that, prior to this change, had the
potential to cause ExtendedBeanInfo to throw an IntrospectionException
depending on the order in which the methods were processed.

Because JDK 7 no longer returns deterministic results from
Class#getDeclaredMethods, it became a genuine possibility - indeed a
statistical certainty that the 'wrong' setScale method handling order
happens sooner or later. Typically one could observe this failure once
out of every four test runs.

This commit introduces deterministic method ordering of all discovered
non-void returning write methods in such a way that solves the problem
for BigDecimal as well as for any other class having a similar method
arrangement.

Also:

 - Remove unnecessary cast

 - Pass no method information to PropertyDescriptor superclasses when
   invoking super(...). This ensures that any 'type mismatch'
   IntrospectionExceptions are handled locally in ExtendedBeanInfo and
   its Simple* PropertyDescriptor variants where we have full control.

Issue: SPR-10111, SPR-9702
1c306df
@philwebb Fix GenericConversionService search algorithm
Previously the algorithm used by GenericConversionService to find
converters incorrectly searched for interfaces working up from the
base class. This caused particular problems with custom List
converters as as the Collection interface would be considered before
the List interface giving CollectionToObjectConverter precedence
over the custom converter.

The updated algorithm restores the class search order to behave in the
same way as Spring 3.1.

Issue: SPR-10116
aa91449
@cbeams cbeams Merge branch 'cleanup-3.2.x' into cleanup-master
* cleanup-3.2.x: (33 commits)
  Update Apache license headers for affected sources
  Ignore performance-sensitive tests by default
  Introduce 'spring-build-junit' subproject
  Replace EasyMock with Mockito in test sources
  Add @Override annotations to test sources
  Update test source and target JDK compatibility
  Update -Xlint compiler warning output
  Fix various compiler warnings in spring-context
  Fix "unnecessary @SuppressWarnings" warnings
  Fix [rawtypes] compiler warnings
  Fix [dep-ann] warnings with @Deprecated
  Fix [cast] compiler warnings
  Fix [serial] compiler warnings
  Fix [varargs] compiler warnings
  Fix warnings due to unused import statements
  Replace <code> with {@code} throughout Javadoc
  Fix various Javadoc warnings
  Replace space indentation with tabs
  Remove trailing whitespace in source files
  Various updates to support IDEA
  ...

Conflicts:
	gradle.properties
a312d90
@cbeams cbeams Add @Override annotations to main sources
Issue: SPR-10130
3b40ce7
@cbeams cbeams Update main source and target JDK compatibility
Update source and target compatibility from 1.5 to 1.6, meaning that
@Override is now allowed on implementations of interface methods within
main classes.

Issue: SPR-10130
9c2046c
@cbeams cbeams Merge branch 'SPR-10130' into cleanup-master
* SPR-10130:
  Add @Override annotations to main sources
  Update main source and target JDK compatibility
45fa508
@cbeams cbeams Update Apache license headers for affected sources b2a048b
@cbeams cbeams Merge branch 'cleanup-master' into master
* cleanup-master: (36 commits)
  Update Apache license headers for affected sources
  Add @Override annotations to main sources
  Update main source and target JDK compatibility
  Update Apache license headers for affected sources
  Ignore performance-sensitive tests by default
  Introduce 'spring-build-junit' subproject
  Replace EasyMock with Mockito in test sources
  Add @Override annotations to test sources
  Update test source and target JDK compatibility
  Update -Xlint compiler warning output
  Fix various compiler warnings in spring-context
  Fix "unnecessary @SuppressWarnings" warnings
  Fix [rawtypes] compiler warnings
  Fix [dep-ann] warnings with @Deprecated
  Fix [cast] compiler warnings
  Fix [serial] compiler warnings
  Fix [varargs] compiler warnings
  Fix warnings due to unused import statements
  Replace <code> with {@code} throughout Javadoc
  Fix various Javadoc warnings
  ...
08c2d2b
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Remove extra URL prefix in the MVC chapter
  Polish contributor guidelines
3011236
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Add quartz scheduling test to TestGroup.PERFORMANCE
f87b193
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Add aop target source test to TestGroup.PERFORMANCE
d5c6d79
@cbeams cbeams Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit 45fa508, reversing
changes made to a312d90.
70eaf02
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Exclude spring-build-src from maven publish
  Move spring-build-junit into spring-core
  Relocate MergePlugin package
  Develop a gradle plugin to add test dependencies
  Expose Gradle buildSrc for IDE support
  Fix [deprecation] compiler warnings
  Upgrade to xmlunit version 1.3
  Improve 'build' folder ignores
  Fix regression in static setter method support
  Fix SpEL JavaBean compliance for setters

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
961dbdb
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Fix ClassCastException when setting media types
  Enable execution of TestNG tests in spring-test
  Polish support for topic branch-specific versions
  Segregate add'l long-running and performance tests
  Eliminate EBR dependencies and repository config
  Skip creation of IDEA metadata for spring-aspects
  Fix Eclipse compilation error in Gradle plugin
  Polish build.gradle
  Fix null parameterName issue in content negotiation
  Recursively add test dependencies
7a737be
@cbeams cbeams Merge branch '3.2.x' into master
* 3.2.x:
  Use unmodified 'version' when not on a topic branch
d3fe578
@cbeams cbeams Increment snapshot version from 3.3 => 4.0 dcf7d18
@cbeams cbeams Merge branch '3.2.x' into master
Conflicts:
	gradle.properties
	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
	spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
	spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java
	spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
	spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java
	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestWrapper.java
	spring-web/src/main/java/org/springframework/http/client/SimpleBufferingClientHttpRequest.java
	spring-web/src/main/java/org/springframework/http/converter/BufferedImageHttpMessageConverter.java
	spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
ce4be3b
@sbrannen sbrannen Document context hierarchy support in the TCF
This commit adds examples to the Javadoc for @ContextHierarchy and
updates the Javadoc for @ContextConfiguration accordingly.

Issue: SPR-10357
4e7098d
@sbrannen sbrannen Document context hierarchy support in the TCF
This commit polishes the Javadoc for @ContextHierarchy and
@ContextConfiguration.

Issue: SPR-10357
ccdb482
@sbrannen sbrannen Reformat the testing chapter
This commit reformats the testing chapter (and adds minor polishing
changes) in order to avoid massive merge diffs in upcoming commits.

Issue: SPR-10357
2b24e99
@rstoyanchev rstoyanchev Disable AsyncTests in spring-test-mvc 3654a62
@rstoyanchev rstoyanchev Make the methodParameter field of HandlerMethod final
Previously the methodParameter array field was initialized lazily since
it requires reflection. However, in practice the field is always used
and there is not much benefit from the lazy initialization.

In Spring Framework 3.2, the methodParameter field was copied when a
new HandlerMethod instance (with the resolved bean) is created for
performance reasons. That introduced a synchronization issue since
the lazy initialization was not synchronized.

Issue: SPR-10365
8ab8e4f
@dsyer dsyer Fix test for daylight savings glitch 5b6f149
@cbeams cbeams Merge pull request #250 from dsyer/feature/crontest
Fix test for daylight savings glitch
88b9bea
@sbrannen sbrannen Document context hierarchy support in the TCF
This commit updates the reference manual regarding the new support for
@ContextHierarchy and hierarchy modes in @DirtiesContext.

Issue: SPR-10357
4171646
@dsyer dsyer Add additional test for daylight savings glitch
The problem was that clocks go forward *at* 2am, so
2am doesn't exist once a year. Users might be surprised
that their cron trigger doesn't go off one night, but that
is arguably correct (and what happens now). The test can be
modified if we decide to change the trigger behaviour.
6914aff
@sbrannen sbrannen Merge pull request #251 from dsyer/feature/crontest
# By Dave Syer
* dsyer-feature/crontest:
  Add additional test for daylight savings glitch
e9f7445
@rstoyanchev rstoyanchev Fix issue with restoring included attributes
Before this change the DispatcherServlet restored modified and also
removed added attributes but did not restore removed attributes.

Issue: SPR-10360
0fb4b74
@sbrannen sbrannen Fix copy-n-paste errors in NativeWebRequest bf6ee16
@sbrannen sbrannen Polish Javadoc in RequestAttributes 12db873
@dharkness dharkness Compare Kind references before checking log levels
Assuming reference comparisons are much quicker than checking
likely-nested logger levels, perform the former first.

Also, since the reference can match only one of the instances,
use "else if" to short-circuit the search.
801f196
@philwebb Merge pull request #252 from dharkness/patch-1
# By David Harkness
* patch-1:
  Compare Kind references before checking log levels
b00f90f
@jhoeller jhoeller Minor refinements along the way of researching static CGLIB callbacks
Specifically, our CallbackFilter doesn't hold an implicit reference to the containing ConfigurationClassEnhancer class anymore.

Issue: SPR-10307
fffeaee
@jhoeller jhoeller Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
Just AsyncAnnotationBeanPostProcessor switches "beforeExistingAdvisors" to "true" by default. So effectively, MethodValidation/PersistenceExceptionTranslationPostProcessor apply after existing advisors by default again, fixing the 3.1->3.2 regression.

Issue: SPR-10309
43c1cec
@jhoeller jhoeller Extracted buildRequestAttributes template method from FrameworkServlet
Also, RequestBindingInterceptor now obtains HttpServletRequest from locally passed-in request handle and delegates to buildRequestAttributes as well now.

Issue: SPR-10342
1f55b4f
@jhoeller jhoeller Polishing c75eba7
@rstoyanchev rstoyanchev Remove Tiles 3 configuration method
Issue: SPR-10361
d9540ff
@jhoeller jhoeller Final preparations for 3.2.2 457ee07
@philwebb Document @Bean 'lite' mode vs @Configuration
Rework the reference documentation to better distinguish the differences
between @Bean methods used in @Comonent vs @Configuration classes. The
'Using the @Bean annotation' section now only covers concepts applicable
when using @Bean methods in @Configuration _or_ @Component classes.
Information only applicable to @Configuration classes has been moved to
a new  'Using the @Configuration annotation' section.

An additional sidebar section attempts to explain the differences
between the two approaches.

Issue: SPR-9425
5730b8d
@philwebb Hide 'doc' changes from jdiff reports f62f697
@philwebb Merge branch '3.2.x'
* 3.2.x: (28 commits)
  Hide 'doc' changes from jdiff reports
  Document @Bean 'lite' mode vs @Configuration
  Final preparations for 3.2.2
  Remove Tiles 3 configuration method
  Polishing
  Extracted buildRequestAttributes template method from FrameworkServlet
  Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
  Minor refinements along the way of researching static CGLIB callbacks
  Compare Kind references before checking log levels
  Polish Javadoc in RequestAttributes
  Fix copy-n-paste errors in NativeWebRequest
  Fix issue with restoring included attributes
  Add additional test for daylight savings glitch
  Document context hierarchy support in the TCF
  Fix test for daylight savings glitch
  Make the methodParameter field of HandlerMethod final
  Disable AsyncTests in spring-test-mvc
  Reformat the testing chapter
  Document context hierarchy support in the TCF
  Document context hierarchy support in the TCF
  ...
4e1cab2
@jhoeller jhoeller Raised source and target compatibility to JDK 1.6 7331937
@jhoeller jhoeller JDK 1.6+ API baseline across the codebase 87e5f19
@jhoeller jhoeller StaxUtils relies on JAXP 1.4 (as included in JDK 1.6+) 7f0a780
@jhoeller jhoeller CustomizableTraceInterceptor relies on JDK 1.5+ Matcher.quoteReplacem…
…ent method now
27693bb
@jhoeller jhoeller JtaTransactionManager relies on presence of JTA 1.1 API 36942f6
@jhoeller jhoeller Removed JMS 1.0.2 support 0f0c93a
@jhoeller jhoeller Removed Servlet 2.4 forward attribute support in InternalResourceView…
… and TilesView
a03d125
@jhoeller jhoeller Removed OC4J support (including documentation references) 9c52ae9
@jhoeller jhoeller Removed JAX-RPC support f1258a6
@jhoeller jhoeller Removed scheduling.timer and scheduling.backportconcurrent packages 3f35bdc
@jhoeller jhoeller Removed iBATIS SQL Maps support 30a9dad
@jhoeller jhoeller Removed EJB 2.x implementation class hierarchy (ejb.support package) 55901e6
@jhoeller jhoeller Removed JUnit 3.8 based test class hierarchy 74021b9
@jhoeller jhoeller Removed Spring MVC command/form controller class hierarchy f19f55a
@jhoeller jhoeller Removed Spring’s own JSP expression support (in favor of JSP 2.0+) 20fb418
@jhoeller jhoeller Added missing section end tag 7ef5c5c
@jhoeller jhoeller Require JRuby 1.6+ (avoiding the use of deprecated API) 90f79f3
@jhoeller jhoeller General JPA 2.0+ requirement; upgraded build and tests to EclipseLink…
… 2.4, OpenJPA 2.2, Hibernate 3.6
ceb9a05
@jhoeller jhoeller Removed spring-struts module (Struts 1.x support) f0ffb1e
@jhoeller jhoeller Removed unintended backport-concurrency dependency 8832d59
@jhoeller jhoeller Clarified support for JRuby 1.5+ and Groovy 1.7+ a272fd7
@jhoeller jhoeller Upgraded to Quartz 1.8 and Velocity 1.7 e3fe9b1
@jhoeller jhoeller Spring's EhCache setup builds on EhCache 2.1+ now
Specifically, EhCacheFactoryBean extends CacheConfiguration now and therefore inherits all configuration properties of the underlying EhCache version. This reduces the need for catching up with new EhCache properties on our side.

Issue: SPR-8258
f2b79c8
@jhoeller jhoeller Removed deprecated core.enums package ebb3d32
@jhoeller jhoeller Removed build reference to spring-struts module 28aa34f
@jhoeller jhoeller Removed deprecated core.enums package 5472e97
@jhoeller jhoeller Only call EhCacheManagerFactoryBean's destroy() method when actually …
…initialized
af3c3ef
@jhoeller jhoeller Fixed job scheduling data test for Quartz 1.8 bea9901
@jhoeller jhoeller Revised WebServiceFeature handling: requiring JAX-WS 2.1+, including …
…support for JAX-WS 2.2 service-level features now
bb14c16
@jhoeller jhoeller Removed explicit JAXB 2.1 dependency (included in JDK 1.7 anyway) d03de21
@jhoeller jhoeller Upgraded all Servlet API mocks to Servlet 3.0 (with a little bit of S…
…ervlet 3.1 support in MockHttpServletResponse)
deba32c
@jhoeller jhoeller Upgraded integration test dependencies to Servlet 3.0 as well 0d23a9d
@jhoeller jhoeller Assigned cache manager name in order to avoid EhCache assertion failu…
…re in case of multiple tests executed on the same VM
b78fa27
@philwebb Support for embedded servlet containers
Develop new EmbeddedWebApplicationContext (along with XML and
@Configuration variants) that creates and controls an embedded servlet
container. Unlike the traditional approach where a ContextLoaderListener
bootstraps Spring and creates a new WebApplicationContext, embedded
support expects that the EmbeddedWebApplicationContext will be created
directly.

The EmbeddedWebApplicationContext will become aware of a ServletContext
once the embedded container has been started. This will happen early,
allowing regular beans to call the getServletContext() method or
implement ServletContextAware.

The EmbeddedServletContainerFactory and EmbeddedServletContainer
interfaces provide a simple abstraction for creating, starting and
stopping the container. Any embedded container that supports Servlet
3.0+ initialization can be adapted. Implementations for Tomcat and
Jetty are provided.

The FrameworkServlet (and hence the DispatcherServlet subclass) is
now ApplicationContextAware. This allows FrameworkServlets to be
defined and used as Spring beans within the
EmbeddedWebApplicationContext.

Issue: SPR-10381
6f132ad
@philwebb Blog post and example (not to be pushed) 3f5176f
@cbeams cbeams Touch up and add TODOs to blog post a153c83
@cbeams

disregard this PR

@cbeams cbeams closed this Mar 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment