12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Reflection;
- using Nini.Config;
- using OpenSim.Framework;
- using OpenSim.Data;
- using OpenSim.Services.Interfaces;
- using OpenSim.Services.Base;
- namespace OpenSim.Services.InventoryService
- {
- public class InventoryServiceBase : ServiceBase
- {
- protected IInventoryDataPlugin m_Database = null;
- public InventoryServiceBase(IConfigSource config) : base(config)
- {
- string dllName = String.Empty;
- string connString = String.Empty;
-
-
-
- IConfig dbConfig = config.Configs["DatabaseService"];
- if (dbConfig != null)
- {
- dllName = dbConfig.GetString("StorageProvider", String.Empty);
- connString = dbConfig.GetString("ConnectionString", String.Empty);
- }
-
-
-
- IConfig inventoryConfig = config.Configs["InventoryService"];
- if (inventoryConfig != null)
- {
- dllName = inventoryConfig.GetString("StorageProvider", dllName);
- connString = inventoryConfig.GetString("ConnectionString", connString);
- }
-
-
-
- if (dllName.Equals(String.Empty))
- throw new Exception("No InventoryService configuration");
- m_Database = LoadPlugin<IInventoryDataPlugin>(dllName);
- if (m_Database == null)
- throw new Exception("Could not find a storage interface in the given module");
- m_Database.Initialise(connString);
- }
- }
- }
|