com.caucho.hessian.io.HessianDebugInputStream Java Examples

The following examples show how to use com.caucho.hessian.io.HessianDebugInputStream. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestHessian2Servlet.java    From jvm-sandbox-repeater with Apache License 2.0 6 votes vote down vote up
/**
 * Invoke the object with the request from the input stream.
 *
 * @param in the Hessian input stream
 * @param out the Hessian output stream
 */
@Override
public void invoke(InputStream is, OutputStream os, String objectId,
                   SerializerFactory serializerFactory)
  throws Exception
{
  CharArrayWriter writer = new CharArrayWriter();

  _threadWriter.set(writer);

  PrintWriter dbg = new PrintWriter(writer);

  HessianDebugInputStream debug = new HessianDebugInputStream(is, dbg);
  debug.startTop2();
  
  super.invoke(debug, os, objectId, serializerFactory);
}
 
Example #2
Source File: TestHessian2Servlet.java    From sofa-hessian with Apache License 2.0 6 votes vote down vote up
/**
 * Invoke the object with the request from the input stream.
 *
 * @param in the Hessian input stream
 * @param out the Hessian output stream
 */
@Override
public void invoke(InputStream is, OutputStream os, String objectId,
                   SerializerFactory serializerFactory)
    throws Exception
{
    CharArrayWriter writer = new CharArrayWriter();

    _threadWriter.set(writer);

    PrintWriter dbg = new PrintWriter(writer);

    HessianDebugInputStream debug = new HessianDebugInputStream(is, dbg);
    debug.startTop2();

    super.invoke(debug, os, objectId, serializerFactory);
}
 
Example #3
Source File: HessianSkeleton.java    From sofa-hessian with Apache License 2.0 4 votes vote down vote up
/**
 * Invoke the object with the request from the input stream.
 *
 * @param in the Hessian input stream
 * @param out the Hessian output stream
 */
public void invoke(InputStream is, OutputStream os,
                   SerializerFactory serializerFactory)
    throws Exception
{
    boolean isDebug = false;

    if (isDebugInvoke()) {
        isDebug = true;

        PrintWriter dbg = createDebugPrintWriter();
        HessianDebugInputStream dIs = new HessianDebugInputStream(is, dbg);
        dIs.startTop2();
        is = dIs;
        HessianDebugOutputStream dOs = new HessianDebugOutputStream(os, dbg);
        dOs.startTop2();
        os = dOs;
    }

    HessianInputFactory.HeaderType header = _inputFactory.readHeader(is);

    AbstractHessianInput in;
    AbstractHessianOutput out;

    switch (header) {
        case CALL_1_REPLY_1:
            in = _hessianFactory.createHessianInput(is);
            out = _hessianFactory.createHessianOutput(os);
            break;

        case CALL_1_REPLY_2:
            in = _hessianFactory.createHessianInput(is);
            out = _hessianFactory.createHessian2Output(os);
            break;

        case HESSIAN_2:
            in = _hessianFactory.createHessian2Input(is);
            in.readCall();
            out = _hessianFactory.createHessian2Output(os);
            break;

        default:
            throw new IllegalStateException(header + " is an unknown Hessian call");
    }

    if (serializerFactory != null) {
        in.setSerializerFactory(serializerFactory);
        out.setSerializerFactory(serializerFactory);
    }

    try {
        invoke(_service, in, out);
    } finally {
        in.close();
        out.close();

        if (isDebug)
            os.close();
    }
}