remove error prone InjectionContextRestartStrategy

This commit is contained in:
Sebastian Sdorra
2020-03-25 08:38:13 +01:00
parent 68fc3b0643
commit 4ad01c210f
10 changed files with 41 additions and 691 deletions

View File

@@ -21,10 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.lifecycle.classloading;
import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.lifecycle.LifeCycle;
@@ -42,16 +41,8 @@ public abstract class ClassLoaderLifeCycle implements LifeCycle {
private static final Logger LOG = LoggerFactory.getLogger(ClassLoaderLifeCycle.class);
@VisibleForTesting
static final String PROPERTY = "sonia.scm.lifecycle.classloading";
public static ClassLoaderLifeCycle create() {
ClassLoader webappClassLoader = Thread.currentThread().getContextClassLoader();
String implementation = System.getProperty(PROPERTY);
if (ClassLoaderLifeCycleWithLeakPrevention.NAME.equalsIgnoreCase(implementation)) {
LOG.info("create new ClassLoaderLifeCycle with leak prevention");
return new ClassLoaderLifeCycleWithLeakPrevention(webappClassLoader);
}
LOG.info("create new simple ClassLoaderLifeCycle");
return new SimpleClassLoaderLifeCycle(webappClassLoader);
}