CloudStartupServlet.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:cloudstack 作者:
@Override
public void init(ServletConfig config) throws ServletException {
    LogUtils.initLog4j("log4j-cloud.xml");
    SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());

    // wait when condition is ready for initialization
    _timer.scheduleAtFixedRate(new TimerTask() {
        @Override
        public void run() {
            if (ComponentContext.getApplicationContext() != null) {
                _timer.cancel();

                TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
                try {
                    ComponentContext.initComponentsLifeCycle();
                } finally {
                    txn.close();
                }
            }
        }
    }, 0, 1000);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号