Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.Hessian2Input$ObjectDefinition


    AbstractHessianInput in;

    if (_isDebug)
      is = new HessianDebugInputStream(is, new PrintWriter(System.out));

    in = new Hessian2Input(is);

    in.setRemoteResolver(getRemoteResolver());

    in.setSerializerFactory(getSerializerFactory());
View Full Code Here


      _homeSkeleton.invoke(is, os, serializerFactory);
  }

  protected Hessian2Input createHessian2Input(InputStream is)
  {
    return new Hessian2Input(is);
  }
View Full Code Here

      if (rs.next()) {
  Serializable payload = null;
   
  InputStream is = rs.getBinaryStream(1);
  if (is != null) {
    Hessian2Input in = new Hessian2Input(is);

    payload = (Serializable) in.readObject();

    in.close();
    is.close();
  }

  return payload;
      }
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

    Hessian2StreamingInput in = _in;

    if (in == null)
      return false;

    Hessian2Input hIn = null;

    try {
      hIn = in.startPacket();
    } catch (IOException e) {
      log.fine(this + " exception while reading HMTP packet\n  " + e);

      log.log(Level.FINER, e.toString(), e);
    }

    if (hIn == null) {
      close();
      return false;
    }

    int type = hIn.readInt();
    String to = hIn.readString();
    String from = hIn.readString();

    switch (HmtpPacketType.TYPES[type]) {
    case MESSAGE:
      {
        Serializable value = (Serializable) hIn.readObject();
        in.endPacket();

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

        actorStream.message(to, from, value);

        break;
      }

    case MESSAGE_ERROR:
      {
        Serializable value = (Serializable) hIn.readObject();
        ActorError error = (ActorError) hIn.readObject();
        in.endPacket();

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

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

        break;
      }

    case QUERY_GET:
      {
        long id = hIn.readLong();
        Serializable value = (Serializable) hIn.readObject();
        in.endPacket();

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

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

        break;
      }

    case QUERY_SET:
      {
        long id = hIn.readLong();
        Serializable value = (Serializable) hIn.readObject();
        in.endPacket();

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

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

        break;
      }

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

        if (log.isLoggable(Level.FINER)) {
          log.finer(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();
        ActorError error = (ActorError) hIn.readObject();
        in.endPacket();

        if (log.isLoggable(Level.FINER)) {
          log.finer(this + " queryError " + error + " " + value
                    + " {id:" + id + ", to:" + to + ", from:" + from + "}");
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 (V) 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

      log.finest("session serialized load data:");
      dis.setDepth(2);
      is = dis;
    }
 
    _in = new Hessian2Input(is);
  }
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

      aes.init(Cipher.DECRYPT_MODE, key);

      byte []plainData = aes.doFinal(data);

      ByteArrayInputStream bis = new ByteArrayInputStream(plainData);
      Hessian2Input in = new Hessian2Input(bis);
      Object value = in.readObject();
      in.close();

      return value;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

TOP

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

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.