com.caucho.hessian.io.HessianDebugOutputStream Java Examples
The following examples show how to use
com.caucho.hessian.io.HessianDebugOutputStream.
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: HessianSkeleton.java From sofa-hessian with Apache License 2.0 | 4 votes |
/** * 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(); } }