Ejemplo n.º 1
0
 /// <summary>
 /// 将需要处理的数据传递给下一个处理器
 /// </summary>
 /// <param name="data">处理数据</param>
 public virtual void ProcessRequest(RecrodData data)
 {
     if (this.mProcessor != null)
     {
         this.mProcessor.ProcessRequest(data);
     }
 }
Ejemplo n.º 2
0
 public override void ProcessRequest(RecrodData data)
 {
     //TODO:特征值的判断
     //if 非特征值
     base.ProcessRequest(data);
     //else 实际处理代码
     Console.WriteLine("This output from Login Processor, Do Not Process");
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 传入序列化后的RecordData
        /// </summary>
        /// <param name="data"></param>
        public static void Process(string data)
        {
            RecrodData recordData;

            try
            {
                recordData = new RecrodData(data);
            }
            catch
            {
                throw new ArgumentException("无法将传入的字符串反序列化为RecordData类型");
            }
            Process(recordData);
        }
Ejemplo n.º 4
0
        public static void Process(RecrodData data)
        {
            if (String.IsNullOrEmpty(data.RecorderFlag))
            {
                throw new ArgumentException("需要处理数据的Flag属性为空");
            }
            var processors = RecorderFactory.Instance.GetProcessors(data.RecorderFlag);

            if (processors == null)
            {
                throw new NullReferenceException("记录器配置中不包含" + data.RecorderFlag + "的配置");
            }
            //进入处理
            processors[0].ProcessRequest(data);
        }