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) {
}
}