C# Класс SharpArch.NHibernate.NHibernateConfigurationFileCache

File cache implementation of INHibernateConfigurationCache. Saves and loads a seralized version of Configuration to a temporary file location.
Seralizing a Configuration object requires that all components that make up the Configuration object be Serializable. This includes any custom NHibernate user types implementing NHibernate.UserTypes.IUserType.
Наследование: INHibernateConfigurationCache
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
dependentFilePaths List

Открытые методы

Метод Описание
LoadConfiguration ( string configKey, string configPath, IEnumerable mappingAssemblies ) : Configuration

Load the Configuration object from a cache.

NHibernateConfigurationFileCache ( ) : System

Initializes new instance of the NHibernateConfigurationFileCache

NHibernateConfigurationFileCache ( string dependentFilePaths ) : System

Initializes new instance of the NHibernateConfigurationFileCache using the given dependentFilePaths parameter.

SaveConfiguration ( string configKey, Configuration config ) : void

Save the Configuration object to cache to a temporary file.

Защищенные методы

Метод Описание
CachedConfigPath ( string configKey ) : string

Provide a unique temporary file path/name for the cache file.

The hash value is intended to avoid the file from conflicting with other applications also using this cache feature.

GetMaxDependencyTime ( ) : System.DateTime

Returns the latest file write time from the list of dependent file paths.

IsCachedConfigCurrent ( string cachePath ) : bool

Tests if an existing cached configuration file is out of date or not.

Приватные методы

Метод Описание
AppendToDependentFilePaths ( IEnumerable paths ) : void

Append the given list of file paths to the dependentFilePaths list.

AppendToDependentFilePaths ( string path ) : void

Append the given file path to the dependentFilePaths list.

FindFile ( string path ) : string

Tests if the file or assembly name exists either in the application's bin folder or elsewhere.

If the path parameter does not end with ".dll" it is appended and tested if the dll file exists.

Описание методов

CachedConfigPath() защищенный Метод

Provide a unique temporary file path/name for the cache file.
The hash value is intended to avoid the file from conflicting with other applications also using this cache feature.
protected CachedConfigPath ( string configKey ) : string
configKey string
Результат string

GetMaxDependencyTime() защищенный Метод

Returns the latest file write time from the list of dependent file paths.
protected GetMaxDependencyTime ( ) : System.DateTime
Результат System.DateTime

IsCachedConfigCurrent() защищенный Метод

Tests if an existing cached configuration file is out of date or not.
Thrown if the cachePath or configPath /// parameters are null.
protected IsCachedConfigCurrent ( string cachePath ) : bool
cachePath string Location of the cached
Результат bool

LoadConfiguration() публичный Метод

Load the Configuration object from a cache.
public LoadConfiguration ( string configKey, string configPath, IEnumerable mappingAssemblies ) : Configuration
configKey string Key value to provide a unique name to the cached .
configPath string NHibernate configuration xml file. This is used to determine if the /// cached is out of date or not.
mappingAssemblies IEnumerable Assemblies containing NHibernate mappings.
Результат Configuration

NHibernateConfigurationFileCache() публичный Метод

Initializes new instance of the NHibernateConfigurationFileCache
public NHibernateConfigurationFileCache ( ) : System
Результат System

NHibernateConfigurationFileCache() публичный Метод

Initializes new instance of the NHibernateConfigurationFileCache using the given dependentFilePaths parameter.
public NHibernateConfigurationFileCache ( string dependentFilePaths ) : System
dependentFilePaths string LIst of files that the cached configuration /// is dependent upon.
Результат System

SaveConfiguration() публичный Метод

Save the Configuration object to cache to a temporary file.
public SaveConfiguration ( string configKey, Configuration config ) : void
configKey string Key value to provide a unique name to the cached .
config Configuration Configuration object to save.
Результат void

Описание свойств

dependentFilePaths защищенное свойство

List of files that the cached configuration is dependent on. If any of these files are newer than the cache file then the cache file could be out of date.
protected List dependentFilePaths
Результат List