本文整理汇总了Java中org.ofbiz.base.util.cache.UtilCache.clearAllCaches方法的典型用法代码示例。如果您正苦于以下问题:Java UtilCache.clearAllCaches方法的具体用法?Java UtilCache.clearAllCaches怎么用?Java UtilCache.clearAllCaches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.base.util.cache.UtilCache
的用法示例。
在下文中一共展示了UtilCache.clearAllCaches方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearAllEvent
import org.ofbiz.base.util.cache.UtilCache; //导入方法依赖的package包/类
/** An HTTP WebEvent handler that clears all caches
* @param request The HTTP request object for the current JSP or Servlet request.
* @param response The HTTP response object for the current JSP or Servlet request.
* @return return an HTTP WebEvent handler that clears all caches
*/
public static String clearAllEvent(HttpServletRequest request, HttpServletResponse response) {
String errMsg = "";
Locale locale = UtilHttp.getLocale(request);
Security security = (Security) request.getAttribute("security");
if (!security.hasPermission("UTIL_CACHE_EDIT", request.getSession())) {
errMsg = UtilProperties.getMessage(UtilCacheEvents.err_resource, "utilCacheEvents.permissionEdit", locale) + ".";
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
UtilCache.clearAllCaches();
errMsg = UtilProperties.getMessage(UtilCacheEvents.err_resource, "utilCache.clearAllCaches", locale);
request.setAttribute("_EVENT_MESSAGE_", errMsg + " (" + UtilDateTime.nowDateString("yyyy-MM-dd HH:mm:ss") + ").");
return "success";
}