Beispiel #1
0
        public static void Initialize(Aegis.Data.TreeNode <string> config)
        {
            var type = config.GetValue("type");

            if (type == null || type == "" || type == "none")
            {
                Engine = new NullDB();
            }
            else if (type == "mysql")
            {
                Engine = new MySqlDB();
            }
            else if (type == "mysql_async")
            {
                Engine = new MySqlDBAsync();
            }
            else
            {
                throw new AegisException(RoseResult.InvalidArgument, "Invalid argument at 'rose/engine/storage/type'.");
            }


            Engine.CheckStorage(config);
            Engine.InitEngine(config);
        }
Beispiel #2
0
        public static void CreateRoseStorage(Aegis.Data.TreeNode <string> config)
        {
            StorageEngine engine;
            var           type = config.GetValue("type");

            if (type == null || type == "" || type == "none")
            {
                engine = new NullDB();
            }
            else if (type == "mysql")
            {
                engine = new MySqlDB();
            }
            else
            {
                throw new AegisException(RoseResult.InvalidArgument, "Invalid argument at 'rose/engine/storage/type'.");
            }

            engine.CreateStorage(config);
        }
Beispiel #3
0
 protected abstract void CreateStorage(Aegis.Data.TreeNode <string> config);
Beispiel #4
0
 protected abstract void InitEngine(Aegis.Data.TreeNode <string> config);