Class EHCacheImpl<T>
java.lang.Object
org.serviceconnector.cache.ehcache.EHCacheImpl<T>
- Type Parameters:
T-
- All Implemented Interfaces:
ISCCacheModule<T>
The Class EHCacheSCMPCacheImpl. This class wraps the EHCache implementation of a cache.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys the cache module.Gets the object from cache module.Gets the cache name.getCreationTime(String key) Gets the creation time.getExpirationTime(String key) Gets the expiration time.longGets the in memory size.Gets the list of keys in the cache module.getLastAccessTime(String key) Gets the last access time.longGets the disk store size.longGets the memory store size.longGets the off heap size.voidputOrUpdate(Object key, T value, int timeToLiveSeconds) Put the object in cache module.Removes the object from cache module.voidRemoves all the objects from cache module.voidReplace the object in cache module.
-
Method Details
-
get
Gets the object from cache module.- Specified by:
getin interfaceISCCacheModule<T>- Parameters:
key- the key- Returns:
- the object
-
putOrUpdate
Put the object in cache module. Existing elements are replaced.- Specified by:
putOrUpdatein interfaceISCCacheModule<T>- Parameters:
key- the keyvalue- the value to storetimeToLiveSeconds- seconds the object has to stay in cache module from now on
-
replace
Description copied from interface:ISCCacheModuleReplace the object in cache module. Element has to be in place otherwise replace fails.- Specified by:
replacein interfaceISCCacheModule<T>- Parameters:
key- the keyvalue- the value to storetimeToLiveSeconds- seconds the object has to stay in cache module from now on
-
getExpirationTime
Description copied from interface:ISCCacheModuleGets the expiration time.- Specified by:
getExpirationTimein interfaceISCCacheModule<T>- Parameters:
key- the key- Returns:
- the expiration time
-
getCreationTime
Description copied from interface:ISCCacheModuleGets the creation time.- Specified by:
getCreationTimein interfaceISCCacheModule<T>- Parameters:
key- the key- Returns:
- the creation time
-
getLastAccessTime
Description copied from interface:ISCCacheModuleGets the last access time.- Specified by:
getLastAccessTimein interfaceISCCacheModule<T>- Parameters:
key- the key- Returns:
- the last access time
-
getKeyList
Description copied from interface:ISCCacheModuleGets the list of keys in the cache module.- Specified by:
getKeyListin interfaceISCCacheModule<T>- Returns:
- the keys with expire check
-
getCacheModuleName
Gets the cache name.- Specified by:
getCacheModuleNamein interfaceISCCacheModule<T>- Returns:
- the cache name
-
getNumberOfMessagesInStore
public long getNumberOfMessagesInStore()Gets the memory store size.- Specified by:
getNumberOfMessagesInStorein interfaceISCCacheModule<T>- Returns:
- the memory store size
-
getNumberOfMessagesInDiskStore
public long getNumberOfMessagesInDiskStore()Gets the disk store size.- Specified by:
getNumberOfMessagesInDiskStorein interfaceISCCacheModule<T>- Returns:
- the disk store size
-
getOffHeapSize
public long getOffHeapSize()Description copied from interface:ISCCacheModuleGets the off heap size.- Specified by:
getOffHeapSizein interfaceISCCacheModule<T>- Returns:
- the off heap size
-
getInMemorySize
public long getInMemorySize()Description copied from interface:ISCCacheModuleGets the in memory size.- Specified by:
getInMemorySizein interfaceISCCacheModule<T>- Returns:
- the in memory size
-
remove
Removes the object from cache module.- Specified by:
removein interfaceISCCacheModule<T>- Parameters:
key- the key- Returns:
- true, if successful
-
removeAll
public void removeAll()Removes all the objects from cache module.- Specified by:
removeAllin interfaceISCCacheModule<T>
-
destroy
public void destroy()Destroys the cache module.- Specified by:
destroyin interfaceISCCacheModule<T>
-