Class TranslationBatchReadCache
java.lang.Object
org.broadleafcommerce.common.i18n.service.TranslationBatchReadCache
Thread-local cache structure that contains all of the
Translation
s 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 void
addToCache
(List<Translation> translations) protected static String
buildCacheKey
(TranslatedEntity entityType, String id, String propertyName, String localeCode) protected static String
buildCacheKey
(Translation translation) static void
protected static javax.cache.Cache<Long,
Map<String, Translation>> getCache()
static Translation
getFromCache
(TranslatedEntity entityType, String id, String propertyName, String localeCode) protected static Map<String,
Translation> static boolean
hasCache()
-
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)
-