Class BroadleafThymeleaf3ICache<K,V>
java.lang.Object
org.broadleafcommerce.presentation.thymeleaf3.cache.BroadleafThymeleaf3ICache<K,V>
- All Implemented Interfaces:
org.thymeleaf.cache.ICache<K,V>
public class BroadleafThymeleaf3ICache<K,V>
extends Object
implements org.thymeleaf.cache.ICache<K,V>
Modification of
StandardCache in order for BLC to be able to
handle caching based on site and profile level templates. As StandardCache is declared final,
this is a wholesale copy with a few changes to get(), put() and getValueIfStillValid().- Author:
- Chad Harchar (charchar)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.common.web.cache.BLCICacheExtensionManagerstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionBroadleafThymeleaf3ICache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.thymeleaf.cache.ICacheEntryValidityChecker<? super K, ? super V> entryValidityChecker, org.slf4j.Logger logger, org.broadleafcommerce.common.web.cache.BLCICacheExtensionManager extensionManager) The only difference from StandardCache() is the constructor name -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voiddefaultGet(K key) This method behaves the same as StandardCache.get()voiddefaultPut(K key, V value) This method behaves the same as StandardCache.put()This method differs from StandardCache.get() by not caching if we're in a sandbox, and adding a hook for Site and Profile interactionsintgetName()booleanbooleanprotected voidincrementReportEntity(AtomicLong entity) keySet()Returns all the keys contained in this cache.protected voidvoidThis method differs from StandardCache.put() by not caching if we're in a sandbox, and adding a hook for Site and Profile interactionsintsize()
-
Field Details
-
NOT_FOUND
- See Also:
-
extensionManager
protected org.broadleafcommerce.common.web.cache.BLCICacheExtensionManager extensionManager
-
-
Constructor Details
-
BroadleafThymeleaf3ICache
public BroadleafThymeleaf3ICache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.thymeleaf.cache.ICacheEntryValidityChecker<? super K, ? super V> entryValidityChecker, org.slf4j.Logger logger, org.broadleafcommerce.common.web.cache.BLCICacheExtensionManager extensionManager) The only difference from StandardCache() is the constructor name- Parameters:
name-useSoftReferences-initialCapacity-maxSize-entryValidityChecker-logger-extensionManager-
-
-
Method Details
-
put
This method differs from StandardCache.put() by not caching if we're in a sandbox, and adding a hook for Site and Profile interactions -
get
This method differs from StandardCache.get() by not caching if we're in a sandbox, and adding a hook for Site and Profile interactions -
defaultPut
This method behaves the same as StandardCache.put()- Parameters:
key-value-
-
defaultGet
This method behaves the same as StandardCache.get()- Parameters:
key-- Returns:
-
get
-
keySet
Returns all the keys contained in this cache. Note this method might return keys for entries that are already invalid, so the result of calling
get(Object)for these keys might be null. -
clear
public void clear() -
clearKey
-
getName
-
hasMaxSize
public boolean hasMaxSize() -
getMaxSize
public int getMaxSize() -
getUseSoftReferences
public boolean getUseSoftReferences() -
size
public int size() -
incrementReportEntity
-
outputReportIfNeeded
protected void outputReportIfNeeded()
-