Пример #1
0
  /**
   * Получаем сервис ErrorsLog
   *
   * @return сервис ErrorsLog
   */
  public static synchronized ErrorsLog getErrorsLog() {
    ApplicatonSettingsService aService = new ApplicatonSettingsService(getSessionFactory());
    String baseConnName = aService.getValue("error.dest");
    ErrorsLog errorLog = new ErrorsLog(baseConnName, getConnectionFactory());

    return errorLog;
  }
Пример #2
0
  /**
   * Получаем сервис статистики
   *
   * @return сервис статистики
   */
  public static synchronized StatsService getStatsService() {
    if (statsService == null) {
      ApplicatonSettingsService aService = new ApplicatonSettingsService(getSessionFactory());
      String baseConnName = aService.getValue("stats.dest");
      statsService = new StatsService(baseConnName);
    }

    return statsService;
  }
Пример #3
0
  /**
   * Возвращает пул потоков
   *
   * @return пул потоков
   * @throws InterruptedException
   */
  public static synchronized ThreadPool getThreadPool() throws InterruptedException {
    if (threadPool == null) {
      ApplicatonSettingsService aService = new ApplicatonSettingsService(sessionFactory);
      int count = Integer.parseInt(aService.getValue("tp.threads"));
      threadPool = new ThreadPool(count);
    }

    return threadPool;
  }