private void InitializeResponserAgent(EntityConfigBase cfg) { if ((cfg.Interaction & InteractionTypes.Responser) != InteractionTypes.Responser) { return; } IResponser p = EntityInstance as IResponser; if (p == null) { return; } _responserAgent = new PullReceiverAgent(p, _log); foreach (PullChannelConfig c in cfg.ResponseConfig.Channels) { _responserAgent.RegisterChannel(c); } _responserAgent.InitializeChannels(); if (cfg.ResponseConfig.ProcessConfig.PreProcessConfig.IsEnable()) { _responserAgent.OnPreProcessing += new DuplexMessagePreProcessHandler(_responserAgent_OnPreProcessing); _log.Write(LogType.Debug, "Message pre processing handler is injected for responser. " + cfg.EntityID.ToString()); } if (cfg.ResponseConfig.ProcessConfig.PostProcessConfig.IsEnable()) { _responserAgent.OnPostProcessing += new DuplexMessagePostProcessHanlder(_responserAgent_OnPostProcessing); _log.Write(LogType.Debug, "Message post processing handler is injected for responser. " + cfg.EntityID.ToString()); } }
public PullReceiverAgent(IResponser responser, ILog log) { _log = log; _responser = responser; }