Ejemplo n.º 1
0
        protected void RegisterEngine(IConfiguration engineConfig)
        {
            String engineKey    = engineConfig.Attributes[IdKey];
            String systemId     = engineConfig.Attributes["systemId"];
            String resetStorage = engineConfig.Attributes["resetStorage"];

            Type systemType  = ObtainSystemType(engineConfig);
            bool autoVersion = Convert.ToBoolean(engineConfig.Attributes["autoVersionMigration"]);

            if (resetStorage == null)
            {
                resetStorage = "false";
            }

            IDictionary properties = new HybridDictionary(true);

            properties.Add(SystemTypePropertyKey, systemType);
            properties.Add(AutoMigrationPropertyKey, autoVersion);
            properties.Add(ResetStoragePropertyKey, Convert.ToBoolean(resetStorage));
            properties.Add(StorageDirPropertyKey, engineConfig.Attributes["storageDir"]);

            ConfigureSnapshot(engineConfig, properties);

            Kernel.AddComponentWithProperties(engineKey, typeof(PrevalenceEngine), properties);

            RegisterSystem(engineKey, systemId, systemType);
        }
Ejemplo n.º 2
0
        protected void RegisterSystem(String engineKey, String systemId, Type systemType)
        {
            IDictionary properties = new HybridDictionary(true);

            properties[EngineIdPropertyKey] = engineKey;

            Kernel.AddComponentWithProperties(systemId, systemType, properties);
        }
Ejemplo n.º 3
0
        private void ConfigureAndAddContainer()
        {
            IConfiguration config = FacilityConfig.Children["container"];

            IDictionary properties = new Hashtable();

            String compKey = config.Attributes[IdKey];

            properties.Add(IdKey, compKey);
            properties.Add(DatabaseFileKey, config.Attributes[DatabaseFileKey]);

            properties.Add(ExceptionsOnNotStorableKey, Convert.ToBoolean(config.Attributes[ExceptionsOnNotStorableKey]));

            if (config.Attributes[CallConstructorsKey] != null)
            {
                properties.Add(CallConstructorsKey, Convert.ToBoolean(config.Attributes[CallConstructorsKey]));
            }

            if (config.Attributes[ActivationDepth] != null)
            {
                properties.Add(ActivationDepth, Convert.ToInt32(config.Attributes[ActivationDepth]));
            }

            if (config.Attributes[UpdateDepth] != null)
            {
                properties.Add(UpdateDepth, Convert.ToInt32(config.Attributes[UpdateDepth]));
            }

            if (config.Attributes[HostNameKey] != null)
            {
                properties.Add(HostNameKey, config.Attributes[HostNameKey]);
                properties.Add(RemotePortKey, Convert.ToInt32(config.Attributes[RemotePortKey]));
                properties.Add(UserKey, config.Attributes[UserKey]);
                properties.Add(PasswordKey, config.Attributes[PasswordKey]);
            }

            Kernel.AddComponentWithProperties(compKey, typeof(ObjectContainer), typeof(ObjectContainer), properties);
        }