mirror of
https://gitee.com/nutz/nutzboot.git
synced 2024-12-02 11:48:09 +08:00
fix: wkcache在特定场景下不生效的bug
This commit is contained in:
parent
c78ad24876
commit
9bb4002d16
@ -90,6 +90,8 @@ public class NbApp extends Thread {
|
|||||||
protected Object lock = new Object();
|
protected Object lock = new Object();
|
||||||
|
|
||||||
protected NbAppEventListener listener = new NbAppEventListener() {};
|
protected NbAppEventListener listener = new NbAppEventListener() {};
|
||||||
|
|
||||||
|
protected boolean started;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个NbApp,把调用本构造方法的类作为mainClass
|
* 创建一个NbApp,把调用本构造方法的类作为mainClass
|
||||||
@ -209,6 +211,7 @@ public class NbApp extends Thread {
|
|||||||
|
|
||||||
sw.stop();
|
sw.stop();
|
||||||
log.infof("%s started : %sms", ctx.getConf().get("nutz.application.name", "NB"), sw.du());
|
log.infof("%s started : %sms", ctx.getConf().get("nutz.application.name", "NB"), sw.du());
|
||||||
|
started = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Throwable e) {
|
catch (Throwable e) {
|
||||||
@ -430,6 +433,20 @@ public class NbApp extends Thread {
|
|||||||
Object obj;
|
Object obj;
|
||||||
if (klass.getAnnotation(IocBean.class) == null) {
|
if (klass.getAnnotation(IocBean.class) == null) {
|
||||||
obj = Mirror.me(klass).born();
|
obj = Mirror.me(klass).born();
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
aware(obj);
|
||||||
|
if (obj instanceof IocLoaderProvider) {
|
||||||
|
IocLoader loader = ((IocLoaderProvider) obj).getIocLoader();
|
||||||
|
ctx.getComboIocLoader().addLoader(loader);
|
||||||
|
}
|
||||||
|
ctx.addStarter(obj);
|
||||||
|
}
|
||||||
|
for (Class<?> klass : starterClasses) {
|
||||||
|
Object obj;
|
||||||
|
if (klass.getAnnotation(IocBean.class) == null) {
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
obj = ctx.getIoc().get(klass);
|
obj = ctx.getIoc().get(klass);
|
||||||
}
|
}
|
||||||
@ -470,4 +487,8 @@ public class NbApp extends Thread {
|
|||||||
throw new NullPointerException("NULL NbAppEventListener!!!");
|
throw new NullPointerException("NULL NbAppEventListener!!!");
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isStarted() {
|
||||||
|
return started;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user