示例#1
0
 @Override
 public Object decode(byte[] bytes) throws Exception {
   ClassLoader tccl = Thread.currentThread().getContextClassLoader();
   Thread.currentThread().setContextClassLoader(HessianCodec.class.getClassLoader());
   HessianInput input = new HessianInput(new ByteArrayInputStream(bytes));
   input.setSerializerFactory(serializerFactory);
   Object resultObject = input.readObject();
   Thread.currentThread().setContextClassLoader(tccl);
   return resultObject;
 }
 public void invoke(InputStream inputStream, OutputStream outputStream) throws Throwable {
   HessianInput in = new HessianInput(inputStream);
   HessianOutput out = new HessianOutput(outputStream);
   if (this.serializerFactory != null) {
     in.setSerializerFactory(this.serializerFactory);
     if (applySerializerFactoryToOutput) {
       out.setSerializerFactory(this.serializerFactory);
     }
   }
   try {
     invokeMethod.invoke(this.skeleton, new Object[] {in, out});
   } finally {
     try {
       in.close();
       inputStream.close();
     } catch (IOException ex) {
     }
     try {
       out.close();
       outputStream.close();
     } catch (IOException ex) {
     }
   }
 }