Examples of JSONOutput


Examples of com.caucho.json.JsonOutput

                      String to,
                      String from,
                      Serializable value)
  {
    try {
      JsonOutput out = _out;
     
      if (out == null)
        return;
     
      out.init(os);
     
      if (log.isLoggable(Level.FINER)) {
        log.finer(this + " message " + value
                  + " {to:" + to + ", from:" + from + "}");
      }
     

      os.print("[\"message\"");
     
      if (to != null) {
        os.print(",\"");
        os.print(to);
        os.print("\"");
      }
      else {
        os.print(",null");
      }
       
      if (from != null) {
        os.print(",\"");
        os.print(from);
        os.print("\"");
      }
      else {
        os.print(",null");
      }
     
      os.print(",\"");
      writeType(os, value);
      os.print("\"");

      os.print(",");
      out.writeObject(value);
      out.flushBuffer();
      os.write("]");
    } catch (IOException e) {
      throw new ProtocolException(e);
    }
  }
View Full Code Here

Examples of com.caucho.json.JsonOutput

                           String from,
                           Serializable value,
                           BamError error)
  {
    try {
      JsonOutput out = _out;

      if (out == null)
        return;
     
      out.init(os);
     
      if (log.isLoggable(Level.FINER)) {
        log.finer(this + " messageError " + value
                  + " {to:" + to + ", from:" + from + "}");
      }

      os.print("[\"message_error\",\"");

      os.print(to);
       
      os.write("\",\"");

      os.print(from);
     
      os.write("\",\"");

      writeType(os, value);
       
      os.write("\",");

      out.writeObject(value);
      out.flushBuffer();
      os.write(",");
      out.writeObject(error);
      out.flushBuffer();
      os.write("]");
    } catch (IOException e) {
      throw new ProtocolException(e);
    }
  }
View Full Code Here

Examples of com.caucho.json.JsonOutput

                    String to,
                    String from,
                    Serializable value)
  {
    try {
      JsonOutput out = _out;

      if (out == null)
        return;
     
      out.init(os);
     
      if (log.isLoggable(Level.FINER)) {
        log.finer(this + " query " + value
                  + " {id: " + id + ", to:" + to + ", from:" + from + "}");
      }

      os.print("[\"query\"");
       
      if (to != null) {
        os.print(",\"");
        os.print(to);
        os.print("\"");
      }
      else {
        os.print(",null");
      }

      if (from != null) {
        os.print(",\"");
        os.print(from);
        os.print("\"");
      }
      else {
        os.print(",null");
      }

      os.print(",");
      os.print(id);
     
      os.write(",\"");
      writeType(os, value);

      os.print("\",");
      out.writeObject(value);
      out.flushBuffer();

      os.print("]");
    } catch (IOException e) {
      throw new ProtocolException(e);
    }
View Full Code Here

Examples of com.caucho.json.JsonOutput

                          String to,
                          String from,
                          Serializable value)
  {
    try {
      JsonOutput out = _out;

      if (out == null)
        return;
     
      out.init(os);
     
      if (log.isLoggable(Level.FINER)) {
        log.finer(this + " result " + value
                  + " {id: " + id + ", to:" + to + ", from:" + from + "}");
      }

      os.print("[\"result\"");

      if (to != null) {
        os.print(",\"");
        os.print(to);
        os.print("\"");
      }
      else {
        os.print(",null");
      }

      if (from != null) {
        os.print(",\"");
        os.print(from);
        os.print("\"");
      }
      else {
        os.print(",null");
      }

      os.print(",");
      os.print(id);

      os.write(",\"");
      writeType(os, value);
     
      os.print("\",");
      out.writeObject(value);
      out.flushBuffer();

      os.print("]");
    } catch (IOException e) {
      throw new ProtocolException(e);
    }
View Full Code Here

Examples of com.caucho.json.JsonOutput

                         String from,
                         Serializable payload,
                         BamError error)
  {
    try {
      JsonOutput out = _out;

      if (out == null)
        return;
     
      out.init(os);
     
      if (log.isLoggable(Level.FINER)) {
        log.finer(this + " query_error " + error + "\n  " + payload + "\n  "
                  + " {id: " + id + ", to:" + to + ", from:" + from + "}");
      }

      os.print("[\"query_error\"");

      if (to != null) {
        os.print(",\"");
        os.print(to);
        os.print("\"");
      }
      else {
        os.print(",null");
      }

      if (from != null) {
        os.print(",\"");
        os.print(from);
        os.print("\"");
      }

      os.print(",");
      os.print(id);


      os.write(",\"");
      writeType(os, payload);
     
      os.print("\",");
      out.writeObject(payload);
      out.flushBuffer();

      os.print(",");
      out.writeObject(error);
      out.flushBuffer();

      os.print("]");
    } catch (IOException e) {
      throw new ProtocolException(e);
    }
View Full Code Here

Examples of com.caucho.json.JsonOutput

  }

  public void flush()
    throws IOException
  {
    JsonOutput out = _out;

    if (out != null) {
      out.flush();
    }
  }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.resultset.JSONOutput

     * @param resultSet     result set
     */
   
    static public void outputAsJSON(OutputStream outStream, ResultSet resultSet)
    {
        JSONOutput jOut = new JSONOutput() ;
        jOut.format(outStream, resultSet) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.resultset.JSONOutput

     * @param booleanResult The boolean result to encode
     */
   
    static public void outputAsJSON(OutputStream outStream, boolean booleanResult)
    {
        JSONOutput jOut = new JSONOutput() ;
        jOut.format(outStream, booleanResult) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.resultset.JSONOutput

     * @param resultSet     result set
     */
   
    static public void outputAsJSON(OutputStream outStream, ResultSet resultSet)
    {
        JSONOutput jOut = new JSONOutput() ;
        jOut.format(outStream, resultSet) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.resultset.JSONOutput

     * @param booleanResult The boolean result to encode
     */
   
    static public void outputAsJSON(OutputStream outStream, boolean booleanResult)
    {
        JSONOutput jOut = new JSONOutput() ;
        jOut.format(outStream, booleanResult) ;
    }
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.