Commit Graph

13795 Commits

Author SHA1 Message Date
Juergen Hoeller
d64d9ab370 Consistent ClassLoader propagation and ConcurrentHashMap setup for AspectJ pointcuts
Issue: SPR-15040
2016-12-22 17:00:04 +01:00
Rossen Stoyanchev
0d0d461903 Use WebSocketFrameAggregator for Reactor and RxNetty
WebSocket frames are now aggregated through a Netty decoder so that
we always receive fully assembled messages by default capped at 64K.

Issue: SPR-14527
2016-12-21 14:14:37 -05:00
Rossen Stoyanchev
00387c3bbd Re-enable Reactor WebSocket integration tests 2016-12-21 12:39:56 -05:00
Brian Clozel
54901ab865 Avoid explicit DecoratedObjectFactory setup in JettyRequestUpgradeStrategy
Align Jetty support on spring-websocket module.

Issue: SPR-14940
2016-12-21 17:27:27 +01:00
Sebastien Deleuze
7b183048b8 Introduce SSE support in WebClient
Issue: SPR-14539
2016-12-21 17:24:45 +01:00
Sebastien Deleuze
69b69442bc Add ServerSentEventHttpMessageReader
This HTTP message reader parse incoming Server-Sent
Events and turn them into Flux<String>, Flux<Pojo>
or Flux<ServerSentEvent>.

Issue: SPR-14539
2016-12-21 17:07:41 +01:00
Sebastien Deleuze
183b326f6d Add ServerSentEvent#toString() 2016-12-21 16:46:43 +01:00
Sebastien Deleuze
419d2b4e0a Polish ServerSentEventHttpMessageWriterTests 2016-12-21 16:46:43 +01:00
Sebastien Deleuze
a8d8273dc1 Fix a typo in ServerSentEventHttpMessageWriter Javadoc 2016-12-21 16:46:42 +01:00
Juergen Hoeller
b54aee27be Polishing 2016-12-21 14:42:43 +01:00
Juergen Hoeller
598122fe8a Avoid package cycle between http.server and web.util 2016-12-21 14:42:32 +01:00
Juergen Hoeller
98d306f558 Upgrade to RxJava 2.0.3 and XMLUnit 2.3 2016-12-21 14:41:25 +01:00
Juergen Hoeller
4125825cf3 Upgrade to Hibernate ORM 5.2.6 2016-12-21 09:59:43 +01:00
Juergen Hoeller
483abfe266 Avoid explicit DecoratedObjectFactory setup in JettyRequestUpgradeStrategy
Issue: SPR-14940
(cherry picked from commit 709d4ba)
2016-12-21 09:56:13 +01:00
Sebastien Deleuze
e07d110a67 Update to reactor-core 3.0.4.BUILD-SNAPSHOT 2016-12-21 08:40:19 +01:00
Stephane Maldini
804935a8eb try less log and increase timeout 2016-12-21 00:48:29 +00:00
Sebastien Deleuze
a1ae9ac1bd Add ServerHttpRequest.Builder#header(String, String)
This method allows to set or override easily a specific header value.
2016-12-20 23:54:22 +01:00
Sebastien Deleuze
712a63205c Add HttpHeaders#setAcceptLanguageAsLocale(Locale)
Issue: SPR-15024
2016-12-20 22:33:09 +01:00
Juergen Hoeller
82c1c859d9 Polishing
(cherry picked from commit 9cb4de8)
2016-12-20 21:17:48 +01:00
Juergen Hoeller
154ef8bf10 Polishing 2016-12-20 19:57:52 +01:00
Juergen Hoeller
9005481a49 Supplier registration support for annotated bean classes
Issue: SPR-14832
2016-12-20 19:57:44 +01:00
Rossen Stoyanchev
3b987c263c Sub-protocol negotiation for reactive WebSocket support
Issue: SPR-14527
2016-12-20 12:22:24 -05:00
Stephane Maldini
241d5f7a3b Sync reactor-netty client response update and uncomment in tests 2016-12-20 14:37:32 +00:00
Juergen Hoeller
97ea22cb4a Defensively catch any exception from match attempts (for compatibility with AspectJ 1.8.10)
Issue: SPR-15019
2016-12-20 12:17:51 +01:00
Juergen Hoeller
f6b2a21206 ConfigurationClassPostProcessor programmatically registers unified ImportAwareBeanPostProcessor
Issue: SPR-14931
2016-12-20 12:16:16 +01:00
Rossen Stoyanchev
30df137273 HandshakeWebSocketService detects upgrade strategies
Issue: SPR-14527
2016-12-19 18:30:14 -05:00
Rossen Stoyanchev
47e141675f Minor refactoring + polish reactive WebSocket support
Rename classes not specific to Tomcat:
TomcatWebSocketSession -> StandardWebSocketSession
TomcatWebSocketHandlerAdapter -> StandardWebSocketHandlerAdapter

WebSocketSessionSupport is renamed to AbstractWebSocketSession since it
actually is a WebSocketSession and pre-implements a number of methods.

ServerEndpointRegistration is now package private (mainly for use in
upgrade strategies) and renamed to DefaultServerEndpointConfig.
2016-12-19 18:16:36 -05:00
Rossen Stoyanchev
5fd600d2ad Fix failing test 2016-12-19 15:29:00 -05:00
Rossen Stoyanchev
1243556047 Add Reactor Netty WebSocketClient support
Issue: SPR-14527
2016-12-19 14:57:10 -05:00
Rossen Stoyanchev
14068d5274 Refactor reactive WebSocketClient contract
Switch from returning Mono<WebSocketSession> to take a WebSocketHandler
and return Mono<Void> for the entire session handling.

The WebSocketHandler callback delimits the stard and end of protocol
handling and forces the handler to operate within the scope of the
Reactor operators.

Give the full duplex nature of WebSockets, the symmetry between client
and server (each now using WebSocketHandler) also seems appropriate.

Issue: SPR-14527
2016-12-19 12:09:47 -05:00
Juergen Hoeller
9c55d22f78 MBeanExporter silently ignores null beans
Issue: SPR-15031
2016-12-19 16:02:59 +01:00
Sebastien Deleuze
e0c43c4fcb Disable also reactor-netty WebSocket integration tests 2016-12-19 10:48:44 +01:00
Sebastien Deleuze
7bde85ae55 Fix previous commit 2016-12-19 10:21:36 +01:00
Sebastien Deleuze
879b387954 Disable temporarily reactor-netty integration tests 2016-12-19 09:55:58 +01:00
Rossen Stoyanchev
558d7f3f3e Fix package cycle
HandshakeInfo has been promoted to the top-level socket package next to
WebSocketSession which exposes it.
2016-12-18 20:37:05 -05:00
Juergen Hoeller
7867e56494 Polishing 2016-12-19 02:00:28 +01:00
Juergen Hoeller
3ee6286eb5 Support for functional instance supplier callback at BeanDefinition level
Issue: SPR-14832
2016-12-18 21:05:45 +01:00
Juergen Hoeller
12aa14ddbc Support @Nullable annotations as indicators for optional injection points
Issue: SPR-15028
2016-12-18 21:04:08 +01:00
Rossen Stoyanchev
8be791c4ff Add reactive WebSocketClient and RxNetty implementation
Issue: SPR-14527
2016-12-18 10:49:52 -05:00
Rossen Stoyanchev
bcf6f6e75f Refactoring in reactive WebSocketSession and adapters
The WebSocketHander adapters are now neutral for client vs server-side
use with the adapters for RxNetty and Reactor Netty (server-side only)
completely removed.

A new HandshakeInfo carries information about the handshake including
URI, headers, and principal from the upgrade strategy, to the adapter,
and then to the session.

WebSocketSession exposes the HandshakeInfo as well reducing its overall
number of methods.
2016-12-18 10:49:52 -05:00
Rossen Stoyanchev
edcf04911f Refactoring in reactive WebSocketMessage
Move WebSocketMessage factory methods to the WebSocketSession which
has the bufferFactory() needed to create message payloads.

WebSocketMessage is left with one public constructor.

WebSocketMessage exposes convenience retain/releasePayload methods.
2016-12-18 10:49:47 -05:00
Rossen Stoyanchev
6cd92c69cf Refactoring in reactive WebSocketSession hierarchy
Expose bufferFactory() at the WebSocketSession level for creating
payloads like ReactiveHttpOutputMessage does.

Promote getId(), getUri(), and bufferFactory() to the base class
WebSocketSessionSupport.
2016-12-18 10:46:28 -05:00
Rossen Stoyanchev
140ff7ce8f Polish reactive WebSocket integration tests 2016-12-18 10:41:05 -05:00
Juergen Hoeller
4c005e6336 ResolvableType-based matching respects generic factory method return type
Includes consistent use of ResolvableType.resolve() wherever applicable.

Issue: SPR-15011
2016-12-17 23:10:48 +01:00
Juergen Hoeller
e9b4cac47f Latest dependency updates (EhCache 3.2, TestNG 6.10, SLF4J 1.7.22, RxJava 1.2.4, Kotlin 1.0.5-3) 2016-12-17 13:01:18 +01:00
Juergen Hoeller
9ba4b47bee Defensive processing of timeout callback and timeout result
Issue: SPR-14978
2016-12-17 12:57:18 +01:00
Rossen Stoyanchev
9376748c9c Apply getAcceptLanguageAsLocale and encodeUrl
Apply the new HttpHeaders#getAcceptLanguageAsLocale() in places where
it was hardcoded or defaulting.

Apply ServerHttpResponse.encodeUrl in RequestContext.

Issue: SPR-15024
2016-12-16 17:33:39 -05:00
Rossen Stoyanchev
bd8af55bc7 getAcceptLanguageAsLocale(s) returns most preferred Locale
An update on the last commit switching from:
List<Locale> getAcceptLanguageAsLocales() to
Locale getAcceptLanguageAsLocale()

This best supports the scenario for the most preferred Locale.
If there is a need to look at the prioritized list of languages it's
best to use Locale.filter with the LocaleRange's.

This is explained in the Javadoc for getAcceptLanguage().

Issue: SPR-15024
2016-12-16 17:15:43 -05:00
Rossen Stoyanchev
fa56361ad2 Add getAcceptLanguageAsLocales
The use of Locale.LanguageRange for the Accept-Language header makes
sense as it gives the most flexibility for a client to set a weighted
list and for a server to do filtering via Locale#filter.

This commit adds an additional convenience method that turns
the LangugeRange list to a list of Locale's also filtering out a
wildcard (i.e. "*"). A List<Locale> is the most basic way to access
prefered languages and needed when filtering is not required.

Issue: SPR-15024
2016-12-16 16:20:06 -05:00
Rossen Stoyanchev
c85d768b3c WebExchangeDataBinder uses the new "requestParams" 2016-12-16 16:20:06 -05:00