1 28 package org.objectweb.carol.jtests.conform.interceptor.iiop; 29 30 import org.omg.CORBA.LocalObject ; 31 import org.omg.IOP.ServiceContext ; 32 import org.omg.PortableInterceptor.ForwardRequest ; 33 import org.omg.PortableInterceptor.ServerRequestInfo ; 34 import org.omg.PortableInterceptor.ServerRequestInterceptor ; 35 36 41 public class IIOPDummyServerInterceptor extends LocalObject implements ServerRequestInterceptor { 42 43 46 private static int SERVER_CTX_ID = 50; 47 48 51 private static int CLIENT_CTX_ID = 51; 52 53 56 private String interceptorName = null; 57 58 62 public IIOPDummyServerInterceptor(String name) { 63 interceptorName = name; 64 } 65 66 71 public void receive_request_service_contexts(ServerRequestInfo jri) throws ForwardRequest { 72 try { 73 } catch (Exception e) { 78 } 80 } 81 82 87 public void receive_request(ServerRequestInfo jri) throws ForwardRequest { 88 } 89 90 94 public void send_reply(ServerRequestInfo jri) { 95 try { 96 byte[] data = java.net.InetAddress.getLocalHost().getHostName().getBytes(); 97 jri.add_reply_service_context(new ServiceContext (SERVER_CTX_ID, data), true); 100 } catch (Exception e) { 101 } 102 } 103 104 108 public String name() { 109 return interceptorName; 110 } 111 112 public void send_exception(ServerRequestInfo jri) throws ForwardRequest { 113 } 114 115 public void send_other(ServerRequestInfo jri) throws ForwardRequest { 116 } 117 118 public void destroy() { 119 } 120 } | Popular Tags |