I use ehcache (not replicated or distributed) in my application and as I know it can be accessed only from the same JVM but all the applications in the same JVM (e.g. deployed in a app server) can get values from the cache. Am I right?
What I want is that only my application can get the cache and its values. Is it possible somehow? I checked the XML config file but I haven't found any configuration to control this. Or should I set something when I get the cache from CacheManager?
It is how I get the cache in code:
private static final String LOCAL_CACHE_NAME = "LOCAL_PROTNEUT_STORE";
private Cache getCache() {
// the name of the ehcache should be able to be configured in the general config XML
URL url = getClass().getResource("/protneut-local-ehcache.xml");
CacheManager manager = CacheManager.create(url);
Cache cache = manager.getCache(LOCAL_CACHE_NAME);
return cache;
}
The config file:
<ehcache>
<cache name="LOCAL_PROTNEUT_STORE" maxElementsInMemory="500" eternal="true" memoryStoreEvictionPolicy="LRU" />
</ehcache>
Is it possible to control the access at all?
Thanks for the help!
Regards,
V.