我定义了类
public class CostOrderNotifyRunnable implements Runnable {
private static final Log log = Logs.get();
private Order order;
public CostOrderNotifyRunnable(Order order){
this.order = order;
}
@Override
public void run() {
Ioc ioc = new NutIoc(new JsonLoader("conf/core.js"));
Dao dao = ioc.get(com.okideaad.erp.OkErpDao.class, "dao");
try{
Ioc mvIoc = Mvcs.getIoc();
QQModule qqModule = mvIoc.get(QQModule.class);
//发现这里拿到的mvIoc为空
}
}catch (Throwable e) {
log.error(Utils.exceptionStackToString(e));
}
}
}
QQModule的类
@At("/module/QQ")
@IocBean(name="qqModule",fields={"dao", "config"},create = "init")
public class QQModule extends EntityService{
我发现在其他module里面是可以像下面的写法是可以拿到qqModule的,即mvIoc不为空。
Ioc mvIoc = Mvcs.getIoc();
QQModule qqModule = mvIoc.get(QQModule.class);
难道是多线程的类CostOrderNotifyRunnable要实现或者继承其他类吗?