Exemple #1
0
        private void PostProcess()
        {
            if (AppHost.Pipes == null)
            {
                StepCompleted();
                return;
            }

            if (null != AppHost.Pipes)
            {
                // reset pending pipes
                pending = AppHost.Pipes == null ? 1 : AppHost.Pipes.Count;

                for (int i = AppHost.Pipes.Count - 1; i >= 0; --i)
                {
                    IManosPipe pipe = AppHost.Pipes[i];
                    try {
                        pipe.OnPostProcessRequest(app, transaction, StepCompleted);

                        if (ctx.Transaction.Aborted)
                        {
                            return;
                        }
                    } catch (Exception e) {
                        pending--;

                        Console.Error.WriteLine("Exception in {0}::OnPostProcessRequest.", pipe);
                        Console.Error.WriteLine(e);
                    }
                }
            }
        }
Exemple #2
0
 public static void AddPipe(IManosPipe pipe)
 {
     if (pipes == null)
     {
         pipes = new List <IManosPipe> ();
     }
     pipes.Add(pipe);
 }
Exemple #3
0
 private void PipePreProcessTarget(Action <IManosTarget> callback)
 {
     if (null != AppHost.Pipes)
     {
         for (int i = 0; i < AppHost.Pipes.Count; ++i)
         {
             IManosPipe pipe = AppHost.Pipes[i];
             try {
                 pipe.OnPreProcessTarget(ctx, callback);
             } catch (Exception e) {
                 Console.Error.WriteLine("Exception in {0}::OnPreProcessTarget.", pipe);
                 Console.Error.WriteLine(e);
             }
         }
     }
 }
Exemple #4
0
        private void PipePostProcessTarget(IManosTarget handler)
        {
            if (null != AppHost.Pipes)
            {
                // reset pending pipes
                pending = AppHost.Pipes == null ? 1 : AppHost.Pipes.Count;

                for (int i = AppHost.Pipes.Count - 1; i >= 0; --i)
                {
                    IManosPipe pipe = AppHost.Pipes[i];
                    try {
                        pipe.OnPostProcessTarget(ctx, handler, StepCompleted);
                    } catch (Exception e) {
                        Console.Error.WriteLine("Exception in {0}::OnPostProcessTarget.", pipe);
                        Console.Error.WriteLine(e);
                    }
                }
            }
        }
Exemple #5
0
        // Load configuration from file
        // Search path:
        //	1.<app_folder>/manos.config
        public static void Load(IManosPipe pipe)
        {
            string [] sources =
            {
                Path.Combine(Environment.CurrentDirectory, "manos.config"),
            };

            foreach (string src in sources)
            {
                try
                {
                    if (File.Exists(src))
                    {
                        CompileFile(src);
                    }
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("** Error processing config file '{0}': {1}", src, ex.Message);
                    Console.Error.WriteLine("** Trace: {0}", ex.StackTrace);
                    continue;
                }
            }
        }
Exemple #6
0
 public static void AddPipe(IManosPipe pipe)
 {
     if (pipes == null)
         pipes = new List<IManosPipe> ();
     pipes.Add (pipe);
 }