public class MainSetup implements Setup{
private static final Logger log = Logger.getLogger(MainSetup.class);
@Override
public void destroy(NutConfig conf) {
// TODO Auto-generated method stub
}
@Override
public void init(NutConfig conf) {
log.info("MainSetup init ----------------------");
Ioc ioc = conf.getIoc();
Dao backendDao = ioc.get(Dao.class,"backendDao");//后台数据库连接
log.info("后台数据库连接 配置读取 backendDao:" + backendDao);
Dao publicServerDao = ioc.get(Dao.class,"daoPublic");//公共数据库
Daos.createTablesInPackage(backendDao, "com.backend", false);
ioc.get(NutQuartzCronJobFactory.class);
log.info("公共数据库 配置读取 publicServerDao:" + publicServerDao);
//计时任务处理
TaskTimerService taskTimer = ioc.get(TaskTimerService.class);
LoginServerManager.getInstance().init(backendDao,publicServerDao);//初始化LS长连接
PlatformServerManager.getInstance().init(backendDao,publicServerDao);//初始化平台信息
LogUtil.getInstance().init(backendDao);//初始化后台操作日志
ServerListManager.getInstance().init(backendDao);
PermitIpListManager.getInstance().init(backendDao);
DayBuyRechargeManager.getInstance().init(backendDao);
CyAnnouceManager.getInstance().initData(backendDao);
LogFieldManager.getInstance().load();
ItemManger.getInstance().init(backendDao);
MoneyManager.getInstance().init(backendDao);
RankManager.getInstance().init(backendDao);
TaskManager.getInstance().init(backendDao);
SoulManager.getInstance().init(backendDao);
CopyMapManager.getInstance().init(backendDao);
WingManager.getInstance().init(publicServerDao);
DailyActivityManager.getInstance().init(backendDao);
QueryUtil.getInstance().init(backendDao);
ChangeReasonManager.getInstance().init(backendDao);
ServerSwitchManager.getInstance().init(backendDao);
LanguageManger.getInstance().init(backendDao);
List<Integer> list = new ArrayList<>();
list.addAll(CyAnnouceManager.getInstance().getAnnouceList().keySet());
for( Integer nn : list){
taskTimer.StartAnnounceTask(1,nn);//启动计时线程
}
log.info("MainSetup success ----------------------");
}
这是我启动的时候需要加载的东西,现目前项目是先加载数据库里面的数据,后创建bean对象的注入的表.但是我希望先创建表,后再加载数据库的东西,但是不知道在哪里弄,还请老师指教一下