1 26 27 package org.objectweb.corba.trace.PI; 28 29 30 import org.objectweb.util.monolog.api.BasicLevel; 31 import org.objectweb.util.monolog.api.Logger; 32 33 37 public class TraceCI extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.ClientRequestInterceptor { 38 39 42 private int trace_slot; 43 44 47 protected Logger logger_; 48 49 52 private short logLevelClient; 53 54 55 58 protected ClientRequestInfoReader crir_; 59 60 63 public TraceCI(int trace_slot, org.omg.PortableInterceptor.ORBInitInfo info) { 64 65 logger_ = MonologLogger.loggerCI; 66 this.trace_slot = trace_slot; 67 logLevelClient = 1; 68 this.crir_ = new ClientRequestInfoReader(logLevelClient); 69 70 if (MonologLogger.enableTrace) 71 logger_.log(BasicLevel.DEBUG, "Init Trace Interceptor CORBA Client Side"); 72 } 73 74 77 81 public void send_request(org.omg.PortableInterceptor.ClientRequestInfo ri){ 82 if (MonologLogger.enableTrace) 83 logger_.log(BasicLevel.INFO, crir_.displayClientRequestInfoMonolog(ri)); 84 } 85 86 90 public void send_poll(org.omg.PortableInterceptor.ClientRequestInfo ri) { 91 if (MonologLogger.enableTrace) 92 logger_.log(BasicLevel.INFO, crir_.displayClientRequestInfoMonolog(ri)); 93 } 94 95 99 public void receive_reply(org.omg.PortableInterceptor.ClientRequestInfo ri) { 100 if (MonologLogger.enableTrace) 101 logger_.log(BasicLevel.INFO, crir_.displayClientRequestInfoMonolog(ri)); 102 } 103 104 108 public void receive_exception(org.omg.PortableInterceptor.ClientRequestInfo ri) { 109 if (MonologLogger.enableTrace) 110 logger_.log(BasicLevel.ERROR, crir_.displayClientRequestInfoMonolog(ri,false)); 111 } 112 113 118 public void receive_other(org.omg.PortableInterceptor.ClientRequestInfo ri) { 119 if (MonologLogger.enableTrace) 120 logger_.log(BasicLevel.INFO, crir_.displayClientRequestInfoMonolog(ri)); 121 } 122 123 126 public java.lang.String name() { 127 return "LoggingClientInterceptor"; 128 } 129 130 133 public void destroy() { 134 } 135 } 136 | Popular Tags |