Beispiel #1
0
 public CMState ProcessMessageToOutgoing(Wrapper wrapper)
 {
     try
     {
         Log("ProcessMessageToOutgoing");
         return(OutgoingModule.ProcessMessage(wrapper));
     }
     catch (Exception ex)
     {
         Log(string.Format("ProcessMessageToOutgoing Error: {0}", ex.Message));
         return(CMState.BuildFail(ex));
     }
 }
Beispiel #2
0
        public override void Run()
        {
            try
            {
                if (Config != null)
                {
                    Log("Initializing Log");
                    State = Bussiness.ApplicationBase.ApplicationState.Logging;

                    Log("Initializing Incoming Module");
                    if (IncomingModule != null)
                    {
                        if (IncomingModule.Initialize(ProcessIncoming, LogIncoming, Config.IncomingConfigPath))
                        {
                            Log("Incoming Module successfully initialized");
                        }
                        else
                        {
                            Log("Error initializing Incoming Module");
                        }
                    }
                    else
                    {
                        Log("Incoming module could not be initialized because it was not instantiated");
                    }

                    Log("Initializing Outgoing Module");
                    if (OutgoingModule != null)
                    {
                        if (OutgoingModule.Initialize(ProcessOutgoing, LogOutgoing, Config.OutgoingConfigPath))
                        {
                            Log("Outgoing Module successfully initialized");
                        }
                        else
                        {
                            Log("Error initializing Outgoing Module");
                        }
                    }
                    else
                    {
                        Log("Outgoing module could not be initialized because it was not instantiated");
                    }

                    State = Bussiness.ApplicationBase.ApplicationState.Logged;
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Beispiel #3
0
        protected override CMState ProcessIncoming(Wrapper wrapper)
        {
            //StrongLogIncoming("ProcessIncoming..." + wrapper.ToString(), Constants.MessageType.Information);

            try
            {
                if (OutgoingModule != null)
                {
                    return(OutgoingModule.ProcessMessage(wrapper));
                }
                else
                {
                    return(CMState.BuildSuccess(false, "Outgoing module not set..."));
                }
            }
            catch (Exception ex)
            {
                LogIncoming("Error processing outgoing message: " + ex.Message, Constants.MessageType.Error);
                return(CMState.BuildFail(ex));;
            }
        }