我有这个方法:
@Service // org.jboss.errai.bus.server.annotations.Service
class StuffServiceImpl implements StuffService {
@Override
public List<String> getStuffForUser(Account account) {
return restClient.getStuffByAccount(account);
}
}
在应用程序的生命周期中被多次调用。我需要做一个简单的缓存,在方法上传递相同的帐户 id 时,而不是再次调用其余客户端。它只会从缓存中获取结果。
我不想手动创建缓存系统,只想使用现有的适用缓存框架。
此外,应该有一种方法可以刷新此方法的“缓存”,例如在用户注销时使用。