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);
            }
        }
예제 #2
0
 public static void LoadRavenConfig(IDocumentStore operationsStore, LogBuffer logBuffer)
 {
     try
     {
         using (var session = operationsStore.OpenSession())
         {
             var config = session.Load<RavenConfig>(RavenConfig.StorageId);
             BrnklyDocumentStore.UpdateAllStores(config);
         }
     }
     catch (Exception exception)
     {
         logBuffer.Critical(
             "Failed to load the Raven configuration due to the exception below. " +
             "The application may not function correctly until a valid Raven configuration is received.");
         logBuffer.Critical(exception);
     }
 }
예제 #3
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;
            }
        }