Browse Source

Merge branch 'master' of Dylan.Liu/finekit into master

pull/1/head
richie 5 years ago committed by Gogs
parent
commit
35d99d0ad6
  1. 20
      src/main/java/com/fanruan/api/cluster/state/BaseFineStoreGenericPool.java
  2. 19
      src/main/java/com/fanruan/api/cluster/state/BaseFineStoreWrapper.java
  3. 2
      src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java
  4. 6
      src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java
  5. 4
      src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java
  6. 2
      src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java

20
src/main/java/com/fanruan/api/cluster/state/BaseFineStoreGenericPool.java

@ -0,0 +1,20 @@
package com.fanruan.api.cluster.state;
import com.fr.collections.config.CollectionsConfig;
import com.fr.store.impl.accessor.api.impl.AbstractFineStoreGenericPool;
/**
* @author Dylan.Liu
* @version 10.0
* Created by Dylan.Liu on 2020/4/26
* 供插件使用
* 设置资源连接池, 注册实际资源
*/
public abstract class BaseFineStoreGenericPool<T> extends AbstractFineStoreGenericPool<T> {
@Override
public abstract boolean accept(CollectionsConfig config);
@Override
public abstract BaseFineStoreWrapper refresh(T redisConfig);
}

19
src/main/java/com/fanruan/api/cluster/state/BaseFineStoreWrapper.java

@ -0,0 +1,19 @@
package com.fanruan.api.cluster.state;
import com.fr.store.impl.accessor.api.FineStoreWrapper;
import com.fr.store.impl.accessor.api.impl.FineStoreAdapter;
/**
* @author Dylan.Liu
* @version 10.0
* Created by Dylan.Liu on 2020/4/26
* 供插件使用的资源包装器
*/
public abstract class BaseFineStoreWrapper implements FineStoreWrapper {
@Override
public abstract FineStoreAdapter getResource();
@Override
public abstract void destroy();
}

2
src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java

@ -2,7 +2,7 @@ package com.fanruan.api.cluster.state;
import com.fr.store.impl.accessor.FineStorePool;
import com.fr.store.impl.accessor.FineStoreWrapper;
import com.fr.store.impl.accessor.api.FineStoreWrapper;
/**
* @author Dylan.Liu

6
src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java

@ -1,7 +1,7 @@
package com.fanruan.api.cluster.state;
import com.fr.store.impl.accessor.FineStore;
import com.fr.store.impl.accessor.StandAloneStore;
import com.fr.store.impl.accessor.api.impl.FineStoreAdapter;
import com.fr.store.impl.accessor.api.impl.StandAloneStore;
import com.fr.third.redis.clients.jedis.Jedis;
/**
@ -16,7 +16,7 @@ public class StandAloneJedisKit {
* @param jedis Jedis 资源
* @return 单机版 Jedis Api集合
*/
public static FineStore createStandAloneJedis(Jedis jedis) {
public static FineStoreAdapter createStandAloneJedis(Jedis jedis) {
if (jedis == null) {
throw new NullPointerException("jedis is null");

4
src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java

@ -1,8 +1,8 @@
package com.fanruan.api.cluster.state;
import com.fr.store.impl.accessor.FineStore;
import com.fr.store.impl.accessor.FineStorePool;
import com.fr.store.impl.accessor.FineStoreWrapper;
import com.fr.store.impl.accessor.api.FineStore;
import com.fr.store.impl.accessor.api.FineStoreWrapper;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;

2
src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java

@ -1,6 +1,6 @@
package com.fanruan.api.cluster.state;
import com.fr.store.impl.accessor.FineStore;
import com.fr.store.impl.accessor.api.FineStore;
import com.fr.third.redis.clients.jedis.Jedis;
import org.easymock.EasyMock;
import org.junit.Assert;

Loading…
Cancel
Save