public void SetUpTest() { m_db = new KeyValueDatabase(filename => new DatabaseFileReader(filename), filename=> new DatabaseFileWriter(filename), filename => new MemoryCacheProvider(filename)); m_db.Start(); }
public void Restart() { Database.Stop(); Database = new KeyValueDatabase(filename => new DatabaseFileReader(filename), filename => new DatabaseFileWriter(filename), filename => new MemoryCacheProvider(filename)); Database.FileName = SpecsDbFile; Database.Start(); }
public DatabaseContext() { File.Delete(SpecsDbFile); Database = new KeyValueDatabase(filename => new DatabaseFileReader(filename), filename => new DatabaseFileWriter(filename), filename => new MemoryCacheProvider(filename)); Database.FileName = SpecsDbFile; Database.Start(); }
public void Start() { m_log = LogManager.GetLogger(this.GetType()); m_log.InfoFormat("Starting SharpDB..."); m_log.InfoFormat("Database Name: {0}", m_name); m_db = new KeyValueDatabase(filename => new DatabaseFileReader(filename), filename => new DatabaseFileWriter(filename), filename => new MemoryCacheProvider(filename)); m_db.FileName = m_name + ".sdb"; m_db.Start(); m_context = NetMQContext.Create(); m_server = new Network.Server(m_context, m_db, string.Format("tcp://*:{0}", m_port)); m_task = Task.Factory.StartNew(m_server.Start); }
public bool Start(HostControl hostControl) #endif { m_log = LogManager.GetLogger(this.GetType()); m_log.InfoFormat("Starting SharpDB..."); m_log.InfoFormat("Database Name: {0}", m_name); m_db = new KeyValueDatabase(filename => new DatabaseFileReader(filename), filename => new DatabaseFileWriter(filename), filename => new MemoryCacheProvider(filename)); m_db.FileName = m_name + ".sdb"; m_db.Start(); m_server = new Network.Server(m_db, string.Format("tcp://*:{0}", m_port)); m_task = Task.Factory.StartNew(m_server.Start); return(true); }