Skip to content

Commit

Permalink
Fix for #260 [jersey][0.9.0.RC2] The WebSocketProtocol.configure() me…
Browse files Browse the repository at this point in the history
…thod is never call if custom WebSocketProtocol is assigned in the web.xml
  • Loading branch information
jfarcand committed Apr 2, 2012
1 parent fee0957 commit 8b455f5
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8b455f5

Please sign in to comment.