Search in sources :

Example 1 with ModularServiceMethodInterceptor

use of io.nuls.core.utils.spring.lite.core.ModularServiceMethodInterceptor in project nuls by nuls-io.

the class MicroKernelBootstrap method init.

@Override
public void init() {
    try {
        NulsContext.NULS_CONFIG = ConfigLoader.loadIni(NulsConstant.USER_CONFIG_FILE);
        NulsContext.MODULES_CONFIG = ConfigLoader.loadIni(NulsConstant.MODULES_CONFIG_FILE);
    } catch (IOException e) {
        Log.error("Client start failed", e);
        throw new NulsRuntimeException(ErrorCode.FAILED, "Client start failed");
    }
    // set system language
    try {
        NulsContext.DEFAULT_ENCODING = NulsContext.NULS_CONFIG.getCfgValue(NulsConstant.CFG_SYSTEM_SECTION, NulsConstant.CFG_SYSTEM_DEFAULT_ENCODING);
        String language = NulsContext.NULS_CONFIG.getCfgValue(NulsConstant.CFG_SYSTEM_SECTION, NulsConstant.CFG_SYSTEM_LANGUAGE);
        I18nUtils.setLanguage(language);
    } catch (NulsException e) {
        Log.error(e);
    }
    SpringLiteContext.init("io.nuls", new ModularServiceMethodInterceptor());
    try {
        VersionManager.start();
    } catch (NulsException e) {
        Log.error(e);
    }
}
Also used : ModularServiceMethodInterceptor(io.nuls.core.utils.spring.lite.core.ModularServiceMethodInterceptor) NulsException(io.nuls.core.exception.NulsException) NulsRuntimeException(io.nuls.core.exception.NulsRuntimeException) IOException(java.io.IOException)

Aggregations

NulsException (io.nuls.core.exception.NulsException)1 NulsRuntimeException (io.nuls.core.exception.NulsRuntimeException)1 ModularServiceMethodInterceptor (io.nuls.core.utils.spring.lite.core.ModularServiceMethodInterceptor)1 IOException (java.io.IOException)1