List of usage examples for org.apache.commons.pool2 PoolUtils synchronizedPool
public static <K, V> KeyedObjectPool<K, V> synchronizedPool(final KeyedObjectPool<K, V> keyedPool)
From source file:org.dspace.event.EventServiceImpl.java
private void initPool() { if (dispatcherPool == null) { // TODO EVENT Some of these pool configuration // parameters can live in dspace.cfg or a // separate configuration file // TODO EVENT Eviction parameters should be set poolConfig = new GenericKeyedObjectPoolConfig(); poolConfig.setMaxTotalPerKey(100); poolConfig.setMaxIdlePerKey(5);//from w w w . j a va 2s . c o m poolConfig.setMaxTotal(100); try { dispatcherFactory = new DispatcherPoolFactory(); dispatcherPool = PoolUtils .synchronizedPool(new GenericKeyedObjectPool(dispatcherFactory, poolConfig)); enumerateConsumers(); } catch (Exception e) { log.error("Could not initialize EventService dispatcher pool", e); } } }