ehcache

net.sf.ehcache.concurrent
Interface CacheLockProvider

All Known Implementing Classes:
StripedReadWriteLockSync

public interface CacheLockProvider

Author:
Alex Snaps

Method Summary
 Sync[] getAndWriteLockAllSyncForKeys(java.lang.Object... keys)
          Gets and write lock the Sync Stripes to use for the given keys.
 Sync getSyncForKey(java.lang.Object key)
          Gets the Sync Stripe to use for a given key.
 void unlockWriteLockForAllKeys(java.lang.Object... keys)
          write unlock the Sync Stripes to use for the given keys.
 

Method Detail

getSyncForKey

Sync getSyncForKey(java.lang.Object key)
Gets the Sync Stripe to use for a given key.

This lookup must always return the same Sync for a given key.

Parameters:
key - the key
Returns:
one of a limited number of Sync's.

getAndWriteLockAllSyncForKeys

Sync[] getAndWriteLockAllSyncForKeys(java.lang.Object... keys)
Gets and write lock the Sync Stripes to use for the given keys.

This lookup must always return the same Sync for a given key. For keys.length > 0, it will return anything between 1 and keys.length Sync's

Parameters:
keys - the keys to lock and get syncs for
Returns:
limited number of write locked Sync's matching the keys.

unlockWriteLockForAllKeys

void unlockWriteLockForAllKeys(java.lang.Object... keys)
write unlock the Sync Stripes to use for the given keys.

Parameters:
keys - the keys to unlock

ehcache

true