OF-1147: Refactoring of Plugin Management

- Plugin Monitor moved to different class
- Methods that operate on plugin.xml files moved to utilility class
  (and made to work even when plugin is not yet loaded)
- Plugin monitoring now loads plugins more efficiently by:
-- Observing parent/child hierarchy (allowing for one-shot load)
-- allowing for concurrent plugin loading
- Dev plugins are now processed as if they were ordinary plugins
- Plugin canoncical naming is now used throughout the code (fixes
  case sensitivity bug)
parent cc3da295
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
<logger name="org.jivesoftware.openfire.container.PluginManager"> <logger name="org.jivesoftware.openfire.container.PluginManager">
<appender-ref ref="console"/> <appender-ref ref="console"/>
</logger> </logger>
<logger name="org.jivesoftware.openfire.container.PluginMonitor">
<appender-ref ref="console"/>
</logger>
<!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. --> <!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. -->
<logger name="org.eclipse.jetty"> <logger name="org.eclipse.jetty">
......
/*
* Copyright 2016 IgniteRealtime.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.openfire.container;
/**
* An enumeration for license agreement types.
*/
public enum License
{
/**
* Distributed using a commercial license.
*/
commercial,
/**
* Distributed using the GNU Public License (GPL).
*/
gpl,
/**
* Distributed using the Apache license.
*/
apache,
/**
* For internal use at an organization only and is not re-distributed.
*/
internal,
/**
* Distributed under another license agreement not covered by one of the other choices. The license agreement
* should be detailed in a Readme or License file that accompanies the code.
*/
other
}
...@@ -85,14 +85,7 @@ ...@@ -85,14 +85,7 @@
} }
if (csrf_check && deletePlugin != null) { if (csrf_check && deletePlugin != null) {
File pluginDir = pluginManager.getPluginDirectory(pluginManager.getPlugin(deletePlugin)); pluginManager.deletePlugin( deletePlugin );
File pluginJar = new File(pluginDir.getParent(), pluginDir.getName() + ".jar");
// Also try the .war extension.
if (!pluginJar.exists()) {
pluginJar = new File(pluginDir.getParent(), pluginDir.getName() + ".war");
}
pluginJar.delete();
pluginManager.unloadPlugin(pluginDir.getName());
// Log the event // Log the event
webManager.logEvent("deleted plugin "+deletePlugin, null); webManager.logEvent("deleted plugin "+deletePlugin, null);
response.sendRedirect("plugin-admin.jsp?deletesuccess=true"); response.sendRedirect("plugin-admin.jsp?deletesuccess=true");
......
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