| | |
| | | @Autowired |
| | | private WebSecretServiceI secretService; |
| | | |
| | | // /** |
| | | // * corba的客户端 |
| | | // */ |
| | | // @Autowired(required = false) |
| | | // private JacorbClientMapProperties jacorbClientMapProperties; |
| | | |
| | | /** |
| | | * 执行初始化 |
| | |
| | | @Override |
| | | public void run(ApplicationArguments args) { |
| | | initCompatibility(); |
| | | initCorbaFromConf(); |
| | | initSysadmin(); |
| | | initClearSession(); |
| | | initSetting(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 从平台的配置中获取conf的信息 |
| | | */ |
| | | public void initCorbaFromConf(){ |
| | | File file = null; |
| | | try { |
| | | file = ResourceUtils.getFile("classpath:properties/corba.properties"); |
| | | } catch (FileNotFoundException e) { |
| | | try { |
| | | file = ResourceUtils.getFile("classpath:corba.properties"); |
| | | } catch (FileNotFoundException fileNotFoundException) { |
| | | logger.info("这个环境里没有存放平台的corba配置文件",fileNotFoundException); |
| | | } |
| | | } |
| | | try { |
| | | if (file.exists()) { |
| | | Properties properties = new Properties(); |
| | | properties.load(new FileInputStream(file)); |
| | | String url = properties.getProperty("NameService"); |
| | | String name = properties.getProperty("InstanceIdentity"); |
| | | // if (StringUtils.isNotBlank(url)) { |
| | | // jacorbClientMapProperties.setUrl(url); |
| | | // } |
| | | // if (StringUtils.isNotBlank(name)) { |
| | | // jacorbClientMapProperties.setInstanceIdentity(name); |
| | | // } |
| | | } |
| | | }catch (IOException e) { |
| | | logger.error("读取平台的corb配置文件出现了错误",e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化用户 |
| | | */ |
| | | public void initSysadmin(){ |
| | |
| | | public void initSetting() { |
| | | System.out.println("----初始化用于查询配置的用户----"); |
| | | ClientContextVariable.setClientLanuchMode(LaunchModeEnum.WebApp); |
| | | // InvocationUtility.registerIInvocationContext(contextInfoFetcher); |
| | | // JacorbClientRequestInterceptor.sessionContext = contextInfoFetcher; |
| | | System.out.println("----初始化用于查询配置的用户完成----"); |
| | | System.out.println("----开始扫描有VciConfigModule注解的类----"); |
| | | String[] namesForAnnotation = ApplicationContextProvider.getApplicationContext().getBeanNamesForAnnotation(VciConfigModule.class); |