/// <summary> /// calls receive request interception point. Throws an exception, if an interception point throws /// an exception. internal void ReceiveRequest(ServerRequestInfoImpl serverInfo) { while (ProceedToNextInterceptor()) { ServerRequestInterceptor current = GetCurrentInterceptor(); current.receive_request(serverInfo); } }
/// <summary> /// calls send reply interception point. Throws an exception, if an interception point throws /// an exception. /// </summary> internal void SendReply(ServerRequestInfoImpl serverInfo) { while (ProceedToNextInterceptor()) { ServerRequestInterceptor current = GetCurrentInterceptor(); current.send_reply(serverInfo); } }
/// <summary> /// calls send exception interception point; /// Don't throw exception,if an interception point throws an exception. /// Instead, pass the exception on to the next interception point with send_excpetion. /// </summary> internal Exception SendException(ServerRequestInfoImpl serverInfo, Exception sentException) { Exception result = sentException; if (serverInfo != null) // can be null, if no interception chain available -> don't set in this case // update exception in requestInfo { serverInfo.SetSentException(sentException); } while (ProceedToNextInterceptor()) // proceed either to the begin element in reply chain, or skip failing element { ServerRequestInterceptor current = GetCurrentInterceptor(); try { current.send_exception(serverInfo); } catch (Exception ex) { result = ex; // update exception in requestInfo serverInfo.SetSentException(ex); } } return(result); }
/// <summary> /// <see cref="omg.org.PortableInterceptor.ServerRequestInterceptor.receive_request_service_contexts"></see> /// </summary> public void receive_request_service_contexts(ServerRequestInfo ri) { object svcCtx = null; try { svcCtx = ri.get_request_service_context(BI_DIR_IIOP.ConstVal); } catch (omg.org.CORBA.BAD_PARAM) { // context not found } if (svcCtx != null) { BiDirIIOPServiceContext receivedCtx = (BiDirIIOPServiceContext)m_codec.decode_value(((ServiceContext)svcCtx).context_data, m_svcContextTypeCode); ServerRequestInfoImpl internalInfo = (ServerRequestInfoImpl)ri; // need access to connection information GiopBidirectionalConnectionManager biDirConManager = (GiopBidirectionalConnectionManager)internalInfo.ConnectionDesc.ConnectionManager; biDirConManager.RegisterBidirectionalConnection(internalInfo.ConnectionDesc, receivedCtx.listen_points); } }
/// <summary> /// calls send exception interception point; /// Don't throw exception,if an interception point throws an exception. /// Instead, pass the exception on to the next interception point with send_excpetion. /// </summary> internal Exception SendException(ServerRequestInfoImpl serverInfo, Exception sentException) { Exception result = sentException; if (serverInfo != null) { // can be null, if no interception chain available -> don't set in this case // update exception in requestInfo serverInfo.SetSentException(sentException); } while (ProceedToNextInterceptor()) { // proceed either to the begin element in reply chain, or skip failing element ServerRequestInterceptor current = GetCurrentInterceptor(); try { current.send_exception(serverInfo); } catch (Exception ex) { result = ex; // update exception in requestInfo serverInfo.SetSentException(ex); } } return result; }
/// <summary> /// calls send reply interception point. Throws an exception, if an interception point throws /// an exception. /// </summary> internal void SendReply(ServerRequestInfoImpl serverInfo) { while (ProceedToNextInterceptor()) { ServerRequestInterceptor current = GetCurrentInterceptor(); current.send_reply(serverInfo); } }
/// <summary> /// calls receive request interception point. Throws an exception, if an interception point throws /// an exception. internal void ReceiveRequest(ServerRequestInfoImpl serverInfo) { while (ProceedToNextInterceptor()) { ServerRequestInterceptor current = GetCurrentInterceptor(); current.receive_request(serverInfo); } }
private void InitalizeForInterception(IInterceptionOption[] interceptionOptions) { // flow lifetime is bound to message lifetime, GiopServerRequest is only a wrapper around message and // can be recreated during message lifetime. m_interceptionFlow = (ServerRequestInterceptionFlow)SimpleGiopMsg.GetInterceptionFlow(m_requestMessage); if (m_interceptionFlow == null) { ServerRequestInterceptor[] interceptors = OrbServices.GetSingleton().InterceptorManager.GetServerRequestInterceptors(interceptionOptions); if (interceptors.Length == 0) { m_interceptionFlow = new ServerRequestInterceptionFlow(); } else { m_interceptionFlow = new ServerRequestInterceptionFlow(interceptors); } SimpleGiopMsg.SetInterceptionFlow(m_requestMessage, m_interceptionFlow); } if (m_interceptionFlow.NeedsRequestInfo()) { m_serverRequestInfo = new ServerRequestInfoImpl(this); } }