示例#1
0
        static public ServiceConfig GetInstance()
        {
            if (_instance == null)
            {
                lock (SynRoot)
                {
                    if (_instance == null)
                    {
                        var handler = new ConfigureHandler(Reset);

                        try
                        {
                            var builder = new DomDaoManagerBuilder();
                            builder.ConfigureAndWatch("dao.config", handler);

                            //IBatisNet.DataAccess.DaoManager.ConfigureAndWatch(handler);
                            //                  var builder = new DomDaoManagerBuilder();
                            //                builder.ConfigureAndWatch(handler);
                            //  builder.Configure();
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.Message);
                        }

                        _instance = new ServiceConfig
                        {
                            DaoManager =
                                IBatisNet.DataAccess.
                                DaoManager.GetInstance("Ssds")
                        };

                        //_instance.DaoManager.SessionStore = new HybridWebThreadSessionStore(_instance.DaoManager.Id);
                    }
                }
            }
            return(_instance);
        }
示例#2
0
 private ProfileService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _Dao        = (IProfileDao)_daoManager.GetDao(typeof(IProfileDao));
 }
示例#3
0
 private WikiService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _Dao        = (IWikiDao)_daoManager.GetDao(typeof(IWikiDao));
 }
示例#4
0
 /// <summary>
 /// Reset the singleton
 /// </summary>
 /// <remarks>
 /// Must verify ConfigureHandler signature.
 /// </remarks>
 /// <param name="obj">
 /// </param>
 static public void Reset(object obj)
 {
     _instance = null;
 }
示例#5
0
 private QuestionService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _Dao        = (IQuestionDao)_daoManager.GetDao(typeof(IQuestionDao));
     _daoManager.SessionStore = new HybridWebThreadSessionStore(_daoManager.Id);
 }
示例#6
0
 private GroupService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _groupDao   = (IGroupDao)_daoManager.GetDao(typeof(IGroupDao));
 }