Commit Graph

19930 Commits

Author SHA1 Message Date
Juergen Hoeller
e6e3ca3e96 LazySingletonAspectInstanceFactoryDecorator uses shared singleton mutex
Issue: SPR-14241
2016-05-04 09:03:28 +02:00
Rossen Stoyanchev
4d9126a474 Add support for more annotated method arguments
- @PathVariable
 - @RequestHeader
 - @RequestParam
 - @CookieValue
 - @Value
 - @RequestAttribute
 - @SessionAttribute
2016-05-03 23:41:52 -04:00
Stephane Maldini
4e8c21e85a Sync Reactor SignalEmitter 2016-05-04 01:37:11 +01:00
Stephane Maldini
04f47da15e Synchronize Reactor Flux#create / Flux#generate changes 2016-05-03 23:06:07 +01:00
Sam Brannen
e26478e3de Polish Javadoc regarding @Commit support 2016-05-03 20:26:11 +02:00
Sam Brannen
7b13311f03 Delete unused imports 2016-05-03 20:12:37 +02:00
Sam Brannen
6b3eba0500 Suppress warnings in Gradle build 2016-05-03 19:56:33 +02:00
Sam Brannen
64c388d524 Properly document avoiding false positives when testing with JPA
Prior to this commit, information regarding avoiding false positives
when testing with JPA had already been added to the Testing chapter of
the reference manual. However, the example did not work properly and
the accompanying text mixed concepts from Hibernate and JPA.

This commit fixes the @Autowired/@PersistenceContext bug, updates the
text, and marks each test as @Transactional in order to avoid any
misinterpretation.

Issue: SPR-9032
2016-05-03 19:33:32 +02:00
Sam Brannen
0f6711fe3b Support @[Before|After]Transaction on default methods
Prior to this commit, @BeforeTransaction and @AfterTransaction could
only be declared on methods within test classes. However, JUnit 5 as
well as some existing third-party Runner implementations for JUnit 4
already support Java 8 based interface default methods in various
scenarios -- for example, @Test, @BeforeEach, etc.

This commit brings the Spring TestContext Framework up to date by
supporting the declaration of @BeforeTransaction and @AfterTransaction
on interface default methods.

Issue: SPR-14183
2016-05-03 18:57:31 +02:00
Sam Brannen
7ce5ba4a3f Refer explicitly to JUnit 4 in the testing chapter
This commit updates the Testing chapter in the reference manual to
refer explicitly to JUnit 4 instead of just "JUnit" (where appropriate)
in order to avoid confusion with forthcoming support for JUnit 5.
2016-05-03 18:57:31 +02:00
Sam Brannen
3433fe35df Fix assertion failure messages in TransactionalTestExecutionListenerTests 2016-05-03 18:57:31 +02:00
Juergen Hoeller
52e5b4a6ff Polishing 2016-05-03 18:55:39 +02:00
Juergen Hoeller
76964e16ef Explicit note on Java deserialization 2016-05-03 18:44:37 +02:00
Rossen Stoyanchev
46e41a9d94 Consolidate SendTo vs SendToUser detection
SendTo and SendToUser are treated as mutually exclusive. The addition of
type-level support in 4.3. RC1 however did not consider the possibility
to mix and match of the two betwee type and method level.

This commit consolidates the detection of SendTo and SendToUser
annotations and considers them all together.

Issue: SPR-14238
2016-05-03 12:34:19 -04:00
Arjen Poutsma
b71f143dfd Polishing 2016-05-03 16:33:56 +02:00
Brian Clozel
05b29a4a17 Add convenient getters for force*Encoding attributes
Issue: SPR-14240
2016-05-03 16:14:09 +02:00
Brian Clozel
76ee46847a Selectively force encoding in CharacterEncodingFilter
Prior to this commit, setting the `forceEncoding` option would force
encoding on both requests and responses.

This commit adds two new setters and a new constructor to differentiate
both options: forcing the encoding on the request and/or on the
response.

You can now define this filter programmatically using those options or
update your servlet XML configuration like:

```
<filter>
  <filter-name>characterEncodingFilter</filter-name>
  <filter-class>o.sf.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
     <param-name>encoding</param-name>
     <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
    <param-name>forceRequestEncoding</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>forceResponseEncoding</param-name>
    <param-value>false</param-value>
  </init-param>
</filter>

```

Issue: SPR-14240
2016-05-03 14:47:22 +02:00
Juergen Hoeller
1be544f8fa JtaTransactionManager explicitly resets transaction timeout after completion
Issue: SPR-14239
2016-05-03 13:30:51 +02:00
Stephane Maldini
b2d9e7c28d Split FluxProcessor factories into individual Processor, remove confusing factories 2016-05-02 22:56:18 +01:00
Brian Clozel
5ac31fb39d Refactor HTTP Range support with ResourceRegion
Prior to this commit, the `ResourceHttpMessageConverter` would support
all HTTP Range requests and `MethodProcessors` would "wrap" controller
handler return values with a `HttpRangeResource` to support that use
case in Controllers.

This commit refactors that support in several ways:
* a new ResourceRegion class has been introduced
* a new, separate, ResourceRegionHttpMessageConverter handles the HTTP
range use cases when serving static resources with the
ResourceHttpRequestHandler
* the support of HTTP range requests on Controller handlers has been
removed until a better solution is found

Issue: SPR-14221, SPR-13834
2016-05-02 19:00:52 +02:00
Juergen Hoeller
7737c3c7e5 Warn about non-static BeanDefinitionRegistryPostProcessor declarations on @Configuration classes
Issue: SPR-14234
2016-05-02 15:19:05 +02:00
Juergen Hoeller
cbc46760b7 Upgrade to Jackson 2.7.4 2016-05-02 13:54:57 +02:00
Juergen Hoeller
07ea3745c4 Polishing 2016-05-02 13:54:47 +02:00
Stephane Nicoll
09b45d2c0f Validate callback is always invoked in DMLC#stop
The underlying issue has been fixed in e45d33f and this commit is merely
adding a test of the expected behaviour.

Issue: SPR-14233
2016-05-02 13:33:05 +02:00
Juergen Hoeller
f83cbff543 Consistent SmartLifecycle implementations
Issue: SPR-14233
2016-05-02 13:01:44 +02:00
Juergen Hoeller
e45d33f9de DefaultMessageListenerContainer immediately invokes stop callback when not running
Issue: SPR-14233
2016-05-02 12:57:30 +02:00
Brian Clozel
29da44c8dc Support ETags with special chars in ServletWebRequest
This commit makes sure that HTTP request headers containing ETag values
are properly parsed and not simply tokenized using a "," separator.
Indeed, ETags can legally contain separator characters such as " " and
",".

Issue: SPR-14216
2016-04-29 11:20:29 +02:00
Juergen Hoeller
fdb31cd715 Check actual cache value for unwrapped Optional
Issue: SPR-14230
2016-04-29 10:56:26 +02:00
Rossen Stoyanchev
bd40a93604 Ensure Environment.shutdown() in Reactor2TcpClient
Issue: SPR-14229
2016-04-28 17:47:59 -04:00
Stephane Maldini
eb21f3ab0a remove lift() 2016-04-28 22:38:26 +01:00
Juergen Hoeller
240f254bfc Allow @Cacheable method to return java.util.Optional variant of cached value
Includes renaming of internal delegate to CacheOperationExpressionEvaluator.

Issue: SPR-14230
2016-04-28 23:16:43 +02:00
Rossen Stoyanchev
220711d45b Reactor2TcpClient cleans up TcpClient instances
Issue: SPR-14231
2016-04-28 15:27:53 -04:00
Brian Clozel
977840884b Allow custom instances of WebJarAssetLocator
This commit allows to configure a custom WebJarAssetLocator in
WebJarResourceResolvers.

Issue: SPR-14092
2016-04-28 19:02:04 +02:00
Brian Clozel
55dae618a6 Improve multi-valued HTTP headers support
Prior to this change, getting header values with `HttpHeaders` when
headers are multi-valued would cause issues.
For example, for a given HTTP message with headers:
    Cache-Control: public, s-maxage=50
    Cache-Control: max-age=42

Getting a `List` of all values would return <"public", "s-maxage=50">
and getting the header value would return "public, s-maxage=50".

This commit takes now into account multi-valued HTTP headers and adds
new getters/setters for "If-Match" and "If-Unmodified-Since" headers.

Note that for ETag-related headers such as "If-Match" and
"If-None-Match", a special parser has been implemented since ETag values
can contain separator characters.

Issue: SPR-14223, SPR-14228
2016-04-28 18:48:47 +02:00
Arjen Poutsma
cc8b2109a9 Removed DataBufferUtils.toInputStream
Replaced all usages of toInputStream with non-blocking alternatives.
2016-04-28 16:12:35 +02:00
Sebastien Deleuze
15138ed96f Revisit ScriptTemplateView resource loading
Resources are now retrieved using the application context in order to
support natively non-classpath locations like /WEB-INF/...

As a consequence of this refactoring, ScriptTemplateView#createClassLoader()
protected method as been removed, since it did not make sense anymore with
this new resource loading implementation.

Issue: SPR-14210
2016-04-28 15:40:14 +02:00
Arjen Poutsma
8aa7b42cbf Resolved DataBuffer leaks in codec package 2016-04-28 15:21:12 +02:00
Juergen Hoeller
9412f7a094 InstantFormatter accepts RFC-1123 values as well
Issue: SPR-14201
2016-04-28 14:35:33 +02:00
Stephane Nicoll
777767c7ee Merge pull request #1046 from panchenko/ReflectionUtils-static-final
* pr/1046:
  "final" for public static fields in ReflectionUtils
2016-04-28 08:34:35 +02:00
Alex Panchenko
8d36332268 "final" for public static fields in ReflectionUtils
Closes gh-1046
2016-04-28 08:34:10 +02:00
Stephane Maldini
6fbaa7dbb4 compile time issue 2016-04-27 22:08:51 +01:00
Juergen Hoeller
cd6b203c88 Upgrade to Caffeine 2.3 2016-04-27 22:10:49 +02:00
Stephane Maldini
09fdc8a384 update consume to subscribe
update after to then (WIP flux)
2016-04-27 21:06:45 +01:00
Juergen Hoeller
8ddb432694 Polishing 2016-04-27 21:35:26 +02:00
Juergen Hoeller
e0734aede8 ApplicationListenerDetector explicitly prevents serialization of its ApplicationContext reference
Issue: SPR-14214
2016-04-27 21:30:46 +02:00
Juergen Hoeller
6ab8d36ed0 DefaultMessageListenerContainer's recovery phase uses wait instead of sleep
Issue: SPR-14200
2016-04-27 21:27:21 +02:00
Juergen Hoeller
b331ad5b2a Explicit note on scheduled methods with a return value
Issue: SPR-14195
2016-04-27 15:45:30 +02:00
Juergen Hoeller
ce2f28da49 CachedIntrospectionResults explicitly introspects implemented interfaces (for Java 8 default methods)
Issue: SPR-14198
2016-04-27 15:39:00 +02:00
Rossen Stoyanchev
335d968f85 Polish DefaultUrlTemplateHandler 2016-04-27 08:55:52 -04:00
Brian Clozel
a50ea80e4e Handle multiple conditional request headers
Prior to this change, setting both "If-None-Match" and
"If-Unmodified-Since" conditional request headers would check for both
conditions to be met.

This commit fixes this behavior to follow the RFC7232 Section 6:
> entity tags are presumed to be more accurate than date validators

So in case both conditions are present, the "If-None-Match" condition
takes precedence.

Issue: SPR-14224
2016-04-27 12:02:33 +02:00