iam trying to get method level caching on my service layer and i want to use it by annotation only and not having put a xml entry to every cache name.
but looks like if i have to add a new cache i have to put a entry in the Set for each in in cachemanager bean.
is there a way to drive this fully from annotation.
like if i have findById and findBySubjectId methods looks like i need two ssmcache instances and both have to be declared in the SET for cachemanager bean.
am i missing something.
<cache:annotation-driven />
<bean name="cacheManager" class="com.google.code.ssm.spring.SSMCacheManager">
<property name="caches">
<set>
<bean class="com.google.code.ssm.spring.SSMCache">
<constructor-arg name="cache" index="0" ref="defaultCache" />
<constructor-arg name="expiration" index="1" value="${memcached.timeout}" />
</bean>
<bean class="com.google.code.ssm.spring.SSMCache">
<constructor-arg name="cache" index="0" ref="findById" />
<constructor-arg name="expiration" index="1" value="${memcached.timeout}" />
</bean>
</set>
</property>
</bean>
<bean name="defaultCache" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="default" />
<property name="cacheClientFactory" ref="myCacheClientFactory" />
<property name="addressProvider" ref="myCacheAddressProvider" />
<property name="configuration" ref="myCacheConfiguration" />
</bean>
<bean name="findById" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="findById" />
<property name="cacheClientFactory" ref="myCacheClientFactory" />
<property name="addressProvider" ref="myCacheAddressProvider" />
<property name="configuration" ref="myCacheConfiguration" />
</bean>
<bean name="myCacheClientFactory" class="com.google.code.ssm.providers.spymemcached.MemcacheClientFactoryImpl" />
<bean name="myCacheAddressProvider" class="com.google.code.ssm.config.DefaultAddressProvider">
<property name="address" value="${memcached.nodeAddresses}" />
</bean>
<bean name="myCacheConfiguration" class="com.google.code.ssm.providers.CacheConfiguration">
<property name="consistentHashing" value="true" />
<property name="useBinaryProtocol" value="true" />
</bean>