public class CacheMgr extends BaseMgr implements CacheMgrIf
Modifier and Type | Class and Description |
---|---|
protected class |
CacheMgr.StaticData
Used to store the static data of this manager
|
Modifier and Type | Field and Description |
---|---|
static int |
cacheType
Cache Type - default is KonaKart
|
protected static java.lang.String |
KKProdCacheQMutex
KK Prod Cache Queue Mutex
|
protected static java.util.LinkedList<java.lang.String> |
kkProdCacheQueue
Queue of lookup key entries in the KonaKart Product Cache
|
protected static java.util.Set<java.lang.String> |
kkProdCacheSet
Set of lookup key entries in the KonaKart Product Cache
|
protected static java.lang.String |
KKSizeCheckMutex
KK Cache Size Check Mutex
|
protected static int |
lastEventProcessed
Index of Last Event Processed
|
protected static java.lang.String |
lastIndexMutex
lastIndexMutex
|
static boolean |
lastIndexSet
Start-up flag for setting lastIndex
|
protected static org.apache.commons.logging.Log |
log
Log
|
protected static java.lang.String |
mutex
Mutex
|
static boolean |
started
Start-up flag
|
protected static java.util.Map<java.lang.String,CacheMgr.StaticData> |
staticDataHM
Hash Map that contains the static data
|
protected static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
staticKKCaches
A Map containing the a Map for each cache
|
templateBaseDir
Modifier and Type | Method and Description |
---|---|
protected void |
checkKonaKartCacheSize(java.lang.String cacheName,
java.util.Map<java.lang.String,java.lang.Object> kkCache)
Ensure the KonaKart Product Cache is not bigger than the maximum defined size
|
void |
dumpCacheStatus(java.lang.String cacheName)
Dump details of the named cache
|
void |
flush(java.lang.String cacheName)
Flush/Clear the specified cache.
|
void |
flushProduct(int productId)
Flush a single product from the caches
|
java.lang.Object |
get(java.lang.String cacheName,
java.lang.String key)
Get an object from the specified cache with the specified key
|
int |
getCacheType()
Get the Cache Type being used
|
static int |
getLastEventProcessed() |
boolean |
isCacheMgrStarted()
Is CacheMgr started up?
|
boolean |
isCachingEnabled()
Is global caching enabled
|
void |
processEvents()
Reads and executes the KKEvents
|
void |
put(java.lang.String cacheName,
java.lang.String key,
java.lang.Object value)
Put an object into the specified cache with the specified key
|
void |
refreshConfigs()
Refresh the manager's configuration.
|
void |
remove(java.lang.String cacheName,
java.lang.String key)
Remove the object from the specified cache with the specified key
|
static void |
setCachingEnabled(boolean cachingEnabled) |
static void |
setLastEventProcessed(int lastEventProcessed) |
void |
setLastIndex()
If the lastEventProcessed Index is -1 (hasn't yet been set) we set it to the highest index in
the events table.
|
void |
shutdown()
Shutdown the Caches
|
void |
startup()
Start up the Caches
|
boolean |
useEhcache()
Use Ehcache?
|
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
protected static org.apache.commons.logging.Log log
protected static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> staticKKCaches
public static int cacheType
public static boolean started
public static boolean lastIndexSet
protected static java.lang.String mutex
protected static java.lang.String lastIndexMutex
protected static java.lang.String KKSizeCheckMutex
protected static java.lang.String KKProdCacheQMutex
protected static int lastEventProcessed
protected static java.util.Map<java.lang.String,CacheMgr.StaticData> staticDataHM
protected static java.util.LinkedList<java.lang.String> kkProdCacheQueue
protected static java.util.Set<java.lang.String> kkProdCacheSet
public CacheMgr(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic void startup()
CacheMgrIf
startup
in interface CacheMgrIf
public boolean useEhcache()
CacheMgrIf
useEhcache
in interface CacheMgrIf
public void shutdown()
CacheMgrIf
shutdown
in interface CacheMgrIf
public java.lang.Object get(java.lang.String cacheName, java.lang.String key)
CacheMgrIf
get
in interface CacheMgrIf
cacheName
- name of the cachekey
- key of the object to getpublic void remove(java.lang.String cacheName, java.lang.String key)
CacheMgrIf
remove
in interface CacheMgrIf
cacheName
- name of the cachekey
- key of the object to removepublic void put(java.lang.String cacheName, java.lang.String key, java.lang.Object value)
CacheMgrIf
put
in interface CacheMgrIf
cacheName
- name of the cachekey
- key of the object to putvalue
- value to putprotected void checkKonaKartCacheSize(java.lang.String cacheName, java.util.Map<java.lang.String,java.lang.Object> kkCache)
cacheName
- the cacheNamekkCache
- the kkCachepublic void flush(java.lang.String cacheName)
CacheMgrIf
flush
in interface CacheMgrIf
cacheName
- the cacheNamepublic void flushProduct(int productId)
CacheMgrIf
flushProduct
in interface CacheMgrIf
productId
- the productIdpublic void processEvents() throws java.lang.Exception
processEvents
in interface CacheMgrIf
java.lang.Exception
- an unexpected exceptionpublic void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface CacheMgrIf
java.lang.Exception
- an unexpected exceptionpublic void dumpCacheStatus(java.lang.String cacheName)
dumpCacheStatus
in interface CacheMgrIf
cacheName
- the cacheNamepublic int getCacheType()
CacheMgrIf
getCacheType
in interface CacheMgrIf
public void setLastIndex()
public static int getLastEventProcessed()
public static void setLastEventProcessed(int lastEventProcessed)
lastEventProcessed
- the lastEventProcessed to setpublic boolean isCachingEnabled()
CacheMgrIf
isCachingEnabled
in interface CacheMgrIf
public static void setCachingEnabled(boolean cachingEnabled)
cachingEnabled
- the cachingEnabled to setpublic boolean isCacheMgrStarted()
CacheMgrIf
isCacheMgrStarted
in interface CacheMgrIf
Copyright © 2018 DS Data Systems UK Ltd.