/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public FileBin(BinConfiguration config) { bool ok = false; try { _path = new Sharpen.IO.File(config.Uri()).GetCanonicalPath(); _file = RandomAccessFileFactory.NewRandomAccessFile(_path, config.ReadOnly(), config .LockFile()); if (config.InitialLength() > 0) { Write(config.InitialLength() - 1, new byte[] { 0 }, 1); } ok = true; } catch (IOException e) { throw new Db4oIOException(e); } finally { if (!ok) { Close(); } } }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IoAdapterStorage.IoAdapterBin bin = new IoAdapterStorage.IoAdapterBin(_io.Open(config .Uri(), config.LockFile(), config.InitialLength(), config.ReadOnly())); ((IBlockSize)Environments.My(typeof(IBlockSize))).Register(bin); return bin; }
/// <summary>opens a Bin for the given URI.</summary> /// <remarks>opens a Bin for the given URI.</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public override IBin Open(BinConfiguration config) { IBin storage = base.Open(config); if (config.ReadOnly()) { return new ReadOnlyBin(new CachingStorage.NonFlushingCachingBin(storage, NewCache (), _pageCount, _pageSize)); } return new CachingBin(storage, NewCache(), _pageCount, _pageSize); }
/// <summary>opens a Bin for the given URI.</summary> /// <remarks>opens a Bin for the given URI.</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public override IBin Open(BinConfiguration config) { IBin storage = base.Open(config); if (config.ReadOnly()) { return(new ReadOnlyBin(new CachingStorage.NonFlushingCachingBin(storage, NewCache (), _pageCount, _pageSize))); } return(new CachingBin(storage, NewCache(), _pageCount, _pageSize)); }
private BinConfiguration PointToNewUri(BinConfiguration oldConfig, string newUri) { return new BinConfiguration(newUri, oldConfig.LockFile(), oldConfig.InitialLength (), oldConfig.ReadOnly()); }
private BinConfiguration PointToNewUri(BinConfiguration oldConfig, string newUri) { return(new BinConfiguration(newUri, oldConfig.LockFile(), oldConfig.InitialLength (), oldConfig.ReadOnly())); }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IBin storage = ProduceStorage(config); return config.ReadOnly() ? new ReadOnlyBin(storage) : storage; }
private static FileAccess FileAccessFor(BinConfiguration config) { return(config.ReadOnly() ? FileAccess.Read : FileAccess.ReadWrite); }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IBin storage = ProduceStorage(config); return(config.ReadOnly() ? new ReadOnlyBin(storage) : storage); }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IoAdapterStorage.IoAdapterBin bin = new IoAdapterStorage.IoAdapterBin(_io.Open(config .Uri(), config.LockFile(), config.InitialLength(), config.ReadOnly())); ((IBlockSize)Environments.My(typeof(IBlockSize))).Register(bin); return(bin); }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { var bin = ProduceBin(config); return(config.ReadOnly() ? new ReadOnlyBin(bin) : bin); }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IBin bin = AcquireBin(config); return config.ReadOnly() ? new ReadOnlyBin(bin) : bin; }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IBin bin = AcquireBin(config); return(config.ReadOnly() ? new ReadOnlyBin(bin) : bin); }
private static FileAccess FileAccessFor(BinConfiguration config) { return config.ReadOnly() ? FileAccess.Read : FileAccess.ReadWrite; }
/// <summary>opens a MemoryBin for the given URI (name can be freely chosen).</summary> /// <remarks>opens a MemoryBin for the given URI (name can be freely chosen).</remarks> /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { var bin = ProduceBin(config); return config.ReadOnly() ? new ReadOnlyBin(bin) : bin; }