1 28 package org.objectweb.carol.rmi.jrmp.server; 29 30 import java.io.IOException ; 32 import java.io.ObjectInput ; 33 import java.io.ObjectOutput ; 34 import java.io.StreamCorruptedException ; 35 import java.rmi.server.RemoteCall ; 36 37 import org.objectweb.carol.rmi.jrmp.interceptor.JServerInterceptorHelper; 38 import org.objectweb.carol.rmi.jrmp.interceptor.JServerRequestInterceptor; 39 40 46 public class JRemoteServerCall implements RemoteCall { 47 48 52 RemoteCall impl; 53 54 57 protected JServerRequestInterceptor[] sis = null; 58 59 64 public JRemoteServerCall(RemoteCall impl, JServerRequestInterceptor[] sis) { 65 this.impl = impl; 67 this.sis = sis; 68 } 69 70 76 public ObjectOutput getResultStream(boolean success) throws IOException , StreamCorruptedException { 77 ObjectOutput out = impl.getResultStream(success); 78 if (!success) { 81 out.writeObject(new Exception ("dummy")); 82 JServerInterceptorHelper.send_exception(out, sis); 83 return out; 84 } else { JServerInterceptorHelper.send_reply(out, sis); 86 return out; 87 } 88 } 89 90 94 public ObjectOutput getOutputStream() throws IOException { 95 return impl.getOutputStream(); 96 } 97 98 102 public void releaseOutputStream() throws IOException { 103 impl.releaseOutputStream(); 104 } 105 106 110 public ObjectInput getInputStream() throws IOException { 111 return impl.getInputStream(); 112 } 113 114 118 public void releaseInputStream() throws IOException { 119 impl.releaseInputStream(); 120 } 121 122 126 public void executeCall() throws Exception { 127 throw new Error ("should never be called by server"); 128 } 129 130 134 public void done() throws IOException { 135 impl.done(); 136 } 137 138 } | Popular Tags |