/** * This returns the number of objects to create during the pool * sustain cycle. This will ensure that the minimum number of idle * instances is maintained without going past the maxActive value. * * @param incrementInternal - Should the count of objects currently under * some form of internal processing be * incremented? * @return The number of objects to be created */ private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; }
public int getMaxPoolSize() { return pool.getMaxActive(); }
public int getPoolSize() { checkOpen(); return pool.getMaxActive(); }
@Override public String toString() { StringBuilder ret = new StringBuilder(getClass().getSimpleName()); ret.append("[config=").append(getConfig()); if (pool == null) { ret.append("[Session pool is disposed]"); } else { ret.append("[ACTIVE: "); ret.append(pool.getNumActive() + "/" + ((GenericObjectPool) pool).getMaxActive()); ret.append(" INACTIVE: "); ret.append(pool.getNumIdle() + "/" + ((GenericObjectPool) pool).getMaxIdle() + "]"); } ret.append("]"); return ret.toString(); } }
/** @see org.geotools.arcsde.session.ISessionPool#getAvailableCount() */ public synchronized int getAvailableCount() { checkOpen(); return pool.getMaxActive() - pool.getNumActive(); }
public int getMaxActive() { return pool.getMaxActive(); }
/** * @return The current maximum number of allowable active transformer objects in * the pool */ public int getMaxActiveTransformers() { return transformerPool.getMaxActive(); }
/** * @return The current maximum number of allowable active transformer objects in * the pool */ public int getMaxActiveTransformers() { return transformerPool.getMaxActive(); }
public int getReadConnectionMaxPoolSize() { return roPool.getMaxActive(); }
public int getWriteConnectionMaxPoolSize() { return rwPool.getMaxActive(); }
public int getQueryConnectionMaxPoolSize() { return queryPool.getMaxActive(); }
public void writeReport(java.io.Writer out) throws java.io.IOException { final String BR = "<br>\n"; out.write("Active connections: " + pool.getNumActive() + " (max: " + pool.getMaxActive() + ")<br>\n"); out.write("Idle connections: " + pool.getNumIdle() + " (min: " + pool.getMinIdle() + " max: " + pool.getMaxIdle() + ")<br>\n"); out.write("Connections created: " + pcfactory.objectsCreated + BR); out.write("Connections destroyed: " + pcfactory.objectsDestroyed + BR); out.write("Connections validated: " + pcfactory.objectsValidated + BR); out.write("Connections activated: " + pcfactory.objectsActivated + BR); out.write("Connections passivated: " + pcfactory.objectsPassivated + BR); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals("close")) { if (logger.isDebugEnabled()) { logger.debug("Return a connection to the pool : " + connection); } pool.returnObject((OlapConnection) proxy); if (logger.isDebugEnabled()) { logger.debug(" - current pool size : " + pool.getNumActive() + " / " + pool.getMaxActive()); } return null; } else { return method.invoke(connection, args); } } };
/** * This returns the number of objects to create during the pool * sustain cycle. This will ensure that the minimum number of idle * instances is maintained without going past the maxActive value. * * @param incrementInternal - Should the count of objects currently under * some form of internal processing be * incremented? * @return The number of objects to be created */ private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; }
/** * This returns the number of objects to create during the pool * sustain cycle. This will ensure that the minimum number of idle * instances is maintained without going past the maxActive value. * * @param incrementInternal - Should the count of objects currently under * some form of internal processing be * incremented? * @return The number of objects to be created */ private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; }
/** * This returns the number of objects to create during the pool * sustain cycle. This will ensure that the minimum number of idle * instances is maintained without going past the maxActive value. * * @param incrementInternal - Should the count of objects currently under * some form of internal processing be * incremented? * @return The number of objects to be created */ private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; }
/** * This returns the number of objects to create during the pool * sustain cycle. This will ensure that the minimum number of idle * instances is maintained without going past the maxActive value. * * @param incrementInternal - Should the count of objects currently under * some form of internal processing be * incremented? * @return The number of objects to be created */ private synchronized int calculateDeficit(boolean incrementInternal) { int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle() - _numInternalProcessing); objectDeficit = Math.min(objectDeficit, growLimit); } if (incrementInternal && objectDeficit >0) { _numInternalProcessing++; } return objectDeficit; }
new GenericKeyedObjectPoolFactory( null, pool.getMaxActive(), pool.getWhenExhaustedAction(), pool .getMaxWait(), pool.getMaxIdle(), maxOpenPreparedStatements );