private void init() { GenericObjectPool.Config config = new GenericObjectPool.Config(); config.maxActive = 2;//TODO: Make this configurable. config.testOnBorrow = true; config.testWhileIdle = true; config.timeBetweenEvictionRunsMillis = 10000; config.minEvictableIdleTimeMillis = 60000; GenericObjectPoolFactory genericObjectPoolFactory = new GenericObjectPoolFactory(this, config); pool = genericObjectPoolFactory.createPool(); }
ObjectPool getPool() { if (workers == null) { // create pool PoolableObjectFactory objectFactory = new AuthorityPoolableObjectFactory(); ObjectPoolFactory poolFactory = new GenericObjectPoolFactory(objectFactory, poolConfig); this.setPool(poolFactory.createPool()); } return workers; }
protected ObjectPoolFactory createPoolFactory() { return new GenericObjectPoolFactory(null, maximumActive); } }
private void init() { GenericObjectPool.Config config = new GenericObjectPool.Config(); config.maxActive = 2;//TODO: Make this configurable. config.testOnBorrow = true; config.testWhileIdle = true; config.timeBetweenEvictionRunsMillis = 10000; config.minEvictableIdleTimeMillis = 60000; GenericObjectPoolFactory genericObjectPoolFactory = new GenericObjectPoolFactory(this, config); pool = genericObjectPoolFactory.createPool(); }
.put( sbbDescriptor.getID(), (new GenericObjectPoolFactory( new SbbObjectPoolFactory( ((SbbID) sbbDescriptor
/** * * @param profileTable */ private void createObjectPool(final ProfileTableImpl profileTable) { // create the pool GenericObjectPoolFactory poolFactory = new GenericObjectPoolFactory( new ProfileObjectPoolFactory(profileTable), config); final ObjectPool objectPool = poolFactory.createPool(); final ProfileObjectPool oldObjectPool = pools.put(profileTable.getProfileTableName(), new ProfileObjectPool(objectPool)); if (oldObjectPool != null) { // there was an old pool, close it try { oldObjectPool.close(); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Failed to close old pool for " + profileTable); } } } if (logger.isDebugEnabled()) { logger.debug("Created Pool for " + profileTable); } }
public void execute() { sbbPooling .put( sbbDescriptor.getID(), (new GenericObjectPoolFactory( new SbbObjectPoolFactory( ((SbbID) sbbDescriptor .getID()), SleeContainer .lookupFromJndi()), poolConfig)).createPool()); if (logger.isDebugEnabled()) { logger.debug("Created Pool for SBB " + sbbDescriptor.getID()); } } };
/** * * @param serviceID * @param sbbID */ private void createObjectPool(final ServiceID serviceID, final SbbComponent sbbComponent) { // create the pool for the given SbbID GenericObjectPoolFactory poolFactory = new GenericObjectPoolFactory( new SbbObjectPoolFactory(serviceID,sbbComponent), config); final ObjectPool objectPool = poolFactory.createPool(); final SbbObjectPoolImpl oldObjectPool = pools.put(new ObjectPoolMapKey(serviceID,sbbComponent.getSbbID()), new SbbObjectPoolImpl(sbbComponent,serviceID,objectPool)); if (oldObjectPool != null) { // there was an old pool, close it try { oldObjectPool.close(); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Failed to close old pool for " + serviceID + "and " + sbbComponent); } } } if (logger.isDebugEnabled()) { logger.debug("Created Pool for " + serviceID + "and " + sbbComponent); } }
(new GenericObjectPoolFactory(new SbbObjectPoolFactory( ((SbbID) mobicentsSbbDescriptor.getID()), SleeContainer .lookupFromJndi()), poolConfig)).createPool()); if (logger.isDebugEnabled()) { logger.debug("Created Pool for SBB "