Examples of Hessian2Input


Examples of com.caucho.hessian.io.Hessian2Input

        major = isToUse.read();
        minor = isToUse.read();
        if (major != 0x02) {
          throw new IOException("Version " + major + "." + minor + " is not understood");
        }
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'C') {
        // Hessian 2.0 call... for some reason not handled in HessianServlet!
        isToUse.reset();
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'c') {
        // Hessian 1.0 call
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Input

        major = isToUse.read();
        minor = isToUse.read();
        if (major != 0x02) {
          throw new IOException("Version " + major + "." + minor + " is not understood");
        }
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'C') {
        // Hessian 2.0 call... for some reason not handled in HessianServlet!
        isToUse.reset();
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'c') {
        // Hessian 1.0 call
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Input

      PrintWriter debugWriter = new PrintWriter(new CommonsLogWriter(this.debugLogger));
      isToUse = new HessianDebugInputStream(inputStream, debugWriter);
      osToUse = new HessianDebugOutputStream(outputStream, debugWriter);
    }

    Hessian2Input in = new Hessian2Input(isToUse);
    if (this.serializerFactory != null) {
      in.setSerializerFactory(this.serializerFactory);
    }

    int code = in.read();
    if (code != 'c') {
      throw new IOException("expected 'c' in hessian input at " + code);
    }

    AbstractHessianOutput out = null;
    int major = in.read();
    int minor = in.read();
    if (major >= 2) {
      out = new Hessian2Output(osToUse);
    }
    else {
      out = new HessianOutput(osToUse);
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Input

public class HessianObjectInput implements CougarObjectInput {
 
  private Hessian2Input hessian2Input;

  HessianObjectInput(InputStream is, SerializerFactory serializerFactory) {
    hessian2Input = new Hessian2Input(is);
        hessian2Input.setSerializerFactory(serializerFactory);
  }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Input

        hession2Output.writeObject(data);
        hession2Output.close();
    }

    public Object deserialize(Class clazz, InputStream inputStream) throws IOException {
        Hessian2Input hession2Input = new Hessian2Input(inputStream);
       
        Object result = hession2Input.readObject();
        hession2Input.close();
        return result;
    }
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Input

    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

Examples of com.caucho.hessian.io.Hessian2Input

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

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

Examples of com.caucho.hessian.io.Hessian2Input

      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

Examples of com.caucho.hessian.io.Hessian2Input

      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

Examples of com.caucho.hessian.io.Hessian2Input

    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
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.