C# Class SIL.FieldWorks.FDO.Infrastructure.Impl.SharedXMLBackendProvider

An XML file-based backend provider that allows multiple applications to access the same project simultaneously. It uses memory mapped files to maintain a shared commit log that all applications use to update their state to reflect changes made by other applications. The commit log is implemented as a circular buffer of commit records. A single peer is responsible for updating the XML file.
Inheritance: XMLBackendProvider
Show file Open project: sillsdev/FieldWorks

Private Properties

Property Type Description
CheckExitedPeerProcesses bool
CreateOrOpen System.IO.MemoryMappedFiles.MemoryMappedFile
CreateSharedMemory void
GetMetadata CommitLogMetadata
GetUnseenForeignChanges bool
LockProject void
ReadUnseenCommitRecords int
RemovePeer void
SaveMetadata void
SaveMetadata void
SharedXMLBackendProvider System
TryGetMetadata bool
UnlockProject void

Public Methods

Method Description
Commit ( HashSet newbies, HashSet dirtballs, HashSet goners ) : bool
RenameDatabase ( string sNewProjectName ) : bool

Protected Methods

Method Description
CreateInternal ( ) : void
OnCacheDisposing ( object sender, EventArgs e ) : void
ShutdownInternal ( ) : void
StartupInternal ( int currentModelVersion ) : int
WriteCommitWork ( CommitWork workItem ) : void

Private Methods

Method Description
CheckExitedPeerProcesses ( CommitLogMetadata metadata ) : bool
CreateOrOpen ( string name, long capacity, bool createdNew ) : MemoryMappedFile
CreateSharedMemory ( bool createdNew ) : void
GetMetadata ( MemoryMappedViewStream stream ) : CommitLogMetadata
GetUnseenForeignChanges ( CommitLogMetadata metadata, List &foreignNewbies, List &foreignDirtballs, List &foreignGoners ) : bool

Gets all unseen foreign changes from the commit log. The metadata should be saved after calling this method, because inactive records might have been purged.

LockProject ( ) : void
ReadUnseenCommitRecords ( CommitLogMetadata metadata, int minPeerGeneration, int startOffset, int length, List unseenCommits ) : int
RemovePeer ( CommitLogMetadata metadata, System.Guid peerID ) : void
SaveMetadata ( CommitLogMetadata metadata ) : void
SaveMetadata ( MemoryMappedViewStream stream, CommitLogMetadata metadata ) : void
SharedXMLBackendProvider ( FdoCache cache, IdentityMap identityMap, ICmObjectSurrogateFactory surrogateFactory, IFwMetaDataCacheManagedInternal mdc, IDataMigrationManager dataMigrationManager, IFdoUI ui, IFdoDirectories dirs, FdoSettings settings ) : System
TryGetMetadata ( MemoryMappedViewStream stream, CommitLogMetadata &metadata ) : bool
UnlockProject ( ) : void

Method Details

Commit() public method

public Commit ( HashSet newbies, HashSet dirtballs, HashSet goners ) : bool
newbies HashSet
dirtballs HashSet
goners HashSet
return bool

CreateInternal() protected method

protected CreateInternal ( ) : void
return void

OnCacheDisposing() protected method

protected OnCacheDisposing ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

RenameDatabase() public method

public RenameDatabase ( string sNewProjectName ) : bool
sNewProjectName string
return bool

ShutdownInternal() protected method

protected ShutdownInternal ( ) : void
return void

StartupInternal() protected method

protected StartupInternal ( int currentModelVersion ) : int
currentModelVersion int
return int

WriteCommitWork() protected method

protected WriteCommitWork ( CommitWork workItem ) : void
workItem CommitWork
return void