WANG 6 éve
szülő
commit
081dadf162

+ 8 - 1
src/main/java/cn/com/qmth/examcloud/web/cache/DefaultFullObjectCacheController.java → src/main/java/cn/com/qmth/examcloud/web/cache/DefaultFullObjectCacheWatcher.java

@@ -1,6 +1,13 @@
 package cn.com.qmth.examcloud.web.cache;
 
-public class DefaultFullObjectCacheController implements FullObjectCacheController {
+/**
+ * 全量缓存观察器
+ *
+ * @author WANGWEI
+ * @date 2019年5月9日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultFullObjectCacheWatcher implements FullObjectCacheWatcher {
 
 	private Boolean allLoaded = false;
 

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/web/cache/FullObjectCache.java

@@ -24,6 +24,6 @@ public interface FullObjectCache<T> extends ObjectCache<T> {
 	 * @author WANGWEI
 	 * @return
 	 */
-	FullObjectCacheController getFullObjectCacheController();
+	FullObjectCacheWatcher getFullObjectCacheWatcher();
 
 }

+ 2 - 2
src/main/java/cn/com/qmth/examcloud/web/cache/FullObjectCacheController.java → src/main/java/cn/com/qmth/examcloud/web/cache/FullObjectCacheWatcher.java

@@ -1,13 +1,13 @@
 package cn.com.qmth.examcloud.web.cache;
 
 /**
- * 全量缓存控制
+ * 全量缓存观察
  *
  * @author WANGWEI
  * @date 2019年3月1日
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
-public interface FullObjectCacheController {
+public interface FullObjectCacheWatcher {
 
 	/**
 	 * 缓存是否全部加载

+ 5 - 5
src/main/java/cn/com/qmth/examcloud/web/cache/FullObjectRedisCache.java

@@ -24,7 +24,7 @@ public abstract class FullObjectRedisCache<T> implements FullObjectCache<T> {
 
 	private RedisClient redisClient;
 
-	private FullObjectCacheController fullObjectCacheController = new DefaultFullObjectCacheController();
+	private FullObjectCacheWatcher fullObjectCacheWatcher = new DefaultFullObjectCacheWatcher();
 
 	private RedisClient getRedisClient() {
 		if (null == redisClient) {
@@ -50,7 +50,7 @@ public abstract class FullObjectRedisCache<T> implements FullObjectCache<T> {
 		String key = buildKey(keys);
 		T t = getFromCache(key);
 		if (null == t) {
-			if (getFullObjectCacheController().allLoaded()) {
+			if (getFullObjectCacheWatcher().allLoaded()) {
 				return t;
 			} else {
 				refresh(keys);
@@ -100,13 +100,13 @@ public abstract class FullObjectRedisCache<T> implements FullObjectCache<T> {
 				this.refresh(keys);
 			}
 		}
-		getFullObjectCacheController().setAllLoaded(true);
+		getFullObjectCacheWatcher().setAllLoaded(true);
 		return 0;
 	}
 
 	@Override
-	public FullObjectCacheController getFullObjectCacheController() {
-		return fullObjectCacheController;
+	public FullObjectCacheWatcher getFullObjectCacheWatcher() {
+		return fullObjectCacheWatcher;
 	}
 
 }