/** * Returns an approximation not less than the of the number of idle instances in the pool. * * @return estimated number of idle instances in the pool */ @Override public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); }
/** * Clears any objects sitting idle in the pool. */ @Override public synchronized void clear() { if(null != _factory) { Iterator<SoftReference<T>> iter = _pool.iterator(); while(iter.hasNext()) { try { T obj = iter.next().get(); if(null != obj) { _factory.destroyObject(obj); } } catch(Exception e) { // ignore error, keep destroying the rest } } } _pool.clear(); pruneClearedReferences(); }
/** * Returns an approximation not less than the of the number of idle instances in the pool. * * @return estimated number of idle instances in the pool */ @Override public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); }
/** Returns an approximation not less than the of the number of idle instances in the pool. */ public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); }
/** Returns an approximation not less than the of the number of idle instances in the pool. */ public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); }
/** * Returns an approximation not less than the of the number of idle instances in the pool. * * @return estimated number of idle instances in the pool */ @Override public synchronized int getNumIdle() { pruneClearedReferences(); return _pool.size(); }
/** * Clears any objects sitting idle in the pool. */ @Override public synchronized void clear() { if(null != _factory) { Iterator<SoftReference<T>> iter = _pool.iterator(); while(iter.hasNext()) { try { T obj = iter.next().get(); if(null != obj) { _factory.destroyObject(obj); } } catch(Exception e) { // ignore error, keep destroying the rest } } } _pool.clear(); pruneClearedReferences(); }
/** * Clears any objects sitting idle in the pool. */ public synchronized void clear() { if(null != _factory) { Iterator iter = _pool.iterator(); while(iter.hasNext()) { try { Object obj = ((SoftReference)iter.next()).get(); if(null != obj) { _factory.destroyObject(obj); } } catch(Exception e) { // ignore error, keep destroying the rest } } } _pool.clear(); pruneClearedReferences(); }
/** * Clears any objects sitting idle in the pool. */ public synchronized void clear() { if(null != _factory) { Iterator iter = _pool.iterator(); while(iter.hasNext()) { try { Object obj = ((SoftReference)iter.next()).get(); if(null != obj) { _factory.destroyObject(obj); } } catch(Exception e) { // ignore error, keep destroying the rest } } } _pool.clear(); pruneClearedReferences(); }
/** * Clears any objects sitting idle in the pool. */ @Override public synchronized void clear() { if(null != _factory) { Iterator<SoftReference<T>> iter = _pool.iterator(); while(iter.hasNext()) { try { T obj = iter.next().get(); if(null != obj) { _factory.destroyObject(obj); } } catch(Exception e) { // ignore error, keep destroying the rest } } } _pool.clear(); pruneClearedReferences(); }