Commit Graph

14427 Commits

Author SHA1 Message Date
Rossen Stoyanchev
f293c4d84b Doc use of reactive types in Spring MVC controllers
Issue: SPR-15365
2017-04-04 17:32:24 -04:00
Rossen Stoyanchev
f716c8e9bc Consistently check if AsyncContext already completed
Related to SPR-15412
2017-04-04 16:30:54 -04:00
Rossen Stoyanchev
c0f2017262 Polish 2017-04-04 15:33:47 -04:00
Violeta Georgieva
ece4815459 Ensure ISE will not be thrown when the client disconnects
- ServletServerHttpResponse.ResponseAsyncListener#onError/onTimeout
must complete the async operation
- ServletHttpHandlerAdapter.HandlerResultSubscriber#onComplete must
check that the async operation is not completed

Issue: SPR-15412
2017-04-04 14:45:00 -04:00
Rossen Stoyanchev
de6f34893a Restore ResponseBodyEmitterReturnValueHandler constructor
Issue: SPR-15410
2017-04-04 14:23:47 -04:00
Rossen Stoyanchev
ae2306326e Add RxJava1 Reactive Streams adapters check 2017-04-04 12:25:58 -04:00
Rossen Stoyanchev
d9221fb87d Async boundary for Spring MVC reactive type streaming
Issue: SPR-15365
2017-04-04 11:22:40 -04:00
Juergen Hoeller
af6f688196 Test for BeanPropertySqlParameterSource with collection
Issue: SPR-15390
2017-04-04 17:17:29 +02:00
Juergen Hoeller
f29ffb37f7 Compatibility with Servlet 4.0 b05
Issue: SPR-15379
2017-04-04 17:17:23 +02:00
Juergen Hoeller
917207b7ae Support for @Order on nested configuration classes
Issue: SPR-15384
2017-04-04 17:17:03 +02:00
Juergen Hoeller
e9627a10c7 Deprecate ObjectUtils.hashCode for primitives in favor of JDK 8's hashCode methods
Issue: SPR-15395
2017-04-04 17:16:50 +02:00
Sam Brannen
8e84fd0aed Clean up warnings in spring-test 2017-04-04 15:53:49 +02:00
Sam Brannen
51f23cb424 Polish JavaDoc for date-time and number format annotations 2017-04-03 16:48:05 +02:00
Sam Brannen
279c56a385 Fix typo in JavaDoc 2017-04-03 16:43:55 +02:00
Rossen Stoyanchev
37f9c86758 Fix failing tests due to last commit 2017-04-03 09:38:08 -04:00
Rossen Stoyanchev
62c1e44db2 Spring MVC supports reactive return values
This commit adds support for reactive library types to be returned
directly from controller methods adapting them either to a
ResponseBodyEmitter (streaming) or DeferredResult (non-streaming).

The reactive libraries supported are the ones that can adapted to a
Reactive Streams Publisher through the ReactiveAdapterRegistry.

Issue: SPR-15365
2017-04-03 09:01:49 -04:00
Rossen Stoyanchev
ae1ed16cb8 Async return values refactoring in Spring MVC
Revise Javadoc on AsyncHandlerMethodReturnValueHandler to clarify its
main purpose is to prioritze custom async return value handlers ahead
of built-in ones. Also replace the interface from built-in handlers
which are prioritized already.

Remove DeferredResultAdapter and ResponseBodyEmitterAdapter --
introduced in 4.3 for custom async return value handling, since for
5.0 we will add built-in support for reactive types and the value of
these contracts becomes very marginal.

Issue: SPR-15365
2017-04-03 09:01:49 -04:00
Sebastien Deleuze
cfc89ebe16 Add WebClient.ResponseSpec Kotlin extensions 2017-04-03 10:41:01 +02:00
Stephane Nicoll
a292539af9 Merge pull request #1370 from ameyjadiye:fix-typo
* pr/1370:
  Polish javadoc
2017-04-02 08:07:56 +02:00
Amey Jadiye
472954bbb7 Polish javadoc
Closes gh-1370
2017-04-02 08:06:57 +02:00
Sam Brannen
ce21fa4152 Upgrade to JUnit 5.0 M4
Issue: SPR-15361
2017-04-01 22:55:24 +02:00
Sebastien Deleuze
73b44828e9 Resolve async model attributes in AbstractView
This change allows the functional WebFlux API to support natively
reactive types and also makes it possible for View implementations to
disable async attributes resolution if they want for example take
advantage of stream rendering.

It also makes AbstractView#getModelAttributes() asynchronous.

Issue: SPR-15368
2017-03-30 21:48:45 +02:00
Rossen Stoyanchev
840d7abbf6 Add ResponseSpec to WebClient
Replace the overloaded "retrieve" methods with a single retrieve() +
ResponseSpec exposing shortcut methods (bodyToMono, bodyToFlux)
mirroring the ClientResponse shortcuts it delegates to.

Unlike exchange() however with retrieve() there is no access to other
parts of ClientResponse so ResponseSpec exposes additional shortcuts
for obtain ResponseEntity<T> or ResponseEntity<List<T>>.

Issue: SPR-15294
2017-03-30 12:24:16 -04:00
Arjen Poutsma
e6b4edc757 Simplify access to response body in WebClient
This commit makes a change to WebClient in oder to facilitate getting
the response body as a `Mono<Object>` or `Flux<Object>` without having
to deal with `ClientResponse`.

Specifically, this commit:

 - Adds `RequestHeaderSpec.retrieve` methods, next to `exchange`, that
 return the response body (and not a `ClientResponse`). Two convenience
 methods return the response body as `Mono` or `Flux`.
 - Adds ClientResponse.toRequestEntity to convert the ClientResponse
 into a RequestEntity.

Issue: SPR-15294
2017-03-30 08:58:04 -04:00
Sebastien Deleuze
dd5a73b2e1 Remove deprecated usage of Reactor Loopback interface 2017-03-30 14:36:23 +02:00
Sebastien Deleuze
9f321e8d56 Suppress warnings in tests 2017-03-30 14:28:10 +02:00
Sebastien Deleuze
e2fd398bad Specify explicitly Kotlin extensions return type
The main purpose is to specify nullability.
2017-03-30 14:25:13 +02:00
Rossen Stoyanchev
cd8c365a0d ServerCodecConfigurer as input in HandlerAdapter
The ServerCodecConfigurer is now passed all the way into the
RequestMappingHandlerAdapter which automatically enables the same
defaults even without the Java config and provides extra flexibility
in passing message codec configuration for the future.
2017-03-29 16:33:51 -04:00
Rossen Stoyanchev
d1db249584 Fix regression in client codecs
Restore the correct client-side default for whether StringDecoder
should split on new lines. It is true forthe server and false for the
client by default.

The regression was introduced in the recent refactoring:
f8a21ab11b (diff-0175d58138b2e8b2bec087ffe0495340)
2017-03-29 16:10:53 -04:00
Rossen Stoyanchev
a8162c03f9 Add ArgumentResolverConfigurer
Replace the List<HandlerMethodArgumentResolver> with a dedicated
configurer that currently has one method accepting custom resolver
registrations.
2017-03-29 15:39:31 -04:00
Arjen Poutsma
118f33aeda Request body improvements in WebClient, WebTestClient
This commit makes changes to WebClient and WebTestClient in oder to
limit setting the body according to HTTP method and also to facilitate
providing the request body as Object.

Specifically, this commit:

 - Moves methods that operate on the request body to a RequestBodySpec
 in both WebClient and WebTestClient, and rename them to `body`.
 These methods now just *set* the body, without performing
 an exchange (which now requires an explicit exchange call).
 - Parameterizes UriSpec in both WebClient and WebTestClient, so that
 it returns either a RequestHeadersSpec or a RequestBodySpec.

Issue: SPR-15394
2017-03-29 12:22:15 -04:00
Sebastien Deleuze
cbd98d5247 Switch back to Reactor BOM Aluminium-BUILD-SNAPSHOT 2017-03-29 16:41:54 +02:00
Arjen Poutsma
81430caa43 Deprecated AsyncRestTemplate and related types
This commit deprecates `AsyncRestTemplate` and related types
(`AsyncClientHttpRequestFactory` etc.) in favor of the Spring 5.0
`WebClient`.

Issue: SPR-15294
2017-03-29 15:54:06 +02:00
Violeta Georgieva
2556178422 Ensure NPE will not be thrown when cancelling a subscription
Issue: SPR-15393
2017-03-29 15:10:36 +02:00
Brian Clozel
dea4825a9f Fix link references between documents
Issue: SPR-14997
2017-03-29 14:22:46 +02:00
Brian Clozel
924adaec6c Render reference documentation with Asciidoctor
This commit removes docbook from the documentation toolchain and
instead makes use of asciidoctor to render the reference documentation
in HTML and PDF formats.

The main Gradle build has been refactored with the documentation tasks
and sniffer tasks extracted to their own gradle file in the "gradle"
folder.

A new asciidoctor Spring theme is also used to render the HTML5 backend.

Issue: SPR-14997
2017-03-29 14:22:46 +02:00
Rossen Stoyanchev
c5bcefbd07 Complete RequestMappingHandlerAdapter refactoring
ControllerMethodResolver now also encapsulates initialization, storage,
and use of HandlerMethodArgumentResolver's by annotated method type.
2017-03-28 17:53:42 -04:00
Sam Brannen
b053311306 Clean up warnings in spring-test 2017-03-28 20:06:42 +02:00
Sam Brannen
0f0aa46e49 Delete unnecessary PropertySourcesPlaceholderConfigurer beans
Issue: SPR-14140
2017-03-28 20:02:27 +02:00
Sam Brannen
7a01771a45 Polishing 2017-03-28 19:27:03 +02:00
Sam Brannen
0b11785852 Improve tests for PropertySourcesPlaceholderConfigurer 2017-03-28 19:26:45 +02:00
Rossen Stoyanchev
e06871ef17 Internal RequestMappingHandlerAdapter refactoring
Extract controller method caches including associated code and
discovery of @ControllerAdvice components into a separate, package
private helper class (ControllerMethodResolver).
2017-03-27 18:29:03 -04:00
Rossen Stoyanchev
525f30ad5e Remove dated references on URI template RFC 2017-03-27 15:49:20 -04:00
Rossen Stoyanchev
0479e3eefc Fix typo 2017-03-27 15:16:59 -04:00
Rossen Stoyanchev
9e96cfa7cd Polish 2017-03-27 15:15:45 -04:00
Rossen Stoyanchev
f8a21ab11b Add ClientCodecConfigurer
Issue: SPR-15247
2017-03-27 14:57:55 -04:00
Rossen Stoyanchev
dc3851df00 Extract AbstractCodecConfigurer base class
Issue: SPR-15247
2017-03-27 14:57:49 -04:00
Stephane Nicoll
5211a099d5 Merge pull request #1278 from stonio:patch-1
* pr/1278:
  Update Apache Licence 2.0 URL
2017-03-27 15:41:35 +02:00
stonio
88e3665d9d Update Apache Licence 2.0 URL
Closes gh-1278
2017-03-27 15:41:14 +02:00
Stephane Nicoll
a3bf2c4a82 Merge pull request #1333 from stonio:patch-2
* pr/1333:
  Replace size() check with isEmpty()
2017-03-27 15:35:01 +02:00