Has anyone tried invalidating a memcached namespace based on timestamp? For e.g. I need to have a memcached namespace which is the timestamp of the tomcat server that hosts my API services. I need to annotate my method calls so that the namespace is a variable (rather than a constant) and it holds a timestamp of the server startup.
@ReadThroughAssignCache(namespace = "api_divisions_", assignedKey="allDivisions")
public List<Division> getAllDivisions()
{
List<Division> all = (List<Division>)getHibernateTemplate().find("from Division");
return all;
}
然后每次服务器启动时, 此方法上的命名空间需要动态设置为服务器启动时间 。
- 我知道最新消息,有 环绕的方式这样做 使用java助理 和动态说明, 但我想要一个更好的方法。
- Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz, Gotz