com.google.code.ssm.spring
Class ExtendedSSMCacheManager
java.lang.Object
com.google.code.ssm.spring.SSMCacheManager
com.google.code.ssm.spring.ExtendedSSMCacheManager
- All Implemented Interfaces:
- InitializingBean, CacheManager
public class ExtendedSSMCacheManager
- extends SSMCacheManager
CacheManager backed by a Simple Spring Memcached (SSM) Cache. Spring Cache and
CacheManager doesn't support configuring expiration time per method (there is no dedicated parameter in cache
annotation to pass expiration time). This extension of SSMCacheManager overcomes this limitation and allow to
pass expiration time as a part of cache name. To define custom expiration on method as a cache name use concatenation
of specific cache name, separator and expiration e.g.
public class UserDAO {
// cache name: userCache, expiration: 300s
@Cacheable("userCache#300")
public User getUser(String name) {
}
}
- Since:
- 3.0.0
- Author:
- Jakub BiaĆek
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtendedSSMCacheManager
public ExtendedSSMCacheManager()
getCache
public SSMCache getCache(String name)
- Specified by:
getCache in interface CacheManager- Overrides:
getCache in class SSMCacheManager
getSeparator
public char getSeparator()
setSeparator
public void setSeparator(char separator)
- Char that separates cache name and expiration time, default: #.
- Parameters:
separator -
Copyright © 2014. All rights reserved.