Package nginx.clojure.wave.MethodDatabase

Examples of nginx.clojure.wave.MethodDatabase.FuzzyLazyClassEntry


      BufferedReader r = new BufferedReader(new InputStreamReader(in, MethodDatabase.UTF_8));
      db.getUserDefinedWaveConfigFiles().add(resource);
      String l = null;
      ClassEntry ce = null;
      LazyClassEntry lce = null;
      FuzzyLazyClassEntry flce = null;
      int lc = 0;
      String clz = null;
      while ((l = r.readLine()) != null) {
        lc++;
        l = l.trim();
        if (l.startsWith("class:")) {
          lce = null;
          flce = null;
          clz = l.substring("class:".length());
          ce = db.getClasses().get(clz);
          if (ce == null) {
            ce = buildClassEntryFamily(db, clz);
            if (ce == null) {
              db.warn("file %s line %d : not found class: %s", resource , lc,  clz);
              ce = null;
              continue;
            }
          }
        }else if (l.startsWith("lazyclass:")) {
          clz = l.substring("lazyclass:".length());
          ce = null;
          flce = null;
          lce = db.getLazyClasses().get(clz);
          if (lce == null) {
            db.getLazyClasses().put(clz, lce = new LazyClassEntry(resource));
          }
        }else if (l.startsWith("fuzzyclass:")) {
          clz = l.substring("fuzzyclass:".length());
          ce = null;
          lce = null;
          flce = new FuzzyLazyClassEntry(Pattern.compile(clz), resource);
          db.getFuzzlyLazyClasses().add(flce);
        }else if (l.startsWith("retransform:")) {
          db.getRetransformedClasses().add(l.substring("retransform:".length()).trim());
          ce = null;
          lce = null;
          flce = null;
        }else if (l.startsWith("filter:")) {
          db.getFilters().add(l.substring("filter:".length()).trim());
          ce = null;
          lce = null;
          flce = null;
        }else if (l.length() == 0 || (ce == null && lce == null && flce == null) || l.charAt(0) == '#'){
          continue;
        }else {
          String[] ma = l.split(":");
          String m = ma[0];
          Integer st = MethodDatabase.SUSPEND_NORMAL;
          if (ma.length > 1) {
            if (MethodDatabase.SUSPEND_NORMAL_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_NORMAL;
            }else if (MethodDatabase.SUSPEND_NONE_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_NONE;
            }else if (MethodDatabase.SUSPEND_JUST_MARK_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_JUST_MARK;
            }else if (MethodDatabase.SUSPEND_BLOCKING_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_BLOCKING;
            }else if (MethodDatabase.SUSPEND_FAMILY_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_FAMILY;
            }else if (MethodDatabase.SUSPEND_SKIP_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_SKIP;
            }else {
              db.warn("file %s line %d : unknown suspend type: %s , we just set to 'normal'", resource , lc, ma[1]);
              st = MethodDatabase.SUSPEND_NORMAL;
            }
          }
          if (lce != null) {
            Map<String, Integer> methods = lce.getMethods();
            Integer ost = methods.get(m);
            if (ost == null || st.intValue() > ost.intValue()) {
              methods.put(m, st);
            }else {
              st = ost;
            }
            if (db.meetTraceTargetClassMethod(clz, m)) {
              db.info("meet traced method %s.%s, suspend type = %s", clz, m, MethodDatabase.SUSPEND_TYPE_STRS[st]);
            }
            continue;
          }else if (flce != null) {
            Map<String, Integer> methods = flce.getMethods();
            Integer ost = methods.get(m);
            if (ost == null || st.intValue() > ost.intValue()) {
              methods.put(m, st);
            }else {
              st = ost;
View Full Code Here

TOP

Related Classes of nginx.clojure.wave.MethodDatabase.FuzzyLazyClassEntry

Copyright © 2018 www.massapicom. 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.