@ -58,28 +60,35 @@ public abstract class AbstractWebSocketSesssion<T> implements DelegatingWebSocke
@@ -58,28 +60,35 @@ public abstract class AbstractWebSocketSesssion<T> implements DelegatingWebSocke
returnthis.handshakeAttributes;
}
/**
*@returntheWebSocketsessiontodelegateto
*/
publicTgetDelegateSession(){
returnthis.delegateSession;
@Override
publicTgetNativeSession(){
returnthis.nativeSession;
}
@SuppressWarnings("unchecked")
@Override
publicvoidafterSessionInitialized(Tsession){
public<R>RgetNativeSession(Class<R>requiredType){
if(requiredType!=null){
if(requiredType.isInstance(this.nativeSession)){
return(R)this.nativeSession;
}
}
returnnull;
}
publicvoidinitializeNativeSession(Tsession){
Assert.notNull(session,"session must not be null");
Assert.isTrue(isOpen(),"Cannot send message after connection closed.");
if(logger.isTraceEnabled()){
@ -109,7 +118,7 @@ public abstract class AbstractWebSocketSesssion<T> implements DelegatingWebSocke
@@ -109,7 +118,7 @@ public abstract class AbstractWebSocketSesssion<T> implements DelegatingWebSocke
@ -54,7 +54,7 @@ public class JettyWebSocketHandlerAdapter implements WebSocketListener {
@@ -54,7 +54,7 @@ public class JettyWebSocketHandlerAdapter implements WebSocketListener {
@ -58,22 +58,22 @@ public class JettyWebSocketSession extends AbstractWebSocketSesssion<org.eclipse
@@ -58,22 +58,22 @@ public class JettyWebSocketSession extends AbstractWebSocketSesssion<org.eclipse
@ -86,40 +86,40 @@ public class JettyWebSocketSession extends AbstractWebSocketSesssion<org.eclipse
@@ -86,40 +86,40 @@ public class JettyWebSocketSession extends AbstractWebSocketSesssion<org.eclipse
@ -58,7 +58,7 @@ public class StandardWebSocketHandlerAdapter extends Endpoint {
@@ -58,7 +58,7 @@ public class StandardWebSocketHandlerAdapter extends Endpoint {
@ -68,14 +68,14 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@@ -68,14 +68,14 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@Override
publicStringgetId(){
checkDelegateSessionInitialized();
returngetDelegateSession().getId();
checkNativeSessionInitialized();
returngetNativeSession().getId();
}
@Override
publicURIgetUri(){
checkDelegateSessionInitialized();
returngetDelegateSession().getRequestURI();
checkNativeSessionInitialized();
returngetNativeSession().getRequestURI();
}
@Override
@ -85,8 +85,8 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@@ -85,8 +85,8 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@Override
publicPrincipalgetPrincipal(){
checkDelegateSessionInitialized();
returngetDelegateSession().getUserPrincipal();
checkNativeSessionInitialized();
returngetNativeSession().getUserPrincipal();
}
@Override
@ -101,29 +101,29 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@@ -101,29 +101,29 @@ public class StandardWebSocketSession extends AbstractWebSocketSesssion<javax.we
@ -52,10 +52,20 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
@@ -52,10 +52,20 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
Assert.notNull(webSocketContainer,"webSocketContainer must not be null");
this.webSocketContainer=webSocketContainer;
@ -63,9 +73,9 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
@@ -63,9 +73,9 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
@ -51,12 +52,22 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma
@@ -51,12 +52,22 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma
@ -55,10 +56,19 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy {
@@ -55,10 +56,19 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy {
@ -96,7 +102,7 @@ public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrateg
@@ -96,7 +102,7 @@ public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrateg
@ -425,6 +425,11 @@ public class DefaultSockJsService extends AbstractSockJsService {
@@ -425,6 +425,11 @@ public class DefaultSockJsService extends AbstractSockJsService {
+" Either add Jackson 2 or Jackson 1.x to the classpath, or configure a SockJsMessageCode");
@ -69,7 +69,7 @@ public class SockJsWebSocketHandler extends TextWebSocketHandlerAdapter {
@@ -69,7 +69,7 @@ public class SockJsWebSocketHandler extends TextWebSocketHandlerAdapter {
@ -93,9 +93,24 @@ public class WebSocketServerSockJsSession extends AbstractSockJsSession
@@ -93,9 +93,24 @@ public class WebSocketServerSockJsSession extends AbstractSockJsSession
Assert.state(this.wsSession!=null,"WebSocketSession not yet initialized");
@ -34,6 +34,8 @@ public class StubSockJsServiceConfig implements SockJsServiceConfig {
@@ -34,6 +34,8 @@ public class StubSockJsServiceConfig implements SockJsServiceConfig {
@ -71,4 +73,12 @@ public class StubSockJsServiceConfig implements SockJsServiceConfig {
@@ -71,4 +73,12 @@ public class StubSockJsServiceConfig implements SockJsServiceConfig {
@ -62,7 +62,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@@ -62,7 +62,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@ -72,7 +72,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@@ -72,7 +72,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@ -111,7 +111,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@@ -111,7 +111,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@ -123,7 +123,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession
@@ -123,7 +123,7 @@ public class WebSocketServerSockJsSessionTests extends BaseAbstractSockJsSession