Package org.serviceconnector.cache
Interface ISCCacheModule<T>
- All Known Implementing Classes:
EHCacheImpl
public interface ISCCacheModule<T>
The Interface ISCCacheModule. Abstracts SC caches modules. A SCCache holds cache modules. A cache module is a logical part 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.- Parameters:
key- the key- Returns:
- the object
-
putOrUpdate
Put the object in cache module. Existing elements are replaced.- Parameters:
key- the keyvalue- the value to storetimeToLiveSeconds- seconds the object has to stay in cache module from now on
-
replace
Replace the object in cache module. Element has to be in place otherwise replace fails.- Parameters:
key- the keyvalue- the value to storetimeToLiveSeconds- seconds the object has to stay in cache module from now on
-
getKeyList
Gets the list of keys in the cache module.- Returns:
- the keys with expire check
-
getExpirationTime
Gets the expiration time.- Parameters:
key- the key- Returns:
- the expiration time
-
getCreationTime
Gets the creation time.- Parameters:
key- the key- Returns:
- the creation time
-
getLastAccessTime
Gets the last access time.- Parameters:
key- the key- Returns:
- the last access time
-
getCacheModuleName
String getCacheModuleName()Gets the cache name.- Returns:
- the cache name
-
getNumberOfMessagesInStore
long getNumberOfMessagesInStore()Gets the memory store size.- Returns:
- the memory store size
-
getNumberOfMessagesInDiskStore
long getNumberOfMessagesInDiskStore()Gets the disk store size.- Returns:
- the disk store size
-
getOffHeapSize
long getOffHeapSize()Gets the off heap size.- Returns:
- the off heap size
-
getInMemorySize
long getInMemorySize()Gets the in memory size.- Returns:
- the in memory size
-
remove
Removes the object from cache module.- Parameters:
key- the key- Returns:
- true, if successful
-
removeAll
void removeAll()Removes all the objects from cache module. -
destroy
void destroy()Destroys the cache module.
-