on 2018 Apr 26 3:28 PM
Hi Team,
I followed several wiki links and trying to create a custom cache region. But i dont see that getting reflected in the below regions debug/ or in HAC, when i try to get all the regions available. Am i missing anything? and, how do we access / get to know if a key i have created is present in cache or not?
any trial to create a new cache and add/ retrieve elements from it?
How to access custom cache to look up for my key and retrieve value?
code:
Bean creation:
<bean name="customCacheRegion" class="de.hybris.platform.regioncache.region.impl.EHCacheRegion">
<constructor-arg name="name" value="customCacheRegion" />
<constructor-arg name="maxEntries" value="${regioncache.contractPriceCache.size}" />
<constructor-arg name="evictionPolicy" value="${regioncache.contractPriceCache.evictionpolicy}" />
<constructor-arg name="statsEnabled" value="${regioncache.stats.enabled}" />
<constructor-arg name="exclusiveComputation" value="${regioncache.exclusivecomputation}" />
<constructor-arg name="ttlSeconds" value="${regioncache.contractPriceCache.ttl}" />
<property name="handledTypes"><null/></property>
</bean>
Registering bean :
<bean id="customCacheRegion" class="de.hybris.platform.regioncache.region.CacheRegionRegistrar"
c:region-ref="customCacheRegion" />
Trying to read from available regions:
@Autowired CacheController controller;
Collection regions = controller.getRegions(); for (CacheRegion region : regions) { CacheStatistics stats = region.getCacheRegionStatistics();
}
Regards, Sandeep
Request clarification before answering.
Hi ,
It's good to create a new spring xml file in your extension, and mention the spring xml in global context property in your extension as follows
xxx . global−context=xxx−cache−spring . xml
Thanks,
Venki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.