Search in sources :

Example 1 with ComboIocLoader

use of org.nutz.ioc.loader.combo.ComboIocLoader in project nutz by nutzam.

the class NutMvcListener method initIoc.

/**
     * 初始化Ioc容器,使用ComboIocLoader作为配置方式
     */
protected void initIoc() {
    String key = "nutz-" + IOCBY;
    String iocby = pp.get(key);
    if (Strings.isBlank(iocby)) {
        throw new RuntimeException(key + " not found nutz.ini or context-param !!");
    }
    String[] args = Strings.splitIgnoreBlank(iocby);
    for (int i = 0; i < args.length; i++) {
        args[i] = args[i].trim();
    }
    log.info("init Ioc by args=" + Arrays.toString(args));
    try {
        ioc = new NutIoc(new ComboIocLoader(args));
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
Also used : NutIoc(org.nutz.ioc.impl.NutIoc) ComboIocLoader(org.nutz.ioc.loader.combo.ComboIocLoader)

Aggregations

NutIoc (org.nutz.ioc.impl.NutIoc)1 ComboIocLoader (org.nutz.ioc.loader.combo.ComboIocLoader)1