memcached - Compare and Swap (CAS) implementation in EhCache -
i trying find equivalent of memcache's casmutator.cas in ehcache. essentially, swapping out ehcache memcache , need implement interface calls setting value via cas. have insight this? also, given i'm not purporting expert in of this, if has high level overview of how cas works / doing, appreciated well. the compare , swap method equivalent in ehcache replace(element old, element element) method found in net.sf.ehcache.cache. method compares "old" element against element in cache and, if matches, replaces element in cache "element." following method provides simple usage example assumes "acache" cache object method has access , "acache" used cache objects of type long. // replace cached value associated key newvalue , // return original value public long replace(string key, long newvalue, long maxtries) boolean success = false; long originalvalue; element originalelement; element newelement = new elemen...