mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
move Resteasy cleanup into the ResteasyAllInOneServletDispatcher
This commit is contained in:
@@ -15,6 +15,7 @@ import javax.inject.Singleton;
|
|||||||
import javax.servlet.ServletConfig;
|
import javax.servlet.ServletConfig;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
import javax.ws.rs.ext.RuntimeDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resteasy initialization and dispatching. This servlet combines the initialization of
|
* Resteasy initialization and dispatching. This servlet combines the initialization of
|
||||||
@@ -66,5 +67,10 @@ public class ResteasyAllInOneServletDispatcher extends HttpServletDispatcher {
|
|||||||
LOG.info("destroy resteasy");
|
LOG.info("destroy resteasy");
|
||||||
super.destroy();
|
super.destroy();
|
||||||
deployment.stop();
|
deployment.stop();
|
||||||
|
|
||||||
|
// ensure everything gets cleared, to avoid classloader leaks
|
||||||
|
ResteasyProviderFactory.clearInstanceIfEqual(ResteasyProviderFactory.getInstance());
|
||||||
|
ResteasyProviderFactory.clearContextData();
|
||||||
|
RuntimeDelegate.setInstance(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ final class ServletContextCleaner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ResteasyProviderFactory.clearInstanceIfEqual(ResteasyProviderFactory.getInstance());
|
|
||||||
ResteasyProviderFactory.clearContextData();
|
|
||||||
RuntimeDelegate.setInstance(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean shouldRemove(String name) {
|
private static boolean shouldRemove(String name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user