@Override public E remove(int index) { checkForComod(); return super.remove(index); }
@Override public boolean remove(Object o) { checkForComod(); return super.remove(o); }
toDestroy.put(key, objects); it.remove(); _poolList.remove(key); _totalIdle = _totalIdle - pool.queue.size(); _totalInternalProcessing =
objectQueue.queue.isEmpty()) { _poolMap.remove(key); _poolList.remove(key);
/** * Clears the specified pool, removing all pooled instances corresponding to the given <code>key</code>. * * @param key the key to clear */ @Override public void clear(K key) { Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K , List<ObjectTimestampPair<V>>>(); final ObjectQueue pool; synchronized (this) { pool = _poolMap.remove(key); if (pool == null) { return; } else { _poolList.remove(key); } // Copy objects to new list so pool.queue can be cleared inside // the sync List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>(); objects.addAll(pool.queue); toDestroy.put(key, objects); _totalIdle = _totalIdle - pool.queue.size(); _totalInternalProcessing = _totalInternalProcessing + pool.queue.size(); pool.queue.clear(); } destroy(toDestroy, _factory); }
toDestroy.put(key, objects); it.remove(); _poolList.remove(key); _totalIdle = _totalIdle - pool.queue.size(); _totalInternalProcessing =
pool.internalProcessingCount == 0) { _poolMap.remove(key); _poolList.remove(key);
pool.internalProcessingCount == 0) { _poolMap.remove(key); _poolList.remove(key);
objectQueue.internalProcessingCount == 0) { _poolMap.remove(key); _poolList.remove(key);
@Override public E remove(int index) { checkForComod(); return super.remove(index); }
@Override public boolean remove(Object o) { checkForComod(); return super.remove(o); }
@Override public E remove(int index) { checkForComod(); return super.remove(index); }
@Override public boolean remove(Object o) { checkForComod(); return super.remove(o); }
public Object remove(int index) { checkForComod(); return super.remove(index); }
public boolean remove(Object o) { checkForComod(); return super.remove(o); }
public boolean remove(Object o) { checkForComod(); return super.remove(o); }
public Object remove(int index) { checkForComod(); return super.remove(index); }
/** * Clears the specified pool, removing all pooled instances corresponding to the given <code>key</code>. * * @param key the key to clear */ public synchronized void clear(Object key) { final ObjectQueue pool = (ObjectQueue)(_poolMap.remove(key)); if(null == pool) { return; } else { _poolList.remove(key); for(Iterator it = pool.queue.iterator(); it.hasNext(); ) { try { _factory.destroyObject(key,((ObjectTimestampPair)(it.next())).value); } catch(Exception e) { // ignore error, keep destroying the rest } it.remove(); _totalIdle--; } } notifyAll(); }
/** * Clears the specified pool, removing all pooled instances corresponding to the given <code>key</code>. * * @param key the key to clear */ @Override public void clear(K key) { Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K , List<ObjectTimestampPair<V>>>(); final ObjectQueue pool; synchronized (this) { pool = _poolMap.remove(key); if (pool == null) { return; } else { _poolList.remove(key); } // Copy objects to new list so pool.queue can be cleared inside // the sync List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>(); objects.addAll(pool.queue); toDestroy.put(key, objects); _totalIdle = _totalIdle - pool.queue.size(); _totalInternalProcessing = _totalInternalProcessing + pool.queue.size(); pool.queue.clear(); } destroy(toDestroy, _factory); }
/** * Clears the specified pool, removing all pooled instances corresponding to the given <code>key</code>. * * @param key the key to clear */ @Override public void clear(K key) { Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K , List<ObjectTimestampPair<V>>>(); final ObjectQueue pool; synchronized (this) { pool = _poolMap.remove(key); if (pool == null) { return; } else { _poolList.remove(key); } // Copy objects to new list so pool.queue can be cleared inside // the sync List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>(); objects.addAll(pool.queue); toDestroy.put(key, objects); _totalIdle = _totalIdle - pool.queue.size(); _totalInternalProcessing = _totalInternalProcessing + pool.queue.size(); pool.queue.clear(); } destroy(toDestroy, _factory); }