public Initialise ( IConfigSource source ) : void | ||
source | IConfigSource | |
Результат | void |
public void Initialise(IConfigSource source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string name = moduleConfig.GetString("AssetCaching");
//m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
if (name == Name)
{
IConfig assetConfig = source.Configs["AssetCache"];
if (assetConfig == null)
{
m_log.Error("[ASSET CACHE]: AssetCache missing from OpenSim.ini");
return;
}
m_Cache = new Cache(CacheMedium.Memory, CacheStrategy.Aggressive, CacheFlags.AllowUpdate);
m_Enabled = true;
m_log.Info("[ASSET CACHE]: Core asset cache enabled");
m_Cache.Size = assetConfig.GetInt("CacheBuckets", 32768);
}
}
}
private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) { IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); config.AddConfig("AssetService"); config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); assetService.Initialise(config); if (cache != null) { IConfigSource cacheConfig = new IniConfigSource(); cacheConfig.AddConfig("Modules"); cacheConfig.Configs["Modules"].Set("AssetCaching", "CoreAssetCache"); cacheConfig.AddConfig("AssetCache"); cache.Initialise(cacheConfig); } return assetService; }