List of usage examples for org.apache.commons.pool2.impl AbandonedConfig setUseUsageTracking
public void setUseUsageTracking(boolean useUsageTracking)
From source file:ch.cyberduck.core.pool.DefaultSessionPool.java
public DefaultSessionPool(final ConnectionService connect, final X509TrustManager trust, final X509KeyManager key, final VaultRegistry registry, final PathCache cache, final TranscriptListener transcript, final Host bookmark) { this.connect = connect; this.registry = registry; this.cache = cache; this.bookmark = bookmark; this.transcript = transcript; final GenericObjectPoolConfig configuration = new GenericObjectPoolConfig(); configuration.setJmxEnabled(false);//from ww w. j av a2s .co m configuration.setEvictionPolicyClassName(CustomPoolEvictionPolicy.class.getName()); configuration.setBlockWhenExhausted(true); configuration.setMaxWaitMillis(BORROW_MAX_WAIT_INTERVAL); this.pool = new GenericObjectPool<Session>( new PooledSessionFactory(connect, trust, key, cache, bookmark, registry), configuration); final AbandonedConfig abandon = new AbandonedConfig(); abandon.setUseUsageTracking(true); this.pool.setAbandonedConfig(abandon); }