Heart surgery no.2: the inventory service hooks.

Several improvements in the connectors themselves.
Several improvements in configurations.
Needed to add a hack in IUserService and UserManagerBase, to be removed when that service is refactored.
This commit is contained in:
diva
2009-06-10 13:18:32 +00:00
parent 8045ed28ec
commit 0f367bd7bb
34 changed files with 726 additions and 437 deletions

View File

@@ -44,19 +44,37 @@ namespace OpenSim.Services.InventoryService
public InventoryServiceBase(IConfigSource config) : base(config)
{
IConfig assetConfig = config.Configs["InventoryService"];
if (assetConfig == null)
string dllName = String.Empty;
string connString = String.Empty;
//
// Try reading the [DatabaseService] section first, if it exists
//
IConfig dbConfig = config.Configs["DatabaseService"];
if (dbConfig != null)
{
dllName = dbConfig.GetString("StorageProvider", String.Empty);
connString = dbConfig.GetString("ConnectionString", String.Empty);
}
else
Console.WriteLine("------ dbConfig = null!");
//
// Try reading the more specific [InventoryService] section, if it exists
//
IConfig inventoryConfig = config.Configs["InventoryService"];
if (inventoryConfig != null)
{
dllName = inventoryConfig.GetString("StorageProvider", dllName);
connString = inventoryConfig.GetString("ConnectionString", connString);
}
//
// We tried, but this doesn't exist. We can't proceed.
//
if (dllName.Equals(String.Empty))
throw new Exception("No InventoryService configuration");
string dllName = assetConfig.GetString("StorageProvider",
String.Empty);
if (dllName == String.Empty)
throw new Exception("No StorageProvider configured");
string connString = assetConfig.GetString("ConnectionString",
String.Empty);
m_Database = LoadPlugin<IInventoryDataPlugin>(dllName);
if (m_Database == null)
throw new Exception("Could not find a storage interface in the given module");