ObjectQueue pool = (_poolMap.get(latch.getkey())); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(K key, boolean populateImmediately) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * {@inheritDoc} * <p>Activation of this method decrements the active count associated with the given keyed pool * and attempts to destroy <code>obj.</code></p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ @Override public void invalidateObject(K key, V obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); } allocate(); // _totalActive has changed } }
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);
ObjectQueue pool = (_poolMap.get(latch.getkey())); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
ObjectQueue pool = (_poolMap.get(latch.getkey())); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);
ObjectQueue pool = (ObjectQueue)(_poolMap.get(latch.getkey())); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
ObjectQueue pool = (ObjectQueue)(_poolMap.get(latch.getkey())); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(latch.getkey(), pool); _poolList.add(latch.getkey());
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(Object key, boolean populateImmediately) { ObjectQueue pool = (ObjectQueue)(_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(K key, boolean populateImmediately) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(K key, boolean populateImmediately) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * {@inheritDoc} * <p>Activation of this method decrements the active count associated with the given keyed pool * and attempts to destroy <code>obj.</code></p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ @Override public void invalidateObject(K key, V obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); } allocate(); // _totalActive has changed } }
/** * {@inheritDoc} * <p>Activation of this method decrements the active count associated with the given keyed pool * and attempts to destroy <code>obj.</code></p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ @Override public void invalidateObject(K key, V obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); } allocate(); // _totalActive has changed } }
/** * Registers a key for pool control. * * If <code>populateImmediately</code> is <code>true</code> and * <code>minIdle > 0,</code> the pool under the given key will be * populated immediately with <code>minIdle</code> idle instances. * * @param key - The key to register for pool control. * @param populateImmediately - If this is <code>true</code>, the pool * will be populated immediately. * @since Pool 1.3 */ public synchronized void preparePool(Object key, boolean populateImmediately) { ObjectQueue pool = (ObjectQueue)(_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key,pool); _poolList.add(key); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
/** * <p>Invalidates the object instance associated with the given key. Decrements the active count * associated with the given keyed pool and destroys the instance.</p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ public void invalidateObject(Object key, Object obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (ObjectQueue) (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); allocate(); // _totalActive has changed } } }
/** * <p>Invalidates the object instance associated with the given key. Decrements the active count * associated with the given keyed pool and destroys the instance.</p> * * @param key pool key * @param obj instance to invalidate * @throws Exception if an exception occurs destroying the object */ public void invalidateObject(Object key, Object obj) throws Exception { try { _factory.destroyObject(key, obj); } finally { synchronized (this) { ObjectQueue pool = (ObjectQueue) (_poolMap.get(key)); if (null == pool) { pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key); } pool.decrementActiveCount(); allocate(); // _totalActive has changed } } }
pool = new ObjectQueue(); _poolMap.put(key, pool); _poolList.add(key);