Пример #1
0
 public static synchronized TransPreference getInstanceNew() {
   if (_instance == null) {
     _instance = new TransPreference();
     TransSettingService settingService = (TransSettingService) ctx.getBean("settingService");
     List<TcsScSetting> settings = settingService.listSettings();
     for (TcsScSetting TcsScSetting : settings) {
       _instance.params.put(TcsScSetting.getName(), TcsScSetting.getValue());
     }
   }
   return _instance;
 }
Пример #2
0
 public static synchronized TransPreference getInstance() {
   if (_instance == null) {
     _instance = new TransPreference();
     TransSettingService settingService = (TransSettingService) ctx.getBean("settingService");
     List<TcsScSetting> settings = settingService.listSettings();
     for (TcsScSetting TcsScSetting : settings) {
       if (TcsScSetting.getName().equals("data_verify_server_url")) {
         _instance.setServerURL(TcsScSetting.getValue());
         continue;
       } else if (TcsScSetting.getName().equals("work_path")) {
         _instance.setWorkPath(TcsScSetting.getValue());
         continue;
       } else if (TcsScSetting.getName().equals("max_data_verify_num")) {
         try {
           _instance.setVeriNum(Integer.parseInt(TcsScSetting.getValue()));
         } catch (Exception e) {
           _instance.setVeriNum(15);
         }
         continue;
       }
     }
   }
   return _instance;
 }