Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.Hessian2Output


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

      if (out != null) {
        synchronized (out) {
          if (log.isLoggable(Level.FINER)) {
            log.finer(this + " queryGet " + value
                      + " {id: " + id + ", to:" + to + ", from:" + from + "}");
          }

          out.startPacket();
          out.writeInt(HmtpPacketType.QUERY_GET.ordinal());
          out.writeString(to);
          out.writeString(from);
          out.writeLong(id);
          out.writeObject(value);
          out.endPacket();
 
          if (_isAutoFlush)
            out.flush();
        }
      }
    } catch (IOException e) {
      close();
     
View Full Code Here


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

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

  synchronized (out) {
    out.startPacket();
    out.writeInt(HmtpPacketType.QUERY_SET.ordinal());
    out.writeString(to);
    out.writeString(from);
    out.writeLong(id);
    out.writeObject(value);
    out.endPacket();
 
    if (_isAutoFlush)
      out.flush();
  }
      }
    } catch (IOException e) {
      close();
     
View Full Code Here

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

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

  synchronized (out) {
    out.startPacket();
    out.writeInt(HmtpPacketType.QUERY_RESULT.ordinal());
    out.writeString(to);
    out.writeString(from);
    out.writeLong(id);
    out.writeObject(value);
    out.endPacket();
 
    if (_isAutoFlush)
      out.flush();
  }
      }
    } catch (IOException e) {
      close();
     
View Full Code Here

       String from,
       Serializable value,
       ActorError error)
  {
    try {
      Hessian2Output out = _out;

      if (out != null) {
  if (log.isLoggable(Level.FINER)) {
    log.finer(this + " queryError " + error + " " + value
        + " {id: " + id + ", to:" + to + ", from:" + from + "}");
  }

  synchronized (out) {
    out.startPacket();
    out.writeInt(HmtpPacketType.QUERY_ERROR.ordinal());
    out.writeString(to);
    out.writeString(from);
    out.writeLong(id);
    out.writeObject(value);
    out.writeObject(error);
    out.endPacket();
 
    if (_isAutoFlush)
      out.flush();
  }
      }
    } catch (IOException e) {
      close();
     
View Full Code Here

  //

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

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

  {
    if (log.isLoggable(Level.FINER))
      log.finer(this + " close");
   
    try {
      Hessian2Output out = _out;
      _out = null;

      if (out != null) {
        synchronized (out) {
          out.close();
        }
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
View Full Code Here

    throws IOException
  {
    if (log.isLoggable(Level.FINEST))
      os = new HessianDebugOutputStream(os, log, Level.FINEST);

    Hessian2Output hOut = new Hessian2Output(os);

    hOut.writeObject(value);

    hOut.close();
  }
View Full Code Here

    is.read();
    is.read();

    Hessian2Input in = new Hessian2Input(is);
    Hessian2Output out = new Hessian2Output(os);

    in.startCall();

    String method = in.getMethod();
    Object []args = in.readArguments();
    in.completeCall();

    try {
      if (method.equals("lookup") ||
          method.equals("lookup_string") ||
          method.equals("lookup_1"))
        executeLookup(args, in, out);
      else if (method.equals("list"))
        executeList(args, in, out);
      else
        executeUnknown(method, args, in, out);
    } catch (HessianProtocolException e) {
      throw e;
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);

      out.startReply();
      out.writeFault("ServiceException", e.getMessage(), e);
      out.completeReply();
    }
   
    out.flush();
  }
View Full Code Here

  {
    if (log.isLoggable(Level.FINEST)) {
      os = new HessianDebugOutputStream(os, log, Level.FINEST);
    }
   
    _out = new Hessian2Output(os);
  }
View Full Code Here

    _out.writeObject(v);
  }

  public void close()
  {
    Hessian2Output out = _out;
    _out = null;

    if (out != null) {
      try {
  out.close();
      } catch (IOException e) {
  log.log(Level.FINEST, e.toString(), e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.hessian.io.Hessian2Output

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.