Is it possible to use Ehcache Cache Server and have it be configured with blockingCache ? I cant seem to find how to configure this in the ehcache.xml file… only programatically.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can declare decorated caches programmatically, but also in configuration, see:
http://ehcache.org/documentation/apis/cache-decorators#by-configuration
You’d need to add a net.sf.ehcache.constructs.CacheDecoratorFactory implementation that does what you need. I guess in you’re case it could do some pattern matching against the Ehcache instance passed to the net.sf.ehcache.constructs.CacheDecoratorFactory#createDecoratedEhcache and return either null, or the cache instance decorated by the BlockingCache.
Word of caution though, is to make sure that on misses, you always put back (even null) into the cache, otherwise the write lock for that key/segment won’t be unlocked.