Commit Graph

153 Commits

Author SHA1 Message Date
Sebastien Deleuze b18919d111 Improve Javadoc for HandlerAdapter and HandlerMapping 2015-11-25 10:35:09 +01:00
Rossen Stoyanchev d319edba28 HandlerMapping is now asynchronous 2015-11-24 17:36:44 -05:00
Sebastien Deleuze dc57e2621c Move HttpServer related classes back to src/main/java
This is needed in order to be able to use Spring Reactive in standalone
applications. These are temporary classes that will return in
src/test/java when Spring Boot support for Reactive applications will
be implemented.
2015-11-24 18:11:44 +01:00
Rossen Stoyanchev 4a3c0bc3b6 Remove top-level org.springfamework.reactive package
reactive.codec -> core.codec
reactive.io    -> util

These may very well not be the final locations. For now they simply
express that there are classes that belong somewhere in core, i.e.
they are lower level dependencies than web.
2015-11-22 15:02:18 -05:00
Rossen Stoyanchev 911d376922 Improve MimeType -> MediaType handling
This change adds an Encoder-to-MediaType lookup in
ResponseBodyResultHandler to avoid MimeType to MediaType creation at
runtime.
2015-11-22 14:41:59 -05:00
Rossen Stoyanchev 8d30722f21 Remove @MVC test with multiple matches
RequestMappingHandlerMapping currently picks the first match and does
have logic to deal with selecting the best match. This caused a
random test failure depending on which controller method was matched
first. This change removes the test.
2015-11-20 13:17:10 -05:00
Rossen Stoyanchev e9e4bcdc59 Move ~.web.reactive.server to ~.http.server 2015-11-20 13:10:44 -05:00
Rossen Stoyanchev 81867fa423 Refactor package structure for web
The web related code is now under org.springframework.web.reactive.
This is parallel to org.springframework.web (the top-level package of
spring-webmvc).
2015-11-13 17:49:31 -05:00
Rossen Stoyanchev 54ce20a5e0 Rename field in HandlerResult 2015-11-13 17:23:00 -05:00
Sebastien Deleuze c6713c23e3 Add a ResolvableType field to HandlerResult
This change allows to be able to check generic type on the return value
at HandlerAdapter and ResultHandler level. For example, it allows to do
a Publisher<Void> check in SimpleHandlerResultHandler.
2015-11-13 17:09:02 -05:00
Rossen Stoyanchev 5d4201d500 Fix "Content-Type" and "Accept" header processing
"Content-Type" is just a single MediaType.

For the response, the MediaType must be fully selected before
selecting and encoder.

The ResponseBodyResultHandler now includes actual content negotiation
with a potential 406 response.
2015-11-13 16:47:52 -05:00
Rossen Stoyanchev 2de127ad4a Polish 2015-11-13 15:55:50 -05:00
Sebastien Deleuze bdc5b38cb1 Refactor codecs
This commit introduces the following changes:
 - MessageToByteEncoder/Decoder renamed to Encoder/Decoder
 - JsonObjectEncoder/Decoder are now used directly in
   JacksonJsonEncoder/Decoder
 - Codec uses MimeType instead of MediaType since they
   are not specific to HTTP
 - Default MimeType are now managed thanks to
   Encoder/Decoder#getSupportedMimeTypes()
 - AbstractEncoder/Decoder takes care of generic MimeType related behavior
2015-11-13 15:01:02 -05:00
Rossen Stoyanchev 141d75791d Polish 2015-11-12 11:52:06 -05:00
Marek Hawrylczak f1bec5f1e4 referencing fields of a class using this 2015-11-07 16:37:40 +01:00
Marek Hawrylczak 9126fd9dec Indentation using tabs 2015-11-07 16:02:09 +01:00
Marek Hawrylczak 4c84117155 undertow support using non-blocking API’s 2015-11-07 15:52:47 +01:00
Rossen Stoyanchev a48c9b6305 Replace DefaultConversionService in spring-reactive 2015-10-30 17:58:59 -04:00
Rossen Stoyanchev c0dff3d2bb Comply with Spring Framework code style
https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Code-Style
2015-10-30 17:22:19 -04:00
Rossen Stoyanchev 0989c8b3c2 HandlerMethodArgumentResolver is now asynchronous 2015-10-30 16:04:49 -04:00
Rossen Stoyanchev 6b73993a38 HandlerAdapter is asynchronous again 2015-10-30 15:02:54 -04:00
Sebastien Deleuze 01ae961820 Make DefaultConversionService usable by the upcoming client 2015-10-30 11:03:49 +01:00
Sebastien Deleuze a257a4a37d Polishing 2015-10-30 11:02:40 +01:00
Arjen Poutsma b2bf18dd3d Removed Closeable implementation 2015-10-30 09:39:46 +01:00
Arjen Poutsma 5f2e958fae Removed IOException declaration 2015-10-30 09:38:29 +01:00
Arjen Poutsma 174e1d295d Merge pull request #36 from poutsma/httpmessage_hierarchy
Introduce HttpMessage hierarchy
2015-10-30 09:27:52 +01:00
Arjen Poutsma bd472af37e Updated Copyright notices 2015-10-30 09:26:34 +01:00
Arjen Poutsma 6006fa6ec2 Optimized imports 2015-10-30 09:24:53 +01:00
Arjen Poutsma e121f7ecd4 Improved documentation on setBody() 2015-10-29 16:44:13 +01:00
Arjen Poutsma 45a88974bc Changed addBody() to setBody() 2015-10-29 16:28:22 +01:00
Arjen Poutsma 5727abc82d Resolved merge conflicts 2015-10-29 16:08:10 +01:00
Arjen Poutsma bab3b6fd1c Introduce HttpMessage hierarchy
This commit introduces "reactive" sub-interfaces of the HttpMessage
interface found in the Spring Framework.
2015-10-29 15:45:28 +01:00
Stephane Maldini 3864fc24ff Fix JSON encoding issue 2015-10-29 11:10:38 +01:00
Stephane Maldini fd52ae999b Update to latest reactor-net
Latest reactor-net doesn't depend on reactor-stream anymore (neither reactor-codec and reactor-bus, it only depends on reactor-core).
2015-10-29 11:10:19 +01:00
Sebastien Deleuze adc50bbfb9 Add handler method parameter and result converters
This commit introduces the following changes:
 - Publisher -> Observable/Stream/etc. conversion is now managed
    in a dedicated ConversionService instead of directly in
    RequestBodyArgumentResolver and ResponseBodyResultHandler
 - More isolated logic that decides if the stream should be
    serialized as a JSON array or not
 - Publisher<ByteBuffer> are now handled by regular
   ByteBufferEncoder and ByteBufferDecoder
 - Handle Publisher<Void> return value properly
 - Ensure that the headers are properly written even for response
   without body
 - Improve JsonObjectEncoder to autodetect JSON arrays
2015-10-29 10:50:06 +01:00
Sebastien Deleuze cf2c1514af Use latest Reactor core capabilities
No need for rxjava-reactive-streams dependency and
 CompletableFutureUtils anymore.
2015-10-19 11:15:03 +02:00
Sebastien Deleuze cb09e58a82 Fix SimpleHandlerResultHandler by using Publishers.completable() 2015-10-19 11:01:24 +02:00
Sebastien Deleuze 3ad765556d Polish ByteBufferPublisherInputStream exception handling 2015-10-16 15:35:16 +02:00
Sebastien Deleuze 8ca04b8425 More accurate ResponseBodyResultHandler error message 2015-10-16 09:13:44 +02:00
Stephane Maldini 06a1ddbe93 Eliminate need for reactor stream in CompletableFutureUtils + fixes 2015-10-16 09:11:22 +02:00
Stephane Maldini 80f9a21b9d Tweaks to ByteBufPubInputStream to use available blockingQueue facilities 2015-10-16 09:10:07 +02:00
Stephane Maldini b11bef7a26 Eliminate need for rxJava in Json Encoder 2015-10-16 09:07:51 +02:00
Stephane Maldini 985640b6ce Fix ReactorHttpServer with latest changes on shutdown behavior 2015-10-12 11:22:28 +02:00
Sebastien Deleuze 0042a65c53 Await properly Reactor server start/stop
The goal is to try to fix #32
With this change de Reactor test seems to execute slowly.
2015-10-09 11:38:35 +02:00
Sebastien Deleuze 07374f48d6 Move server related classes from src/test to src/main 2015-10-07 14:06:26 +02:00
Stephane Maldini 464ff1d960 Progress #24
Replace Streams fail, empty and Stream map with Publishers.error, empty and map.
Replace Streams calls by Publishers.flatMap, just and Publishers.from
Precise cancel and size to toReadQueue to simulate Promise
Update build
2015-10-07 12:24:32 +01:00
Sebastien Deleuze 0dabdb8207 Add request method based mapping
Closes #22
2015-10-07 12:15:39 +02:00
Sebastien Deleuze 906dead596 Polishing 2015-10-07 12:13:35 +02:00
Stephane Maldini ec1189b0b5 minor fix and update to work on latest 2.1.0.BUILD-SNAPSHOT to use core check in CFUtils 2015-10-05 16:49:25 +01:00
Sebastien Deleuze 32214e0a49 Add Javadoc for main interfaces/classes 2015-10-05 14:18:15 +02:00