Browse Source
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.pull/292/head
24 changed files with 277 additions and 121 deletions
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
/* |
||||
* Copyright 2002-2013 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.websocket; |
||||
|
||||
/** |
||||
* A "marker" interface for {@link BinaryMessageHandler} types that wish to handle partial |
||||
* messages. |
||||
* |
||||
* @author Rossen Stoyanchev |
||||
* @since 4.0 |
||||
*/ |
||||
public interface PartialMessageHandler { |
||||
|
||||
} |
||||
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
/* |
||||
* Copyright 2002-2013 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.websocket.server; |
||||
|
||||
import org.springframework.core.NestedRuntimeException; |
||||
|
||||
|
||||
/** |
||||
* Thrown when handshake processing failed to complete due to an internal, unrecoverable |
||||
* error. This implies a server error (HTTP status code 500) as opposed to a failure in |
||||
* the handshake negotiation. |
||||
* |
||||
* <p> |
||||
* By contrast, when handshake negotiation fails, the response status code will be 200 and |
||||
* the response headers and body will have been updated to reflect the cause for the |
||||
* failure. A {@link HandshakeHandler} implementation will have protected methods to |
||||
* customize updates to the response in those cases. |
||||
* |
||||
* @author Rossen Stoyanchev |
||||
* @since 4.0 |
||||
*/ |
||||
@SuppressWarnings("serial") |
||||
public class HandshakeFailureException extends NestedRuntimeException { |
||||
|
||||
|
||||
public HandshakeFailureException(String msg, Throwable cause) { |
||||
super(msg, cause); |
||||
} |
||||
|
||||
public HandshakeFailureException(String msg) { |
||||
super(msg); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue