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