Commit Graph

13731 Commits

Author SHA1 Message Date
Sebastien Deleuze dfcd5b9ed9 Add a test to validate Reactor Netty automatic flushing
Issue: SPR-14992
2016-12-15 13:08:36 +01:00
Stephane Maldini c201a14ea2 Temp disabling reactor-netty to unblock pipeline 2016-12-15 04:11:34 +00:00
Rossen Stoyanchev 257318eb87 Minor refactoring + polish in server reactive package
Renamed:
AbstractListenerFlushProcessor -> AbstractListenerWriteFlushProcessor
2016-12-14 17:43:07 -05:00
Rossen Stoyanchev 4738a61e98 Early registration of ReadListener
This is similar to the WriteListener changes on the ServerHttpResponse
where we are more naturally exposed to a delayed write. Nevertheless
we could also have a delayed read and should be consistent. The early
initialization of the RequestBodyPublisher also simplifies the
internal implementation a bit.
2016-12-14 16:17:46 -05:00
Juergen Hoeller 3370f41c61 Defensively catch IllegalStateException from match attempts (for compatibility with AspectJ 1.8.10)
Issue: SPR-15019
2016-12-14 22:06:13 +01:00
Juergen Hoeller 29543856ec OkHttpClientHttpRequestFactory allows POST request without body
Issue: SPR-15015
2016-12-14 22:05:34 +01:00
Juergen Hoeller 6d1cae2f57 Avoid proxy replacement for generic return type signatures
Issue: SPR-15010
2016-12-14 22:00:41 +01:00
Juergen Hoeller 58eccfe5bd Remove setExtractOldValueForEditor at DataBinder level (to be deprecated in 4.3.5)
Issue: SPR-15009
2016-12-14 22:00:05 +01:00
Juergen Hoeller b366e159f8 Fine-tuned handling of running state
Issue: SPR-14527
2016-12-14 21:59:49 +01:00
Rossen Stoyanchev 5a29069798 Refactor AsyncListener registration + polish
Instead of registering an AsyncListener in ServletHttpHandlerAdapter
we now register an AsyncListener in each of the request and response
where the events need to be handled anyway. This allows removing the
package private delegation methods in the request and response.
2016-12-14 15:34:58 -05:00
Rossen Stoyanchev 70f14c14c8 Polish Undertow reactive server support 2016-12-14 14:51:33 -05:00
Rossen Stoyanchev c3621bf153 Merge pull request #1268 from violetagg/undertow-byte-buffer-pool 2016-12-14 13:51:35 -05:00
Rossen Stoyanchev d3e05296e1 Replace close method with Undertow exchange listener
The Undertow HttpServerExchange has a complete listener which we can
use instead of the close() method UndertowServerHttpRequest.
2016-12-14 13:48:40 -05:00
Violeta Georgieva 8d786e8bba Refactor the usage of Undertow ByteBufferPool
- lazy allocate the PooledByteBuffer, only if there is a request body
  for reading
- close the PooledByteBuffer once the request finishes
2016-12-14 12:49:09 -05:00
Juergen Hoeller 35eaeb5636 Merge pull request #1269 from moores-expedia/use-rowmapper-hook
SPR-15018 - Construct RowMapper using the impl hook
2016-12-14 18:25:51 +01:00
Arjen Poutsma 582e625fcf Allow HandlerFunction to return Mono<ServerResponse>
This commit makes it possible for handler functions to return
asynchronous status codes and headers, by making HandlerFunction.handle
return a Mono<ServerResponse> instead of a ServerResponse. As a
consequence, all other types that deal with HandlerFunctions
(RouterFunction, HandlerFilterFunction, etc.) had to change as well.

However, when combining the above change with method references (a very
typical use case), resulting signatures would have been something like:

```
public Mono<ServerResponse<Mono<Person>>> getPerson(ServerRequest request)
```

which was too ugly to consider, especially the two uses of Mono. It was
considered to merge ServerResponse with the last Mono, essentialy making
ServerResponse always contain a Publisher, but this had unfortunate
consequences in view rendering.

It was therefore decided to drop the parameterization of ServerResponse,
as the only usage of the extra type information was to manipulate the
response objects in a filter. Even before the above change this was
suggested; it just made the change even more necessary.

As a consequence, `BodyInserter` could be turned into a real
`FunctionalInterface`, which resulted in changes in ClientRequest.

We did, however, make HandlerFunction.handle return a `Mono<? extends
ServerResponse>`, adding little complexity, but allowing for
future `ServerResponse` subtypes that do expose type information, if
it's needed. For instance, a RenderingResponse could expose the view
name and model.

Issue: SPR-14870
2016-12-14 16:52:36 +01:00
mmoores 79c202ab14 Call getColumnRowMapper() to create the row mapper; prevents requirement to override extractReturnedResults(). 2016-12-14 07:48:32 -08:00
Sebastien Deleuze 4021d239ab Fix JsonObjectDecoder with '[' starting chunk
Issue: SPR-15013
2016-12-14 14:53:12 +01:00
Rossen Stoyanchev b70071fdda Remove temporary workaround in ReactorServertHttpResponse
We no longer should need the workaround for:
https://github.com/reactor/reactor-netty/issues/2

Issue: SPR-14643
2016-12-14 08:50:37 -05:00
Rossen Stoyanchev 2633b4e9ec RedirectView applies encodeUri + polish 2016-12-14 05:54:53 -05:00
Rossen Stoyanchev c66dd01724 Equal MockServerHttpResponse in spring-test and -web 2016-12-14 05:54:53 -05:00
Sebastien Deleuze 4519c236d6 Restore reactor-netty test in FlushingIntegrationTests 2016-12-14 11:05:18 +01:00
Sebastien Deleuze 1829adecb7 Disable temporarily reactor-netty in FlushingIntegrationTests 2016-12-14 09:34:19 +01:00
Sebastien Deleuze b9892cc5d4 Add missing overrides to MockServerHttpResponse 2016-12-14 03:13:44 +01:00
Rossen Stoyanchev 3df902c6cc Add ServerHttpRequest builder
Similar pattern as for ServerWebExchange with a default mutate method
on ServerHttpRequest returning a Builder and eventually creating an
immutable wrapper.

HttpHandlerAdapterSupport uses the builder to set the contextPath.
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev f693e32973 Add ServerHttpResponseDecorator
For completeness and consistency with the existing
ServerHttpRequestDecorator and the ServerWebExchangeDecorator.
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev d421112af3 Polish ServerWebExchange builder and ServerHttpResponse
Remove duplicated ServerHttpResponse#setComplete also declard in the
parent ReactiveHttpOutputMessage interface.

Also rename:
ServerWebExchange.MutativeBuilder --> ServerWebExchange.Builder
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev 7193686bb0 Support encodeUrl mechanism via ServerHttpResponse
Issue: SPR-14529
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev 2191d80a31 Allow athentication at the STOMP level
This commit makes it possible for a ChannelInterceptor to override the
user header in a Spring Message that contains a STOMP CONNECT frame.

After the message is sent, the updated user header is observed and
saved to be associated with session thereafter.

Issue: SPR-14690
2016-12-13 17:59:51 -05:00
Brian Clozel d4411f4cc6 Update AbstractClientHttpRequest with server changes
This commit updates `AbstractClientHttpRequest` to make it more similar
to its server counterpart.
2016-12-13 22:58:01 +01:00
Rossen Stoyanchev a8d834b797 Merge pull request #1263 2016-12-13 16:01:24 -05:00
Rossen Stoyanchev 128a1f8eed Polish MockRestRequestMatchers query param support
Issue: SPR-14995
2016-12-13 16:00:46 -05:00
schjan79 ba826f1026 MockRestRequestMatchers can match query params
Issue: SPR-14995
2016-12-13 16:00:46 -05:00
Brian Clozel ba47d06cbb Update integration tests for reactor-netty
Now that reactor/reactor-netty#12 is fixed, we can restore the
previously ignored integration tests.
New tests are hanging, so this commit is converting the `StepVerifier`
`verify()` calls to using actual timeouts.

Issue: SPR-14975
2016-12-13 21:34:13 +01:00
Stephane Maldini 2802926c1d update STOMP support to reactor-netty 0.6 2016-12-13 17:31:09 +00:00
Stephane Maldini 70bab23609 update STOMP support to reactor-netty 0.6 2016-12-13 17:29:43 +00:00
Stephane Maldini 6922a1c534 Sync with latest reactor netty changes 2016-12-13 17:22:40 +00:00
Juergen Hoeller 39d2769bd0 Autodetect Kotlin nullability for optional injection points (analogous to java.util.Optional)
Built-in support in MethodParameter and DependencyDescriptor supersedes our separate KotlinUtils helper.

Issue: SPR-14951
2016-12-13 17:38:58 +01:00
Juergen Hoeller 361ab6b621 Merge pull request #1266 from kazuki43zoo/SPR-15009
Support lazy initialization of BindingResult when customize a MessageCodesResolver
2016-12-13 16:55:59 +01:00
Kazuki Shimizu 9f229283fb Support lazy initialization of BindingResult when customize a MessageCodesResolver
Issue: SPR-15009
2016-12-14 00:50:25 +09:00
Juergen Hoeller 5169c51a6c Polishing 2016-12-13 13:02:23 +01:00
Juergen Hoeller eeb7ae537f @RequestBody supports java.util.Optional
Issue: SPR-15007
2016-12-13 13:00:03 +01:00
Brian Clozel 52f664139f Improve VersionResourceResolve javadoc
The `pathPatterns` args are relative to the patterns configured for the
resource handler.

Issue: SPR-14817
2016-12-13 10:43:27 +01:00
Rossen Stoyanchev 885e76bdd0 Synchronized lazy start in JettyRequestUpgradeStrategy
Issue: SPR-14527
2016-12-12 21:10:59 -05:00
Rossen Stoyanchev 75422787b6 Merge Tomcat, Jetty, Undertow WebSocket support 2016-12-12 17:57:30 -05:00
Rossen Stoyanchev d6895aa098 Consistently extend WebSocketHandlerAdapterSupport
The WebSocketHandler adapters for all runtimes now extend
WebSocketHandlerAdapterSupport, which now also exposes
a shared DataBufferFactory property initialized from the response.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Rossen Stoyanchev 5829e1c141 Polish method and field declaration order 2016-12-12 17:56:48 -05:00
Rossen Stoyanchev f32a41933e Polish 2016-12-12 17:56:48 -05:00
Rossen Stoyanchev db5bc4a24e Minor refactoring of suspend/resumeReceiving
suspend/resumeReceiving in the AbstractListenerWebSocketSession are
now abstract methods. In Tomcat/Jetty these methods are no-op
implementations that are then coupled with a buffering strategy via
Flux#onBackpressureBuffer. In Undertow they rely on flow control for
receiving WebSocket messages.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Violeta Georgieva 08edec006b Refactor AbstractListenerWebSocketSession
- Added suspended flag to indicate whether the ReceivePublisher
is able to process the incoming messages.
- Use buffer strategy for the incoming messages.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00