List of usage examples for org.apache.commons.pool2.impl SoftReferenceObjectPool returnObject
@Override public synchronized void returnObject(T obj) throws Exception
From source file:com.lambdaworks.redis.support.ConnectionPoolSupportTest.java
@Test public void softReferencePoolShouldWorkWithPlainConnections() throws Exception { SoftReferenceObjectPool<StatefulRedisConnection<String, String>> pool = ConnectionPoolSupport .createSoftReferenceObjectPool(() -> client.connect(), false); borrowAndReturn(pool);//www. jav a 2 s . c o m StatefulRedisConnection<String, String> connection = pool.borrowObject(); assertThat(Proxy.isProxyClass(connection.getClass())).isFalse(); pool.returnObject(connection); pool.close(); }
From source file:io.lettuce.core.support.ConnectionPoolSupportTest.java
@Test public void softReferencePoolShouldWorkWithPlainConnections() throws Exception { SoftReferenceObjectPool<StatefulRedisConnection<String, String>> pool = ConnectionPoolSupport .createSoftReferenceObjectPool(() -> client.connect(), false); borrowAndReturn(pool);/*from w w w . ja va 2 s . c o m*/ StatefulRedisConnection<String, String> connection = pool.borrowObject(); assertThat(Proxy.isProxyClass(connection.getClass())).isFalse(); pool.returnObject(connection); connection.close(); pool.close(); }