org.smallmind.quorum.cache
Class LockableCacheEnforcer<K,V>

java.lang.Object
  extended by org.smallmind.quorum.cache.LockableCacheEnforcer<K,V>
All Implemented Interfaces:
Cache<K,V>, LockableCache<K,V>

public class LockableCacheEnforcer<K,V>
extends Object
implements LockableCache<K,V>


Constructor Summary
LockableCacheEnforcer(LockingCache<K,V> cache)
           
 
Method Summary
 void clear()
           
 void close()
           
<R> R
executeLockedCallback(LockedCallback<K,R> callback)
           
 boolean exists(K key)
           
 V get(K key, Object... parameters)
           
 String getCacheName()
           
 long getLockTimeout()
           
 boolean isClosed()
           
 void lock(K key)
           
 V put(K key, V value)
           
 V putIfAbsent(K key, V value)
           
 V remove(K key)
           
 int size()
           
 void unlock(K key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockableCacheEnforcer

public LockableCacheEnforcer(LockingCache<K,V> cache)
Method Detail

getLockTimeout

public long getLockTimeout()
Specified by:
getLockTimeout in interface LockableCache<K,V>

lock

public void lock(K key)
Specified by:
lock in interface LockableCache<K,V>

unlock

public void unlock(K key)
Specified by:
unlock in interface LockableCache<K,V>

executeLockedCallback

public <R> R executeLockedCallback(LockedCallback<K,R> callback)
Specified by:
executeLockedCallback in interface LockableCache<K,V>

size

public int size()
Specified by:
size in interface Cache<K,V>

getCacheName

public String getCacheName()
Specified by:
getCacheName in interface Cache<K,V>

get

public V get(K key,
             Object... parameters)
Specified by:
get in interface Cache<K,V>

remove

public V remove(K key)
Specified by:
remove in interface Cache<K,V>

put

public V put(K key,
             V value)
Specified by:
put in interface Cache<K,V>

putIfAbsent

public V putIfAbsent(K key,
                     V value)
Specified by:
putIfAbsent in interface Cache<K,V>

exists

public boolean exists(K key)
Specified by:
exists in interface Cache<K,V>

clear

public void clear()
Specified by:
clear in interface Cache<K,V>

isClosed

public boolean isClosed()
Specified by:
isClosed in interface Cache<K,V>

close

public void close()
Specified by:
close in interface Cache<K,V>


Copyright © 2012. All Rights Reserved.