Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.AbstractHessianOutput


  {
    BytesMessage message = _jmsSession.createBytesMessage();

    BytesMessageOutputStream os = new BytesMessageOutputStream(message);

    AbstractHessianOutput out = _factory.getHessianOutput(os);

    out.call(methodName, args);
    out.flush();

    _producer.send(message);
  }
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);

      out.setSerializerFactory(serializerFactory);

      if (_skeleton == null)
        throw new Exception("skeleton is null!");

      _skeleton.invoke(in, out);

      out.close();
    } catch (IOException e) {
      log.log(Level.INFO, L.l("Unable to process request: "), e);
    } catch (Throwable e) {
      log.log(Level.INFO, L.l("Unable to process request: "), e);
    }
View Full Code Here

          new BytesMessageInputStream((BytesMessage) message);

        NullOutputStream os = new NullOutputStream();

        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("expected 'c' in hessian input at " + code);
        }

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

        if (major >= 2)
          out = new Hessian2Output(os);
        else
          out = new HessianOutput(os);

        out.setSerializerFactory(serializerFactory);

        if (objectId != null)
          _objectSkeleton.invoke(in, out);
        else
          _homeSkeleton.invoke(in, out);

        out.close();
      } catch (JMSException e) {
        log.warning("Unable to process request: " + e);
      } catch (IOException e) {
        log.warning("Unable to process request: " + e);
      } catch (Throwable e) {
View Full Code Here

        try {
            InputStream is = request.getInputStream();
            OutputStream os = response.getOutputStream();

            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("expected 'c' in hessian input at " + code);
            }

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

            if (major >= 2)
                out = new Hessian2Output(os);
            else
                out = new HessianOutput(os);

            out.setSerializerFactory(serializerFactory);

            invoke(in, out);

            out.close();
        } catch (RuntimeException e) {
            throw e;
        } catch (ServletException e) {
            throw e;
        } catch (Throwable e) {
View Full Code Here

    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(outputStream);
    }
    else {
      out = new HessianOutput(outputStream);
    }
    if (this.serializerFactory != null) {
      out.setSerializerFactory(this.serializerFactory);
    }

    this.skeleton.invoke(in, out);
  }
View Full Code Here

    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);
    }
    if (this.serializerFactory != null) {
      out.setSerializerFactory(this.serializerFactory);
    }

    this.skeleton.invoke(in, out);
  }
View Full Code Here

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

        AbstractHessianOutput  hessianOutput = null;
        int major = hessianInput.read();
        // useless read just get the stream in the right position.
        int minor = hessianInput.read();
        if (major >= 2) {
                hessianOutput = new Hessian2Output(outputStream);
        }
        else {
                hessianOutput = new HessianOutput(outputStream);
        }
        if (this.serializerFactory != null) {
                hessianOutput.setSerializerFactory(this.serializerFactory);
        }

        try {
            this.skeleton.invoke(hessianInput, hessianOutput);
        } catch (Throwable e) {
View Full Code Here

  {
    BytesMessage message = _jmsSession.createBytesMessage();

    BytesMessageOutputStream os = new BytesMessageOutputStream(message);

    AbstractHessianOutput out = _factory.getHessianOutput(os);

    out.call(methodName, args);
    out.flush();

    _producer.send(message);
  }
View Full Code Here

    } catch (Exception e) {
      throw new HessianRuntimeException(e);
    }

    try {
      AbstractHessianOutput out = _factory.getHessianOutput(os);

      out.call(methodName, args);
      out.flush();

      return conn;
    } catch (IOException e) {
      if (conn instanceof HttpURLConnection)
  ((HttpURLConnection) conn).disconnect();
View Full Code Here

    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);
    }
    if (this.serializerFactory != null) {
      out.setSerializerFactory(this.serializerFactory);
    }

    try {
      this.skeleton.invoke(in, out);
    }
    finally {
      try {
        in.close();
        isToUse.close();
      }
      catch (IOException ex) {
      }
      try {
        out.close();
        osToUse.close();
      }
      catch (IOException ex) {
      }
    }
View Full Code Here

TOP

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

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.