|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
An interface for an hierarchical cache.
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
Method Summary | |
---|---|
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 |
writeLock()
Applies a write lock. |
void |
writeUnlock()
Releases a write lock. |
Method Detail |
---|
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 keys
null if the branch or leaf doesn't exist
void remove(String... keys)
keys
- the keys of the branch or leafint check(String... keys)
keys
- the keys of the branch or leaf
keys.length
if the object is in the cachevoid writeLock()
void writeUnlock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |