code: public void process(final String beanName,
  			final HttpServletRequest request, final HttpServletResponse response)
  			throws ServletException, IOException {
  
  		InputStream is = request.getInputStream();
  		OutputStream os = response.getOutputStream();
  
  		Hessian2Input in = new Hessian2Input(is);
  		AbstractHessianOutput out;
  
  		SerializerFactory serializerFactory = new SerializerFactory();
  
  		serializerFactory.setAllowNonSerializable(true);
  
  		serializerFactory.addFactory(new JdonSerializerFactory());
  		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();
  		in.read();
  
  		if (major >= HESSIAN_PROTOCOL_MAJOR_VERSION) {
  			out = new Hessian2Output(os);
  		} else {
  			out = new HessianOutput(os);
  		}
  
  		out.setSerializerFactory(serializerFactory);
  		// backward compatibility for some frameworks that don't read
  		// the call type first
  		in.skipOptionalCall();
  
  		out.startReply();
  
  		readHeaders(in); // read headers from call
  
  		try {
  			out.writeObject(makeCall(in, beanName, request));
  		} catch (Exception e) {
  			writeException(out, e);
  		}
  
  		// The complete call needs to be after the invoke to handle a
  		// trailing InputStream
  		in.completeCall();
  		out.completeReply();
  		out.close();
  
  	}
docs: Process servlet requests and writes bean's method result to output
  
  @param beanName
  String
  @param request
  HttpServletRequest
  @param response
  HttpServletResponse
  @throws javax.servlet.ServletException
  If error occur
  @throws java.io.IOException
  If error occur