示例#1
0
        /// <summary>
        /// Gets the one instance of the <b>NHSessionFactory</b>. This is done with a Singleton so that we don't have
        /// to register mappings etc. with every request. It also registers the given assemblies with <i>NHibernate</i>.
        /// </summary>
        /// <param name="assemblyNames">Names of assemblies to register with <i>NHibernate</i>.</param>
        /// <returns>The one instance of <b>NHSessionFactory</b>.</returns>
        public static NHSessionFactory GetInstance(params string[] assemblyNames)
        {
            if (instance == null)
                instance = new NHSessionFactory();

            instance.registerAssemblies(assemblyNames);

            return instance;
        }
示例#2
0
        /// <summary>
        /// Intializes the timer used by the manager.</summary>
        public JobManager()
        {
            // initializes NHSessionFactory
            factory = NHSessionFactory.GetInstance();

            _notifiers = new AgentNotifierCollection(this);

            // initialize the Timer control
            _timer = new System.Timers.Timer();
            _timer.Elapsed += new ElapsedEventHandler(Timer_Elapsed);
            _timer.AutoReset = true;
        }
示例#3
0
        internal IDalSessionFactory GetSessionFactory()
        {
            SecurityManager.Initialize(SecuritySetupType.InMemory);
            SecurityManager.SetUser("manual", string.Empty);

            if (factory == null)
                factory = NHSessionFactory.GetInstance();
            return factory;
        }