Ejemplo n.º 1
0
        public void ModifyBurrowConfigruationTest()
        {
            BurrowFramework f = new BurrowFramework();

            IBurrowConfig section = f.BurrowEnvironment.Configuration;

            Assert.IsNotNull(section);
            Assert.AreEqual(5, section.ConversationCleanupFrequency);

            Random r    = new Random(3);
            int    freq = r.Next(10, 100);

            try
            {
                section.ConversationCleanupFrequency = freq;
                Assert.Fail("Failed to throw ChangeConfigWhenRunningException");
            }
            catch (ChangeConfigWhenRunningException) { }
            f.BurrowEnvironment.ShutDown();

            section.ConversationCleanupFrequency = freq;

            Assert.AreEqual(freq, section.ConversationCleanupFrequency);
            freq = r.Next(10, 100);
            section.ConversationCleanupFrequency = freq;
            Assert.AreEqual(freq, section.ConversationCleanupFrequency);
            f.BurrowEnvironment.Start();
        }
Ejemplo n.º 2
0
 public static void Initialize(IBurrowConfig configuration)
 {
     instance = new PersistenceUnitRepo();
     foreach (IPersistenceUnitCfg pus in configuration.PersistenceUnitCfgs)
     {
         instance.PersistenceUnits.Add(new PersistenceUnit(pus, configuration.Configurator));
     }
 }
Ejemplo n.º 3
0
 public void Config(IBurrowConfig val)
 {
     val.PersistenceUnitCfgs.Add(new PersistenceUnitElement
     {
         Name         = "bPersistenceUnit",
         NHConfigFile = null
     });
 }
 public void ReConfig(IConfigurator configurator)
 {
     if(IsRunning)
         ShutDown();
     cfg = new ConfigurationFactory().Create(configurator);
     Start();
     cfg.Configurator = null;
 }
 public static IConversationExpirationChecker Create(IBurrowConfig cfg)
 {
     string checkerName = cfg.ConversationExpirationChecker;
     if (string.IsNullOrEmpty(checkerName))
     {
         return new ConversationExpirationCheckerByTimeout();
     }
     return InstanceLoader.Load<IConversationExpirationChecker>(checkerName);
 }
Ejemplo n.º 6
0
        public void Config(IBurrowConfig val)
        {
            if (val == null) throw new ArgumentNullException("val");

            val.PersistenceUnitCfgs.Add(new PersistenceUnitElement
            {
                Name = "bPersistenceUnit",
                NHConfigFile = null
            });
        }
 public void ReConfig(IConfigurator configurator)
 {
     if (IsRunning)
     {
         ShutDown();
     }
     cfg = new ConfigurationFactory().Create(configurator);
     Start();
     cfg.Configurator = null;
 }
Ejemplo n.º 8
0
        public static IConversationExpirationChecker Create(IBurrowConfig cfg)
        {
            string checkerName = cfg.ConversationExpirationChecker;

            if (string.IsNullOrEmpty(checkerName))
            {
                return(new ConversationExpirationCheckerByTimeout());
            }
            return(InstanceLoader.Load <IConversationExpirationChecker>(checkerName));
        }
Ejemplo n.º 9
0
 public void Config(IBurrowConfig val)
 {
     XmlConfigurator.Configure();
       NHibernateProfiler.Initialize();
       var unit = new PersistenceUnitElement
            {
              Name = "persistenceUnit1",
              NHConfigFile = null
            };
       val.PersistenceUnitCfgs.Add(unit);
 }
Ejemplo n.º 10
0
        private IWorkSpaceNameSniffer Sniffer()
        {
            IBurrowConfig cfg = bf.BurrowEnvironment.Configuration;

            if (string.IsNullOrEmpty(cfg.WorkSpaceNameSniffer))
            {
                return(new WorkSpaceSnifferByAttribute());
            }
            else
            {
                return(InstanceLoader.Load <IWorkSpaceNameSniffer>(cfg.WorkSpaceNameSniffer));
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="configurator">optional</param>
        /// <returns></returns>
        public IBurrowConfig Create(IConfigurator configurator)
        {
            IBurrowConfig retVal = GetConfigurationInstance();

            if (configurator != null)
            {
                retVal.Configurator = configurator;
            }

            if (retVal.Configurator != null)
            {
                retVal.Configurator.Config(retVal);
            }
            return(retVal);
        }
 internal ConversationPool(IBurrowConfig cfg)
 {
     ExpirationChecker = ConversationExpirationCheckerFactory.Create(cfg);
 }
Ejemplo n.º 13
0
		public static void Initialize(IBurrowConfig configuration) {
			instance = new PersistenceUnitRepo();
			foreach (IPersistenceUnitCfg pus in configuration.PersistenceUnitCfgs)
				instance.PersistenceUnits.Add(new PersistenceUnit(pus, configuration.Configurator));
		}
Ejemplo n.º 14
0
 public virtual void Config(IBurrowConfig val)
 {
     val.ManualTransactionManagement = true;
 }
 public void Config(IBurrowConfig val)
 {
 }
Ejemplo n.º 16
0
 internal ConversationPool(IBurrowConfig cfg)
 {
     ExpirationChecker = ConversationExpirationCheckerFactory.Create(cfg);
 }
Ejemplo n.º 17
0
 public void Config(IBurrowConfig val)
 {
     val.PersistenceUnitCfgs.Add(new MockPersistenceUnitCfg());
 }
Ejemplo n.º 18
0
 public void Config(IBurrowConfig val)
 {
     val.PersistenceUnitCfgs.Add(new MockPersistenceUnitCfg());
 }