Commit Graph

279 Commits

Author SHA1 Message Date
Sebastien Deleuze 36788207f3 Polish RequestMappingIntegrationTests 2016-02-09 17:53:26 +01:00
Rossen Stoyanchev 3ca1d33905 Merge templating branch 2016-02-08 18:14:42 -05:00
Rossen Stoyanchev 971ca6beb8 Add HTML rendering integration test 2016-02-08 18:13:42 -05:00
Rossen Stoyanchev 29db80c3e8 Add FreeMarker View, ViewResolver and basic hierarchy 2016-02-08 18:13:42 -05:00
Rossen Stoyanchev 55d37c0522 Add View, ViewResolver, and ViewResolverResultHandler
This commit adds a View and ViewResolver contracts to support HTML
template based rendering.

ViewResolverResultHandler applies view resolution by iterating the
resolvers to resolve to a view and then use it to render.
2016-02-08 18:13:37 -05:00
Rossen Stoyanchev 14997eccf3 Support Model as method argument and in HandlerResult
A model is created and passed to argument resolvers including a new
ModelArgumentResolver. The model is then exposed for result handling
as a field in HandlerResult.
2016-02-08 18:04:07 -05:00
Rossen Stoyanchev e92174c772 Update HandlerResult
Rename result to returnValue and resultType to returnValueType to
reflect what they represent.

The returnValue getter is also wrapped as Optional since the value
returned from a handler may be null (e.g. void method, null value).
2016-02-07 21:50:56 -05:00
Stephane Maldini b7b423a003 Remove Stream#toBlockingQueue use 2016-02-08 00:25:52 +00:00
Arjen Poutsma 4a24979181 Various DataBuffer utility enhancements
- Javadoc for DataBufferUtils
 - Introduction of DataBufferTestUtils, containing methods for dumping
   the entire contents of a buffer
2016-02-05 14:31:48 +01:00
Stephane Maldini 52292cafae sync reactor-core scheduler 2016-02-04 03:08:26 +00:00
Brian Clozel 7ab92cfccf Add WebResponseExtractor impl for RxJava1
This commit adds `RxJava1WebResponseExtractors`, a static factory of
`WebResponseExtractor`s that are based on the RxJava1 composition API.
All extracted types are based on the `Single` and `Observable` types.
2016-02-02 14:06:02 +01:00
Brian Clozel 69ce33e1ee Add WebClient and its WebResponseExtractor API
This commit adds the `WebClient`, which relies on several parts of our
infrastructure:
* a `ClientHttpRequestFactory` to drive the underlying client library
* a `HttpRequestBuilder` builder API to create the client request
* a `WebResponseExtractor` to extract the "low-level"
`ClientHttpResponse` into a higher level representation such as a
decoded body

The `WebResponseExtractors` helper class contains many extractor
implementations all based on the `Flux`/`Mono` composition API.
2016-02-02 14:06:02 +01:00
Brian Clozel f63960af0a Add client Request/Response impl. for RxNetty
This commit adds the `ClientHttpRequest` and `ClientHttpResponse`
implementations for the RxNetty HTTP client.
This client library is based on the `Single` and `Observable`
composition API, so this has to be converted to the `Flux`/`Mono`
variants.
2016-02-02 14:06:01 +01:00
Brian Clozel 255d2de553 Add client Request/Response impl. for Reactor-Net
This commit introduces the `ClientHttpRequest` and `ClientHttpResponse`
implementations for the Reactor-Net HTTP client. This client is already
based on the `Flux` and `Mono` contracts.

This commit also adds a `AbstractClientHttpRequest` to support the
`ClientHttpRequest` implementations; it mirrors the
`AbstractServerHttpResponse` contract with a `beforeCommit` to register
`Supplier`s that should be notified before the request is committed.
2016-02-02 14:06:01 +01:00
Brian Clozel a6469baa4f Add HttpRequestBuilder default implementation
This commit adds a `DefaultHttpRequestBuilder` and its companion static
builders in `HttpRequestBuilders`. This allows to build client requests
with a friendly builder API, inspired by Spring's MockMvc API.
2016-02-02 14:06:01 +01:00
Brian Clozel 0983d302c7 Add base contracts for the Web client
This commit adds the base contracts for the Web client.
The "Reactive" prefixes of the previously commited contracts has been
removed to match the server ones.

Both the `ClientHttpRequest` and the `ServerHttpResponse` extend
`ReactiveHttpOutputMessage`, which now has a `beforeCommit` method,
necessary in both client and server implementations.

`HttpRequestBuilder` will be used by the developers to create requests
with a nice builder API. `ClientHttpRequestFactory` will provide support
for many HTTP client libraries in this new client.
2016-02-02 14:06:01 +01:00
Arjen Poutsma a4be950e37 Polishing 2016-02-02 13:57:02 +01:00
Stephane Maldini 199252cda6 sync 2016-01-28 20:57:24 +00:00
Stephane Maldini 44f4930e29 sync 2016-01-28 20:36:29 +00:00
Stephane Maldini 9204fdc371 fix timer issues
sync reactor-core
2016-01-28 18:59:56 +00:00
Stephane Maldini 28dcf2e78f fix compile test issue 2016-01-28 18:29:54 +00:00
Sebastien Deleuze ee9c5833f5 Update our tests to use TestSubscriber 2016-01-28 10:24:05 +01:00
Rossen Stoyanchev b9f4698b69 Remove license from package infos 2016-01-27 17:45:54 -05:00
Rossen Stoyanchev 381855aaf3 Refine names in web.server and polish Javadoc
WebServerExchange -> ServerWebExchange

Follows the same convention as in the http package also better allowing
the possibility for a client equivalent in the future.

WebToHttpHandlerBuilder -> WebHttpHandlerBuilder
WebToHttpHandlerAdapter -> WebHttpHandlerAdapter

More consistent with Spring conventions.
2016-01-27 17:05:07 -05:00
Rossen Stoyanchev e59b927fd1 Refine web.server package structure
Introduce adapter and handler sub-packages under web.server following a
review prompted by the addition of the session package and the package
cycle it brought in based on dependency on session.WebSessionManager.
2016-01-27 16:26:47 -05:00
Rossen Stoyanchev 407d11a58a Server-side session support
This commit adds initial support for a maintaining a server-side
session with attributes across HTTP requests. The WebSession
abstraction can be accessed via WebServerExchange from a WebFilter or
the target WebHandler.

The session sub-package contains additional abstractions for creating
and managing sessions providing a basis for extensibility (e.g. Spring
Session). Those include WebSessionManager, SessionIdStrategy, and
SessionStore along with a cookie-based session id strategy and an
in-memory session store in use by default.

Note that the current API does not provide a way to invalidate or
re-create the session from server side code.
2016-01-27 16:24:20 -05:00
Rossen Stoyanchev 3744549a3e Add setComplete + beforeCommit to ServerHttpResponse
setComplete replaces writeHeaders as a more general lifecycle method
to perform any kind of handling at the end of request processing, for
example to ensure headers are written if not already.

beforeCommit provides an extension point for an action to be invoked
just before the response is committed, e.g. adding headers/cookies.
2016-01-27 16:24:20 -05:00
Stephane Maldini 03e6d7dabf minor sync 2016-01-27 20:49:18 +00:00
Stephane Maldini 8a6fa02887 Sync with RSC move graph to flow 2016-01-27 17:42:05 +00:00
Sebastien Deleuze dc91c81fc4 Polishing 2016-01-27 17:04:08 +01:00
Sebastien Deleuze 506c4bc27b Finish to cleanup Reactor Buffer usages
We use it only for Reactor Net support now.
2016-01-27 17:01:17 +01:00
Arjen Poutsma 1c7d845245 Merge pull request #63 from poutsma/byte_buffer_abstraction
Byte buffer abstraction
2016-01-27 16:17:04 +01:00
Arjen Poutsma c84ef6cbf3 Incorporated misc. suggestions from the PR. 2016-01-27 16:07:02 +01:00
Arjen Poutsma 66c424daf9 Removed DataBufferAllocator.allocateHeapBuffer and allocateDirectBuffer in favor of allocateBuffer. 2016-01-27 16:04:03 +01:00
Arjen Poutsma b8f2388d60 Removed unused classes 2016-01-27 16:04:03 +01:00
Arjen Poutsma 225179bc6f Updated http and web packages to use DataBuffer 2016-01-27 16:04:03 +01:00
Arjen Poutsma 2981b5e6e8 Updated Encoder and Decoder to use DataBuffer 2016-01-27 16:04:03 +01:00
Arjen Poutsma 38ab47f8a0 Added DataBuffer abstraction
Added DataBuffer and DataBufferAllocator, and provided a default NIO
ByteBuffer-based implementation of those, as well as a Netty
ByteBuf-based version.
2016-01-27 16:04:03 +01:00
Stephane Maldini 641a57ec93 no need to convert to array list with last zip signature 2016-01-27 14:59:19 +00:00
Stephane Maldini 10f4f64e6f sync updates with mono 2016-01-26 23:15:55 +00:00
Arjen Poutsma 21fff02dbd Fixing the build that bad boy @smaldini broke 2016-01-26 12:43:59 +01:00
Stephane Maldini ac94bf1120 sync with reactor-stream package-scope change 2016-01-25 09:05:40 +00:00
Stephane Maldini a907898910 fix signature 2016-01-22 23:11:31 +00:00
Stephane Maldini 0ba5e1d21c sync update on reactor-io Buffer move 2016-01-21 11:59:59 +00:00
Rossen Stoyanchev 30b007dc26 Based on fix in core for SPR-13876 2016-01-20 18:01:32 -05:00
Stephane Maldini 4e162122af sync update on reactor-core 2016-01-20 20:50:28 +00:00
Stephane Maldini 7b3e9e0950 move queue.disruptor and packagescope RingBufferUtils/RequestTask 2016-01-20 18:01:07 +00:00
Sebastien Deleuze 4572cfa38c Fix RxJava1Converter -> RxJava1ObservableConverter 2016-01-20 11:45:18 +01:00
Rossen Stoyanchev 2dd9c92267 Update reactor converter package 2016-01-19 21:34:28 -05:00
Stephane Maldini 198e316412 demote cyclic dependency under reactor-core reactor package
-> reactor.Mono : reactor.core.publisher.Mono
-> reactor.Flux : reactor.core.publisher.Flux
-> reactor.Processors : reactor.core.publisher.Processors
-> reactor.Timers : reactor.core.timer.Timers
-> reactor.Subscribers : reactor.core.subscriber.Subscribers
2016-01-19 20:18:47 +00:00