Commit Graph

13623 Commits

Author SHA1 Message Date
Juergen Hoeller 1039fa1d34 Avoid defensive check for Servlet 3.1 Part interface
Issue: SPR-14467
2016-12-01 20:11:54 +01:00
Juergen Hoeller f6fc0a86b3 Polishing
(cherry picked from commit 0028b29)
2016-12-01 20:11:47 +01:00
Sebastien Deleuze 300f2cd2dd Polish RedirectView
Issue: SPR-14534
2016-12-01 17:27:29 +01:00
Juergen Hoeller 7a8ec4f6eb Consistent use of "URI variables" terminology
Issue: SPR-14969
2016-12-01 12:30:10 +01:00
Rossen Stoyanchev d41d3aa1d6 Merge pull request #1250 from origin/update-stomp-reactor-netty 2016-11-30 21:17:51 -05:00
Rossen Stoyanchev b874692452 Simplify ReactorNettyTcpClient input
Create a ReactorNettyCodec to hold the decoding and encoding function
and consumer along with a package-private sub-class that delegates to
StompDecoder and StompEncoder.

Issue: SPR-14531
2016-11-30 21:17:04 -05:00
Rossen Stoyanchev 85c93f5d67 Polish Reactor Netty TCP client support 2016-11-30 21:17:04 -05:00
Stephane Maldini 870f61fd8e update STOMP support to reactor-netty 2016-11-30 21:17:04 -05:00
Juergen Hoeller 845dbf040d Test injection point match for narrow target return type
Issue: SPR-14960
2016-11-30 23:47:32 +01:00
Juergen Hoeller 1ae17c27df Efficient ISO_LOCAL_* variants for printing LocalDate/LocalTime/LocalDateTime
Issue: SPR-14958
2016-11-30 23:41:00 +01:00
Juergen Hoeller 5458a427a1 Polishing 2016-11-30 22:31:47 +01:00
Juergen Hoeller 01868096a3 Consistent catching of Throwable for introspection failures
Issue: SPR-12889
2016-11-30 22:24:14 +01:00
Juergen Hoeller f6b8b84df9 Efficient type plus annotation comparisons during converter retrieval
Issue: SPR-14926
Issue: SPR-12926
2016-11-30 22:22:44 +01:00
Juergen Hoeller ac5933a7ac Various DefaultListableBeanFactory clarifications
* getBeanDefinitionNames defensively returns a copy of the bean definition names array.
* copyConfigurationFrom provides an independent AutowireCandidateResolver instance and copies a ConversionService and dependency comparator configuration as well.
* findAutowireCandidates only considers a self reference fallback for direct dependency declarations, not as a collection element.

Issue: SPR-14897
Issue: SPR-14921
Issue: SPR-14965
2016-11-30 22:07:55 +01:00
Juergen Hoeller 2f9a775a8e Upgrade to JUnit 5.0 M3
Issue: SPR-14924
2016-11-30 15:12:00 +01:00
Juergen Hoeller 8cb7e026e2 HttpRequestPathHelper in new web.server.support package
In general, web.util is supposed to remain lowest-level, not depending on any other web.* package. Since web.client also has a support package, a corresponding web.server.support package seemed appropriate for a helper class depending on ServerWebExchange in web.server itself.
2016-11-30 11:12:06 +01:00
Rossen Stoyanchev 93cfc791a7 Spring MVC supports ResponseStatusException
The ResponseStatusException is now also supported in Spring MVC
through the ResponseStatusExceptionResolver.

Issue: SPR-14895
2016-11-29 15:18:02 -05:00
Rossen Stoyanchev 729551f375 Use full package names in ReactiveAdapterRegistry
The recent refactoring lead to
java.lang.NoClassDefFoundError: io/reactivex/Completable

where only RxJava 1 is in the classpath. Most likely due to the
lack of prefix in Completable::complete with rx package to avoid
the RxJava 2 reference.
2016-11-29 13:29:49 -05:00
Juergen Hoeller 10d5926b1a Direct use of Bean Definition 1.1 ExecutableValidator
Issue: SPR-13481
2016-11-29 18:09:13 +01:00
Juergen Hoeller f065589a37 Avoid defensive casts against Java 8 default methods
Issue: SPR-13188
2016-11-29 18:07:46 +01:00
Brian Clozel 3bd17175ed Update with new HttpServerResponse.sendFile signature
Reactor Netty's `HttpServerResponse` has a new `sendFile` signature that
takes a `Path` instead of a `File`.
2016-11-29 14:29:39 +01:00
Rossen Stoyanchev 38b6746d3d HtmlUnitRequestBuilder detects form encoding type
Issue: SPR-14916
2016-11-28 18:07:40 -05:00
Rossen Stoyanchev cb50f6bc8c ResponseEntity headers builder casts body to any type
Issue: SPR-14939
2016-11-28 17:22:24 -05:00
Rossen Stoyanchev a203b74d20 PayloadArgumentResolver has useDefaultResolution flag
Issue: SPR-14937
2016-11-28 17:00:22 -05:00
Rossen Stoyanchev 122334c37a RxNettyWebSocketSession creates PONG frame correctly 2016-11-28 16:48:31 -05:00
Sebastien Deleuze 2e994f7dc3 Add RedirectView to Spring Web Reactive
Main differences with the Spring MVC original implementation:
 - Default redirect HTTP code is 303 See Other since we can assume
   all HTTP clients support HTTP 1.1 in 2016
 - No more http10Compatible property, use statusCode instead
 - By default the redirect is relative to the context path
 - A builder allow to set various properties if needed
 - In UrlBasedViewResolver, a Function<String, RedirectView>
   redirectViewProvider property allows to customize RedirectView
   instances in a flexible way

Issue: SPR-14534
2016-11-28 19:23:42 +01:00
Rossen Stoyanchev 25b95efad9 Shared ReactiveAdapterRegistry in web reactive config 2016-11-28 12:54:48 -05:00
Rossen Stoyanchev 5651c2180e Further refactoring of ReactiveAdapter/Registry
Simplify getAdapterFrom/To into a single getAdapter method that looks
for an exact match by type first and then isAssignableFrom.

Also expose shortcut methods in ReactiveAdapter to minimize the need
for access to the ReactiveTypeDescriptor.

Issue: SPR-14902
2016-11-28 12:43:22 -05:00
Rossen Stoyanchev adb80f4099 Merge pull request #1248 from rstoyanchev/14902-reactive-adapters 2016-11-27 21:44:51 -05:00
Rossen Stoyanchev ac86acde53 ReactiveAdapterRegistry detects Reactor
The ReactiveAdapterRegistry now detects the presence of Reactor. In
practice Reactor is required for the Spring Framework reactive support
and it is expected to be present.

The registry however is now capable of being neutral if Reactor is not
present on the classpath for example where other Spring projects may
not have the same assumptions about Reactor's presence.

Issue: SPR-14902
2016-11-27 21:41:07 -05:00
Rossen Stoyanchev 52096ab8b9 Refactor ReactiveAdapter hierarchy
Collapse ReactiveAdapter hierarchy into a single class that simply
delegates to functions for converting to/from a Publisher.

A private ReactorAdapter extension automaticlaly wraps adapted,  "raw"
Publisher's as Flux or Mono depending on the semantics of the target
reactive type.

Issue: SPR-14902
2016-11-27 21:41:07 -05:00
Rossen Stoyanchev e563326357 Polish ReactiveAdapterRegistry
Issue: SPR-14902
2016-11-27 21:41:07 -05:00
Rossen Stoyanchev 2e7d16df04 Improved reactive type descriptor support
ReactiveTypeDescriptor is now a top-level type with named constructors.
It also contains and provides a getter for the actual type.

Issue: SPR-14902
2016-11-27 21:41:07 -05:00
Juergen Hoeller 4f37fdb133 Latest dependency updates (Hibernate ORM 5.2.5, JOpt Simple 5.0.3, JRuby 9.1.6) 2016-11-25 13:31:01 +01:00
Sebastien Deleuze 0fcae5d2c5 Polishing
Issue: SPR-14952
2016-11-25 12:54:48 +01:00
Sebastien Deleuze 4660ef701e Disable temporarily Kotlin compiler to fix JDK 9 build 2016-11-25 11:38:09 +01:00
Sebastien Deleuze 8d26c738a0 Polishing
This commit polishes previous one by also accepting
generic types explicitly declared with a class that
extends DataBuffer allowing to write Flux<DefaultDataBuffer>
for example.

Issue: SPR-14952
2016-11-25 10:33:13 +01:00
Daniel Fernández a98be035a3 Make the signature of RHOM#writeAndFlush() more flexible
This modifies the signature of
ReactiveHttpOutputMessage#writeAndFlush(...) in order to
be able to use Flux<Flux<DataBuffer>> objects as arguments of
this method.

Issue: SPR-14952
2016-11-25 09:59:33 +01:00
Sebastien Deleuze a143b57d4b Polish Kotlin nullable support
This commit polishes Kotlin nullable support by reusing
MethodParameter#isOptional() instead of adding a new
MethodParameter#isNullable() method, adds
Kotlin tests and introduces Spring Web Reactive
support.

Issue: SPR-14165
2016-11-24 18:28:50 +01:00
Raman Gupta fada91e538 Treat Kotlin nullable as non-required
Where `isOptional` is used, also check for `isNullable` i.e.
values are not considered required if they are Kotlin nullables:
- spring-messaging: named value method arguments
- spring-web: named value method arguments
- spring-webmvc: request parts

This means that Kotlin client code no longer has to explicity specify
"required=false" for Kotlin nullables -- this information is inferred
automatically by the framework.

Issue: SPR-14165
2016-11-24 17:18:55 +01:00
Arjen Poutsma 735e288d46 Add DataBuffer BodyInserter/BodyExtractor
Added a BodyExtractor for Flux<DataBuffer>, and a BodyInserter for
Publisher<DataBuffer>

Issue: SPR-14918
2016-11-24 17:04:50 +01:00
Juergen Hoeller b22a59a0c4 Polishing 2016-11-24 15:32:06 +01:00
Juergen Hoeller 0b71e3640b Avoid defensive check for Servlet 3.1 setContentLengthLong method
Issue: SPR-14467
2016-11-24 15:30:10 +01:00
Juergen Hoeller 80931b211c Shared DefaultConversionService instance for simple fallback purposes
Issue: SPR-14948
2016-11-24 15:29:17 +01:00
Arjen Poutsma 34c6c9ffc2 Merge pull request #1243 from violetagg/write-issue
* SPR-14941:
  Fix NPE in ServletServerHttpResponse.ResponseBodyProcessor.write
2016-11-24 11:55:34 +01:00
Violeta Georgieva 6f222609c2 Fix NPE in ServletServerHttpResponse.ResponseBodyProcessor.write
Issue: SPR-14941
2016-11-24 11:53:28 +01:00
Juergen Hoeller 14eba5034d Consistent ExpressionException-style quoting of expression string and position
Issue: SPR-14942
2016-11-24 11:08:55 +01:00
Brian Clozel b10045dc0e Do not execute ResourceUrlEncodingFilter only once per request
In case the filter is also registered to the ERROR dispatcher, the
following happens:
* the filter is executed once for the regular execution
* the filter should be executed a second time when dispatched to error

Since the filter is a `OncePerRequestFilter`, the filter is only
executed once and won't be executed when handling the error.

This can lead to situations like spring-projects/spring-boot#7348

This commit makes this filter a simple `GenericFilterBean`.

Issue: SPR-14891
2016-11-24 09:56:33 +01:00
Rossen Stoyanchev 9bcc7c3b06 Remove ResourceServlet (deprecated in 4.3) 2016-11-23 21:24:07 -05:00
Rossen Stoyanchev d201a222b8 Avoid locking in WebSocket session "close" callback
When processing a "close" notification from the server make an effort
to cancel any outstanding heartbeat but avoid going as far as acquiring
the responseLock since the server itself may already hold a lock of its
own leading to a potential deadlock.

The heartbeat task is now also further protected with an isClosed()
check in case the heartbeat does not get cancelled in a concurrent
scenario.

Issue: SPR-14917
2016-11-23 20:49:24 -05:00