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

OF-1326: Made compatible with HttpBind API changes.

parent e4a4fdd5
...@@ -44,6 +44,13 @@ ...@@ -44,6 +44,13 @@
Openfire WebSocket Plugin Changelog Openfire WebSocket Plugin Changelog
</h1> </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> <p><b>1.1.4</b> -- March 3, 2016</p>
<ul> <ul>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<name>Openfire WebSocket</name> <name>Openfire WebSocket</name>
<description>Provides WebSocket support for Openfire.</description> <description>Provides WebSocket support for Openfire.</description>
<author>Tom Evans</author> <author>Tom Evans</author>
<version>1.1.4</version> <version>1.2.0</version>
<date>03/03/2016</date> <date>05/08/2017</date>
<url>https://tools.ietf.org/html/rfc7395</url> <url>https://tools.ietf.org/html/rfc7395</url>
<minServerVersion>4.1.0 Alpha</minServerVersion> <minServerVersion>4.2.0 Alpha</minServerVersion>
</plugin> </plugin>
\ No newline at end of file
...@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory; ...@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
*/ */
public class WebSocketPlugin extends WebSocketServlet implements Plugin { 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 static final Logger Log = LoggerFactory.getLogger(WebSocketPlugin.class);
private ServletContextHandler contextHandler; private ServletContextHandler contextHandler;
...@@ -63,11 +63,12 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin { ...@@ -63,11 +63,12 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin {
Log.info(String.format("Initializing websocket plugin")); Log.info(String.format("Initializing websocket plugin"));
try { try {
ContextHandlerCollection contexts = HttpBindManager.getInstance().getContexts(); contextHandler = new ServletContextHandler(null, "/ws", ServletContextHandler.SESSIONS);
contextHandler = new ServletContextHandler(contexts, "/ws", ServletContextHandler.SESSIONS);
contextHandler.addServlet(new ServletHolder(this), "/*"); contextHandler.addServlet(new ServletHolder(this), "/*");
} catch (Exception e) { HttpBindManager.getInstance().addJettyHandler( contextHandler );
} catch (Exception e) {
Log.error("Failed to start websocket plugin", e); Log.error("Failed to start websocket plugin", e);
} }
} else { } else {
...@@ -88,8 +89,7 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin { ...@@ -88,8 +89,7 @@ public class WebSocketPlugin extends WebSocketServlet implements Plugin {
} }
} }
} }
ContextHandlerCollection contexts = HttpBindManager.getInstance().getContexts(); HttpBindManager.getInstance().removeJettyHandler( contextHandler );
contexts.removeHandler(contextHandler);
contextHandler = null; contextHandler = null;
pluginClassLoader = 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