mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Remove function creep
This commit is contained in:
@@ -58,6 +58,8 @@ import sonia.scm.util.IOUtil;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletContextEvent;
|
import javax.servlet.ServletContextEvent;
|
||||||
|
import java.io.Closeable;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -183,6 +185,18 @@ public class ScmContextListener extends GuiceResteasyBootstrapServletContextList
|
|||||||
}
|
}
|
||||||
|
|
||||||
super.contextDestroyed(servletContextEvent);
|
super.contextDestroyed(servletContextEvent);
|
||||||
|
|
||||||
|
for (PluginWrapper plugin : getPlugins()) {
|
||||||
|
ClassLoader pcl = plugin.getClassLoader();
|
||||||
|
|
||||||
|
if (pcl instanceof Closeable) {
|
||||||
|
try {
|
||||||
|
((Closeable) pcl).close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
LOG.warn("could not close plugin classloader", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeCloseables() {
|
private void closeCloseables() {
|
||||||
@@ -205,6 +219,4 @@ public class ScmContextListener extends GuiceResteasyBootstrapServletContextList
|
|||||||
private void destroyServletContextListeners(ServletContextEvent event) {
|
private void destroyServletContextListeners(ServletContextEvent event) {
|
||||||
injector.getInstance(ServletContextListenerHolder.class).contextDestroyed(event);
|
injector.getInstance(ServletContextListenerHolder.class).contextDestroyed(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,20 +112,6 @@ public class BootstrapContextListener implements ServletContextListener {
|
|||||||
public void contextDestroyed(ServletContextEvent sce) {
|
public void contextDestroyed(ServletContextEvent sce) {
|
||||||
contextListener.contextDestroyed(sce);
|
contextListener.contextDestroyed(sce);
|
||||||
|
|
||||||
if (contextListener instanceof ScmContextListener) {
|
|
||||||
for (PluginWrapper plugin : ((ScmContextListener) contextListener).getPlugins()) {
|
|
||||||
ClassLoader pcl = plugin.getClassLoader();
|
|
||||||
|
|
||||||
if (pcl instanceof Closeable) {
|
|
||||||
try {
|
|
||||||
((Closeable) pcl).close();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
logger.warn("could not close plugin classloader", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
context = null;
|
context = null;
|
||||||
contextListener = null;
|
contextListener = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user