1 8 9 package mx4j.tools.remote.caucho.hessian; 10 11 import java.io.IOException ; 12 import java.io.InputStream ; 13 14 import com.caucho.hessian.io.HessianInput; 15 import mx4j.tools.remote.caucho.CauchoInput; 16 import mx4j.tools.remote.caucho.serialization.JMXSerializerFactory; 17 18 21 class HessianCauchoInput implements CauchoInput 22 { 23 private final HessianInput input; 24 25 HessianCauchoInput(InputStream stream) 26 { 27 this.input = new HessianInput(); 28 input.setSerializerFactory(new JMXSerializerFactory()); 29 input.init(stream); 30 } 31 32 public void startCall() throws IOException  33 { 34 input.readCall(); 35 } 36 37 public void completeCall() throws IOException  38 { 39 input.completeCall(); 40 } 41 42 public void startReply() throws Exception  43 { 44 try 45 { 46 input.startReply(); 47 } 48 catch (Throwable x) 49 { 50 if (x instanceof Exception ) throw (Exception )x; 51 throw (Error )x; 52 } 53 } 54 55 public void completeReply() throws IOException  56 { 57 input.completeReply(); 58 } 59 60 public String readHeader() throws IOException  61 { 62 return input.readHeader(); 63 } 64 65 public String readMethod() throws IOException  66 { 67 return input.readMethod(); 68 } 69 70 public Object readObject(Class cls) throws IOException  71 { 72 return cls == null ? input.readObject() : input.readObject(cls); 73 } 74 } 75 | Popular Tags |