@Override public synchronized void poolParametersChanged(ConnectionPoolEvent evt) { synchronized(pool) { this.minPool = pool.getMinPool(); this.maxPool = pool.getMaxPool(); this.maxSize = pool.getMaxSize(); this.idleTimeout = (int)pool.getIdleTimeout(); } }
/** * Sets the minimum number of pooled connections in the underlying {@link ConnectionPool}. * @param minPool minimum number of pooled connections */ public synchronized void setMinPool(int minPool) { this.minPool = minPool; if (pool != null) pool.setParameters(this.minPool, pool.getMaxPool(), pool.getMaxSize(), pool.getIdleTimeout()); }
/** * Sets the maximum number of pooled connections in the underlying {@link ConnectionPool}. * @param maxPool maximum number of pooled connections */ public synchronized void setMaxPool(int maxPool) { this.maxPool = maxPool; if (pool != null) pool.setParameters(pool.getMinPool(), this.maxPool, pool.getMaxSize(), pool.getIdleTimeout()); }
/** * Sets the idle timeout (seconds) for connections in the underlying {@link ConnectionPool}. * @param idleTimeout idle timeout (seconds) */ public synchronized void setIdleTimeout(int idleTimeout) { this.idleTimeout = idleTimeout; if (pool != null) pool.setParameters(pool.getMinPool(), pool.getMaxPool(), pool.getMaxSize(), this.idleTimeout * 1000L); }
synchronized(pool) info = "minpool=" + pool.getMinPool() + ",maxpool=" + pool.getMaxPool() + ",maxsize=" + pool.getMaxSize() + ",idleTimeout="; info += pool.getIdleTimeout() == 0 ? "none" : pool.getIdleTimeout();