Package org.mortbay.util.ajax

Examples of org.mortbay.util.ajax.JSON$ReaderSource


    String format = request.getParameter("format");
    Collection<MetricsContext> allContexts =
      ContextFactory.getFactory().getAllContexts();
    if ("json".equals(format)) {
      // Uses Jetty's built-in JSON support to convert the map into JSON.
      out.print(new JSON().toJSON(makeMap(allContexts)));
    } else {
      printMap(out, makeMap(allContexts));
    }
    out.close();
  }
View Full Code Here


    String format = request.getParameter("format");
    Collection<MetricsContext> allContexts =
      ContextFactory.getFactory().getAllContexts();
    if ("json".equals(format)) {
      // Uses Jetty's built-in JSON support to convert the map into JSON.
      out.print(new JSON().toJSON(makeMap(allContexts)));
    } else {
      printMap(out, makeMap(allContexts));
    }
    out.close();
  }
View Full Code Here

    /* ------------------------------------------------------------ */
    public String getJSON()
    {
        if (_json==null)
        {
            JSON json=_pool==null?JSON.getDefault():_pool.getMsgJSON();
            StringBuffer buf = new StringBuffer(json.getStringBufferSize());
            synchronized(buf)
            {
                json.appendMap(buf,this);
                _json=buf.toString();
            }
        }
        return _json;
    }
View Full Code Here

      if (mr != null) {
        map.put("resourcemanager_port", mr.getConfig().get(
            YarnConfiguration.RM_ADDRESS).split(":")[1]);
      }
      FileWriter fw = new FileWriter(new File(writeDetails));
      fw.write(new JSON().toJSON(map));
      fw.close();
    }
  }
View Full Code Here

      if (mr != null) {
        map.put("resourcemanager_port", mr.getConfig().get(
            YarnConfiguration.RM_ADDRESS).split(":")[1]);
      }
      FileWriter fw = new FileWriter(new File(writeDetails));
      fw.write(new JSON().toJSON(map));
      fw.close();
    }
  }
View Full Code Here

    String format = request.getParameter("format");
    Collection<MetricsContext> allContexts =
      ContextFactory.getFactory().getAllContexts();
    if ("json".equals(format)) {
      // Uses Jetty's built-in JSON support to convert the map into JSON.
      out.print(new JSON().toJSON(makeMap(allContexts)));
    } else {
      printMap(out, makeMap(allContexts));
    }
    out.close();
  }
View Full Code Here

    if ("json".equals(format)) {
      response.setContentType("application/json; charset=utf-8");
      PrintWriter out = response.getWriter();
      try {
        // Uses Jetty's built-in JSON support to convert the map into JSON.
        out.print(new JSON().toJSON(makeMap(allContexts)));
      } finally {
        out.close();
      }
    } else {
      PrintWriter out = response.getWriter();
View Full Code Here

    if ("json".equals(format)) {
      response.setContentType("application/json; charset=utf-8");
      PrintWriter out = response.getWriter();
      try {
        // Uses Jetty's built-in JSON support to convert the map into JSON.
        out.print(new JSON().toJSON(makeMap(allContexts)));
      } finally {
        out.close();
      }
    } else {
      PrintWriter out = response.getWriter();
View Full Code Here

    if ("json".equals(format)) {
      response.setContentType("application/json; charset=utf-8");
      PrintWriter out = response.getWriter();
      try {
        // Uses Jetty's built-in JSON support to convert the map into JSON.
        out.print(new JSON().toJSON(makeMap(allContexts)));
      } finally {
        out.close();
      }
    } else {
      PrintWriter out = response.getWriter();
View Full Code Here

      if (dfs != null) {
        map.put("namenode_port", dfs.getNameNodePort());
      }

      FileWriter fw = new FileWriter(new File(writeDetails));
      fw.write(new JSON().toJSON(map));
      fw.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.mortbay.util.ajax.JSON$ReaderSource

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.