org.apache.chemistry.opencmis.client.bindings.cache.impl
Class CacheImpl

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.bindings.cache.impl.CacheImpl
All Implemented Interfaces:
java.io.Serializable, Cache

public class CacheImpl
extends java.lang.Object
implements Cache

Default cache implementation.

See Also:
Serialized Form

Constructor Summary
CacheImpl()
          Constructor.
CacheImpl(java.lang.String name)
          Constructor.
 
Method Summary
 int check(java.lang.String... keys)
          Checks if a given key is in the cache.
 java.lang.Object get(java.lang.String... keys)
          Retrieves an object from the cache.
 void initialize(java.lang.String[] cacheLevelConfig)
          Initializes the cache.
 void put(java.lang.Object value, java.lang.String... keys)
          Adds an object to the cache.
 void remove(java.lang.String... keys)
          Removes a branch or leaf from the cache.
 java.lang.String toString()
           
 void writeLock()
          Applies a write lock.
 void writeUnlock()
          Releases a write lock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheImpl

public CacheImpl()
Constructor.


CacheImpl

public CacheImpl(java.lang.String name)
Constructor.

Method Detail

initialize

public void initialize(java.lang.String[] cacheLevelConfig)
Description copied from interface: Cache
Initializes the cache.

Specified by:
initialize in interface Cache
Parameters:
cacheLevelConfig - the level configuration strings from the root to the leafs

get

public java.lang.Object get(java.lang.String... keys)
Description copied from interface: Cache
Retrieves an object from the cache.

Specified by:
get in interface Cache
Parameters:
keys - the keys
Returns:
the object or null if the branch or leaf doesn't exist

put

public void put(java.lang.Object value,
                java.lang.String... keys)
Description copied from interface: Cache
Adds an object to the cache.

Specified by:
put in interface Cache
Parameters:
value - the object
keys - the keys for this object

remove

public void remove(java.lang.String... keys)
Description copied from interface: Cache
Removes a branch or leaf from the cache.

Specified by:
remove in interface Cache
Parameters:
keys - the keys of the branch or leaf

check

public int check(java.lang.String... keys)
Description copied from interface: Cache
Checks if a given key is in the cache.

Specified by:
check in interface Cache
Parameters:
keys - the keys of the branch or leaf
Returns:
the index of the first key part that is not in the cache or keys.length if the object is in the cache

writeLock

public void writeLock()
Description copied from interface: Cache
Applies a write lock.

Specified by:
writeLock in interface Cache

writeUnlock

public void writeUnlock()
Description copied from interface: Cache
Releases a write lock.

Specified by:
writeUnlock in interface Cache

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.