啓動時候的醜事



package ws.apps;

import ws.apps.security.utils.Config;
import ws.framework.integration.quartz.SmartQuartzCronJobFactory;
import ws.framework.ioc.Ioc;
import ws.framework.ioc.impl.SmartIoc;
import ws.framework.ioc.loader.combo.ComboIocLoader;
import ws.framework.log.Log;
import ws.framework.log.Logs;
import ws.framework.mvc.SmartConfig;
import ws.framework.mvc.Setup;


/**
 * @author @hhl
 */
public class ApplicationSetup implements Setup {
    protected final static Log log = Logs.get();
   
 @Override
 public void init(SmartConfig config) {
              try {
                ComboIocLoader loader=new ComboIocLoader(new String[]{"*json", "ws/framework/mvc/view", "/ws", "/ioc", "*anno", "ws.apps","*ws.framework.integration.quartz.QuartzIocLoader"});
                Ioc si=new SmartIoc(loader);
                config.getServletContext().setAttribute("ws.pass", true);
                config.getServletContext().setAttribute("DEFINEIOC", si);
                si.get(SmartQuartzCronJobFactory.class);
         Config.loadProper();
  } catch (Exception ex) {
   log.error("ApplicationSetup初始化失敗", ex);
  }
       
 }

 @Override
 public void destroy(SmartConfig config) {

 }
       
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章