Class TranslationBatchReadCache
java.lang.Object
org.broadleafcommerce.common.i18n.service.TranslationBatchReadCache
Thread-local cache structure that contains all of the
Translations for a batch of processing. This is mainly
used when executing a search re-index operation. Rather than go to the database for each item being indexed, it makes
more sense to go to the database once, cache all of the results here, and then let the TranslationService
use this instead.- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToCache(List<Translation> translations) protected static StringbuildCacheKey(TranslatedEntity entityType, String id, String propertyName, String localeCode) protected static StringbuildCacheKey(Translation translation) static voidprotected static javax.cache.Cache<Long,Map<String, Translation>> getCache()static TranslationgetFromCache(TranslatedEntity entityType, String id, String propertyName, String localeCode) protected static Map<String,Translation> static booleanhasCache()
-
Field Details
-
CACHE_NAME
- See Also:
-
-
Constructor Details
-
TranslationBatchReadCache
public TranslationBatchReadCache()
-
-
Method Details
-
getCache
-
getThreadlocalCache
-
clearCache
public static void clearCache() -
hasCache
public static boolean hasCache() -
addToCache
-
getFromCache
public static Translation getFromCache(TranslatedEntity entityType, String id, String propertyName, String localeCode) -
buildCacheKey
-
buildCacheKey
protected static String buildCacheKey(TranslatedEntity entityType, String id, String propertyName, String localeCode)
-