Commit Graph

14848 Commits

Author SHA1 Message Date
Rossen Stoyanchev
3dae3fd8a9 Refine ListenableFutureCallback policy for exceptions
This change updates all cases where callbacks are invoked to catch and
suppress errors (since there is not match to do with and error from
a callback be it success or failure).

Also updated is the contract itself to clarify this and emphasize the
callbacks are really notifications for the outcome of the
ListenableFuture not the callbacks themselves.

Issue: SPR-13785
2016-01-14 17:49:01 -05:00
Rossen Stoyanchev
037f351efd Replace anonymous impls with ListenableFutureAdapater
Before this change AsyncRestTemplate had two anonymous implementations
of ListenableFuture that were adapting the result. Those have been
replaces with ListenableFutureAdapter.

This commit is preparation for SPR-13785.
2016-01-14 16:47:55 -05:00
Ian Chan
93298fc9fa Catch RejectedExecutionException in WebAsyncManager
Issue: SPR-13836
2016-01-14 15:47:00 -05:00
Rossen Stoyanchev
4818378c25 Better document client-side tests against MockMvc
Issue: SPR-13815
2016-01-14 15:15:07 -05:00
Rossen Stoyanchev
7690f27c5e Add MediaType constants for application/pdf
Issue: SPR-13831
2016-01-14 14:57:09 -05:00
Rossen Stoyanchev
f3c2bb6557 Fix error message in RestTemplate
Issue: SPR-13860
2016-01-14 14:52:10 -05:00
Rossen Stoyanchev
24fdf64d91 Fix javadoc issue in ResponseEntityExceptionHandler
Issue: SPR-13869
2016-01-14 14:25:30 -05:00
Rossen Stoyanchev
e56587dcc3 Add note to @CrossOrigin javadoc
Issue: SPR-13857
2016-01-14 14:13:53 -05:00
Sebastien Deleuze
de300e8c00 Fix the Javadoc external links by using a page without frames 2016-01-14 20:01:38 +01:00
Sebastien Deleuze
9436dd7412 Polish Javadoc 2016-01-14 19:18:38 +01:00
Sebastien Deleuze
398eb0b478 Polish packages documentation 2016-01-14 18:54:17 +01:00
Sebastien Deleuze
ae6912086a Add packages documentation 2016-01-14 18:45:43 +01:00
Stephane Nicoll
31a3607de6 Lazy resolution of the JMS message
Previously, any `javax.jms.Message` was converted eagerly to the Message
abstraction. This leads to unnecessary conversion if the Payload is not
requested by the underlying method (i.e. if the `javax.jms.Message` is
injected directly).

This commit returns a `Message` implementation that holds the
`javax.jms.Message` and lazily resolve the payload or the headers on
demand (that is the first time they are requested).

Issue: SPR-13777
2016-01-14 17:20:25 +01:00
Sebastien Deleuze
2cdce62c3d Update README with the Javadoc link 2016-01-14 16:15:34 +01:00
Sebastien Deleuze
14cb20a9f1 Disable uniqueVersion in order to get a reliable Javadoc link 2016-01-14 16:12:27 +01:00
Sebastien Deleuze
22bea1da01 Add sources and Javadoc to the build 2016-01-14 15:38:35 +01:00
Stephane Maldini
89da87a3e5 Async test case to explore jetty/tomcat issues 2016-01-14 12:38:21 +00:00
Sebastien Deleuze
72e5aa39ec Polish @RestController support 2016-01-14 11:06:04 +01:00
Stephane Maldini
1e28dee608 add streaming test, commented due to issue with a tomcat and jetty 2016-01-14 03:59:15 +00:00
Stephane Maldini
0f432f735a use reactor cookie support 2016-01-14 03:34:25 +00:00
Rossen Stoyanchev
da90f03f4c Support type-level @ResponeBody (and @RestController) 2016-01-13 18:12:36 -05:00
Rossen Stoyanchev
437c127b62 Log and handle unresolved exceptions
Before this change use of ExceptionHandlingWebHandler did ensure no
error signals are allowed to escape (hence relying on runtime
behavior).

This change ensures the same is done even when
ExceptionHandlingWebHandler is not configured for use, at the lowest
level which is the WebToHttpHandlerAdapter.
2016-01-13 18:06:42 -05:00
Juergen Hoeller
50829c9fdc Shared EntityManager does not insist on actualTransactionActive flag anymore
Issue: SPR-13838
2016-01-13 14:11:13 +01:00
Juergen Hoeller
773d175681 Polishing 2016-01-13 12:52:05 +01:00
Juergen Hoeller
e14c2de1d2 ImportStack extends ArrayDeque instead of Stack and relies on standard contains implementation
Issue: SPR-13852
2016-01-13 12:46:28 +01:00
Juergen Hoeller
5d4547d343 FastByteArrayInputStream consistently returns -1 when no data available
Issue: SPR-13858
2016-01-13 12:44:34 +01:00
Brian Clozel
cf6ceeed62 Allow Splitting/aggregation operations in Decoders
When decoding buffers as plain strings, the StringDecoder returns a
Publisher that may produce one or more `onNext` events.
This is perfectly valid, but leads to errors when trying to convert the
resulting Publisher into a `reactor.Mono` or `rx.Single`.

If the original Publisher emits 2 or more `onNext` signals,
converting to:
* `rx.Single` will throw an error saying that the underlying Observable
"emitted too many elements"
* `reactor.Mono` may contain only the first emitted element

This commit adds a `AbstractRawByteStreamDecoder` that takes a
`SubscriberBarrier` to apply splitting/aggregation operations on the
received elements.
The `StringDecoder` class now inherits from this abstract class and
uses one of the provided `SubscriberBarrier` implementations to
buffer all received elements in a single buffer.
2016-01-13 12:23:47 +01:00
Stephane Nicoll
96cb0e6bd6 Upgrade to Undertow 1.3.12 2016-01-12 16:34:13 +01:00
Sebastien Deleuze
99e51a9101 Replace Reactor Stream by Flux in tests when possible 2016-01-12 15:27:02 +01:00
Stephane Nicoll
ee946f6ac6 Fix typo 2016-01-12 15:05:59 +01:00
Sebastien Deleuze
d9b67f5e72 Use Mono semantics for JSON object/array serialization
Before this commit, a handler method returning a stream with a JSON
content-type was producing a JSON object for single element streams
or a JSON array for multiple elements streams.

This kind of dynamic change of the output based on the number of
elements was difficult to handle on client side and not consistent
with Spring MVC behavior.

With this commit, we achieve a more consistent behavior by using
the Mono semantics to control this behavior. Mono (and Promise/Single)
are serialized to JSON object and Flux (and Observable/Stream) are
serialized to JSON array.
2016-01-12 11:31:18 +01:00
Rossen Stoyanchev
c3cde84e6b Polish cookie support
HttpCookie is now immutable with factory methods to create a client
cookie (name-value) vs a server cookie (name-value + attributes)
including a builder for the latter.
2016-01-11 22:54:46 -05:00
Sebastien Deleuze
ae4b35ced7 Add Mono and Flux support in @RequestMapping handler methods 2016-01-11 13:02:36 +01:00
Rossen Stoyanchev
1faeb0ec87 Add HttpCookie + server support through HttpHeaders 2016-01-10 22:36:45 -05:00
Rossen Stoyanchev
f8ef2e0220 Add base classes for ServerHttpRequest/Response impls 2016-01-10 15:46:56 -05:00
Rossen Stoyanchev
eedc90818f Re-introduce writeHeaders() in ServerHttpResponse
This commit brings back the writeHeaders method on ServerHttpResponse
that was once added (2a6a4f) and then removed (9c7151).

This version is a little simpler since writeHeaders doesn't explicitly
flush/send headers which runtimes are expected to do by default.
Instead the main purpose of writeHeaders now is to ensure changes made
via HttpHeaders are applied to the underlying runtime response at some
point and we now do that once at the very end.

This approach provides the most flexibility (vs keeping HttpHeaders in
sync) because it allows a full and consistent set of mutative
operations for both headers and cookies (to be added) regardless of the
API exposed by the underlying runtime.
2016-01-10 06:25:12 -05:00
Rossen Stoyanchev
4f614fa0fd Add WebServerExchange
This change adds a WebServerExchange and updates all contracts at the
the same level (i.e. org.springframework.web.server) as well as the
org.springframework.web.reactive level to use it so that all
framework-related code will have access to server-side processing
features such as request attributes (and others to come).
2016-01-08 12:30:13 -05:00
Rossen Stoyanchev
54e4e012b2 Separate out web.server from http.server.reactive
This change separates out lower-level HTTP adapter code from the more
(framework-specific) HTTP processing into a separate package under
org.springframework.web.server (not under org.springframework.http).
2016-01-08 12:29:04 -05:00
Dennis Kieselhorst
554bf4958d Improve Content-Length exception message
In case ShallowEtagHeaderFilter is not used, the message was confusing
2016-01-08 09:30:31 +01:00
Stephane Maldini
94be412327 Remove last Stream reference 2016-01-07 23:41:48 +00:00
Stephane Maldini
b4c3a67d2c Use Stream instead of Streams and uncomment reactor test 2016-01-07 23:29:16 +00:00
Rossen Stoyanchev
97af9998d5 Refine exception handling
Refine exception handling responsibilities between the
DispatcherHandler and the HandlerAdapter.
2016-01-07 18:26:27 -05:00
Stephane Maldini
70b8848492 fix Streams to Stream in test 2016-01-07 22:28:35 +00:00
Rossen Stoyanchev
9a1492e401 Polish 2016-01-07 17:09:49 -05:00
Rossen Stoyanchev
a712f43654 Polish 2016-01-07 15:26:11 -05:00
Rossen Stoyanchev
c3a8bf4d17 Revert "Remove mandatory dependency on Reactor Stream"
This reverts commit d5e6f70483d4a6c8af3cc5e97e52a54e98199169.
2016-01-07 15:23:55 -05:00
Brian Clozel
cdda839426 XML configuration support for RFC 5861
This commit adds the XML+XSD configuration part of the RFC 5861
Cache-Control directives added in Spring's `CacheControl`.

Issue: SPR-13841
2016-01-07 18:13:34 +01:00
madorb
6c282096c6 Add RFC-5681 support to CacheControl
This commit adds the "stale-while-revalidate" and "stale-if-error"
Cache-Control directives in the `CacheControl` support class.

Issue: SPR-13841
2016-01-07 18:13:26 +01:00
Sebastien Deleuze
318092cfd0 Use Mono#defaultIfEmpty instead of Flux#defaultIfEmpty 2016-01-07 15:58:46 +01:00
Sebastien Deleuze
327c420409 Remove mandatory dependency on Reactor Stream with JarJar 2016-01-07 14:51:43 +01:00