Commit d2b3b491 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1326: Made compatible with HttpBind API changes.

parent a0049776
......@@ -44,6 +44,13 @@
Openfire WebSocket Plugin Changelog
</h1>
<p><b>1.2.0</b> -- May 8, 2017</p>
<ul>
<li>[<a href='https://igniterealtime.org/issues/browse/OF-1326'></a>] - Made compatible with new HttpBind API in Openfire 4.2.0</li>
<li>Minimum server requirement: 4.2.0 Alpha</li>
</ul>
<p><b>1.1.4</b> -- March 3, 2016</p>
<ul>
......
......@@ -8,8 +8,8 @@
<name>Openfire WebSocket</name>
<description>Provides WebSocket support for Openfire.</description>
<author>Tom Evans</author>
<version>1.1.4</version>
<date>03/03/2016</date>
<version>1.2.0</version>
<date>05/08/2017</date>
<url>https://tools.ietf.org/html/rfc7395</url>
<minServerVersion>4.1.0 Alpha</minServerVersion>
<minServerVersion>4.2.0 Alpha</minServerVersion>
</plugin>
\ No newline at end of file
......@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
*/
public class WebSocketPlugin extends WebSocketServlet implements Plugin {
private static final long serialVersionUID = 7281841492829464603L;
private static final long serialVersionUID = 7281841492829464604L;
private static final Logger Log = LoggerFactory.getLogger(WebSocketPlugin.class);
private ServletContextHandler contextHandler;
......@@ -63,11 +63,12 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin {
Log.info(String.format("Initializing websocket plugin"));
try {
ContextHandlerCollection contexts = HttpBindManager.getInstance().getContexts();
contextHandler = new ServletContextHandler(contexts, "/ws", ServletContextHandler.SESSIONS);
contextHandler = new ServletContextHandler(null, "/ws", ServletContextHandler.SESSIONS);
contextHandler.addServlet(new ServletHolder(this), "/*");
} catch (Exception e) {
HttpBindManager.getInstance().addJettyHandler( contextHandler );
} catch (Exception e) {
Log.error("Failed to start websocket plugin", e);
}
} else {
......@@ -88,8 +89,7 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin {
}
}
}
ContextHandlerCollection contexts = HttpBindManager.getInstance().getContexts();
contexts.removeHandler(contextHandler);
HttpBindManager.getInstance().removeJettyHandler( contextHandler );
contextHandler = null;
pluginClassLoader = null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment