All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.jvm.sandbox.module.mgr.OnJarUnLoadCompleted Maven / Gradle / Ivy

package com.alibaba.jvm.sandbox.module.mgr;

import ch.qos.logback.classic.LoggerContext;
import com.alibaba.jvm.sandbox.api.spi.ModuleJarUnLoadSpi;
import org.kohsuke.MetaInfServices;
import org.slf4j.LoggerFactory;

@MetaInfServices(ModuleJarUnLoadSpi.class)
public class OnJarUnLoadCompleted implements ModuleJarUnLoadSpi {

    @Override
    public void onJarUnLoadCompleted() {
        closeLogback();
    }

    // 关闭Logback日志框架
    private void closeLogback() {
        try {
            ((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
        } catch (Throwable cause) {
            cause.printStackTrace();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy