Package cn.bran.japid.rendererloader

Examples of cn.bran.japid.rendererloader.TemplateClassLoader.loadClass()


    ClassLoader cl = _parentClassLoader == null ? JapidRenderer.class.getClassLoader() : _parentClassLoader;
    // do I need to new instance of TemplateClassLoader for each invocation?
    // likely...
    TemplateClassLoader classReloader = new TemplateClassLoader(cl);
    try {
      Class<JapidTemplateBaseWithoutPlay> loadClass = (Class<JapidTemplateBaseWithoutPlay>) classReloader
          .loadClass(rc.getClassName());
      rc.setClz(loadClass);
      return loadClass;
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
View Full Code Here


        for (RendererClass rc: classes.values()) {
          try {
            if (isDevMode())
              rc.setClz(null); // to enable JIT loading in dev mode
            else
              rc.setClz((Class<JapidTemplateBaseWithoutPlay>) classReloader.loadClass(rc.getClassName()));
          } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
          }
        }
        howlong("compile/load time for " + names.length + " classes", t);
View Full Code Here

      RendererClass rendererClass = classes.get(c);
      rendererClass.setLastUpdated(0);
    }
    TemplateClassLoader classReloader = new TemplateClassLoader();
    try {
      Class<JapidTemplateBaseWithoutPlay> loadClass = (Class<JapidTemplateBaseWithoutPlay>) classReloader.loadClass(name);
      rc.setClz(loadClass);
      return loadClass;
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

          japidClasses.get(k).setClz(null);
        }

        TemplateClassLoader loader = getClassLoader();
        for (String cname : updatedClasses) {
          loader.loadClass(cname);
        }
      }
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
View Full Code Here

        compiler.compile(names.toArray(new String[] {}));
        howlong("compile time for " + names.size() + " classes", t);

        TemplateClassLoader loader = getClassLoader();
        for (String cname : names) {
          loader.loadClass(cname);
        }
      }
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
View Full Code Here

                    // refresh will erase dynamic template
                    // class from this container.
      compiler.compile(new String[] { key });
      dynamicClasses.put(key, rc);
      TemplateClassLoader loader = getClassLoader();
      loader.loadClass(key);
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
      throw new RuntimeException(e);
    }
View Full Code Here

          japidClasses.get(k).setClz(null);
        }

        TemplateClassLoader loader = getClassLoader();
        for (String cname : updatedClasses) {
          loader.loadClass(cname);
        }
      }
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
View Full Code Here

        compiler.compile(names.toArray(new String[] {}));
        howlong("compile time for " + names.size() + " classes", t);

        TemplateClassLoader loader = getClassLoader();
        for (String cname : names) {
          loader.loadClass(cname);
        }
      }
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
View Full Code Here

                    // refresh will erase dynamic template
                    // class from this container.
      compiler.compile(new String[] { key });
      dynamicClasses.put(key, rc);
      TemplateClassLoader loader = getClassLoader();
      loader.loadClass(key);
    } catch (Exception e) {
      if (e instanceof JapidTemplateException)
        throw (JapidTemplateException) e;
      throw new RuntimeException(e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.