NotifyDynamicSinks() private method

private NotifyDynamicSinks ( IMessage msg, bool bCliSide, bool bStart, bool bAsync, bool bNotifyGlobals ) : bool
msg IMessage
bCliSide bool
bStart bool
bAsync bool
bNotifyGlobals bool
return bool
 internal static IMessage CallProcessMessage(IMessageSink ms, IMessage reqMsg, ArrayWithSize proxySinks, Thread currentThread, Context currentContext, bool bSkippingContextChain)
 {
     if (proxySinks != null)
     {
         DynamicPropertyHolder.NotifyDynamicSinks(reqMsg, proxySinks, true, true, false);
     }
     bool flag = false;
     if (bSkippingContextChain)
     {
         flag = currentContext.NotifyDynamicSinks(reqMsg, true, true, false, true);
         ChannelServices.NotifyProfiler(reqMsg, RemotingProfilerEvent.ClientSend);
     }
     if (ms == null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_NoChannelSink"));
     }
     IMessage msg = ms.SyncProcessMessage(reqMsg);
     if (bSkippingContextChain)
     {
         ChannelServices.NotifyProfiler(msg, RemotingProfilerEvent.ClientReceive);
         if (flag)
         {
             currentContext.NotifyDynamicSinks(msg, true, false, false, true);
         }
     }
     IMethodReturnMessage message2 = msg as IMethodReturnMessage;
     if ((msg == null) || (message2 == null))
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
     }
     if (proxySinks != null)
     {
         DynamicPropertyHolder.NotifyDynamicSinks(msg, proxySinks, true, false, false);
     }
     return msg;
 }
Exemplo n.º 2
0
        // This is used when a TP is called with SyncProcessMessage
        internal static IMessage CallProcessMessage(IMessageSink ms, 
                                                    IMessage reqMsg, 
                                                    ArrayWithSize proxySinks,
                                                    Thread currentThread,
                                                    Context currentContext,
                                                    bool bSkippingContextChain)
        {                   
            // Notify Dynamic Sinks: CALL starting          
            if (proxySinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(
                                            reqMsg, 
                                            proxySinks, 
                                            true,   // bCliSide
                                            true,   // bStart
                                            false); // bAsync
            }

            RemotingServices.LogRemotingStage(RemotingServices.CLIENT_MSG_SINK_CHAIN);            

            bool bHasDynamicSinks = false;
            if (bSkippingContextChain)
            {
                // this would have been done in the client context terminator sink
                bHasDynamicSinks = 
                    currentContext.NotifyDynamicSinks(reqMsg, 
                        true,   // bCliSide
                        true,   // bStart
                        false,  // bAsync
                        true);  // bNotifyGlobals 
   
                ChannelServices.NotifyProfiler(reqMsg, RemotingProfilerEvent.ClientSend);
            }
            
            if (ms == null)
            {
                throw new RemotingException(
                    Environment.GetResourceString(
                        "Remoting_Proxy_NoChannelSink"));                    
            }

            IMessage retMsg = ms.SyncProcessMessage(reqMsg);

            if (bSkippingContextChain)
            {
                // this would have been done in the client context terminator sink
                ChannelServices.NotifyProfiler(retMsg, RemotingProfilerEvent.ClientReceive);

                if (bHasDynamicSinks)
                {
                    currentContext.NotifyDynamicSinks(
                        retMsg, 
                        true,   // bCliSide
                        false,   // bStart
                        false,  // bAsync
                        true);  // bNotifyGlobals  
                }
            }            

            IMethodReturnMessage mrm = retMsg as IMethodReturnMessage;
            if (retMsg == null || mrm == null)
            {
                throw new RemotingException(
                    Environment.GetResourceString("Remoting_Message_BadType"));                    
            }

            // notify DynamicSinks: CALL returned
            if (proxySinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(
                                            retMsg, 
                                            proxySinks, 
                                            true,   // bCliSide
                                            false,  // bStart
                                            false); // bAsync
            }

           
            RemotingServices.LogRemotingStage(RemotingServices.CLIENT_RET_PROPAGATION);

            return retMsg;
        }