Esempio n. 1
0
        /// <summary>
        /// Starts this instance.
        /// </summary>
        public void Start()
        {
            lock (this)
            {
                // register ESP/CEP engine
                cepProvider = CEPProvider.GetCEPProvider();
                cepProvider.Init(sleepListenerMillis);

                // register statements
                String suffix = MODES.Get("_SUFFIX");
                if (mode == "NOOP")
                {
                    ;
                }
                else
                {
                    String stmtString = MODES.Get(mode) + " " + suffix;
                    Console.WriteLine("Using " + mode + " : " + stmtString);

                    if (MODES.Get(mode).IndexOf('$') < 0)
                    {
                        cepProvider.RegisterStatement(stmtString, mode);
                        Console.WriteLine("\nStatements registered # 1 only");
                    }
                    else
                    {
                        // create a stmt for each symbol
                        for (int i = 0; i < Symbols.SYMBOLS.Length; i++)
                        {
                            if (i % 100 == 0)
                            {
                                Console.WriteLine(".");
                            }
                            String ticker = Symbols.SYMBOLS[i];
                            cepProvider.RegisterStatement(stmtString.Replace("\\$", ticker), mode + "-" + ticker);
                        }
                        Console.WriteLine("\nStatements registered # " + Symbols.SYMBOLS.Length);
                    }
                }
            }

            thread.Start();
        }