public IServiceBus Start()
        {
            if (Started)
            {
                throw new ApplicationException(ESBResources.ServiceBusInstanceAlreadyStarted);
            }

            GuardAgainstInvalidConfiguration();

            foreach (var module in Configuration.Modules)
            {
                module.Initialize(this);
            }

            var startupPipeline = new StartupPipeline(this);

            Events.OnPipelineCreated(this, new PipelineEventArgs(startupPipeline));

            startupPipeline.Execute();

            inboxThreadPool   = startupPipeline.State.Get <IProcessorThreadPool>("InboxThreadPool");
            controlThreadPool = startupPipeline.State.Get <IProcessorThreadPool>("ControlInboxThreadPool");
            outboxThreadPool  = startupPipeline.State.Get <IProcessorThreadPool>("OutboxThreadPool");

            started = true;

            return(this);
        }
        public IServiceBus Start()
        {
            if (Started)
            {
                throw new ApplicationException(ESBResources.ServiceBusInstanceAlreadyStarted);
            }

            GuardAgainstInvalidConfiguration();

            // cannot be in startup pipeline as some modules may need to observe the startup pipeline
            foreach (var module in Configuration.Modules)
            {
                module.Initialize(this);
            }

            var startupPipeline = new StartupPipeline(this);

            Events.OnPipelineCreated(this, new PipelineEventArgs(startupPipeline));

            startupPipeline.Execute();

            _inboxThreadPool           = startupPipeline.State.Get <IProcessorThreadPool>("InboxThreadPool");
            _controlThreadPool         = startupPipeline.State.Get <IProcessorThreadPool>("ControlInboxThreadPool");
            _outboxThreadPool          = startupPipeline.State.Get <IProcessorThreadPool>("OutboxThreadPool");
            _deferredMessageThreadPool = startupPipeline.State.Get <IProcessorThreadPool>("DeferredMessageThreadPool");

            _started = true;

            return(this);
        }
Exemple #3
0
        public IServiceBus Start()
        {
            if (Started)
            {
                throw new ApplicationException(ESBResources.ServiceBusInstanceAlreadyStarted);
            }

            GuardAgainstInvalidConfiguration();

            foreach (var module in Configuration.Modules)
            {
                module.Initialize(this);
            }

            var startupPipeline = new StartupPipeline(this);

            Events.OnPipelineCreated(this, new PipelineEventArgs(startupPipeline));

            startupPipeline.Execute();

            inboxThreadPool = startupPipeline.State.Get<IProcessorThreadPool>("InboxThreadPool");
            controlThreadPool = startupPipeline.State.Get<IProcessorThreadPool>("ControlInboxThreadPool");
            outboxThreadPool = startupPipeline.State.Get<IProcessorThreadPool>("OutboxThreadPool");
            deferredMessageThreadPool = startupPipeline.State.Get<IProcessorThreadPool>("DeferredMessageThreadPool");

            started = true;

            return this;
        }