public interface Cache extends Serializable
Each level of the hierarchy could use a different caching strategy. The cache
is initialize by defining the classes that handle the caching for one level.
These classes must implement the CacheLevel
interface.
Level configuration string format: "
<class name> [param1=value1,param2=value2,...]
".
For example:
org.apache.opencmis.client.bindings.cache.impl.MapCacheLevelImpl capacity=10
CacheLevel
Modifier and Type | Method and Description |
---|---|
int |
check(String... keys)
Checks if a given key is in the cache.
|
Object |
get(String... keys)
Retrieves an object from the cache.
|
void |
initialize(String[] cacheLevelConfig)
Initializes the cache.
|
void |
put(Object value,
String... keys)
Adds an object to the cache.
|
void |
remove(String... keys)
Removes a branch or leaf from the cache.
|
void |
removeAll()
Removes all entries from the cache.
|
void |
writeLock()
Applies a write lock.
|
void |
writeUnlock()
Releases a write lock.
|
void initialize(String[] cacheLevelConfig)
cacheLevelConfig
- the level configuration strings from the root to the leafsvoid put(Object value, String... keys)
value
- the objectkeys
- the keys for this objectObject get(String... keys)
keys
- the keysnull
if the branch or leaf doesn't existvoid remove(String... keys)
keys
- the keys of the branch or leafvoid removeAll()
int check(String... keys)
keys
- the keys of the branch or leafkeys.length
if the object is in the cachevoid writeLock()
void writeUnlock()
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.