JedisPool继承了Pool<T>类,最原始的Pool类,仅仅对GenericObjectPool进行了一层简单的封装,将borrowObject,returnObject,returnInvalidateObject简单封装了下
JedisPool自己定义了private类JedisFactory,也仅仅是对BasePoolalbeObjectFactory的简单封装,实现了makeObject,destroyObject,validateObject,分别 new一个jedis并且connect了,disconnect一个jedis,
jedis继承了BinaryJedis,BinaryJedis里面放了一个Client,继承自BinaryClient,
apache-commons-pool
switch(whenExhaustedAction) { case WHEN_EXHAUSTED_BLOCK: case WHEN_EXHAUSTED_FAIL: case WHEN_EXHAUSTED_GROW: _whenExhaustedAction = whenExhaustedAction; break; default: throw new IllegalArgumentException("whenExhaustedAction " + whenExhaustedAction + " not recognized."); }
技巧
_pool = new CursorableLinkedList(); startEvictor(_timeBetweenEvictionRunsMillis);
原文:http://www.cnblogs.com/starfuxks/p/3556403.html