public boolean actionNameIsCachableForClass(Class actionClass, String actionName) {
return policyCacheEntryForClass(actionClass, actionName) != null;
}
public ERXMultiKey cacheKeyForRequest(Class actionClass, String actionName, WORequest request) {
ERXMultiKey cacheKey = null;
PolicyCacheEntry cacheEntry = policyCacheEntryForClass(actionClass, actionName);
if (cacheEntry != null) {
int count = 0;
Object[] cache = new Object[cacheEntry.count + 2];
cache[count++] = actionClass;
cache[count++] = actionName;
if (cacheEntry.formKeys.count() > 0) {
for (Enumeration formKeyEnumerator = cacheEntry.formKeys.objectEnumerator();
formKeyEnumerator.hasMoreElements();) {
String formKey = (String)formKeyEnumerator.nextElement();
cache[count++] = request.formValueForKey(formKey);
}
}
if (cacheEntry.headerKeys.count() > 0) {
for (Enumeration headerKeyEnumerator = cacheEntry.headerKeys.objectEnumerator();
headerKeyEnumerator.hasMoreElements();) {
String headerKey = (String)headerKeyEnumerator.nextElement();
cache[count++] = request.headerForKey(headerKey);
}
}
if (cacheEntry.cookieKeys.count() > 0) {
for (Enumeration cookieKeyEnumerator = cacheEntry.cookieKeys.objectEnumerator();
cookieKeyEnumerator.hasMoreElements();) {
String cookieKey = (String)cookieKeyEnumerator.nextElement();
cache[count++] = request.cookieValueForKey(cookieKey);
}
}
cacheKey = new ERXMultiKey(cache);
}
return cacheKey;
}