Ejemplo n.º 1
0
        public WindowsService()
        {
            _console    = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());

            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness     = new CounterBusiness();
            var publisherBusiness   = new PublisherBusiness();

            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            CounterBusiness.ChangedCurrentCultureEvent += ChangedCurrentCultureEvent;
            var sendBusiness = new SendBusiness(configBusiness, new ConsoleQueueEvents(_console));
            var tagLoader    = new TagLoader(configBusiness);

            _processor = new Processor(configBusiness, counterBusiness, publisherBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent         = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue         = true;
            CanShutdown = true;
            CanStop     = true;

            _console.LineWrittenEvent += _console_LineWrittenEvent;
        }
Ejemplo n.º 2
0
 public CompositeRoot()
 {
     ClientConsole       = new ClientConsole();
     InfluxDbAgentLoader = new InfluxDbAgentLoader();
     FileLoaderAgent     = new FileLoaderAgent();
     ConfigBusiness      = new ConfigBusiness(FileLoaderAgent);
     ConfigBusiness.InvalidConfigEvent += InvalidConfigEvent;
     CounterBusiness   = new CounterBusiness();
     PublisherBusiness = new PublisherBusiness();
     SendBusiness      = new SendBusiness(ConfigBusiness, InfluxDbAgentLoader);
     SendBusiness.SendBusinessEvent += SendBusinessEvent;
     TagLoader = new TagLoader(ConfigBusiness);
 }
Ejemplo n.º 3
0
 public CompositeRoot()
 {
     ClientConsole       = new ClientConsole();
     InfluxDbAgentLoader = new InfluxDbAgentLoader();
     FileLoaderAgent     = new FileLoaderAgent();
     ConfigBusiness      = new ConfigBusiness(FileLoaderAgent);
     ConfigBusiness.InvalidConfigEvent += InvalidConfigEvent;
     CounterBusiness   = new CounterBusiness();
     PublisherBusiness = new PublisherBusiness();
     MetaDataBusiness  = new MetaDataBusiness();
     SendBusiness      = new SendBusiness(ConfigBusiness, new ConsoleQueueEvents(ClientConsole));
     TagLoader         = new TagLoader(ConfigBusiness);
     SocketClient      = new SocketClient();
 }
Ejemplo n.º 4
0
        public WindowsService()
        {
            _console    = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: This can be removed when the new version of Tharga.Toolkit.Console is used. One version after 1.5.13.0 will do this for you.
            if (!EventLog.SourceExists(ServiceName))
            {
                EventLog.CreateEventSource(ServiceName, "Application");
            }

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());

            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness     = new CounterBusiness();
            var publisherBusiness   = new PublisherBusiness();

            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            var sendBusiness = new SendBusiness(configBusiness, influxDbAgentLoader);

            sendBusiness.SendBusinessEvent += SendBusinessEvent;
            var tagLoader = new TagLoader(configBusiness);

            _processor = new Processor(configBusiness, counterBusiness, publisherBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent         = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue         = true;
            CanShutdown = true;
            CanStop     = true;
        }