Commit Graph

349 Commits

Author SHA1 Message Date
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
54eeb2cdb1 Merge pull request #97 from poutsma/zero_copy_response
@ResponseBody Resource support
2016-04-20 16:28:08 +02: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