Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.Hessian2Input


      log.finest("session serialized load data:");
      dis.setDepth(2);
      is = dis;
    }
 
    _in = new Hessian2Input(is);
    _in.setSerializerFactory(new SerializerFactory(loader));
  }
View Full Code Here


    return _in.readObject();
  }

  public void close()
  {
    Hessian2Input in = _in;
    _in = null;

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

  private int _addressCacheIndex;
  private String []_addressCacheRing = new String[256];

  public HmtpReader()
  {
    _hIn = new Hessian2Input();
  }
View Full Code Here

    throws IOException
  {
    if (actorStream == null)
      throw new IllegalStateException("HmtpReader.readPacket requires a valid ActorStream for callbacks");

    Hessian2Input hIn = _hIn;
   
    hIn.init(is);

    int type = hIn.readInt();
    String to = readAddress(hIn);
    String from = readAddress(hIn);
   
    switch (HmtpPacketType.TYPES[type]) {
    case MESSAGE:
      {
        Serializable value = (Serializable) hIn.readObject();

        if (log.isLoggable(Level.FINEST)) {
          log.finest(this + " message " + value
                    + " {to:" + to + ", from:" + from + "}");
        }

        actorStream.message(to, from, value);

        break;
      }

    case MESSAGE_ERROR:
      {
        Serializable value = (Serializable) hIn.readObject();
        BamError error = (BamError) hIn.readObject();

        if (log.isLoggable(Level.FINEST)) {
          log.finest(this + " messageError " + error + " " + value
                    + " {to:" + to + ", from:" + from + "}");
        }

        actorStream.messageError(to, from, value, error);

        break;
      }

    case QUERY:
      {
        long id = hIn.readLong();
        Serializable value = (Serializable) hIn.readObject();

        if (log.isLoggable(Level.FINEST)) {
          log.finest(this + " query " + value
                    + " {id:" + id + ", to:" + to + ", from:" + from + "}");
        }

        actorStream.query(id, to, from, value);

        break;
      }

    case QUERY_RESULT:
      {
        long id = hIn.readLong();
        Serializable value = (Serializable) hIn.readObject();

        if (log.isLoggable(Level.FINEST)) {
          log.finest(this + " queryResult " + value
                    + " {id:" + id + ", to:" + to + ", from:" + from + "}");
        }

        actorStream.queryResult(id, to, from, value);

        break;
      }

    case QUERY_ERROR:
      {
        long id = hIn.readLong();
        Serializable value = (Serializable) hIn.readObject();
        BamError error = (BamError) hIn.readObject();

        if (log.isLoggable(Level.FINEST)) {
          log.finest(this + " queryError " + error + " " + value
                    + " {id:" + id + ", to:" + to + ", from:" + from + "}");
        }
View Full Code Here

          break;
        }
      }

      Hessian2Input input = new Hessian2Input(new ByteArrayInputStream(data,
                                                                       start +
                                                                       1,
                                                                       scan
                                                                         .pointer -
                                                                                  start -
                                                                                  3));

      Object obj = input.readObject();

      HttpSession session = request.getSession(true);

      session.setAttribute("caucho.jsf.developer.aid", obj);
    }
View Full Code Here

    throws IOException
  {
    if (log.isLoggable(Level.FINEST))
      is = new HessianDebugInputStream(is, log, Level.FINEST);

    Hessian2Input hIn = new Hessian2Input(is);

    Object value = hIn.readObject();

    hIn.close();
   
    return value;
  }
View Full Code Here

      throw new IOException(L.l("expected 'H' for Hessian 2 at '{0}'", String.valueOf((char) ch)));

    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"))
View Full Code Here

      Cipher cipher = initCipher(cookie, Cipher.DECRYPT_MODE);

      ByteArrayInputStream is = new ByteArrayInputStream(encData);
      CipherInputStream cIn = new CipherInputStream(is, cipher);

      Hessian2Input in = new Hessian2Input(cIn);

      Object obj = in.readObject();

      if (! (obj instanceof SelfEncryptedCookie))
        throw new SecurityException(L.l("SelfEncryptedCookie[] is invalid because it does not correctly decrypt"));

      SelfEncryptedCookie cookieObj = (SelfEncryptedCookie) obj;

      in.close();
      cIn.close();
      is.close();

      return cookieObj;
    } catch (SecurityException e) {
View Full Code Here

     
      if (certPath.canRead()) {
        ReadStream is = certPath.openRead();
       
        try {
          Hessian2Input hIn = new Hessian2Input(is);
         
          cert = (SelfSignedCert) hIn.readObject(SelfSignedCert.class);
         
          hIn.close();
         
          return cert;
        } finally {
          IoUtil.close(is);
        }
View Full Code Here

  }

  public void invoke(InputStream is, OutputStream os)
  {
    try {
      Hessian2Input in = new Hessian2Input(is);
      AbstractHessianOutput out;

      SerializerFactory serializerFactory = getSerializerFactory();

      in.setSerializerFactory(serializerFactory);

      int code = in.read();

      if (code != 'c') {
        // XXX: deflate
        throw new IOException(L.l("expected 'c' in hessian input at {0}",
                                  code));
      }

      int major = in.read();
      int minor = in.read();

      if (major >= 2)
        out = new Hessian2Output(os);
      else
        out = new HessianOutput(os);
View Full Code Here

TOP

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

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.