Example #1
0
        public JournalRegistry(JournalingSystem system, string fileName, bool isReadOnly)
        {
            if (system == null)
                throw new ArgumentNullException("system");
            if (String.IsNullOrEmpty(fileName))
                throw new ArgumentNullException("fileName");

            System = system;
            FileName = fileName;
            IsReadOnly = isReadOnly;

            resourceIdCache = new Dictionary<string, long>(StringComparer.Ordinal);
            curSeqId = 0;
        }
Example #2
0
            public LoggingResource(JournalingSystem system, string name, long id, IStoreData storeData)
                : base(system, name, id, storeData)
            {
                journalEntries = new JournalEntry[257];
                dataOpen = false;
                dataExists = storeData.Exists;
                dataDeleted = false;

                if (dataExists) {
                    try {
                        size = storeData.Length;
                    } catch (IOException e) {
                        throw new Exception("Error getting size of resource: " + e.Message, e);
                    }
                }

                isOpen = false;
            }
Example #3
0
 protected ResourceBase(JournalingSystem system, string name, long id, IStoreData storeData)
     : base(name, id, storeData)
 {
     System = system;
 }
Example #4
0
 public NonLoggingResource(JournalingSystem system, string name, long id, IStoreData storeData)
     : base(system, name, id, storeData)
 {
 }
Example #5
0
 public File(JournalingSystem system, string fileName, bool readOnly)
     : this(CreateHandle(system, fileName, readOnly))
 {
     createdHandle = true;
 }
Example #6
0
 private static IFileHandle CreateHandle(JournalingSystem system, string fileName, bool readOnly)
 {
     return system.FileHandleFactory.CreateHandle(fileName, readOnly);
 }