Commit Graph

869 Commits

Author SHA1 Message Date
Rossen Stoyanchev
ad41f095a1 Refactor STOMP and PubSub header message support 2013-06-11 17:07:48 -04:00
Rossen Stoyanchev
e7dde941b7 Update STOMP MESSAGE frames with messageId 2013-06-11 10:49:31 -04:00
Rossen Stoyanchev
d26b9d60e5 Refactor approach to working with STOMP headers 2013-06-11 01:52:32 -04:00
Rossen Stoyanchev
547167e8b4 Remove remaining Reactor event wrapping 2013-06-10 13:59:19 -04:00
Rossen Stoyanchev
de899820c9 Add Message, MessageChannel and refactor stomp support 2013-06-09 19:36:46 -04:00
Rossen Stoyanchev
8913283ce0 Add AnnotationStompService 2013-06-03 19:35:40 -04:00
Rossen Stoyanchev
b194d4d6a0 Add AbstractStompService 2013-05-30 15:29:46 -04:00
Rossen Stoyanchev
4de40fad8e Refactor STOMP package and class names 2013-05-30 15:29:20 -04:00
Rossen Stoyanchev
2b5acbda99 Add handling for remaining STOMP server commands 2013-05-30 15:28:42 -04:00
Rossen Stoyanchev
69ef364ef9 Introduce messaging package
org.springframework.web.stomp is now
org.springframework.web.messaging.stomp

Also classes in the ~.stomp.server and ~.stomp.adapter packages have
been renamed.
2013-05-30 15:28:42 -04:00
Rossen Stoyanchev
c67b694339 Add STOMP service that relays messages to STOMP broker 2013-05-30 15:28:42 -04:00
Rossen Stoyanchev
3eac62925b Add basic stomp error handling 2013-05-30 15:28:42 -04:00
Rossen Stoyanchev
730d456e84 Add early STOMP/reactor support 2013-05-30 15:28:42 -04:00
Rossen Stoyanchev
87a9602f65 Fix bug in WebSocketClient implementations 2013-05-16 19:12:27 -04:00
Rossen Stoyanchev
fb4e34fce4 Add partial WebSocketMessage support 2013-05-16 12:17:40 -04:00
Rossen Stoyanchev
81bce424cb Fix bug with deriving SockJS path 2013-05-15 21:31:51 -04:00
Rossen Stoyanchev
6825aaf41f Add Javadoc 2013-05-14 16:41:47 -04:00
Rossen Stoyanchev
278a5924cb Remove isLast flag from WebSocketMessage 2013-05-14 14:32:25 -04:00
Rossen Stoyanchev
05084d504b Add spring-websocket module tests 2013-05-14 13:59:15 -04:00
Rob Winch
9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Juergen Hoeller
2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Rossen Stoyanchev
37c6a94905 Update deps for spring-websocket 2013-05-06 16:42:42 -04:00
Rossen Stoyanchev
d89b18613f Polish (minor) 2013-05-06 14:33:00 -04:00
Rossen Stoyanchev
7845ebc428 Add SockJS path detection 2013-05-05 20:51:37 -04:00
Rossen Stoyanchev
97d225ba75 Refactor packages
org.springframework.websocket  -> org.springframework.web.socket
org.springframework.sockjs     -> org.springframework.web.socket.sockjs

Flatten .sockjs and .sockjs.server
2013-05-02 20:39:54 -04:00
Rossen Stoyanchev
4faf0d265f Rename classes 2013-05-02 20:25:09 -04:00
Rossen Stoyanchev
2a7935a913 Add WebSocketSession attributes + initialization
In addition to adding the attributes, there is now mechanism for
initializing WebSocketSession instances from attributes of the
handshake request.
2013-05-02 13:47:18 -04:00
Rossen Stoyanchev
166ca7a5a3 Update exception handling
Allow WebSocketHandler methods to raise an exception.

By default we install ExceptionWebSocketHandlerDecorator, which logs
unhandled exceptions and closes the session. That decorator can be
extended or replaced.

Any exceptions that remain unhandled still (i.e. no exception handling
decorator), are caught in the lowest level before propagating to the
WebSocket engine or a SockJS transport handler and handled the same
way. That means default behavior is guaranteed but also fully
customizable.
2013-05-01 16:04:58 -04:00
Rossen Stoyanchev
9ca4672300 Fix handshake handling issue 2013-05-01 14:18:25 -04:00
Rossen Stoyanchev
46bcffcf30 Add JettyWebSocketClient
Also split out JSR-356 related configuration and load it conditionally.
2013-04-30 17:35:20 -04:00
Rossen Stoyanchev
f45ef75f95 Add WebSocketHandlerDecorator 2013-04-29 22:36:20 -04:00
Rossen Stoyanchev
ba87743087 Polish (minor) 2013-04-29 10:17:57 -04:00
Rossen Stoyanchev
f347988428 Remove parameterized type from WebSocketHandler 2013-04-27 05:56:46 -04:00
Rossen Stoyanchev
0c1b329949 Remove HandlerProvider 2013-04-26 21:59:04 -04:00
Rossen Stoyanchev
861ab900ae Switch to single message method for WebSocketHandler 2013-04-26 12:04:45 -04:00
Rossen Stoyanchev
5f22cf0532 Add WebSocketHandlerInvoker class 2013-04-25 23:12:21 -04:00
Phillip Webb
db2c2480db Javadocs and general formatting polish 2013-04-25 16:47:25 -07:00
Rossen Stoyanchev
9da2c21edb Consolidate WebSocketHandler interface and sub-interfaces 2013-04-25 19:01:49 -04:00
Rossen Stoyanchev
8200601ace Tighten up exception handling strategy
WebSocketHandler implementations:
- methods must deal with exceptions locally
- uncaught runtime exceptions are handled by ending the session
- transport errors (websocket engine) are passed into handleError

WebSocketSession methods may raise IOException

SockJS implementation of WebSocketHandler:
- delegate SockJS transport errors into handleError
- stop runtime exceptions from user WebSocketHandler and end session

SockJsServce and TransportHandlers:
- raise IOException or TransportErrorException

HandshakeHandler:
- raise IOException
2013-04-25 18:31:07 -04:00
Rossen Stoyanchev
34c95034d8 Fix minor issue and polish 2013-04-24 13:29:08 -04:00
Rossen Stoyanchev
36148b7cb1 Switch DefaultSockJsService to constructor DI
DefaultSockJsService now relies on constructors and requires a
TaskScheduler at a minimum. It no longer needs lifecycle methods.
2013-04-23 21:35:24 -04:00
Rossen Stoyanchev
c28ce0e2bd Ensure WebSocketHandlerEndpoint can connect only once
WebSocketHandlerEndpoint and SockJsWebSocketHandler are stateful
wrappers that are not intended to be used with one client connection.
2013-04-23 17:44:53 -04:00
Phillip Webb
db4de526d2 Minor polish and FIXMEs 2013-04-23 13:47:52 -07:00
Phillip Webb
ff2e9aa5bc Minor tweaks to WebSocketMessage
- payload is now required
- byte data is obtained and stored only once (allowing multiple calls)
- minor formatting polish
2013-04-23 13:47:52 -07:00
Phillip Webb
a14161f0ca JettyRequestUpgradeStrategy 2013-04-23 13:47:43 -07:00
Rossen Stoyanchev
3cd4909ba3 Minor fix 2013-04-23 11:56:57 -04:00
Rossen Stoyanchev
84089bf396 Add HandlerProvider interface
HandlerProvider is now an interface that can be used to plug in
WebSocket handlers with per-connection scope semantics. There are two
implementations, of the interface, one simple and a second that creates
handler instances through AutowireCapableBeanFactory.

HandlerProvider also provides a destroy method that is used to
apply a destroy callback whenever a client connection closes.
2013-04-23 11:48:10 -04:00
Rossen Stoyanchev
f9078c947f Add WebSocketMessage and WebSocketHandler sub-interfcs
There is now a WebSocketMessage type with TextMessage and BinaryMessage
sub-types. WebSocketHandler is also sub-divided into TextMessageHandler
and BinaryMessageHandler, so that applications can choose to handle
text, binary, or both.

Also in this commit, the SockJsHandler and SockJsSession interfaces
have been removed. SockJsService now accepts WebSocketHandler.
2013-04-22 17:59:19 -04:00
Rossen Stoyanchev
2046629945 Add WebSocketClient and WebSocketConnectionManager
This change adds a WebSocketClient abstraction and enables the use of
WebSocketHandler on the client side.
2013-04-21 10:04:44 -04:00
Rossen Stoyanchev
ab5d60d343 Improve APIs for WebSocket and SockJS messages 2013-04-18 22:04:18 -04:00