Commit Graph

498 Commits

Author SHA1 Message Date
Arjen Poutsma 54c2e866c3 Renamed getSupportedMimeTypes() in [En|De]coder
Renamed getSupportedMimeTypes() to getEncodableMimeTypes and
getDecodableMimeTypes. This will allow for both Encoder and Decoder to
be implemented in the same class.

This issue fixes #113.
2016-06-10 11:00:28 +02:00
Arjen Poutsma b5394a1f50 Polishing 2016-06-10 10:39:26 +02:00
Arjen Poutsma 61240ee517 Fixed javadoc typo 2016-06-09 13:34:51 +02:00
Rossen Stoyanchev 4fd80bbb67 Add Jackons decoder tests related List vs Flux 2016-06-08 18:10:27 -04:00
Rossen Stoyanchev 22a6ca1f41 Remove Pojo from tests that shouldn't depend on it
The Pojo test class from the codec package will end up in spring-core.
This commit ensures it is used only from classes that also belong to
spring-core.
2016-06-08 16:09:54 -04:00
Rossen Stoyanchev 4e3c439593 Polish Encoder and Decoder 2016-06-08 16:04:52 -04:00
Rossen Stoyanchev a8e5e40d97 @RequestBody raises 415 if no matching converter 2016-06-07 22:14:59 -04:00
Rossen Stoyanchev 36765f0f52 Add protected method to reactive config 2016-06-06 22:24:46 -04:00
Rossen Stoyanchev 7ec85b21bb Remove unused test class 2016-06-06 17:44:08 -04:00
Rossen Stoyanchev 0a88d5983a Polish ResponseBodyArgumentResolver 2016-06-06 17:43:47 -04:00
Rossen Stoyanchev 5c236e1edf Update to latest Reactor snapshot 2016-06-06 10:12:11 -04:00
Rossen Stoyanchev 03b474edfe Add Web Reactive Java config 2016-06-06 09:50:46 -04:00
Rossen Stoyanchev 505569c992 Add Encoder constructor to HttpMessageConverterView 2016-06-06 09:50:16 -04:00
Rossen Stoyanchev b45a48d0fc Support for custom argument resolvers 2016-06-06 09:49:59 -04:00
Rossen Stoyanchev a163938758 Message converters are configurable 2016-06-03 17:56:08 -04:00
Rossen Stoyanchev b20ea75766 Update to latest Reactor snapshot 2016-06-03 17:56:08 -04:00
Rossen Stoyanchev 03a997c9d4 Remove outdated DataBufferFactory properties
Removed in favor of accessing the factory from the response.
2016-06-01 18:07:54 -04:00
Rossen Stoyanchev 431fedccc7 Upgrade to RxJava 1.1.5
After the fix for ReactiveX/RxNetty#509 we can remove the workaround
to concatenate with an empty Observable for the request body and
upgrade to the latest RxJava 1.1.5.

Issues: #103
2016-06-01 17:32:05 -04:00
Sebastien Deleuze 8cf5ea91f8 Sync with TestSubscriber changes in reactor-core 2016-06-01 17:55:53 +02:00
Rossen Stoyanchev 65246f8cfd Remove FIXME on retain in ReactorServerHttpRequest
The converters release so this is the right thing to do, not a
temporary fix.
2016-06-01 10:17:12 -04:00
Rossen Stoyanchev a40a8b06bf Polish view resolution 2016-05-31 22:14:17 -04:00
Rossen Stoyanchev 8cc72b320b View resolution with content negotiation
ViewResolutionResultHandler and ResponseBodyResultHandler now share
a common base class ContentNegotiatingResultHandlerSupport that
supports content negotiation.

For view resolution we compare against the supported media types of
resolved View instances, which may include default View's delegating
to an HttpMessageConverter (e.g. JSON, XML, rendering).
2016-05-31 21:51:24 -04:00
Rossen Stoyanchev 5db1a54ff0 Add HttpMessageConverterView 2016-05-31 17:49:21 -04:00
Rossen Stoyanchev a37b2e3a84 Refactor View contract
View now returns Mono<Void> rather than Flux<DataBuffer> which aligns
more closely with the reactive HttpMessageConverter vs the Encoder.

The change was prompted by the upcoming implementation of a View that
delegates to an existing HttpMessageConverter e.g. for JSON, XML.

The resulting change also brings the reactive View closer in spirit to
the View from spring-webmvc which returns void.
2016-05-31 16:50:38 -04:00
Rossen Stoyanchev f8a7024b73 Polish SimpleResultHandler 2016-05-31 16:50:32 -04:00
Rossen Stoyanchev 1b308cffbf Introduce base class for ResponseBodyResultHandler
The ContentNegotiatingResultHandlerSupport base class encapsulates the
logic for content negotiation needed for both @ResponseBody and view
resolution result handling.
2016-05-31 16:33:01 -04:00
Stephane Maldini 3f7178ba9f Sync Reactor 2016-05-31 13:00:51 +01:00
Stephane Maldini 7fc3031c7a update after Schedulers change 2016-05-31 11:11:38 +01:00
Sebastien Deleuze 3f80b4ab2e Polish 2016-05-30 15:26:55 +02:00
Sebastien Deleuze 97155f1a30 Rename ReactiveHttpOutputMessage.setBody() to writeWith() 2016-05-30 15:09:37 +02:00
Rossen Stoyanchev 58307ebac4 Support Model-related return values
This commit adds support for Model-related return values types such as
Map, Model, @ModelAttribute annotated, and non-simple types, which
helps to clarify the logic in ViewResolutionResultHandler.
2016-05-27 20:22:58 -04:00
Rossen Stoyanchev 33c5a19769 Handle unresolved view name 2016-05-27 15:22:22 -04:00
Rossen Stoyanchev a72462cd8c Polish view resolution tests 2016-05-27 15:22:22 -04:00
Rossen Stoyanchev f7d4688b84 Improve 404 "handler not found" handling
Remove handler inserted at the end to generate error in favor of doing
the same using the otherwiseIfEmpty operator.
2016-05-27 15:21:28 -04:00
Brian Clozel c6ed12297f Add Host property in HttpServerSupport
And change the defaults to:

* "0.0.0.0" for the host
* any available port, starting at 8080
2016-05-27 15:50:41 +02:00
Arjen Poutsma 03fe209862 Renamed ReactiveHttpOutputMessage dataBufferFactory() method to bufferFactory() 2016-05-27 10:37:04 +02:00
Arjen Poutsma d36286c7d1 Renamed DataBufferAllocator to DataBufferFactory 2016-05-27 09:51:42 +02:00
Arjen Poutsma 6f46164727 Changed reduceToSingleBuffer to splitOnNewline
In order to be more "reactive", changed StringDecoder's default from
merging all buffers in the stream to a single buffer into splitting the
buffers along newline (\r, \n) characters.
2016-05-27 09:22:57 +02:00
Arjen Poutsma 74abe92804 Added DataBuffer indexOf and lastIndexOf
This commit introduces DataBuffer.indexOf(IntPredicate) and
lastIndexOf(IntPredicate), for finding the index of a byte in a
DataBuffer.
It also introduces DataBufferUtils.tokenize, which tokenizes a
DataBuffer into separate tokens, given a delimiter function.
2016-05-27 09:22:57 +02:00
Rossen Stoyanchev f0c8c4e7a4 Add request path based default view name support 2016-05-26 18:08:18 -04:00
Rossen Stoyanchev 793638e610 Rename ViewResolverResultHandler to ViewResolution~ 2016-05-26 17:48:35 -04:00
Rossen Stoyanchev 8b99c51969 Fix compiler warnings 2016-05-26 17:37:39 -04:00
Rossen Stoyanchev eb9fe235fe Properly handle Mono.empty() for view resolution
This commit ensures correct handling for Mono.empty() return value
where the declared return type is Mono<String> or Mono<View>.
2016-05-26 17:34:52 -04:00
Rossen Stoyanchev 91a5759cf5 Polish result handlers default order 2016-05-26 16:17:56 -04:00
Rossen Stoyanchev bc782902d7 Remove java.util.Optional from View contract 2016-05-26 16:00:08 -04:00
Rossen Stoyanchev 4d04bd5690 Consolidate view resolution under result.view
While View and ViewResolver play the same role as in spring-webmvc they
are now abstracted behind the HandlerResultHandler abstraction so that
top-level contracts don't reference them and the DispatcherHandler is
also unaware of their existence.

Furthermore view resolution and response body handling which are now at
the same level of abstraction (each is a HandlerResultHandler) will
also share code for content negotiation, so it makes sense for them to
be side by side.

This commit moves the reactive.view package to reactive.result.view
with the View and ViewResolver contracts (previously in the top-level
reactive package) also moving there.
2016-05-26 15:55:22 -04:00
Rossen Stoyanchev 318b15c321 Polish 2016-05-26 13:39:16 -04:00
Rossen Stoyanchev 2263954ad7 Respect produces condition in @ResponseBody algorithm 2016-05-26 13:34:08 -04:00
Rossen Stoyanchev a017e2848a Rename ContentTypeResolver to RequestedContentTypeResolver 2016-05-26 11:05:48 -04:00
Rossen Stoyanchev 37404d081e Use ContentTypeResolver for content negotiation 2016-05-26 10:52:19 -04:00
Rossen Stoyanchev 2292e46b04 Update empty return value ResponseBody handling
When a null is returned from an @ResponseBody method, rather than
returning Mono.empty() immediately, convert it to Mono.empty() and
apply the same processing.

Currently that doesn't make a practical difference but it's more
accurate to do it this way. Eventually it may mean the possibility
to turn empty values into something through an extension point
as we do with ResponseBodyAdvice in Spring MVC today.
2016-05-25 17:35:58 -04:00
Rossen Stoyanchev 91d063899b Polish ResponseBody result handling 2016-05-25 17:34:15 -04:00
Rossen Stoyanchev da3b21b020 Fix typo in build script 2016-05-24 15:41:51 -04:00
Rossen Stoyanchev 662e093fbb Temporarily fix RxJava at 1.1.1 to avoid hanging tests
Issue #103
2016-05-24 15:32:18 -04:00
Sebastien Deleuze 5cbc29e61e Upgrade to Tomcat 8.5.2 2016-05-17 13:24:36 +02:00
Stephane Maldini a108268241 fix emit 2016-05-12 11:24:09 +01:00
Stephane Maldini efa5b876fe fix emit 2016-05-12 09:36:28 +01:00
Stephane Maldini f0d28f4b09 fixme : force retain() on incoming bytebuf content 2016-05-06 23:52:23 +01:00
Rossen Stoyanchev 59217243ee Add viewNames for UrlBasedViewResolver 2016-05-05 21:16:21 -04:00
Rossen Stoyanchev aadbf1d8a6 Order ViewResolver's 2016-05-05 20:53:12 -04:00
Rossen Stoyanchev 4d9126a474 Add support for more annotated method arguments
- @PathVariable
 - @RequestHeader
 - @RequestParam
 - @CookieValue
 - @Value
 - @RequestAttribute
 - @SessionAttribute
2016-05-03 23:41:52 -04:00
Stephane Maldini 4e8c21e85a Sync Reactor SignalEmitter 2016-05-04 01:37:11 +01:00
Stephane Maldini 04f47da15e Synchronize Reactor Flux#create / Flux#generate changes 2016-05-03 23:06:07 +01:00
Arjen Poutsma b71f143dfd Polishing 2016-05-03 16:33:56 +02:00
Stephane Maldini b2d9e7c28d Split FluxProcessor factories into individual Processor, remove confusing factories 2016-05-02 22:56:18 +01:00
Stephane Maldini eb21f3ab0a remove lift() 2016-04-28 22:38:26 +01:00
Arjen Poutsma cc8b2109a9 Removed DataBufferUtils.toInputStream
Replaced all usages of toInputStream with non-blocking alternatives.
2016-04-28 16:12:35 +02:00
Arjen Poutsma 8aa7b42cbf Resolved DataBuffer leaks in codec package 2016-04-28 15:21:12 +02:00
Stephane Maldini 6fbaa7dbb4 compile time issue 2016-04-27 22:08:51 +01:00
Stephane Maldini 09fdc8a384 update consume to subscribe
update after to then (WIP flux)
2016-04-27 21:06:45 +01:00
Arjen Poutsma 72b66c9715 Introduction of PooledDataBuffer
This commit introduces a pooled data buffer as a subtype of DataBuffer,
as well as various utility methods related to reference counting.

Additionally, Crelease calls have been introduced throughout the
codebase to properly dispose of pooled databuffers.
2016-04-26 15:08:52 +02:00
Arjen Poutsma 92e1bff768 Merge pull request #84 from mp911de/charsetdecoder-in-stringdecoder
Use CharsetDecoder to decode a DataBuffer into a String.
2016-04-25 14:51:48 +02:00
Arjen Poutsma ad0a4e0cf8 Introduce AbstractSingleValueEncoder
This commit introduces the AbstractSingleValueEncoder, an abstract base
class for encoders that only handle a single value.
2016-04-22 13:06:00 +02:00
Arjen Poutsma 9ed4bff4a9 Fixed DataBufferUtils.takeUntilByteCount 2016-04-22 13:01:18 +02:00
Arjen Poutsma 52c9b3b235 Introduce ResourceEncoder and ResourceDecoder
This commit introduces the ResourceEncoder and ResourceDecoder, and uses
these in ResourceHttpMessageConverter as a non-zero-copy fallback
method.
2016-04-22 09:54:51 +02:00
Rossen Stoyanchev df7c8e550d Updates to WebHandler support
Rename two classes each adapting to WebHandler to avoid confusing them:
1. HttpWebHandlerAdapter adapts from the low level HttpHandler to any
WebHandler (e.g. DispatcherHandler).
2. SimpleHandlerAdapter adapts the plain WebHandler for use within the
DispatcherHandler.

This commit also fixes an issue in WebHttpHandlerBuilder to ensure that
WebExceptionHandler's are inserted before and not after WebFilter's.
2016-04-21 20:35:47 -04:00
Rossen Stoyanchev a23f792052 Add SimpleUrlHandlerMapping
This commit replaces the temporary SimpleUrlHandlerMapping with
a full-featured one.
2016-04-21 17:04:43 -04:00
Arjen Poutsma 53f8b84bcc Polishing 2016-04-21 12:46:57 +02:00
Arjen Poutsma df3cf69a96 Polishing 2016-04-21 12:23:44 +02:00
Rossen Stoyanchev dd607d3e53 BadRequestStatusException -> ServerWebInputException
The renaming makes it clear this exception is for use where 400 error
applies within a Spring web application where the error may be
associated with a MethodParameter, a BindingResult, and so on.

There is no need for BadRequestStatusException which can be expressed
with ResponseStatusException(HttpStatus.BAD_REQUEST, "reason").
2016-04-20 13:39:42 -04:00
Arjen Poutsma 804f69c8b6 Wrapping up zero-copy support
This commit wraps up the previous commits:

 - It uses HttpMessageConverter in the web.reactive.server package instead of Encoder/Decoder.
 - It introduces tests for the Resource @ResponseBodies.
2016-04-20 16:27:11 +02:00
Arjen Poutsma 3c486c02ab Reactive HttpMessageConverter
This commit introduces a reactive version of the HttpMessageConverter.
During the implementation of zero-copy support, it became apparent that
it was ueful to have a common abstraction between client and server that
operated on HttpMessages rather than DataBuffers.

Two HttpMessageConverter implementations are provided:
 - The CodecHttpMessageConverter, based on Encoder/Decoder.
 - The ResourceHttpMessageConverter, using zero-copy if available.
2016-04-20 16:27:11 +02:00
Arjen Poutsma 451e296a78 Zero-copy support
This commit introduces support for zero-copy file transfers in the HTTP
response, through the ZeroCopyHttpOutputMessage subinterface of
ReactiveHttpOutputMessage.
2016-04-20 16:27:04 +02:00
Arjen Poutsma 7b7f833004 Various MimeType and MediaType improvements 2016-04-20 13:34:30 +02:00
Arjen Poutsma d626b5e833 Various DataBuffer improvements
This commit introduces two DataBuffer improvements:

 - The capability to read a Flux<DataBuffer> from an input stream or
   channel.

 - The capability to limit a Publisher<DataBuffer> to publish up until a
   given maximum byte count.
2016-04-20 13:30:40 +02:00
Rossen Stoyanchev a173c78d98 Add getAttribute to WebSession and ServerWebExchange 2016-04-19 17:34:08 -04:00
Rossen Stoyanchev d041b73c10 Polish 2016-04-19 16:43:50 -04:00
Rossen Stoyanchev 8ca5b830b1 Remove dependency on WebUtils 2016-04-19 16:41:32 -04:00
Rossen Stoyanchev 9c40b65b70 Improve error message for unsatisfied param conditions 2016-04-19 16:28:32 -04:00
Rossen Stoyanchev 6b7360fed1 Apply new ResponseStatusException hierarchy
This commit replaces use of the existing ServletException-based
exceptions with the new ones from ~.web.server.
2016-04-19 16:02:22 -04:00
Rossen Stoyanchev 3849fd6b5b Remove DispatcherHandlerExceptionMapper
No need to translate to response status codes any more and no need for
an exception handling mechanism at this level.
2016-04-19 16:02:22 -04:00
Rossen Stoyanchev 8f0fe713f5 Add concrete ResponseStatusException sub-classes 2016-04-19 16:02:22 -04:00
Rossen Stoyanchev 66707835fe Move ResponseStatusException into server sub-package 2016-04-19 16:02:22 -04:00
Stephane Maldini 00eff4b611 Rename SchedulerGroup to Computations and its methods to avoid confusion 2016-04-19 09:08:38 +01:00
Rossen Stoyanchev 92c72b93a6 Switch defaults for ContentTypeResolver
Now that we have a CompositeContentTypeResolverBuilder with built-in
defaults, we switch to those defaults in places where a
ContentTypeResolver is used.
2016-04-18 17:56:19 -04:00
Rossen Stoyanchev 4af99473ff Add CompositeContenTypeResolver and a builder
This is the equivalent of the existing ContentNegotiationManager +
ContentNegotiationManagerFactoryBean
2016-04-18 17:43:20 -04:00
Rossen Stoyanchev 1f283acb98 Add path extension and parameter ContentTypeResolver's 2016-04-18 17:43:20 -04:00
Rossen Stoyanchev 9ffc0b5e65 Update FileExtensionContentTypeResolver
Rename to MappingContentTypeResolver and replace "fileExtension" with
"key" in methods to be more general (e.g. file extension or query
param). Also switch from List to Set for the return values.
2016-04-18 17:43:20 -04:00
Stephane Maldini 7d60c2767d Normalize returns with Scheduler factories in SchedulerGroup 2016-04-18 21:26:12 +01:00
Rossen Stoyanchev 0f44fedd19 Complete RequestMappingHandlerMapping
This commit adds RequestMappingInfoHandlerMapping and
RequestMappingHandlerMapping with support equivalent to that in
spring-webmvc.
2016-04-18 13:07:23 -04:00
Stephane Maldini 0e5a892bad Use ByteBuf instead of Buffer in reactor-netty 2016-04-18 17:49:32 +01:00
Stephane Maldini ad9d8c28fe Polish reactor-ipc/netty contracts 2016-04-17 14:50:20 +01:00
Stephane Maldini 0a3396c5b2 Polish contracts 2016-04-16 01:05:30 +01:00
Stephane Maldini 9a4b98d2e9 Update HttpClient with Inbound/Outbound contract split 2016-04-15 23:23:54 +01:00
Stephane Maldini 4431a76a05 Update addCookie signature and improve client cookie 2016-04-15 21:25:56 +01:00
Rossen Stoyanchev b2ca216498 Add RequestCondition hierarchy
A pretty complete equivalent to the same in spring-webmvc except for
CORS checks, and custom HTTP methods. Another notable difference is
that the "params" condition works on query params strictly.
2016-04-15 16:21:46 -04:00
Rossen Stoyanchev 641c6428e8 Add ContentTypeResolver strategy
A starting point for an alternative to the existing
ContentNegotiationStrategy but for use with ServerWebExchange.
2016-04-15 16:21:46 -04:00
Rossen Stoyanchev 09c5711862 Polish ServerHttpRequest
Consistent initialization of HttpHeaders and the cookies map.
 - allow sub-classes to create instance
 - make unmodifiable
2016-04-15 16:21:46 -04:00
Rossen Stoyanchev a7f32cd528 Add getQueryParams to ServerHttpRequest 2016-04-15 16:21:46 -04:00
Rossen Stoyanchev 61136e614e Fix issue with Cookies in ReactorServerHttpResponse 2016-04-15 16:20:55 -04:00
Stephane Maldini 4ddd9d2895 fix change issue on HttpChannel#writeHeaders to sendHeaders 2016-04-15 20:04:52 +01:00
Stephane Maldini 4a0adc2b2d Sync with reactor-netty and reactor-ipc 2016-04-15 19:55:33 +01:00
Rossen Stoyanchev 33a7b91e57 Add abstract case class HandlerMappings
This commit adds AbstractHandlerMethodMapping, a starting point for
AbstractHandlerMapping, and HttpRequestPathHelper with a similar
purpose to UrlPathHelper but based with ServerWebExchange as input.
2016-04-15 04:08:19 -04:00
Rossen Stoyanchev 341f23e0e6 Add "result" package under ~.web.reactive
The new package is parallel to the "mvc" package under spring-webmvc
and a place to hold the various programming model styles.
2016-04-14 16:15:44 -04:00
Rossen Stoyanchev 3460e577ad Polish "simple" handler support
- correct name of HttpHandlerHandlerAdapter to WebHandlerHandlerAdapter
- shorten SimpleHandlerResultHandler to SimpleResultHandler
- add HandlerResult constructor without Model
- update tests
2016-04-14 15:17:28 -04:00
Stephane Maldini ff6b639cf9 sync with dispatchOn change in reactor-core 2016-04-11 16:04:01 +01:00
Brian Clozel a3b371bf4b Accept all media types in StringDecodere
This commit adds the "*/*" media type in the list of compatible media
types for the StringDecoder. This allows this decoder to decoder
payloads of any media type as long as the target type is String.

Fixes #87
2016-04-08 22:18:46 +02:00
Stephane Maldini da2276a954 First wave scheduler contract migration 2016-04-08 03:09:32 +01:00
Sebastien Deleuze 87ce5d641c Update dependencies
- Spring Framework 4.2.3.RELEASE -> 4.3.0.RC1
 - Netty 4.1.0.CR3 -> 4.1.0.CR6
 - Jackson 2.6.2 -> 2.7.3
 - Jetty 9.3.5.v20151012 -> 9.3.8.v20160314
 - Undertow 1.3.5.Final -> 1.3.20.Final
2016-04-07 20:26:38 +02:00
Brian Clozel 023dafa903 Support "text/*" media types in StringDecoder 2016-04-07 16:06:56 +02:00
Brian Clozel e3f87b3e3a Polish 2016-04-07 16:06:56 +02:00
Brian Clozel 09327181c4 Improve ClientHttpRequestFactory javadoc
This commit underlines the fact that the request created by a
ClientHttpRequestFactory should be augmented with a message body using
the `ClientHttpRequest#setBody` method before it is executed.

See #82
2016-04-07 16:06:56 +02:00
Brian Clozel ddf996cfeb Polish HttpRequestBuilder API
This commit makes messageEncoders a required argument for building a
client request - those are needed to actually encode the body object as
a reactive stream to be written to the HTTP request body.

Removed raw types usage in DefaultHttpRequestBuilder.

DefaultHttpRequestBuilder now uses a UriTemplateHandler to expand URI
templates + variables into a concrete URI.

Fixes #80, fixes #85, fixes #86
2016-04-07 16:06:56 +02:00
Brian Clozel 8ed2925ce3 Propagate Errors in DefaultHttpRequestBuilder
This commit introduces the new `WebClientException` for wrapping
client-side exceptions.
This exception is now thrown when now message encoder can be found for
writing the request body as an HTTP request message.

Fixes #83
2016-04-07 16:06:56 +02:00
Brian Clozel e2a07659ab Add generics support for WebResponseExtractors
This commit adds generics support for WebResponseExtractors.
Types should be described using a ResolvableType, which can be
created with static methods like:

    // for the type Event<Registration>
    ResolvableType.forClassWithGenerics(Event.class, Registration.class)

Fixes #89
2016-04-07 16:06:56 +02:00
Sebastien Deleuze 24a63f1d90 Upgrade RxNetty to 0.5.2-SNAPSHOT and Tomcat to 8.0.33 2016-04-07 16:04:39 +02:00
Brian Clozel 04fae44163 Switch back to reactor-core SNAPSHOT versions
Some important issues have been fixed in recent SNAPSHOT versions.

See #78 and #70
2016-04-07 15:10:49 +02:00
Arjen Poutsma 75399814cd Improve Jaxb2Decoder
- Introcuces XmlEventDecoder which decodes from DataBuffer to
  javax.xml.stream.events.XMLEvent. It uses the Aalto async XML API if
  available, but falls back to a blocking default if not.

- Refacors Jaxb2Decoder to use said XmlEventDecoder, and split the
  stream of events into separate substreams by using the JAXB annotation
  value, one stream for each part of the tree that can be unmarshaled to
  the given type.

- Various improvements in the JAXB code.
2016-04-06 16:22:49 +02:00
Arjen Poutsma a8f27af5fb Polishing. 2016-04-06 16:20:08 +02:00
Mark Paluch 9e79b344ca Implement review feedback.
Remove empty string optimization. Simplify test to use only Mono/Flux/TestSubscriber instead of mixing with RxJava.
2016-04-04 09:49:22 +02:00
Rob Winch fd6fc30eea Add RequestPostProcessor
Fixes gh-81
2016-03-31 12:33:45 -05:00
Mark Paluch c4b9d94c33 Use CharsetDecoder to decode a DataBuffer into a String. 2016-03-31 16:39:39 +02:00
Arjen Poutsma 75d006d2f9 Improve StringDecoder. 2016-03-31 11:31:02 +02:00
Lukas Krecan 23f3fff367 Replacing potentionally slow and infinite while loop by a latch 2016-03-29 10:33:21 +02:00
Arjen Poutsma d9d76ecd19 Polishing 2016-03-24 09:39:58 +01:00
Arjen Poutsma 35e511b03f Resolved comments from review
This commit resolves a few comments brought forward during a review
meeting, specifically:

- It renames AbstractResponseBodyPublisher to
  AbstractRequestBodyPublisher.
- It separates out registration logic into a register method.
- It moves the RequestBodyPublisher and ResponseBodySubscriber for the
  Servlet 3.1 support back into ServletHttpHandlerAdapter.
2016-03-23 17:04:18 +01:00
Arjen Poutsma d20b0003c6 Refactoring of Servlet 3.1 and Undertow support
- Introduce abstract base class for Servlet 3.1 and Undertow support
- Simplify Undertow support
2016-03-23 16:02:44 +01:00
Arjen Poutsma f7c6c69e51 Improve JacksonJsonEncoder
This commit removes the need for the custom Subscriber in
JsonObjectEncoder, and replaces it with higher-level Flux and Mono-based
solution.
2016-03-21 11:37:51 +01:00
Arjen Poutsma 7f786ce4d7 Added DataBufferAllocator property to ReactiveHttpOutputMessage, and use that to pass on to Encoder.encode(). 2016-03-18 16:14:33 +01:00
Arjen Poutsma 1836b2825b Added DataBufferAllocator parameter to Encoder.encode, and use that instead of AbstractAllocatingEncoder base class. 2016-03-18 16:05:30 +01:00
Arjen Poutsma e56dda1864 Make JsonObjectDecoder use allocator property on DataBuffer. 2016-03-18 14:11:25 +01:00
Arjen Poutsma b838fdab88 Added allocator property to DataBuffer 2016-03-18 12:16:23 +01:00
Arjen Poutsma 273c1b85e6 Reduced batch size to 1, so that we don't block on init. 2016-03-18 11:58:55 +01:00
Arjen Poutsma 2c52731417 Various test improvements 2016-03-18 10:02:28 +01:00
Arjen Poutsma 5519428d43 Replaced DataBufferPublisherInputStream with JDK equivalent. 2016-03-18 10:02:28 +01:00
Rossen Stoyanchev 72dbe9012e Add cookies to ClientHttpRequest/Response 2016-03-17 21:04:50 -04:00
Rossen Stoyanchev e19abf9c90 Rename ServerCookie to ResponseCookie
HttpCookie-ResponseCookie follows HttpEntity-ResponseEntity and also
avoids use of "Server" outside of server sub-package.
2016-03-17 15:28:55 -04:00
Rob Winch ececec21f7 Update to Gradle 2.12 2016-03-17 10:11:28 -05:00
Rob Winch 62753102dc Ensure a consistent netty version
Currently there are clashes between io.netty:netty-common:4.1.0.Beta7 and
io.netty:netty-all:4.1.0.CR3 which can cause errors in the build related
to "VerifyError: Bad type on operand stack".

One solution would be to exclude the jars that duplicate the classes.
However, this can be fragile since additional dependencies may be added
that bring in the dependency transitively.

This commit locks the version for any artifiact with the group "io.nettty"
to ensure the correct version of netty is used.
2016-03-17 10:11:12 -05:00
Arjen Poutsma 10a04b0769 Test improvements. 2016-03-17 10:21:04 +01:00