• Jeecg 容器初始化监听器


    文件位置:

    F:jeecg-bpm-3.8jeecg-bpm-3.8-masterjeecg-bpm-3.8srcmainjavaorgjeecgframeworkwebsystemlistenerInitListener.java

     1 package org.jeecgframework.web.system.listener;
     2 
     3 import javax.servlet.ServletContextEvent;
     4 
     5 import org.apache.commons.lang.CommonRandomUtil;
     6 import org.apache.commons.lang.StringUtil;
     7 import org.jeecgframework.web.system.service.DynamicDataSourceServiceI;
     8 import org.jeecgframework.web.system.service.MutiLangServiceI;
     9 import org.jeecgframework.web.system.service.SystemService;
    10 import org.springframework.web.context.WebApplicationContext;
    11 import org.springframework.web.context.support.WebApplicationContextUtils;
    12 
    13 
    14 /**
    15  * 系统初始化监听器,在系统启动时运行,进行一些初始化工作
    16  * @author laien
    17  *
    18  */
    19 public class InitListener  implements javax.servlet.ServletContextListener {
    20     
    21     public void contextDestroyed(ServletContextEvent arg0) {
    22         
    23     }
    24 
    25     public void contextInitialized(ServletContextEvent event) {
    26         WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
    27         SystemService systemService = (SystemService) webApplicationContext.getBean("systemService");
    28 //        MenuInitService menuInitService = (MenuInitService) webApplicationContext.getBean("menuInitService");
    29         MutiLangServiceI mutiLangService = (MutiLangServiceI) webApplicationContext.getBean("mutiLangService");
    30         DynamicDataSourceServiceI dynamicDataSourceService = (DynamicDataSourceServiceI) webApplicationContext.getBean("dynamicDataSourceService");
    31         
    32         /**
    33          * 第一部分:对数据字典进行缓存
    34          */
    35         if(StringUtil.isNotEmpty(systemService)){
    36             systemService.initAllTypeGroups();
    37             systemService.initAllTSIcons();
    38         }
    39         
    40         
    41 //        /**
    42 //         * 第二部分:自动加载新增菜单和菜单操作权限
    43 //         * 说明:只会添加,不会删除(添加在代码层配置,但是在数据库层未配置的)
    44 //         */
    45 //        if("true".equals(ResourceUtil.getConfigByName("auto.scan.menu.flag").toLowerCase())){
    46 //            menuInitService.initMenu();
    47 //        }
    48         
    49         /**
    50          * 第三部分:加载多语言内容
    51          */
    52         if(StringUtil.isNotEmpty(systemService)){
    53             mutiLangService.initAllMutiLang();
    54         }
    55         
    56         /**
    57          * 第四部分:加载配置的数据源信息
    58          */
    59         if(StringUtil.isNotEmpty(systemService)){
    60             dynamicDataSourceService.initDynamicDataSource();
    61         }
    62     }
    63     
    64     /**
    65      * 自动加载新增菜单和菜单操作权限
    66      * 说明:只会添加,不会删除(添加在代码层配置,但是在数据库层未配置的)
    67      */
    68     private static boolean initMenuFlag = CommonRandomUtil.TRUE;    
    69 }
  • 相关阅读:
    Ninject Lazy Load问题
    log4net 极简配置
    log4net 使用指南,最常遇到的问题整理。。。
    【应聘】阿里巴巴Java面试题目
    【Unity3D】自动寻路(Nav Mesh Agent组件)
    【unity3D】鼠标控制camera的移动、放大(俯视浏览效果、LOL摄像机移动效果)
    【Unity3D】枪战游戏—弹孔设置
    【Unity3D】枪战游戏—发射子弹、射线检测
    【Unity3D】Unity自带组件—完成第一人称人物控制
    软件工程【第5章】- 需求工程与需求设计
  • 原文地址:https://www.cnblogs.com/Jeely/p/10985349.html
Copyright © 2020-2023  润新知