1 28 29 30 package org.objectweb.ccm.logservice; 31 32 import org.objectweb.corba.runtime.*; 33 import org.objectweb.corba.logservice.*; 34 35 39 public class LogCallControllerImpl 40 extends org.omg.CORBA.LocalObject 41 implements org.coach.ECA.ClientCallController, 42 org.coach.ECA.ServerCallController 43 { 44 private LogCurrent _current; 46 47 public 48 LogCallControllerImpl(LogCurrent current, 49 String scheme) 50 { 51 _current = current; 52 } 54 55 59 private LogCurrent 60 getLogCurrent() 61 { 62 return _current; 63 } 64 65 69 final public void 70 destroy() 71 { 72 } 73 74 78 final public void 79 send_request(org.coach.ECA.ClientCallContext ctx) 80 { 81 LogCallback callback = null; 83 String cid = ""; 84 try { 85 callback = (LogCallback)ctx.get_service_callback(LOG_SERVICE_ID.value, LOG_SERVICE_CALLBACK_ID.value); 86 cid = callback.get_identity(); 88 } catch(org.coach.ECM.UnknownService ex) { 89 } catch(org.coach.ECM.UnknownServiceCallback ex) { 90 } 91 92 org.omg.CORBA.Any acid = ctx.create_any(); 94 acid.insert_string(cid); 95 getLogCurrent().current_id(acid); 96 97 MessageContent content = new MessageContent(); 99 java.util.Calendar cal = java.util.Calendar.getInstance(); 100 content.timestamp = java.lang.Long.toString(cal.getTimeInMillis()); 101 content.interception_point = "SEND_REQUEST"; 102 content.operation_name = ctx.call_information().operation_name; 103 content.sender_id = cid; 104 content.receiver_id = ""; 105 content.data = ""; 106 107 LogInternal internal = null; 109 internal = (LogInternal)ctx.get_service_internal(LOG_SERVICE_ID.value, LOG_SERVICE_INTERNAL_ID.value); 110 111 LogEvent evt = new LogEvent(); 113 evt.level = INFO_LEVEL.value; 114 evt.message = content; 115 internal.log_event(evt); 116 } 117 118 final public void 119 receive_reply(org.coach.ECA.ClientCallContext ctx) 120 { 121 } 122 123 final public void 124 receive_system_exception(org.coach.ECA.ClientCallContext ctx) 125 { 126 } 127 128 final public void 129 receive_user_exception(org.coach.ECA.ClientCallContext ctx) 130 { 131 } 132 133 137 final public void 138 receive_request(org.coach.ECA.ServerCallContext ctx) 139 { 140 org.omg.CORBA.Any acid = getLogCurrent().current_id(); 142 String cid = ""; 143 if ((acid!=null) && (acid.type().kind()!=org.omg.CORBA.TCKind.tk_null)) { 144 cid = acid.extract_string(); 145 } 146 147 LogCallback callback = null; 149 String sid = ""; 150 try { 151 callback = (LogCallback)ctx.get_service_callback(LOG_SERVICE_ID.value, LOG_SERVICE_CALLBACK_ID.value); 152 sid = callback.get_identity(); 154 } catch(org.coach.ECM.UnknownService ex) { 155 } catch(org.coach.ECM.UnknownServiceCallback ex) { 156 } 157 158 MessageContent content = new MessageContent(); 160 java.util.Calendar cal = java.util.Calendar.getInstance(); 161 content.timestamp = java.lang.Long.toString(cal.getTimeInMillis()); 162 content.interception_point = "RECEIVE_REQUEST"; 163 content.operation_name = ctx.call_information().operation_name; 164 content.sender_id = cid; 165 content.receiver_id = sid; 166 content.data = ""; 167 168 LogInternal internal = null; 170 internal = (LogInternal)ctx.get_service_internal(LOG_SERVICE_ID.value, LOG_SERVICE_INTERNAL_ID.value); 171 172 LogEvent evt = new LogEvent(); 174 evt.level = INFO_LEVEL.value; 175 evt.message = content; 176 internal.log_event(evt); 177 } 178 179 final public void 180 send_reply(org.coach.ECA.ServerCallContext ctx) 181 { 182 } 183 184 final public void 185 send_system_exception(org.coach.ECA.ServerCallContext ctx) 186 { 187 } 188 189 final public void 190 send_user_exception(org.coach.ECA.ServerCallContext ctx) 191 { 192 } 193 } 194 | Popular Tags |