/// <summary> /// the active client request interceptors /// </summary> internal ClientRequestInterceptor[] GetClientRequestInterceptors(params IInterceptionOption[] options) { ClientRequestInterceptor[] result; if (m_interceptionRegistrationComplete) { result = m_clientRequestInterceptorsInitalized; } else { // registration incomplete. result = s_emptyClientRequestInterceptors; } if (options.Length > 0) { ClientRequestInterceptor[] oldResult = result; result = new ClientRequestInterceptor[oldResult.Length + options.Length]; for (int i = 0; i < oldResult.Length; i++) { result[i] = oldResult[i]; } for (int i = 0; i < options.Length; i++) { result[oldResult.Length + i] = options[i].GetClientRequestInterceptor(m_orb); } } return(result); }
/// <summary> /// calls receive reply interception point. Throws an exception, if an interception point throws /// an exception. /// </summary> internal void ReceiveOther(ClientRequestInfoImpl clientInfo) { while (ProceedToNextInterceptor()) { ClientRequestInterceptor current = GetCurrentInterceptor(); current.receive_other(clientInfo); } }
public void add_client_request_interceptor(ClientRequestInterceptor interceptor) { if (m_manager.RegistrationComplete) { throw new OBJECT_NOT_EXIST(701, CompletionStatus.Completed_No); } m_manager.add_client_request_interceptor(interceptor); }
/// <summary> /// calls receive 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 receive_excpetion. /// </summary> /// <param name="receivedException"></param> /// <returns></returns> internal Exception ReceiveException(ClientRequestInfoImpl clientInfo, Exception receivedException) { Exception result = receivedException; if (clientInfo != null) // can be null, if no interception chain available -> don't set in this case // update exception in requestInfo { clientInfo.SetReceivedException(receivedException); } while (ProceedToNextInterceptor()) // proceed either to the begin element in reply chain, or skip failing element { ClientRequestInterceptor current = GetCurrentInterceptor(); try { current.receive_exception(clientInfo); } catch (Exception ex) { result = ex; // update exception in requestInfo clientInfo.SetReceivedException(ex); } } return(result); }
/// <summary> /// adds a client request interceptor to the inactive client request interceptors. Not possible any more /// after registration completed. /// </summary> internal void add_client_request_interceptor(ClientRequestInterceptor interceptor) { lock (this) { if (m_interceptionRegistrationComplete) { throw new BAD_INV_ORDER(701, CompletionStatus.Completed_No); } if (interceptor.Name != null && interceptor.Name != String.Empty) { if (!m_namedClientRequestInterceptors.Contains(interceptor.Name)) { m_namedClientRequestInterceptors[interceptor.Name] = interceptor; } else { throw new DuplicateName(interceptor.Name); } } else { m_unnamedClientRequestInterceptors.Add(interceptor); } } }
/// <summary> /// adds a client request interceptor to the inactive client request interceptors. Not possible any more /// after registration completed. /// </summary> internal void add_client_request_interceptor(ClientRequestInterceptor interceptor) { lock(this) { if (m_interceptionRegistrationComplete) { throw new BAD_INV_ORDER(701, CompletionStatus.Completed_No); } if (interceptor.Name != null && interceptor.Name != String.Empty) { if (!m_namedClientRequestInterceptors.Contains(interceptor.Name)) { m_namedClientRequestInterceptors[interceptor.Name] = interceptor; } else { throw new DuplicateName(interceptor.Name); } } else { m_unnamedClientRequestInterceptors.Add(interceptor); } } }
/// <summary> /// the active client request interceptors /// </summary> internal ClientRequestInterceptor[] GetClientRequestInterceptors(params IInterceptionOption[] options) { ClientRequestInterceptor[] result; if (m_interceptionRegistrationComplete) { result = m_clientRequestInterceptorsInitalized; } else { // registration incomplete. result = s_emptyClientRequestInterceptors; } if (options.Length > 0) { ClientRequestInterceptor[] oldResult = result; result = new ClientRequestInterceptor[oldResult.Length + options.Length]; for (int i = 0; i < oldResult.Length; i++) { result[i] = oldResult[i]; } for (int i = 0; i < options.Length; i++) { result[oldResult.Length + i] = options[i].GetClientRequestInterceptor(m_orb); } } return result; }
internal ClientRequestInterceptionFlow(ClientRequestInterceptor[] interceptors) : base(interceptors) { }