Package org.aoju.bus.cache.metric
Class MemoryCache
java.lang.Object
org.aoju.bus.cache.metric.MemoryCache
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean是否开启定时clear()()}的任务static long默认缓存过期时间:3分钟 鉴于授权过程中,根据个人的操作习惯,或者授权平台的不同(google等),每个授权流程的耗时也有差异,不过单个授权流程一般不会太长 本缓存工具默认的过期时间设置为3分钟,即程序默认认为3分钟内的授权有效,超过3分钟则默认失效,失效后删除 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()清理过期的缓存获取缓存read(Collection<String> keys) 从缓存中获得一组对象信息void清理过期的缓存voidschedulePrune(long delay) 定时清理void设置缓存void设置缓存
-
Field Details
-
timeout
public static long timeout默认缓存过期时间:3分钟 鉴于授权过程中,根据个人的操作习惯,或者授权平台的不同(google等),每个授权流程的耗时也有差异,不过单个授权流程一般不会太长 本缓存工具默认的过期时间设置为3分钟,即程序默认认为3分钟内的授权有效,超过3分钟则默认失效,失效后删除 -
schedulePrune
public static boolean schedulePrune是否开启定时clear()()}的任务
-
-
Constructor Details
-
MemoryCache
public MemoryCache()
-
-
Method Details
-
write
-
write
-
read
-
read
-
clear
-
remove
-
schedulePrune
public void schedulePrune(long delay) 定时清理- Parameters:
delay- 间隔时长,单位毫秒
-