Package com.jk.core.cache.simple
Class JKAbstractCacheManager
java.lang.Object
com.jk.core.cache.simple.JKAbstractCacheManager
- All Implemented Interfaces:
 JKCacheManager
- Direct Known Subclasses:
 JKDefaultCacheManager,JKTimedAndSizeCacheManager
This abstract class provides a base implementation for cache management.
 
 This class implements the JKCacheManager interface.
- Version:
 - 1
 - Author:
 - Dr. Jalal H. Kiswani
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionasMap()This method transformJKCacheManagerinto a map.voidThis method caches data with the specified key inside theJKCacheManagerobject instance.<T> voidThis method caches data with the associated key inside the specified cached data container.voidclear()This method clears all the data cached inside theJKCacheManager.voidThis method clears the data cached inside the specified data type.This method creates a new cache map for theJKAbstractCacheManager.<T> TThis method gets the cached data associated with the specified key, and stored in the specified data container type.<T> List<T>This method gets the cached data container that is associated with the specified key as a list.getCachableMap(Class<?> clas) This method gets the cached data container as a map.This method returns a set of all the currently cached classes.booleanThis method checks whether thisJKAbstractCacheManagerallow null values or not.booleanisAvailable(Object key, Class<?> clas) This method checks whether the specified cached data is available or not.voidThis method removes the cached data fromJKCacheManager.voidThis method removes the cached data associated with the specified key fromJKCacheManager.voidsetAllowNullable(boolean allowNullable) This method changes the value which specify whether thisJKAbstractCacheManagerallows null value or not.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jk.core.cache.JKCacheManager
get 
- 
Field Details
- 
logger
Represents this class logger. 
 - 
 - 
Constructor Details
- 
JKAbstractCacheManager
public JKAbstractCacheManager() 
 - 
 - 
Method Details
- 
cache
This method caches data with the specified key inside theJKCacheManagerobject instance.- Specified by:
 cachein interfaceJKCacheManager- Parameters:
 key- Specifies the key of the cached data.object- Specifies the cached data.
 - 
cache
This method caches data with the associated key inside the specified cached data container.- Specified by:
 cachein interfaceJKCacheManager- Type Parameters:
 T- Specifies the generic type of the cached data.- Parameters:
 key- Specifies the key of the cached data.object- Specifies the object to be cached.clas- Specifies the cached data container type.
 - 
clear
This method clears the data cached inside the specified data type.- Specified by:
 clearin interfaceJKCacheManager- Parameters:
 clas- Specifies the data type to be cleared.
 - 
get
This method gets the cached data container that is associated with the specified key as a list.- Specified by:
 getin interfaceJKCacheManager- Type Parameters:
 T- Specifies the generic type of the cached data.- Parameters:
 key- Specifies the key associated with the cached data.- Returns:
 - a list of the cached data container content.
 
 - 
get
This method gets the cached data associated with the specified key, and stored in the specified data container type.- Specified by:
 getin interfaceJKCacheManager- Type Parameters:
 T- Specifies the generic type of the cached data.- Parameters:
 key- Specifies the key associated with the cached data.clas- Specifies the cached data container type.- Returns:
 - the cached data, returns null if there's no entry, or if the specified data type has been cleared.
 
 - 
getCachableMap
This method gets the cached data container as a map.- Specified by:
 getCachableMapin interfaceJKCacheManager- Parameters:
 clas- Specifies the cached data container type.- Returns:
 - a map with the specified cached data.
 
 - 
createCacheMap
This method creates a new cache map for theJKAbstractCacheManager.- Returns:
 - the new cache map.
 
 - 
isAllowNullable
public boolean isAllowNullable()This method checks whether thisJKAbstractCacheManagerallow null values or not.- Returns:
 - true, if it allows null values, false, otherwise.
 
 - 
isAvailable
This method checks whether the specified cached data is available or not.- Specified by:
 isAvailablein interfaceJKCacheManager- Parameters:
 key- Specifies the id of the cached data.clas- Specifies the cached data container type.- Returns:
 - true, if is available, false otherwise.
 
 - 
remove
This method removes the cached data fromJKCacheManager.- Specified by:
 removein interfaceJKCacheManager- Parameters:
 key- Specifies the key of the cached data.clas- Specifies the cached data container type.
 - 
setAllowNullable
public void setAllowNullable(boolean allowNullable) This method changes the value which specify whether thisJKAbstractCacheManagerallows null value or not.- Parameters:
 allowNullable- Indicates whether null values are allowed (true) or not (false).
 - 
clear
public void clear()This method clears all the data cached inside theJKCacheManager.- Specified by:
 clearin interfaceJKCacheManager
 - 
remove
This method removes the cached data associated with the specified key fromJKCacheManager.- Specified by:
 removein interfaceJKCacheManager- Parameters:
 key- Specifies the key associated with the cached data.
 - 
getCacheClasses
This method returns a set of all the currently cached classes.- Specified by:
 getCacheClassesin interfaceJKCacheManager- Returns:
 - a set of all the currently cached classes.
 
 - 
toString
 - 
asMap
This method transformJKCacheManagerinto a map.- Specified by:
 asMapin interfaceJKCacheManager- Returns:
 - a map that represents the 
JKCachedManager 
 
 -