예제 #1
0
        /// <summary>
        /// 消息树构建 由插件调用 应用不需要关心这个方法
        /// </summary>
        /// <returns></returns>
        public static RemotionCallContext logRemoteCallClient()
        {
            IMessageTree tree      = Jasmine.GetManager().GetMessageTree(CallContextManager.MessageTreeId);
            String       messageId = tree.MessageId;

            if (messageId == null)
            {
                messageId      = Jasmine.GetProducer().CreateMessageId();
                tree.MessageId = messageId;
            }

            String childId = Jasmine.GetProducer().CreateMessageId();

            Jasmine.Event(JasmineConstants.TYPE_REMOTE_CALL, "", "0", childId);

            String root = tree.RootMessageId;

            if (root == null)
            {
                root = messageId;
            }

            return(new RemotionCallContext()
            {
                ChildMessageId = childId,
                ParentMessageId = messageId,
                RootMessageId = root
            });

            //ctx.AddProperty(CatContext.ROOT, root);
            //ctx.AddProperty(CatContext.PARENT, messageId);
            //ctx.AddProperty(CatContext.CHILD, childId);
        }
예제 #2
0
        /// <summary>
        ///  消息树构建 由插件调用 应用不需要关心这个方法
        /// </summary>
        /// <param name="ctx"></param>
        public static void logRemoteCallServer(RemotionCallContext ctx)
        {
            IMessageTree tree           = Jasmine.GetManager().GetMessageTree(CallContextManager.MessageTreeId);
            String       childMessageId = ctx.ChildMessageId;
            String       rootId         = ctx.RootMessageId;
            String       parentId       = ctx.ParentMessageId;

            if (childMessageId != null)
            {
                tree.MessageId = childMessageId;
            }
            if (parentId != null)
            {
                tree.ParentMessageId = parentId;
            }
            if (rootId != null)
            {
                tree.RootMessageId = rootId;
            }

            String childId = Jasmine.GetProducer().CreateMessageId();

            Jasmine.Event(JasmineConstants.TYPE_REMOTE_CALL, "", "0", childId);
        }