public SystemInformationDispatchingService(IAgentCoordinationServiceFactory agentCoordinationServiceFactory, IMessageQueueFeederFactory messageQueueFeederFactory, IMessageQueueWorkerFactory messageQueueWorkerFactory, IMessageQueueProvider<SystemInformation> messageQueueProvider, IMessageQueuePersistence<SystemInformation> messageQueuePersistence)
        {
            if (agentCoordinationServiceFactory == null)
            {
                throw new ArgumentNullException("agentCoordinationServiceFactory");
            }

            if (messageQueueFeederFactory == null)
            {
                throw new ArgumentNullException("messageQueueFeederFactory");
            }

            if (messageQueueWorkerFactory == null)
            {
                throw new ArgumentNullException("messageQueueWorkerFactory");
            }

            if (messageQueueProvider == null)
            {
                throw new ArgumentNullException("messageQueueProvider");
            }

            if (messageQueuePersistence == null)
            {
                throw new ArgumentNullException("messageQueuePersistence");
            }

            this.messageQueueFeeder = messageQueueFeederFactory.GetMessageQueueFeeder();
            this.messageQueueWorker = messageQueueWorkerFactory.GetMessageQueueWorker();
            this.messageQueueProvider = messageQueueProvider;
            this.messageQueuePersistence = messageQueuePersistence;

            this.agentCoordinationService = agentCoordinationServiceFactory.GetAgentCoordinationService(
                () => this.messageQueueWorker.Pause(), () => this.messageQueueWorker.Resume());
        }
        public SystemInformationDispatchingService(IAgentCoordinationServiceFactory agentCoordinationServiceFactory, IMessageQueueFeederFactory messageQueueFeederFactory, IMessageQueueWorkerFactory messageQueueWorkerFactory, IMessageQueueProvider <SystemInformation> messageQueueProvider, IMessageQueuePersistence <SystemInformation> messageQueuePersistence)
        {
            if (agentCoordinationServiceFactory == null)
            {
                throw new ArgumentNullException("agentCoordinationServiceFactory");
            }

            if (messageQueueFeederFactory == null)
            {
                throw new ArgumentNullException("messageQueueFeederFactory");
            }

            if (messageQueueWorkerFactory == null)
            {
                throw new ArgumentNullException("messageQueueWorkerFactory");
            }

            if (messageQueueProvider == null)
            {
                throw new ArgumentNullException("messageQueueProvider");
            }

            if (messageQueuePersistence == null)
            {
                throw new ArgumentNullException("messageQueuePersistence");
            }

            this.messageQueueFeeder      = messageQueueFeederFactory.GetMessageQueueFeeder();
            this.messageQueueWorker      = messageQueueWorkerFactory.GetMessageQueueWorker();
            this.messageQueueProvider    = messageQueueProvider;
            this.messageQueuePersistence = messageQueuePersistence;

            this.agentCoordinationService = agentCoordinationServiceFactory.GetAgentCoordinationService(
                () => this.messageQueueWorker.Pause(), () => this.messageQueueWorker.Resume());
        }