* Added loading methods for NullStorage.

This commit is contained in:
Adam Frisby
2007-07-15 15:40:50 +00:00
parent f65c3d5a31
commit 8fc1dfec79
8 changed files with 83 additions and 7 deletions

View File

@@ -39,6 +39,7 @@ using OpenSim.Framework.Servers;
using OpenSim.Framework.Types;
using OpenSim.Physics.Manager;
using OpenSim.Region.Caches;
using OpenSim.Region.Interfaces;
using OpenSim.Region.Scripting;
using OpenSim.Region.Terrain;
using Caps = OpenSim.Region.Capabilities.Caps;
@@ -65,6 +66,7 @@ namespace OpenSim.Region.Environment.Scenes
protected AuthenticateSessionsBase authenticateHandler;
protected RegionCommsListener regionCommsHost;
protected CommunicationsManager commsManager;
protected StorageManager storageManager;
protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>();
protected BaseHttpServer httpListener;
@@ -118,11 +120,12 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="clientThreads">Dictionary to contain client threads</param>
/// <param name="regionHandle">Region Handle for this region</param>
/// <param name="regionName">Region Name for this region</param>
public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer)
public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer)
{
updateLock = new Mutex(false);
this.authenticateHandler = authen;
this.commsManager = commsMan;
this.storageManager = storeManager;
this.assetCache = assetCach;
m_clientManager = clientManager;
m_regInfo = regInfo;

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers;
using OpenSim.Region.Capabilities;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Interfaces;
using System.Reflection;
namespace OpenSim.Region.Environment
{
public class StorageManager
{
private IRegionDataStore m_dataStore;
public IRegionDataStore DataStore
{
get
{
return m_dataStore;
}
}
public StorageManager(IRegionDataStore storage)
{
m_dataStore = storage;
}
public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IRegionDataStore", true);
if (typeInterface != null)
{
IRegionDataStore plug = (IRegionDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(dataStoreFile, dataStoreDB);
m_dataStore = plug;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
//TODO: Add checking and warning to make sure it initialised.
}
}
}