Package com.killcoding.cache
Class MemoryCache
java.lang.Object
com.killcoding.cache.AbsCacheApi
com.killcoding.cache.MemoryCache
This cache class is save to memory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ExecutorServiceprivate static booleanprivate static final Loggerprivate final longFields inherited from class com.killcoding.cache.AbsCacheApi
stored, TIMER -
Constructor Summary
ConstructorsConstructorDescriptionNew a MemoryCache objectMemoryCache(Boolean stored) New a MemoryCache object -
Method Summary
-
Field Details
-
log
-
PID
-
CACHE_VALUE
-
CACHE_LIFE
-
isStartRemoveExpiredThread
-
executor
-
-
Constructor Details
-
MemoryCache
public MemoryCache()New a MemoryCache object -
MemoryCache
New a MemoryCache object- Parameters:
stored- - 'true' is force write cache
-
-
Method Details
-
startRemoveExpiredThread
Start remove expired thread -
included
- Specified by:
includedin classAbsCacheApi
-
getNames
- Specified by:
getNamesin classAbsCacheApi
-
removeAll
void removeAll()- Specified by:
removeAllin classAbsCacheApi
-
remove
- Specified by:
removein classAbsCacheApi
-
get
- Specified by:
getin classAbsCacheApi
-
set
- Specified by:
setin classAbsCacheApi
-