Initial JedisSentinelPool based on code from hamsterready/jedis-sentinel-pool.

Given a master name and a set of sentinels this pool will subscribe to the
Sentinel notifications about master changes (+switch-master) and
re-establishes the pool to the new master when one is announced.
This commit is contained in:
Hisham Mardam-Bey
2013-08-23 23:06:13 -04:00
parent 404c5632c7
commit c2a48afafd
4 changed files with 290 additions and 80 deletions

View File

@@ -14,14 +14,19 @@ public abstract class Pool<T> {
* the internalPool yourself.
*/
public Pool() {
this.internalPool = null;
this.internalPool = null;
}
public Pool(final GenericObjectPool.Config poolConfig,
PoolableObjectFactory factory) {
this.internalPool = new GenericObjectPool(factory, poolConfig);
initPool(poolConfig, factory);
}
public void initPool(final GenericObjectPool.Config poolConfig,
PoolableObjectFactory factory) {
this.internalPool = new GenericObjectPool(factory, poolConfig);
}
@SuppressWarnings("unchecked")
public T getResource() {
try {