public SkyApplication(IApplication bootApplication, SystemApplicationType sysAppType, IFileSystem metabaseFileSystem, FileSystemSessionConnectParams metabaseFileSystemSessionParams, string metabaseFileSystemRootPath, string thisHostName, bool allowNesting, string[] cmdArgs, ConfigSectionNode rootConfig) : base() { ctor(allowNesting, cmdArgs, rootConfig); m_BootLoader = new BootConfLoader(this, bootApplication, sysAppType, metabaseFileSystem, metabaseFileSystemSessionParams, metabaseFileSystemRootPath, thisHostName, cmdArgs, rootConfig); try { m_ConfigRoot = m_BootLoader.ApplicationConfiguration.Root; InitApplication(); } catch { Destructor(); throw; } }
public static IDisposable LoadForTest(SystemApplicationType appType, Metabank mbase, string host, string dynamicHostNameSuffix = null) { SetDomainInvariantCulture(); s_Loaded = true; s_SystemApplicationType = appType; s_Metabase = mbase; s_HostName = host; if (dynamicHostNameSuffix.IsNotNullOrWhiteSpace()) { s_DynamicHostNameSuffix = Metabank.HOST_DYNAMIC_SUFFIX_SEPARATOR + dynamicHostNameSuffix; } else { var sh = mbase.CatalogReg.NavigateHost(host); if (sh.Dynamic) { s_DynamicHostNameSuffix = thisMachineDynamicNameSuffix(); } } if (s_DynamicHostNameSuffix.IsNotNullOrWhiteSpace()) { s_HostName = s_HostName + s_DynamicHostNameSuffix; } SystemVarResolver.Bind(); Configuration.ProcesswideConfigNodeProviderType = typeof(Metabase.MetabankFileConfigNodeProvider); return(new TestDisposer()); }
internal BootConfLoader(IApplication bootApp, SystemApplicationType appType, Metabank mbase, string host, string dynamicHostNameSuffix = null) { Platform.Abstraction.PlatformAbstractionLayer.SetProcessInvariantCulture(); m_BootApplication = bootApp; m_SystemApplicationType = appType; m_Metabase = mbase; m_HostName = host; if (dynamicHostNameSuffix.IsNotNullOrWhiteSpace()) { m_DynamicHostNameSuffix = Metabank.HOST_DYNAMIC_SUFFIX_SEPARATOR + dynamicHostNameSuffix; } else { var sh = mbase.CatalogReg.NavigateHost(host); if (sh.Dynamic) { m_DynamicHostNameSuffix = thisMachineDynamicNameSuffix(); } } if (m_DynamicHostNameSuffix.IsNotNullOrWhiteSpace()) { m_HostName = m_HostName + m_DynamicHostNameSuffix; } SystemVarResolver.Bind(); Configuration.ProcesswideConfigNodeProviderType = typeof(Sky.Metabase.MetabankFileConfigNodeProvider); }
public SkyApplication(SystemApplicationType sysAppType, bool allowNesting, string[] args, ConfigSectionNode rootConfig) : base() { var loader = new BootConfLoader(sysAppType); ctor(loader, allowNesting, args, rootConfig); }
internal SkyApplication(IApplication bootApp, SystemApplicationType sysAppType, Metabank metabase, string thisHost, bool allowNesting, string[] args, ConfigSectionNode rootConfig) : base() { var loader = new BootConfLoader(bootApp, sysAppType, metabase, thisHost); ctor(loader, allowNesting, args, rootConfig); }
internal BootConfLoader(ISkyApplication application, IApplication bootApplication, SystemApplicationType appType, IFileSystem metabaseFileSystem, FileSystemSessionConnectParams metabaseFileSystemSessionParams, string metabaseFileSystemRootPath, string thisHostName, string[] cmdArgs, ConfigSectionNode rootConfig, string dynamicHostNameSuffix = null) { Platform.Abstraction.PlatformAbstractionLayer.SetProcessInvariantCulture(); SystemVarResolver.Bind();//todo: Refactor to use ~App. app var resolver instead Configuration.ProcesswideConfigNodeProviderType = typeof(MetabankFileConfigNodeProvider); m_SystemApplicationType = appType; m_Application = application.NonNull(nameof(application)); //1. Init boot app container m_BootApplication = bootApplication; if (m_BootApplication == null) { m_BootApplication = new AzosApplication(allowNesting: true, cmdArgs: cmdArgs, rootConfig: rootConfig); m_IsBootApplicationOwner = true; } writeLog(MessageType.Trace, "Entering Sky app bootloader..."); //2. what host is this? m_HostName = determineHostName(thisHostName); //Sets cluster host name in all log messages if (m_HostName.IsNotNullOrWhiteSpace()) { Message.DefaultHostName = m_HostName; } //3. Mount metabank var mNode = m_BootApplication.ConfigRoot[CONFIG_SKY_SECTION][CONFIG_METABASE_SECTION]; ensureMetabaseAppName(mNode); m_Metabase = new Metabank(m_BootApplication, m_Application, metabaseFileSystem, metabaseFileSystemSessionParams, metabaseFileSystemRootPath); m_IsMetabaseFSOwner = false;//externally supplied writeLog(MessageType.Trace, "...exiting Sky app bootloader"); }
public SkyApplication(SystemApplicationType sysAppType, bool allowNesting, string[] cmdArgs, ConfigSectionNode rootConfig) : base() { ctor(allowNesting, cmdArgs, rootConfig); m_BootLoader = new BootConfLoader(this, null, sysAppType, cmdArgs, rootConfig); try { m_ConfigRoot = m_BootLoader.ApplicationConfiguration.Root; InitApplication(); } catch { Destructor(); throw; } }
internal BootConfLoader(ISkyApplication application, IApplication bootApplication, SystemApplicationType appType, string [] cmdArgs, ConfigSectionNode rootConfig) { Platform.Abstraction.PlatformAbstractionLayer.SetProcessInvariantCulture(); SystemVarResolver.Bind();//todo: Refactor to use ~App. app var resolver instead Configuration.ProcesswideConfigNodeProviderType = typeof(MetabankFileConfigNodeProvider); m_SystemApplicationType = appType; m_Application = application.NonNull(nameof(application)); //1. Init boot app container m_BootApplication = bootApplication; if (m_BootApplication == null) { m_BootApplication = new AzosApplication(allowNesting: true, cmdArgs: cmdArgs, rootConfig: rootConfig); m_IsBootApplicationOwner = true; } writeLog(MessageType.Trace, "Entering Sky app bootloader..."); //2. what host is this? m_HostName = determineHostName(null); //Sets cluster host name in all log messages if (m_HostName.IsNotNullOrWhiteSpace()) { Message.DefaultHostName = m_HostName; } //3. Mount Metabank m_Metabase = mountMetabank(); writeLog(MessageType.Trace, "...exiting Sky app bootloader"); }
internal static void Unload() { if (!s_Loaded) { return; } s_Loaded = false; s_SystemApplicationType = AppModel.SystemApplicationType.Unspecified; s_HostName = null; s_DynamicHostNameSuffix = null; s_ParentZoneGovernorPrimaryHostName = null; try { if (s_Metabase != null) { var mb = s_Metabase; var fs = mb.FileSystem; s_Metabase = null; try { mb.Dispose(); } finally { if (fs != null) { fs.Dispose(); } }//finally } } catch { //nowhere to log anymore as all loggers have stopped } }
public SkyApplication(SystemApplicationType sysAppType, string[] cmdArgs, ConfigSectionNode rootConfig) : this(sysAppType, false, cmdArgs, rootConfig) { }
public SkyApplication(SystemApplicationType sysAppType, string[] cmdArgs) : this(sysAppType, false, cmdArgs, null) { }
/// <summary> /// Internal hack to compensate for c# inability to call .ctor within .ctor body /// </summary> internal static string[] SetSystemApplicationType(SystemApplicationType appType, string[] args) { s_SystemApplicationType = appType; return(args); }
public AgniServiceApplication(SystemApplicationType sysAppType, string[] args, ConfigSectionNode rootConfig) : base(BootConfLoader.SetSystemApplicationType(sysAppType, args), rootConfig) { }
internal BootConfLoader(SystemApplicationType appType) { Platform.Abstraction.PlatformAbstractionLayer.SetProcessInvariantCulture(); m_SystemApplicationType = appType; }