jedis底层链接池相关类图
2020-05-19 23:45:51 56 举报
jedis底层链接池的类图
作者其他创作
大纲/内容
只有第一次初始化资源池。如果打开连接时探测功能,支持失败重新建立链接的机制
jedis封装的资源池
JedisPoolAbstract
Pool<Jedis>
+ internalPool:type:GenericObjectPool<Jedis>
+ getResource():Jedis# returnResourceObject(Jedis)
哨兵模式的连接池(存在探活进程,会重新初始化commons-pool资源池)
contains
caller
JedisSentinelPool
+ master:type = MasterListener
- initSentinels()- initpool()
此抽象类以及接口,仅仅用作抽取公共代码
JedisPool
+ getResource():Jedis# returnResource(Jedis)# returnBrokenResource(Jedis)
GenericKeyedObjectPool
PooledObjectFactory
+ makeObject():PooledObject+ destroyObject(PooledObject<T> p)+ validateObject(PooledObject<T> p) boolean+ activateObject(PooledObject<T> p)+ passivateObject(PooledObject<T> p)
JedisFactory
- hostanport:type = HostAndPort- connectionTimeout:int- soTimeout:int- ......
+ makeObject():PooledObject<Jedis>
GenericObjectPool<Jedis>
- factory:PooledObjectFactory<Jedis> - idleObjects:LinkedBlockingDeque<PooledObject<Jedis>> - allObjects:ConcurrentHashMap
+ borrowObject():Jedis+ returnObject(Jedis)- create():PooledObject<Jedis>- close()- clear()- destroy(PooledObject<Jedis>)- initpool
BaseObject
ObjectPool<Jedis>
+ borrowObject()+ returnObject(Jedis)+ addObject()+ clear()+ close()+ invalidateObject(Jedis)
BaseGenericObjectPool
+ attrs......
+ setter......+ getter......
worker
收藏
0 条评论
下一页