Ejemplo n.º 1
0
        private Configuration getEffectiveAppConfigAndZoneGovernor(out Metabank.SectionHost zoneGovernorSection,
                                                                   out bool isDynamicHost)
        {
            Configuration result = null;

            writeLog(MessageType.Info, "Getting effective app config for '{0}'...".Args(SkySystem.MetabaseApplicationName));
            try
            {
                var host = m_Metabase.CatalogReg.NavigateHost(m_HostName);

                result = host.GetEffectiveAppConfig(SkySystem.MetabaseApplicationName).Configuration;

                result.Application = this.m_Application;

                zoneGovernorSection = host.ParentZoneGovernorPrimaryHost();//Looking in the same NOC only
                isDynamicHost       = host.Dynamic;
            }
            catch (Exception error)
            {
                writeLog(MessageType.CatastrophicError, error.ToMessageWithType());
                throw error;
            }
            writeLog(MessageType.Info, "...config obtained");

            return(result);
        }
Ejemplo n.º 2
0
        private static Configuration getEffectiveAppConfigAndZoneGovernor(ServiceBaseApplication bootApp,
                                                                          out Metabank.SectionHost zoneGovernorSection,
                                                                          out bool isDynamicHost)
        {
            Configuration result = null;

            bootApp.writeLog(NFX.Log.MessageType.Info, "Getting effective app config for '{0}'...".Args(AgniSystem.MetabaseApplicationName));
            try
            {
                var host = s_Metabase.CatalogReg.NavigateHost(s_HostName);

                result = host.GetEffectiveAppConfig(AgniSystem.MetabaseApplicationName).Configuration;

                zoneGovernorSection = host.ParentZoneGovernorPrimaryHost();//Looking in the same NOC only
                isDynamicHost       = host.Dynamic;
            }
            catch (Exception error)
            {
                bootApp.writeLog(NFX.Log.MessageType.CatastrophicError, error.ToMessageWithType());
                throw error;
            }
            bootApp.writeLog(NFX.Log.MessageType.Info, "...config obtained");

            return(result);
        }
Ejemplo n.º 3
0
        public Contracts.DynamicHostID Spawn(Metabank.SectionHost host, string id)
        {
            if (!host.Dynamic)
            {
                throw new DynamicException("Target host is not dynamic");         //todo Move to constant
            }
            var hosts = host.ParentZone.ZoneGovernorHosts;

            return(App.GetServiceClientHub().CallWithRetry <Contracts.IZoneHostRegistryClient, Contracts.DynamicHostID>
                   (
                       (controller) => controller.Spawn(host.RegionPath, id),
                       hosts.Select(h => h.RegionPath)
                   ));
        }
Ejemplo n.º 4
0
        public Contracts.DynamicHostID Spawn(Metabank.SectionHost host, string id)
        {
            if (!host.Dynamic)
            {
                throw new DynamicException("TODO");
            }

            var hosts = host.ParentZone.ZoneGovernorHosts;

            return(Contracts.ServiceClientHub.CallWithRetry <Contracts.IZoneHostRegistryClient, Contracts.DynamicHostID>
                   (
                       (controller) => controller.Spawn(host.RegionPath, id),
                       hosts.Select(h => h.RegionPath)
                   ));
        }
Ejemplo n.º 5
0
        protected override void DoConfigure(IConfigSectionNode node)
        {
            base.DoConfigure(node);

            m_Host = AgniSystem.Metabase.CatalogReg.NavigateHost(node.AttrByName(CONFIG_HOST_ATTR).Value);
        }
Ejemplo n.º 6
0
 public Host(Metabank.SectionHost host, int o)
 {
     m_Section = host; m_Order = o;
 }