use of com.ctrip.xpipe.netty.commands.NettyKeyedPoolClientFactory in project x-pipe by ctripcorp.
the class XpipeNettyClientKeyedObjectPool method doInitialize.
@Override
protected void doInitialize() throws Exception {
this.pooledObjectFactory = new NettyKeyedPoolClientFactory();
pooledObjectFactory.start();
GenericKeyedObjectPool<InetSocketAddress, NettyClient> genericKeyedObjectPool = new GenericKeyedObjectPool<>(pooledObjectFactory, config);
genericKeyedObjectPool.setTestOnBorrow(true);
genericKeyedObjectPool.setTestOnCreate(true);
genericKeyedObjectPool.setSoftMinEvictableIdleTimeMillis(DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
genericKeyedObjectPool.setMinEvictableIdleTimeMillis(DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
genericKeyedObjectPool.setTimeBetweenEvictionRunsMillis(DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
this.objectPool = genericKeyedObjectPool;
}
Aggregations