Beispiel #1
0
  public static String call(PageContext pc, String cacheName) throws FunctionException {

    if (StringUtil.isEmpty(cacheName, true)
        || "all".equals(cacheName = cacheName.trim().toLowerCase())) {
      PagePoolClear.call(pc);
      ComponentCacheClear.call(pc);
      CTCacheClear.call(pc);
      queryCache(pc);
      tagCache(pc);
      functionCache(pc);
    } else if ("template".equals(cacheName) || "page".equals(cacheName)) {
      PagePoolClear.call(pc);
    } else if ("component".equals(cacheName) || "cfc".equals(cacheName)) {
      ComponentCacheClear.call(pc);
    } else if ("customtag".equals(cacheName) || "ct".equals(cacheName)) {
      CTCacheClear.call(pc);
    } else if ("query".equals(cacheName) || "object".equals(cacheName)) {
      queryCache(pc);
    } else if ("tag".equals(cacheName)) {
      tagCache(pc);
    } else if ("function".equals(cacheName)) {
      functionCache(pc);
    } else
      throw new FunctionException(
          pc,
          "cacheClear",
          1,
          "cacheName",
          ExceptionUtil.similarKeyMessage(
              new String[] {
                "all", "template", "component", "customtag", "query", "tag", "function"
              },
              cacheName,
              "cache name",
              "cache names"));

    return null;
  }
Beispiel #2
0
 private static void functionCache(PageContext pc) {
   ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
   config.clearFunctionCache();
   PagePoolClear.clear(config.getServerFunctionMapping());
   PagePoolClear.clear(config.getFunctionMapping());
 }
Beispiel #3
0
 private static void tagCache(PageContext pc) {
   ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
   PagePoolClear.clear(config.getServerTagMapping());
   PagePoolClear.clear(config.getTagMapping());
 }