Commit 1724d44a authored by Matt Tucker's avatar Matt Tucker Committed by matt

Properly unload plugins.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1305 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8ed2e9dd
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.messenger.container;
......@@ -181,7 +172,8 @@ public class PluginManager {
pluginDirs.put(plugin, pluginDir);
classloaders.put(plugin, pluginLoader);
// Load any JSP's defined by the plugin.
File webXML = new File(pluginDir, "web" + File.separator + "WEB-INF" + File.separator + "web.xml");
File webXML = new File(pluginDir, "web" + File.separator + "WEB-INF" +
File.separator + "web.xml");
if (webXML.exists()) {
PluginServlet.registerServlets(this, plugin, webXML);
}
......@@ -236,8 +228,8 @@ public class PluginManager {
if (plugin == null) {
return;
}
File webXML = new File(pluginDirectory + File.separator + pluginName +
File.separator + "web" + File.separator + "web.xml");
File webXML = new File(pluginDirectory, "web" + File.separator + "WEB-INF" +
File.separator + "web.xml");
if (webXML.exists()) {
AdminConsole.removeModel(pluginName);
PluginServlet.unregisterServlets(webXML);
......
......@@ -171,7 +171,7 @@ public class PluginServlet extends HttpServlet {
}
// Find the name of the plugin directory given that the webXML file
// lives in plugins/[pluginName]/web/web.xml
String pluginName = webXML.getParentFile().getParentFile().getName();
String pluginName = webXML.getParentFile().getParentFile().getParentFile().getName();
try {
SAXReader saxReader = new SAXReader(false);
saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",
......
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