Example #1
0
 /// <summary>
 /// calls send request interception point. Throws an exception, if an interception point throws
 /// an exception.
 /// </summary>
 internal void SendRequest(ClientRequestInfoImpl clientInfo)
 {
     while (ProceedToNextInterceptor())
     {
         GetCurrentInterceptor().send_request(clientInfo);
     }
 }
Example #2
0
 /// <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);
     }
 }
Example #3
0
        /// <summary>
        /// <see cref="omg.org.PortableInterceptor.ClientRequestInterceptor.send_request"></see>
        /// </summary>
        public void send_request(ClientRequestInfo ri)
        {
            ClientRequestInfoImpl internalInfo = (ClientRequestInfoImpl)ri;    // need access to connection information

            if ((internalInfo.ConnectionDesc.Connection.IsInitiatedLocal()) && // initiated in this appdomain
                (internalInfo.ConnectionDesc.ConnectionManager.SupportBiDir()))
            {
                GiopBidirectionalConnectionManager biDirConManager =
                    (GiopBidirectionalConnectionManager)internalInfo.ConnectionDesc.ConnectionManager;

                ListenPoint[]           listenPointsEntry = ConvertToListenPoints(biDirConManager.GetOwnListenPoints());
                BiDirIIOPServiceContext contextEntry      = new BiDirIIOPServiceContext(listenPointsEntry);

                ServiceContext svcContext = new ServiceContext(BI_DIR_IIOP.ConstVal,
                                                               m_codec.encode_value(contextEntry));
                ri.add_request_service_context(svcContext, true);

                biDirConManager.SetupConnectionForBidirReception(internalInfo.ConnectionDesc);
            }
        }
Example #4
0
        /// <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>
 /// 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>
 /// 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);
     }
 }
 /// <summary>
 /// calls send request interception point. Throws an exception, if an interception point throws
 /// an exception.
 /// </summary>
 internal void SendRequest(ClientRequestInfoImpl clientInfo) {
     while (ProceedToNextInterceptor()) {
         GetCurrentInterceptor().send_request(clientInfo);
     }
 }
Example #8
0
 private void IntializeForInterception(IInterceptionOption[] interceptionOptions) {
     // flow lifetime is bound to message lifetime, GiopClientRequest is only a wrapper around message and
     // can be recreated during message lifetime.
     m_interceptionFlow =
         (ClientRequestInterceptionFlow)SimpleGiopMsg.GetInterceptionFlow(m_requestMessage);
     if (m_interceptionFlow ==  null) {
         ClientRequestInterceptor[] interceptors = 
             OrbServices.GetSingleton().InterceptorManager.GetClientRequestInterceptors(interceptionOptions);
         if (interceptors.Length == 0) {
             m_interceptionFlow = new ClientRequestInterceptionFlow();
         } else {
             m_interceptionFlow = new ClientRequestInterceptionFlow(interceptors);
         }
         SimpleGiopMsg.SetInterceptionFlow(m_requestMessage, m_interceptionFlow);
     }
     if (m_interceptionFlow.NeedsRequestInfo()) {
         // optimization: needs not be created, if non-intercepted.
         m_clientRequestInfo = new ClientRequestInfoImpl(this);
     }            
 }