protected Engine(Model model, EngineConfiguration config) { _config = config; _synchronizer = _config.CreateSynchronizer(); _authorizer = _config.CreateAuthorizer(); Configure(model); if (_config.SnapshotBehavior == SnapshotBehavior.AfterRestore) { _log.Info("Starting snaphot job on threadpool"); ThreadPool.QueueUserWorkItem(_ => CreateSnapshot()); //Give the snapshot thread a chance to start and aquire the readlock Thread.Sleep(TimeSpan.FromMilliseconds(10)); } if (_config.PersistenceMode == PersistenceMode.SnapshotPerTransaction) { CommandExecuted += (s, e) => CreateSnapshot(); } Core.Config.Engines.AddEngine(config.Location.OfJournal, this); }
protected Engine(Model model, EngineConfiguration config) { _config = config; _synchronizer = _config.CreateSynchronizer(); _authorizer = _config.CreateAuthorizer(); IsolatedReturnTypes.AddRange(_config.IsolatedTypes); _config.Isolation.Commands.SetFormatter(_config.CreateFormatter(FormatterUsage.Messages)); _config.Isolation.ReturnValues.SetFormatter(_config.CreateFormatter(FormatterUsage.Results)); Configure(model); if (_config.SnapshotBehavior == SnapshotBehavior.AfterRestore) { Logger.Info("Starting snaphot job on threadpool"); ThreadPool.QueueUserWorkItem(_ => CreateSnapshot()); //Give the snapshot thread a chance to start and aquire the readlock Thread.Sleep(TimeSpan.FromMilliseconds(10)); } if (_config.PersistenceMode == PersistenceMode.SnapshotPerTransaction) { CommandExecuted += (s, e) => CreateSnapshot(); } model.Starting(this); Core.Config.Engines.AddEngine(config.JournalPath, this); }
protected Kernel(EngineConfiguration config, Model model) { Synchronizer = config.CreateSynchronizer(); _model = model; Isolation = config.Isolation; }
protected Kernel(EngineConfiguration config, Model model) { _resultFormatter = config.CreateFormatter(FormatterUsage.Results); _synchronizer = config.CreateSynchronizer(); _model = model; }