private ResponseWrapper fetchContentFromCacheIfAvailable(final RenderRequest req, final String serviceUrl) {
ResponseWrapper rslt = null; // default
final List<CacheTuple> cacheKeysToTry = new ArrayList<>();
// Don't use private-scope caching for anonymous users
if (req.getRemoteUser() != null) {
cacheKeysToTry.add(
// Private-scope cache key
new CacheTuple(serviceUrl, req.getPortletMode().toString(),
req.getWindowState().toString(), req.getRemoteUser())
);
}
cacheKeysToTry.add(
// Public-scope cache key
new CacheTuple(serviceUrl, req.getPortletMode().toString(),
req.getWindowState().toString())
);
for (CacheTuple key : cacheKeysToTry) {
final Element cacheElement = this.responseCache.get(key);
if (cacheElement != null) {
rslt = (ResponseWrapper) cacheElement.getObjectValue();
break;
}
}
return rslt;
}
SoffitConnectorController.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:Soffit
作者:
评论列表
文章目录