public void shutdown() { // System.out.println("JDBC POOL SHUTDOWN CALLED"); shuttingDown.set(true); while (connectionCloserThread.isAlive()) { try { Thread.sleep(1000L); } catch (InterruptedException e) { // Ignore this until the thread is down connectionCloserThread.interrupt(); } } synchronized (this) { Iterator<String> iter = poolMap.keySet().iterator(); while (iter.hasNext()) { String poolKey = iter.next(); ConnectionPool cp = poolMap.get(poolKey); cp.closePool(); } } }
public ConnectionPoolManager(int count, boolean debug) throws ManifoldCFException { this.debug = debug; poolMap = new HashMap<String, ConnectionPool>(count); connectionCloserThread = new ConnectionCloserThread(); connectionCloserThread.start(); }