From 8b455f5da7d3bdcb13f3d483136a064891e95f38 Mon Sep 17 00:00:00 2001 From: jfarcand Date: Mon, 2 Apr 2012 15:26:46 -0400 Subject: [PATCH] Fix for #260 [jersey][0.9.0.RC2] The WebSocketProtocol.configure() method is never call if custom WebSocketProtocol is assigned in the web.xml --- .../org/atmosphere/cpr/AtmosphereFramework.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereFramework.java b/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereFramework.java index e22c6aa1c3c..57cb0440250 100644 --- a/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereFramework.java +++ b/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereFramework.java @@ -791,14 +791,15 @@ public void destroy() { } protected void initWebSocketProtocol() { - if (webSocketProtocol != null) return; - try { - webSocketProtocol = (WebSocketProtocol) AtmosphereFramework.class.getClassLoader() - .loadClass(webSocketProtocolClassName).newInstance(); - logger.info("Installed WebSocketProtocol {} ", webSocketProtocolClassName ); - } catch (Exception ex) { - logger.error("Cannot load the WebSocketProtocol {}", getWebSocketProtocolClassName(), ex); - webSocketProtocol = new SimpleHttpProtocol(); + if (webSocketProtocol == null) { + try { + webSocketProtocol = (WebSocketProtocol) AtmosphereFramework.class.getClassLoader() + .loadClass(webSocketProtocolClassName).newInstance(); + logger.info("Installed WebSocketProtocol {} ", webSocketProtocolClassName); + } catch (Exception ex) { + logger.error("Cannot load the WebSocketProtocol {}", getWebSocketProtocolClassName(), ex); + webSocketProtocol = new SimpleHttpProtocol(); + } } webSocketProtocol.configure(config); }