Example usage for org.apache.commons.pool2.impl DefaultPooledObject DefaultPooledObject

List of usage examples for org.apache.commons.pool2.impl DefaultPooledObject DefaultPooledObject

Introduction

In this page you can find the example usage for org.apache.commons.pool2.impl DefaultPooledObject DefaultPooledObject.

Prototype

public DefaultPooledObject(T object) 

Source Link

Document

Create a new instance that wraps the provided object so that the pool can track the state of the pooled object.

Usage

From source file:redis.client.jedis.CustomShardedJedisFactory.java

/**
 * {@link ShardedJedis}?{@link PooledObject}?
 * <p>/* w  w w. j a va 2s . c  o m*/
 * {@inheritDoc}
 */
@Override
public PooledObject<ShardedJedis> makeObject() throws Exception {
    ShardedJedis shardedJedis = new ShardedJedis(shards, algo, keyTagPattern);
    return new DefaultPooledObject<ShardedJedis>(shardedJedis);
}