super.contextInitialized(event);
StorageService.ctx = WebApplicationContextUtils
.getRequiredWebApplicationContext(event.getServletContext());
if(StorageService.ctx.containsBean("privilegeManagementService")){
PrivilegeManagementService priv = (PrivilegeManagementService)StorageService.ctx.getBean("privilegeManagementService");
priv.setInterceptUrls();
}
// CacheUtility.init();
} catch (Exception e) {
e.printStackTrace();
}
ExcelUtility.initTemplates();
// DirectoryWatcher directoryWatcher = (DirectoryWatcher)StorageService.ctx.getBean("directoryWatcher");
// if(directoryWatcher!=null){
// directoryWatcher.start();
// }
if(StorageService.ctx.containsBean("maintainMeasurePoints4WinccService")){
MaintainMeasurePoints4WinccService winccMeasurePointsService = (MaintainMeasurePoints4WinccService)StorageService
.ctx.getBean("maintainMeasurePoints4WinccService");
if(isSystemProperty("REFRESH_WINCC_MEASURE_WHEN_START")){
winccMeasurePointsService.maintainMeasurePointsAndSaveLog();
}
if(isSystemProperty("REFRESH_INDEX_WHEN_START"))
{
winccMeasurePointsService.maintainIndex4WinccOnStart();
}
}
// LuceneSupport.optimize();
// System.out.println(WebVariable.appPath+WebVariable.indexPath);
if(StorageService.ctx.containsBean("privilegeManagementService")){
PrivilegeManagementService privilegeManagementService = (PrivilegeManagementService)StorageService.ctx.getBean("privilegeManagementService");
privilegeManagementService.addRootUserAndRole();
}
// if(StorageService.ctx.containsBean("equipmentManagementService")){
// EquipmentManagementService equipmentManagementService = (EquipmentManagementService)StorageService.ctx.getBean("equipmentManagementService");
// equipmentManagementService.addDefaultDepAlgorithm();