Interface ICacheService<K,V>
- All Known Subinterfaces:
ICacheServiceNonLocal<K,
,V> IRemoteCacheServer<K,
,V> IRemoteHttpCacheClient<K,
V>
- All Known Implementing Classes:
AbstractRemoteCacheService
,LateralTCPService
,RemoteCacheServer
,RemoteHttpCacheClient
,RemoteHttpCacheService
,ZombieCacheService
,ZombieCacheServiceNonLocal
public interface ICacheService<K,V>
Used to retrieve and update the cache.
Note: server which implements this interface provides a local cache service, whereas server which implements IRmiCacheService provides a remote cache service.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Frees the specified cache.Returns a cache bean from the specified cache; or null if the key does not exist.Map<K,
ICacheElement<K, V>> getMatching
(String cacheName, String pattern) Gets multiple items from the cache matching the pattern.Map<K,
ICacheElement<K, V>> getMultiple
(String cacheName, Set<K> keys) Gets multiple items from the cache based on the given set of keys.void
release()
Frees all caches.void
Removes the given key from the specified cache.void
Remove all keys from the specified cache.void
update
(ICacheElement<K, V> item) Puts a cache item to the cache.
-
Method Details
-
update
Puts a cache item to the cache.- Parameters:
item
-- Throws:
ObjectExistsException
IOException
-
get
Returns a cache bean from the specified cache; or null if the key does not exist.- Parameters:
cacheName
-key
-- Returns:
- the ICacheElement<K, V> or null if not found
- Throws:
ObjectNotFoundException
IOException
-
getMultiple
Map<K,ICacheElement<K, getMultipleV>> (String cacheName, Set<K> keys) throws ObjectNotFoundException, IOException Gets multiple items from the cache based on the given set of keys.- Parameters:
cacheName
-keys
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
ObjectNotFoundException
IOException
-
getMatching
Gets multiple items from the cache matching the pattern.- Parameters:
cacheName
-pattern
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache matching the pattern.
- Throws:
IOException
-
remove
Removes the given key from the specified cache.- Parameters:
cacheName
-key
-- Throws:
IOException
-
removeAll
Remove all keys from the specified cache.- Parameters:
cacheName
-- Throws:
IOException
-
dispose
Frees the specified cache.- Parameters:
cacheName
-- Throws:
IOException
-
release
Frees all caches.- Throws:
IOException
-