public class CacheWrapper extends Object implements CacheManagement
| Modifier and Type | Field and Description |
|---|---|
CacheManagement |
cache |
| Modifier | Constructor and Description |
|---|---|
protected |
CacheWrapper(CacheManagement cache) |
| Modifier and Type | Method and Description |
|---|---|
Serializable |
get(String key)
Get method to retrieve value from cache Must not raise exception if the key is null, but return null
|
String |
getName()
Get cache name as specified in the descriptor
|
long |
getSize()
Returns this cache size (approximate number of entries), or
-1 if the number of entries is unknown or too
expensive to compute. |
boolean |
hasEntry(String key)
Check if a given key is present inside the cache.
|
void |
invalidate(String key)
Invalidate the given key
|
void |
invalidateAll()
Invalidate all key-value stored in the cache
|
void |
invalidateLocal(String key)
Invalidates the given key locally.
|
void |
invalidateLocalAll()
Invalidates all keys locally.
|
Set<String> |
keySet()
Returns the set of all keys stored in the cache.
|
void |
put(String key,
Serializable value)
Put method to store a
Serializable value |
void |
putLocal(String key,
Serializable value)
Stores a
Serializable value into the cache locally. |
void |
start()
Starts this cache.
|
void |
stop()
Stops this cache and releases related resources.
|
String |
toString() |
public final CacheManagement cache
protected CacheWrapper(CacheManagement cache)
public String getName()
Cachepublic Serializable get(String key)
Cacheget in interface Cachekey - the string keySerializable value, return null if the key does not exist or if the key is nullpublic Set<String> keySet()
Cachepublic void invalidateLocal(String key)
CacheManagementinvalidateLocal in interface CacheManagementkey - the key to remove from the cachepublic void invalidate(String key)
Cacheinvalidate in interface Cachepublic void invalidateLocalAll()
CacheManagementinvalidateLocalAll in interface CacheManagementpublic void invalidateAll()
CacheinvalidateAll in interface Cachepublic void putLocal(String key, Serializable value)
CacheManagementSerializable value into the cache locally. Does not propagate invalidations.putLocal in interface CacheManagementkey - the keyvalue - the valuepublic void put(String key, Serializable value)
CacheSerializable valuepublic boolean hasEntry(String key)
Cachepublic void start()
CacheManagementstart in interface CacheManagementpublic void stop()
CacheManagementstop in interface CacheManagementpublic long getSize()
CacheManagement-1 if the number of entries is unknown or too
expensive to compute.getSize in interface CacheManagement-1Copyright © 2018 Nuxeo. All rights reserved.