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.ClientRequestInfo ; 33 import org.omg.PortableInterceptor.ClientRequestInterceptor ; 34 import org.omg.PortableInterceptor.ForwardRequest ; 35 36 import org.objectweb.carol.util.configuration.TraceCarol; 37 38 43 public class IIOPDummyClientInterceptor extends LocalObject implements ClientRequestInterceptor { 44 45 48 50 53 private static final int CLIENT_CTX_ID = 51; 54 55 58 private String interceptorName = null; 59 60 64 public IIOPDummyClientInterceptor(String name) { 65 interceptorName = name; 66 } 67 68 72 public String name() { 73 return interceptorName; 74 } 75 76 79 public void destroy() { 80 } 81 82 89 public void send_request(ClientRequestInfo jri) throws ForwardRequest { 90 try { 91 byte[] data = java.net.InetAddress.getLocalHost().getHostName().getBytes(); 92 TraceCarol.debugCarol("Add/Send Dummy Client Service Context"); 93 jri.add_request_service_context(new ServiceContext (CLIENT_CTX_ID, data), true); 94 } catch (Exception e) { 95 TraceCarol.debugCarol("No service context"); 96 } 97 } 98 99 104 public void receive_reply(ClientRequestInfo jri) { 105 TraceCarol.debugCarol("Get/Receive Dummy Server Service Context:"); 106 109 } 110 111 116 public void send_poll(ClientRequestInfo jri) { 117 } 118 119 128 public void receive_exception(ClientRequestInfo jri) throws ForwardRequest { 129 } 130 131 139 public void receive_other(ClientRequestInfo jri) throws ForwardRequest { 140 } 141 } | Popular Tags |