Commit Graph

9821 Commits

Author SHA1 Message Date
Stephane Nicoll
8fcbdaee24 Handle receive timeout in JmsInvokerClientInterceptor
JmsInvokerClientInterceptor defines a receiveTimeout field but does not
handle such timeout. This commit adds an additional callback that throws
an RemoteTimeoutException instead.

Sub-classes can override the onReceiveTimeout to throw a different
exception or return a fallback RemoteInvocationResult.

Issue: SPR-12731
2015-02-19 17:13:48 +01:00
Sebastien Deleuze
90e6304b49 Adjust log level for invalid SockJS or Websocket requests 2015-02-19 16:52:19 +01:00
Sebastien Deleuze
40cbede7f3 Improve error handling in WebUtils.isValidOrigin()
With this commit, WebUtils.isValidOrigin() logs an error message instead
of throwing an IllegalArgumentException when Origin header value is
invalid (for example when it does not contain the scheme).

Issue: SPR-12697
2015-02-19 16:51:58 +01:00
Stephane Nicoll
adb502a0de Merge pull request #739 from ericbottard/CodeFlowJavadocFix
* CodeFlowJavadocFix:
  Fix copy/paste error in Javadoc
2015-02-19 15:25:57 +01:00
Eric Bottard
ece7eb14ff Fix copy/paste error in Javadoc 2015-02-19 15:25:26 +01:00
Stephane Nicoll
aabf73dea4 Add Commons Pool 2 support
Deprecated CommonsPoolTargetSource (supporting commons pool 1.5+) in
favor of CommonsPool2TargetSource with a similar contract.

Commons Pool 2.x uses object equality while Commons Pool 1.x used
identity equality. This clearly means that Commons Pool 2 behaves
differently if several instances having the same identity according to
their `Object#equals(Object)` method are managed in the same pool. To
provide a smooth upgrade, a backward-compatible pool is created by
default; use `setUseObjectEquality(boolean)` if you need the standard
Commons Pool 2.x behavior.

Issue: SPR-12532
2015-02-19 13:07:04 +01:00
Stephane Nicoll
1aec6a6cc2 Detect Order on target class as well
Previously, the `@Order` annotation was managed in an inconsistent way
when placed at the implementation level. For simple beans, it was
discovered properly but wasn't for beans requiring a proxy.

OrderComparator.SourceProvider now explicitly allows to return several
order sources; the default implementation returns not only the factory
method (if  any) but also the target class if it happens to be different
from the class of the bean.

Issue: SPR-12636
2015-02-19 09:47:20 +01:00
Juergen Hoeller
f20a62408b Correct reference to executeAndReturnKey method
Issue: SPR-12639
2015-02-18 22:28:36 +01:00
Juergen Hoeller
dbd353bbd9 MessageHeaderAccessor defensively checks id, timestamp and contentType values
Issue: SPR-12730
2015-02-18 22:28:27 +01:00
Sam Brannen
c7a456c0bf Polish reference manual regarding WebSocket
- fixed typos
 - improved grammar and punctuation
 - fixed class names
2015-02-18 20:30:45 +01:00
Juergen Hoeller
81ae1153e6 Latest dependency updates (Groovy 2.4.1, SLF4J 1.7.10) 2015-02-18 18:19:55 +01:00
Juergen Hoeller
2135e70f36 Polishing 2015-02-18 17:59:32 +01:00
Rossen Stoyanchev
917eb1de0b Ignore Pong messages in StompSubProtocolHandler
Issue: SPR-12728
2015-02-18 11:52:59 -05:00
Rossen Stoyanchev
1f990c3df6 Fix handling of empty payload Pong message on Jetty
Issue: SPR-12727
2015-02-18 11:36:22 -05:00
Juergen Hoeller
406171c9c0 RequestPartMethodArgumentResolver declares @UsesJava8 now
Issue: SPR-12644
2015-02-18 16:54:10 +01:00
Juergen Hoeller
69844ed30b Latest dependency updates (AspectJ 1.8.5, Joda-Time 2.7, H2 1.4.185) 2015-02-18 16:45:42 +01:00
Juergen Hoeller
0c15a54007 Polishing 2015-02-18 16:45:16 +01:00
Juergen Hoeller
8716129058 Revised MappingJackson2MessageConverter towards var-arg constructor
Issue: SPR-12724
2015-02-18 16:45:01 +01:00
Juergen Hoeller
6ebac00f32 @RequestPart supports java.util.Optional
Issue: SPR-12644
2015-02-18 16:17:07 +01:00
Juergen Hoeller
61cc3b5bff ServletUriComponentsBuilder.java avoids NPE on scheme check
Issue: SPR-12723
2015-02-18 16:16:28 +01:00
Juergen Hoeller
1273c90a64 ScheduledAnnotationBeanPostProcessor uses target class as cache key in case of proxy
Issue: SPR-12709
2015-02-18 16:16:05 +01:00
Sebastien Deleuze
8159aa99a1 Add parametrized constructors to MappingJackson2MessageConverter
Issue: SPR-12724
2015-02-18 14:23:19 +01:00
Sebastien Deleuze
6062e15572 Change SockJS and Websocket default allowedOrigins to same origin
This commit adds support for a same origin check that compares
Origin header to Host header. It also changes the default setting
from all origins allowed to only same origin allowed.

Issues: SPR-12697, SPR-12685
2015-02-18 09:30:15 +01:00
Sam Brannen
42af33034d Make TestPropertySourceUtils more robust
- Added assertions for pre-conditions on method arguments for all
   public utility methods.

 - Introduced additional tests in TestPropertySourceUtilsTests to verify
   the new pre-conditions.

 - Introduced INLINED_PROPERTIES_PROPERTY_SOURCE_NAME constant for the
   name of the MapPropertySource created from inlined properties; the
   name therefore no longer contains the inlined properties, but the
   original values of the inlined properties can now be logged at debug
   level.

 - Simplified tests in InlinedPropertiesTestPropertySourceTests.

Issue: SPR-12721
2015-02-17 19:42:52 +01:00
Sam Brannen
0267715c9d Polish Javadoc for @TestPropertySource 2015-02-17 19:32:19 +01:00
Sam Brannen
75e0bc9271 Open up TestPropertySourceUtils for public consumption
Spring Framework 4.1 introduced support for @TestPropertySource;
however, the utilities used to parse inlined properties and add test
property sources to the environment are currently private which
prevents reuse by third-party frameworks like Spring Boot.

This commit addresses this issue by making such utilities public.

 - TestPropertySourceUtils is now a public class.

 - Various utility methods in TestPropertySourceUtils have been made
   public.

 - addResourcePropertySourcesToEnvironment() has been renamed to
   addPropertiesFilesToEnvironment().

 - extractEnvironmentProperties() has been renamed to
   convertInlinedPropertiesToMap().

 - All public methods in TestPropertySourceUtils are now fully
   documented.

Issue: SPR-12721
2015-02-17 03:09:24 +01:00
Sam Brannen
d6a799ad4a Preserve ordering of inlined props in @TestPropertySource
The initial implementation for adding inlined properties configured via
@TestPropertySource to the context's environment did not preserve the
order in which the properties were physically declared. This makes
@TestPropertySource a poor testing facility for mimicking the
production environment's configuration if the property source mechanism
used in production preserves ordering of property names -- which is the
case for YAML-based property sources used in Spring Boot, Spring Yarn,
etc.

This commit addresses this issue by ensuring that the ordering of
inlined properties declared via @TestPropertySource is preserved.
Specifically, the original functionality has been refactored. extracted
from AbstractContextLoader, and moved to TestPropertySourceUtils where
it may later be made public for general purpose use in other frameworks.

Issue: SPR-12710
2015-02-16 20:26:49 +01:00
Sam Brannen
add718d75c Polish EnumerablePropertySource 2015-02-16 20:26:49 +01:00
Rossen Stoyanchev
b4fa1c24cc Pass SockJS session attributes to HandshakeHandler
Before this change the WebSocketTransportHandler passed
Collections.emptyMap as attributes to the HandshakeHandler because
it didn't matter what attributes the underlying WebSocketSession has
since it is wrapped by the SockJsSession and that's what exposed for
use everywhere.

This change has the WebSocketTransportHandler passing the attributes
from the SockJsSession instead since it's more accurate for the
underlying WebSocketSession to have access to the same map instance
and it allows the HandshakeHandler to change the attributes even if
it doesn't need to do that today.

Issue: SPR-12716
2015-02-16 14:12:12 -05:00
Stephane Nicoll
8eb7beebc8 Order ApplicationListener using @Order
AnnotationListener implementations can now be ordered either using the
`@Order` annotation or by implementing the Ordered interface.

Issue: SPR-12410
2015-02-16 10:41:26 +01:00
Sam Brannen
67934a22e2 Add further regression tests for @TestPropertySource
This commit introduces further regression tests to ensure proper parsing
of inlined properties configured via @TestPropertySource. Specifically,
these additional tests ensure that we do not introduce a bug like the
one raised in Spring Boot issue #1110 [0].

[0] https://github.com/spring-projects/spring-boot/issues/1110

Issue: SPR-12710
2015-02-12 20:24:06 +01:00
Sam Brannen
ef75bd8441 Clean up classpath for iajc Ant task 2015-02-12 19:32:49 +01:00
Stephane Nicoll
66735d01cf Add exception-handler attribute support for AspectJ
Previously, the exception-handler attribute was not taken care of when
task:annotation-driven is used in AspectJ mode. This commit provides the
expected behavior.

Issue: SPR-12619
2015-02-12 15:25:51 +01:00
Stephane Nicoll
fa8d202a45 AspectJ support for javax.transaction.Transactional
Issue: SPR-11803
2015-02-12 14:45:47 +01:00
Stephane Nicoll
d75f390360 Merge pull request #738 from johnktims/patch-3
* patch-3:
  fix javadoc typo
2015-02-12 08:43:09 +01:00
John Tims
4c00a3b4c8 fix javadoc typo 2015-02-12 08:43:01 +01:00
Juergen Hoeller
be76da654f Latest dependency updates (POI 3.11, FreeMarker 2.3.21) 2015-02-11 20:38:30 +01:00
Juergen Hoeller
77fcf21401 Refined Jackson configuration enhancements
Issue: SPR-12594
Issue: SPR-12634
2015-02-11 20:37:04 +01:00
Andy Wilkinson
7a6a13201f Fix Animal Sniffer
Jasper Reports’ transitive dependency on spring-context (via
castor-xml which is a new dependency in 6.0.3) was being mapped by
Gradle to a dependency on the spring-context project. For reasons that
I do not fully understand this was causing -source and -javadoc jars
to be added to the project's compile classpath which is used by the
Animal Sniffer Ant task. When the task runs these jars do not exist
which causes it to fail. This commit fixes the problem by adding an
exclusion of org.springframework:spring-context to the Jasper Reports
dependencies in spring-context-support and spring-webmvc.
2015-02-11 18:07:26 +01:00
Stephane Nicoll
aa213396b4 BeanWrapper auto-grows arrays if necessary
Previously, only indexed access for collections were supported. When
attempting to access the element of an array that had not the requested
size, the call would fail with an IndexOutOfBoundException

This commit harmonize the binding support so that the array is updated
according to the requested index if necessary.

Issue: SPR-12706
2015-02-11 11:29:15 +01:00
Juergen Hoeller
f58abd3d9a Polishing (forward-ported from 4.1.x) 2015-02-10 23:04:12 +01:00
Juergen Hoeller
098e60e125 Latest dependency updates (Tomcat 8.0.18, Undertow 1.1.2) 2015-02-10 23:02:14 +01:00
Juergen Hoeller
75bf9df384 Latest dependency updates (Jackson 2.5.1, JasperReports 6.0.3) 2015-02-10 19:31:49 +01:00
Juergen Hoeller
058714b03a Polishing 2015-02-10 19:30:59 +01:00
Juergen Hoeller
7585be85f3 Revised validation javadoc, plus protected validate/isBindingErrorFatal template methods
Issue: SPR-12655
2015-02-10 19:28:30 +01:00
Juergen Hoeller
981aefc2c0 Properly honor conditions on overriding bean methods
Issue: SPR-12694
2015-02-10 19:26:19 +01:00
Juergen Hoeller
918bc3b103 Avoid ConcurrentModificationException in getBeansWithAnnotation
Issue: SPR-12688
2015-02-10 19:24:34 +01:00
Stephane Nicoll
13ccc8ede8 Merge pull request #723 from svolsky/SPR-12653
* SPR-12653:
  Synchronize clear on TransactionAwareCacheDecorator
2015-02-10 14:53:43 +01:00
Stas Volsky
ef95fc2f7e Synchronize clear on TransactionAwareCacheDecorator
Previously, a cache decorated with TransactionAwareCacheDecorator would
clear the cache immediately, even when a transaction is running. This
commit updates the decorator to synchronize to the afterCommit phase for
the clear operation as well.

Issue: SPR-12653
2015-02-10 14:53:16 +01:00
Stephane Nicoll
6b3092c236 Clear expression caches on context shutdown
Issue: SPR-12691
2015-02-10 14:47:15 +01:00