Esempio n. 1
0
 /// <summary>
 /// Configure this instance for use with an immutable kernel.
 /// </summary>
 /// <returns></returns>
 public EngineConfiguration ForImmutability()
 {
     Kernel          = Kernels.Immutability;
     Synchronization = SynchronizationMode.None;
     Isolation       = IsolationSettings.ForImmutability();
     return(this);
 }
Esempio n. 2
0
        /// <summary>
        /// Create an EngineConfiguration instance using default values
        /// </summary>
        /// <param name="targetLocation"></param>
        public EngineConfiguration(string targetLocation = null)
        {
            JournalPath = targetLocation;

            //Set default values
            Kernel                      = Kernels.Optimistic;
            JournalStorage              = StorageType.File;
            LockTimeout                 = DefaultTimeout;
            Synchronization             = SynchronizationMode.ReadWrite;
            AsynchronousJournaling      = false;
            MaxBytesPerJournalSegment   = DefaultMaxBytesPerJournalSegment;
            MaxEntriesPerJournalSegment = DefaultMaxCommandsPerJournalSegment;
            PacketOptions               = null;
            PersistenceMode             = PersistenceMode.Journaling;
            SqlSettings                 = new SqlSettings();
            Isolation                   = new IsolationSettings();
            IsolatedTypes               = new HashSet <Type>();

            Registry = new TeenyIoc();
            Register <IAuthorizer>(c => new Authorizer(Permission.Allowed));
            Register <IFormatter>(c => new BinaryFormatter(), FormatterUsage.Default.ToString());
            InitSynchronizers();
            InitStoreTypes();
            InitKernels();
        }
Esempio n. 3
0
 protected Kernel(EngineConfiguration config, Model model)
 {
     Synchronizer = config.CreateSynchronizer();
     _model       = model;
     Isolation    = config.Isolation;
 }