コード例 #1
0
 public void init(com.caucho.java.LineMap lineMap, com.caucho.vfs.Path appDir)
     throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   _caucho_line_map = new com.caucho.java.LineMap("_main__jsp.java", "foo");
   _caucho_line_map.add("/myadmin/main.jsp", 14, 30);
   _caucho_line_map.add(14, 32);
   _caucho_line_map.add(22, 34);
   _caucho_line_map.add(62, 75);
   _caucho_line_map.add(63, 77);
   _caucho_line_map.add(67, 79);
   _caucho_line_map.add(68, 81);
   _caucho_line_map.add(69, 83);
   _caucho_line_map.add(70, 85);
   _caucho_line_map.add(74, 87);
   _caucho_line_map.add(83, 96);
   _caucho_line_map.add(92, 98);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("myadmin/main.jsp"), "AOlUHB8X9qDorKgZ7MCqag==", false);
   _caucho_depends.add(depend);
 }
コード例 #2
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("Coach/AddCoach.jsp"), 9120939392708460488L, false);
   _caucho_depends.add(depend);
 }
コード例 #3
0
ファイル: _error__jsp.java プロジェクト: hellforever/nq-picco
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("WEB-INF/jsp/error.jsp"), -6469239493088807450L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
 }
コード例 #4
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("Survey_RatingList.jsp"), 4990420660777494174L, false);
   _caucho_depends.add(depend);
 }
コード例 #5
0
 public void init(com.caucho.vfs.Path appDir)
   throws javax.servlet.ServletException
 {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend = new com.caucho.vfs.Depend(appDir.lookup("order/download.jsp"), -8925709412953061948L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
 }
コード例 #6
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend = new com.caucho.vfs.Depend(appDir.lookup("initpass.jsp"), 7048575714632404679L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("login_check.jsp"), 5313538553479869376L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
 }
コード例 #7
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("EthnicGroup.jsp"), 6847378287986436659L, false);
   _caucho_depends.add(depend);
   depend = new com.caucho.vfs.Depend(appDir.lookup("Footer.jsp"), -3074380813858324039L, false);
   _caucho_depends.add(depend);
 }
コード例 #8
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("tweetSearch.jsp"), -3076669215319968785L, false);
   _caucho_depends.add(depend);
   depend = new com.caucho.vfs.Depend(appDir.lookup("header.jsp"), 7773134504633206276L, false);
   _caucho_depends.add(depend);
 }
コード例 #9
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend = new com.caucho.vfs.Depend(appDir.lookup("bms/info.jsp"), -3507448949258287785L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("WEB-INF/tld/MyTld.tld"), 2313055599944075409L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(dms.tag.CategorySelectTag.class, 4895540770968086576L));
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(dms.tag.CitySelectTag.class, -8095317528224568575L));
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(dms.tag.DomainSelectTag.class, -6906637344929707994L));
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(dms.tag.ServiceSelectTag.class, 1551605886958229292L));
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(dms.tag.GroupSelectTag.class, 8341835262871728445L));
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("WEB-INF/tld/fmt.tld"), 308338869353100094L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   com.caucho.jsp.JavaPage.addDepend(
       _caucho_depends,
       new com.caucho.make.ClassDependency(
           org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag.class, 7844905413159918656L));
 }
コード例 #10
0
 public void init(com.caucho.vfs.Path appDir) throws javax.servlet.ServletException {
   com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
   com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
   mergePath.addMergePath(appDir);
   mergePath.addMergePath(resinHome);
   com.caucho.loader.DynamicClassLoader loader;
   loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
   String resourcePath = loader.getResourcePathSpecificFirst();
   mergePath.addClassPath(resourcePath);
   com.caucho.vfs.Depend depend;
   depend = new com.caucho.vfs.Depend(appDir.lookup("allnews.jsp"), 4100619310644654661L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   depend =
       new com.caucho.vfs.Depend(appDir.lookup("parts/header.jsp"), 7818843393653806549L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("parts/messageBox.jsp"), 4695996236894547340L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
   depend =
       new com.caucho.vfs.Depend(
           appDir.lookup("parts/messagesDisplay.jsp"), 3651959889291330025L, false);
   com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
 }
コード例 #11
0
ファイル: EnhancerManager.java プロジェクト: dlitz/resin
  public static EnhancerManager create(ClassLoader loader) {
    EnhancerManager enhancer = _localEnhancer.getLevel(loader);

    if (enhancer == null) {
      enhancer = new EnhancerManager(loader);
      _localEnhancer.set(enhancer, loader);

      for (; loader != null; loader = loader.getParent()) {
        if (loader instanceof DynamicClassLoader) {
          ((DynamicClassLoader) loader).addTransformer(enhancer);
          break;
        }
      }
    }

    return enhancer;
  }
コード例 #12
0
ファイル: EnhancerManager.java プロジェクト: dlitz/resin
  /** Returns the enhanced .class or null if no enhancement. */
  public byte[] transform(
      ClassLoader loader,
      String className,
      Class<?> oldClass,
      ProtectionDomain domain,
      byte[] buffer) {
    if (isClassMatch(className)) {
      try {
        ClassLoader tempLoader = ((DynamicClassLoader) loader).getNewTempClassLoader();
        DynamicClassLoader workLoader = SimpleLoader.create(tempLoader, getPostWorkPath());
        workLoader.setServletHack(true);
        boolean isModified = true;

        Thread thread = Thread.currentThread();
        ClassLoader oldLoader = thread.getContextClassLoader();

        try {
          Class<?> cl = Class.forName(className.replace('/', '.'), false, workLoader);

          thread.setContextClassLoader(tempLoader);

          Method init = cl.getMethod("_caucho_init", new Class[] {Path.class});
          Method modified = cl.getMethod("_caucho_is_modified", new Class[0]);

          init.invoke(null, Vfs.lookup());

          isModified = (Boolean) modified.invoke(null);
        } catch (Exception e) {
          log.log(Level.FINEST, e.toString(), e);
        } catch (Throwable e) {
          log.log(Level.FINER, e.toString(), e);
        } finally {
          thread.setContextClassLoader(oldLoader);
        }

        if (!isModified) {
          try {
            return load(className);
          } catch (Exception e) {
            log.log(Level.FINER, e.toString(), e);
          }
        }

        ByteCodeParser parser = new ByteCodeParser();
        parser.setClassLoader(_jClassLoader);

        ByteArrayInputStream is;
        is = new ByteArrayInputStream(buffer, 0, buffer.length);

        JavaClass jClass = parser.parse(is);

        return enhance(jClass);
      } catch (RuntimeException e) {
        throw e;
      } catch (Exception e) {
        throw new EnhancerRuntimeException(e);
      }
    }

    return null;
  }
コード例 #13
0
  /** Calculates a MD5 digest of the class. */
  public String getDigest() {
    try {
      if (_className == null || "".equals(_className)) return "";

      DynamicClassLoader loader =
          (DynamicClassLoader) Thread.currentThread().getContextClassLoader();

      ClassLoader tmpLoader = loader.getNewTempClassLoader();

      Class cl = Class.forName(_className, false, tmpLoader);

      if (cl == null) return "";

      MessageDigest digest = MessageDigest.getInstance("MD5");

      addDigest(digest, cl.getName());

      addDigest(digest, cl.getModifiers());

      Class superClass = cl.getSuperclass();
      if (superClass != null) addDigest(digest, superClass.getName());

      Class[] interfaces = cl.getInterfaces();
      for (int i = 0; i < interfaces.length; i++) addDigest(digest, interfaces[i].getName());

      Field[] fields = cl.getDeclaredFields();

      Arrays.sort(fields, new FieldComparator());

      if (_checkFields) {
        for (Field field : fields) {
          if (Modifier.isPrivate(field.getModifiers()) && !_checkPrivate) continue;
          if (Modifier.isProtected(field.getModifiers()) && !_checkProtected) continue;

          addDigest(digest, field.getName());
          addDigest(digest, field.getModifiers());
          addDigest(digest, field.getType().getName());

          addDigest(digest, field.getAnnotations());
        }
      }

      Method[] methods = cl.getDeclaredMethods();
      Arrays.sort(methods, new MethodComparator());

      for (int i = 0; i < methods.length; i++) {
        Method method = methods[i];

        if (Modifier.isPrivate(method.getModifiers()) && !_checkPrivate) continue;
        if (Modifier.isProtected(method.getModifiers()) && !_checkProtected) continue;
        if (Modifier.isStatic(method.getModifiers()) && !_checkStatic) continue;

        addDigest(digest, method.getName());
        addDigest(digest, method.getModifiers());
        addDigest(digest, method.getName());

        Class[] param = method.getParameterTypes();
        for (int j = 0; j < param.length; j++) addDigest(digest, param[j].getName());

        addDigest(digest, method.getReturnType().getName());

        Class[] exn = method.getExceptionTypes();
        for (int j = 0; j < exn.length; j++) addDigest(digest, exn[j].getName());

        addDigest(digest, method.getAnnotations());
      }

      byte[] digestBytes = new byte[256];

      int len = digest.digest(digestBytes, 0, digestBytes.length);

      return digestToBase64(digestBytes, len);
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);

      return "";
    }
  }