1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.yihu.platform.listener;
- import javax.servlet.ServletContextEvent;
- import javax.servlet.ServletContextListener;
- import com.coreframework.remoting.Server;
- import com.coreframework.util.PropUtils;
- import com.yihu.monitor.sdk.MonitorClient;
- import com.yihu.platform.cache.DBCache;
- import com.yihu.platform.utils.ConfigUtil;
- import com.yihu.platform.utils.Constant;
- import com.yihu.wsgw.api.AsyncBus;
- /**
- * 监听器 用于全局数据加载
- *
- */
- public class ContextLoaderListener implements ServletContextListener {
- /**
- * Default constructor.
- */
- public ContextLoaderListener() {
- // TODO Auto-generated constructor stub
- }
- /**
- * @see ServletContextListener#contextInitialized(ServletContextEvent)
- */
- public void contextInitialized(ServletContextEvent servletcontextevent) {
- // 初使化配置
- try {
- int port = ConfigUtil.getInstance().getPort();
- if (port != 0) {
- Server server = Server.getInstance(port);
- server.start();
- }
-
-
- DBCache.initCacheByDB() ;
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- /**
- * @see ServletContextListener#contextDestroyed(ServletContextEvent)
- */
- public void contextDestroyed(ServletContextEvent servletcontextevent) {
- // TODO Auto-generated method stub
- }
- }
|