Allow configuring custom argument types

The WebSocket messaging namespace now exposes configuration options for
custom argument resolvers and return value handlers.

Issue: SPR-12217
This commit is contained in:
Rossen Stoyanchev
2014-09-19 16:47:39 -04:00
parent a9b2a12491
commit 237b50a9c8
10 changed files with 286 additions and 40 deletions

View File

@@ -0,0 +1,30 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:websocket="http://www.springframework.org/schema/websocket"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket.xsd">
<websocket:message-broker application-destination-prefix="/app" user-destination-prefix="/personal">
<websocket:stomp-endpoint path="/foo,/bar">
<websocket:handshake-handler ref="myHandler"/>
</websocket:stomp-endpoint>
<websocket:simple-broker prefix="/topic"/>
<websocket:argument-resolvers>
<bean class="org.springframework.web.socket.config.CustomArgumentResolver" />
<ref bean="myArgumentResolver" />
</websocket:argument-resolvers>
<websocket:return-value-handlers>
<bean class="org.springframework.web.socket.config.CustomReturnValueHandler" />
<ref bean="myReturnValueHandler" />
</websocket:return-value-handlers>
</websocket:message-broker>
<bean id="myHandler" class="org.springframework.web.socket.config.TestHandshakeHandler"/>
<bean id="myInterceptor" class="org.springframework.web.socket.config.TestChannelInterceptor"/>
<bean id="myArgumentResolver" class="org.springframework.web.socket.config.CustomArgumentResolver" />
<bean id="myReturnValueHandler" class="org.springframework.web.socket.config.CustomReturnValueHandler" />
</beans>