public class BLCICache<K,V> extends Object implements org.thymeleaf.cache.ICache<K,V>
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().| Modifier and Type | Field and Description |
|---|---|
protected BLCICacheExtensionManager |
extensionManager |
static String |
NOT_FOUND |
| Constructor and Description |
|---|
BLCICache(String name,
boolean useSoftReferences,
int initialCapacity,
int maxSize,
org.thymeleaf.cache.ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker,
org.slf4j.Logger logger,
BLCICacheExtensionManager extensionManager)
The only difference from StandardCache() is the constructor name
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearKey(K key) |
V |
defaultGet(K key)
This method behaves the same as StandardCache.get()
|
void |
defaultPut(K key,
V value)
This method behaves the same as StandardCache.put()
|
V |
get(K key)
This method differs from StandardCache.get() by not caching if we're in a sandbox, and adding a hook for
Site and Profile interactions
|
V |
get(K key,
org.thymeleaf.cache.ICacheEntryValidityChecker<? super K,? super V> validityChecker) |
int |
getMaxSize() |
String |
getName() |
boolean |
getUseSoftReferences() |
boolean |
hasMaxSize() |
Set<K> |
keySet()
Returns all the keys contained in this cache.
|
void |
put(K key,
V value)
This method differs from StandardCache.put() by not caching if we're in a sandbox, and adding a hook for
Site and Profile interactions
|
int |
size() |
public static final String NOT_FOUND
protected BLCICacheExtensionManager extensionManager
public BLCICache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.thymeleaf.cache.ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger, BLCICacheExtensionManager extensionManager)
name - useSoftReferences - initialCapacity - maxSize - entryValidityChecker - logger - extensionManager - public void put(K key, V value)
public V get(K key)
public void defaultPut(K key, V value)
key - value - public V defaultGet(K key)
key - public V get(K key, org.thymeleaf.cache.ICacheEntryValidityChecker<? super K,? super V> validityChecker)
public Set<K> 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.
public void clearKey(K key)
public String getName()
public boolean hasMaxSize()
public int getMaxSize()
public boolean getUseSoftReferences()
public int size()
Copyright © 2016. All rights reserved.