String filterContext = context + "filter" + i + "."; String className = properties.getProperty(filterContext + "className"); filters[i] = (ForumMessageFilter) Class.forName(className).newInstance(); // If this filter isn't cacheable, then no further filters can // be cached. if (!filters[i].isCacheable()) { uncacheableIndex = i; }
if (!filters.isCacheable()) { uncacheableIndex = i; } 的作用按照注释所说当遇见不能cache的filter后,剩下的filter过滤的结果均不能被cache,可是这里有个疑问,如果fiters[]中出现了多个不能cache的filter,按照程序中,uncacheableIndex将定位在最后一个不能cache的filter上,那么在其之前的不能cacahe的filter不是被cache了吗?