Example #1
0
        public OperationLogicPelineObject BuildOperationPipeline(Request request)
        {
            var result = new OperationLogicPelineObject();

            result.Add(requestObject => {
                //记录.net 客户端请求Log
            });
            result.Add(requestObjcet =>
            {
                //执行.net请求
            });
            return(result);
        }
Example #2
0
        static void Main(string[] args)
        {
            //启动客户端管道处理
            Request request = new Request()
            {
                Content = new RequestContent {
                    Content = "Query order method"
                },
                Head       = new StringBuilder(),
                ClientType = RequestClientTypeFactory.CreateRequestClientTypeForNet2()
            };
            ClientPipelineObject pipe = new ClientPipelineObject();

            pipe.AddModule(ClientPipelineModules.CheckRequestContent);
            pipe.AddModule(ClientPipelineModules.AddRequestHead);
            pipe.AddModule(ClientPipelineModules.TransFerRequestFormat);
            pipe.AddModule(ClientPipelineModules.ReduceRequest);
            pipe.RunPipeline(request);
            //执行特性类型客户端的管道处理
            IBuildOperationLogicPipelineObject clientType = OperationLogicPipelineObjectFactory.Create(request.ClientType);
            OperationLogicPelineObject         pipleline  = clientType.BuildOperationPipeline(request);

            pipleline.RunPipeLine(request);
        }