private void LogCreatingEndpoint(BusEndpointInfo endpointInfo, LogBuffer logBuffer)
 {
     logBuffer.Information(
         "Creating service endpoint:\n\tAddress: {0}\n\tQueue name:{1}",
         endpointInfo.LocalhostUri,
         endpointInfo.QueueName);
 }
Exemplo n.º 2
0
        private void LogAssembliesLoaded(LogBuffer logBuffer)
        {
            string assembliesLoaded =
                string.Join(
                    "\n",
                    BuildManager.GetReferencedAssemblies()
                        .Cast<Assembly>()
                        .OrderBy(a => a.FullName)
                        .Select(a => a.FullName));

            logBuffer.Information("Assemblies loaded:\n{0}", assembliesLoaded);
        }
        private void host_Faulted(object sender, EventArgs e)
        {
            var logBuffer = new LogBuffer();

            try
            {
                logBuffer.Critical("The BusReceiverServiceHost faulted. Attempting to re-open...");

                this.serviceHost.Abort();
                this.serviceHost = this.CreateServiceHostInternal();
                this.serviceHost.Open();

                logBuffer.Information("BusReceiverServiceHost re-opened.");
            }
            finally
            {
                logBuffer.FlushToLog(LogPriority.Application, LogCategory.ServiceBus);
            }
        }
Exemplo n.º 4
0
 private void InitializeServiceBus(LogBuffer logBuffer)
 {
     logBuffer.Information("Configuring service bus.");
     Bus.FactoryMethod = provider => new WcfBusImplementation(provider, true);
     Bus.UpdateSubscriptions(
         new EnvironmentConfig()
             .WithDefaultsForEnvironmentType(this.EnvironmentType)
             .ExpandMachineGroups()
             .Applications);
     this.Container.RegisterInstance<IBus>(new Bus());
     MessageHandlerRegistry.RegisterAllHandlerTypes();
     this.Container.RegisterInstance<MessageHandlerRegistry>(MessageHandlerRegistry.Instance);
     this.Container.RegisterType<IBusReceiver, BusReceiver>();
 }
Exemplo n.º 5
0
        private void InitializeOperationsStoreAndDocs(LogBuffer logBuffer)
        {
            logBuffer.Information("Registering Operations store.");
            var operationsStore =
                BrnklyDocumentStore.Register(this.Container, StoreName.Operations);

            LoadRavenConfig(operationsStore, logBuffer);

            this.Container.Resolve<EnvironmentConfigUpdater>()
                .Initialize(EnvironmentConfig.StorageId, logBuffer);

            this.Container.Resolve<LoggingSettingsUpdater>()
                .Initialize(LoggingSettings.StorageId, logBuffer);

            this.Container.Resolve<CacheSettingsUpdater>()
                .Initialize(CacheSettingsData.StorageId, logBuffer);
        }
Exemplo n.º 6
0
        internal PlatformApplication Initialize(LogBuffer logBuffer)
        {
            lock (this.configurationLock)
            {
                if (this.isConfigured)
                {
                    return this;
                }

                try
                {
                    logBuffer.Information("Configuring PlatformApplication...");

                    this.Container = new UnityContainer();
                    this.InitializeServiceBus(logBuffer);
                    this.InitializeOperationsStoreAndDocs(logBuffer);
                    this.AllowAreasToConfigureContainer(logBuffer);
                    isConfigured = true;

                    logBuffer.Information("PlatformApplication was successfully configured.");
                }
                catch (Exception exception)
                {
                    logBuffer.Critical("PlatformApplication configuration failed due to the exception below.");
                    logBuffer.Critical(exception);
                    throw;
                }

                return this;
            }
        }
        private void ConfigureContainerIfNecessary(
            IUnityContainer container,
            LogBuffer logBuffer)
        {
            if (!areasWithContainerConfigured.TryAdd(this.GetType(), false))
            {
                logBuffer.Information(
                    "Container has already been configured for area {0}.",
                    this.AreaName);
                return;
            }

            logBuffer.Information("Configuring container for area {0}.", this.AreaName);
            this.ConfigureContainer(container, logBuffer);
            areasWithContainerConfigured[this.GetType()] = true;
        }