Пример #1
0
  /**
   * Schedule a regular triggerSweep
   *
   * @param connectionPool identifies the pool
   */
  protected static void register(ConnectionPool connectionPool) {
    String alias = connectionPool.getDefinition().getAlias();
    LOG.debug("Registering '" + alias + "' house keeper");
    HouseKeeper houseKeeper = new HouseKeeper(connectionPool);
    synchronized (LOCK) {
      houseKeepers.put(alias, houseKeeper);
      houseKeeperList.add(houseKeeper);

      if (houseKeeperThreads.size() == 0) {
        HouseKeeperThread hkt = new HouseKeeperThread("HouseKeeper");
        LOG.debug("Starting a house keeper thread");
        hkt.start();
        houseKeeperThreads.add(hkt);
      }
    }
  }