/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs. * @see #getTimeBetweenEvictionRunsMillis */ public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; startEvictor(_timeBetweenEvictionRunsMillis); }
/** * <p>Closes the pool. Once the pool is closed, {@link #borrowObject()} * will fail with IllegalStateException, but {@link #returnObject(Object)} and * {@link #invalidateObject(Object)} will continue to work, with returned objects * destroyed on return.</p> * * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> * * @throws Exception */ @Override public void close() throws Exception { super.close(); synchronized (this) { clear(); startEvictor(-1L); while(_allocationQueue.size() > 0) { Latch<T> l = _allocationQueue.removeFirst(); synchronized (l) { // notify the waiting thread l.notify(); } } } }
startEvictor(_timeBetweenEvictionRunsMillis);
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs. * @see #getTimeBetweenEvictionRunsMillis */ public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; startEvictor(_timeBetweenEvictionRunsMillis); }
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs. * @see #getTimeBetweenEvictionRunsMillis */ public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; startEvictor(_timeBetweenEvictionRunsMillis); }
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs. * @see #getTimeBetweenEvictionRunsMillis */ public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; startEvictor(_timeBetweenEvictionRunsMillis); }
/** * Sets the number of milliseconds to sleep between runs of the * idle object evictor thread. * When non-positive, no idle object evictor thread will be * run. * * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs. * @see #getTimeBetweenEvictionRunsMillis */ public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; startEvictor(_timeBetweenEvictionRunsMillis); }
/** * <p>Closes the pool. Once the pool is closed, {@link #borrowObject()} * will fail with IllegalStateException, but {@link #returnObject(Object)} and * {@link #invalidateObject(Object)} will continue to work, with returned objects * destroyed on return.</p> * * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> * * @throws Exception */ @Override public void close() throws Exception { super.close(); synchronized (this) { clear(); startEvictor(-1L); while(_allocationQueue.size() > 0) { Latch<T> l = _allocationQueue.removeFirst(); synchronized (l) { // notify the waiting thread l.notify(); } } } }
/** * <p>Closes the pool. Once the pool is closed, {@link #borrowObject()} * will fail with IllegalStateException, but {@link #returnObject(Object)} and * {@link #invalidateObject(Object)} will continue to work, with returned objects * destroyed on return.</p> * * <p>Destroys idle instances in the pool by invoking {@link #clear()}.</p> * * @throws Exception */ @Override public void close() throws Exception { super.close(); synchronized (this) { clear(); startEvictor(-1L); while(_allocationQueue.size() > 0) { Latch<T> l = _allocationQueue.removeFirst(); synchronized (l) { // notify the waiting thread l.notify(); } } } }
/** * Closes the pool. Once the pool is closed, {@link #borrowObject()} * will fail with IllegalStateException, but {@link #returnObject(Object)} and * {@link #invalidateObject(Object)} will continue to work. This method does not * {@link #clear()} the pool. The method is idempotent - that is, it is OK to call it on a closed * pool. * * @throws Exception */ public void close() throws Exception { super.close(); synchronized (this) { clear(); startEvictor(-1L); } }
/** * Closes the pool. Once the pool is closed, {@link #borrowObject()} * will fail with IllegalStateException, but {@link #returnObject(Object)} and * {@link #invalidateObject(Object)} will continue to work. This method does not * {@link #clear()} the pool. The method is idempotent - that is, it is OK to call it on a closed * pool. * * @throws Exception */ public void close() throws Exception { super.close(); synchronized (this) { clear(); startEvictor(-1L); } }
startEvictor(_timeBetweenEvictionRunsMillis);
startEvictor(_timeBetweenEvictionRunsMillis);
startEvictor(_timeBetweenEvictionRunsMillis);
startEvictor(_timeBetweenEvictionRunsMillis);