Hi,
It is possible to register a new cache on the fly by using SSMCacheManager.addCache() method. When a cache is registered under a given name it can be accessed in @Cacheable annotation.
A several caches can be registered on the startup by using:
cacheManager.setCaches(Arrays.asList(new SSMCache(cache1, 0, false), new SSMCache(cache2, 0, false));
where each cache can be created by using java code that corresponds below XML (example is for xmemcached provider):
<bean name="memcachedClient1" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="myCache1"/>
<property name="cacheClientFactory">
<bean name="cacheClientFactory" class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl" />
</property>
<property name="addressProvider">
<bean class="com.google.code.ssm.config.DefaultAddressProvider">
<property name="address" value="127.0.0.1:11211" />
</bean>
</property>
<property name="configuration">
<bean class="com.google.code.ssm.providers.CacheConfiguration">
<property name="consistentHashing" value="true" />
</bean>
</property>
</bean>
then @Cacheable(cacheName="myCache1") can be used
-- RaGnoR