- IAssetProviderPlugin was changed to IAssetDataPlugin

- Use OpenSim.Data.DataPluginFactory to load data plugins
0.6.3-post-fixes
Mike Mazur 2009-02-16 02:26:01 +00:00
parent 9e88cef033
commit 98b5e5062e
3 changed files with 9 additions and 15 deletions

View File

@ -38,6 +38,7 @@ using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Grid.AssetInventoryServer.Extensions; using OpenSim.Grid.AssetInventoryServer.Extensions;
using OpenSim.Data;
namespace OpenSim.Grid.AssetInventoryServer.Plugins namespace OpenSim.Grid.AssetInventoryServer.Plugins
{ {
@ -46,7 +47,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
const string EXTENSION_NAME = "OpenSimAssetStorage"; // Used in metrics reporting const string EXTENSION_NAME = "OpenSimAssetStorage"; // Used in metrics reporting
private AssetInventoryServer server; private AssetInventoryServer server;
private IAssetProviderPlugin m_assetProvider; private IAssetDataPlugin m_assetProvider;
public OpenSimAssetStoragePlugin() public OpenSimAssetStoragePlugin()
{ {
@ -315,7 +316,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
try try
{ {
m_assetProvider = LoadDatabasePlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null)); m_assetProvider = DataPluginFactory.LoadAssetDataPlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null));
if (m_assetProvider == null) if (m_assetProvider == null)
{ {
Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting."); Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting.");
@ -354,17 +355,5 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
} }
#endregion IPlugin implementation #endregion IPlugin implementation
private IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect)
{
PluginLoader<IAssetProviderPlugin> loader = new PluginLoader<IAssetProviderPlugin>(new AssetDataInitialiser(connect));
// Loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "Provider" entry in the addin.xml
loader.Add("/OpenSim/AssetData", new PluginProviderFilter (provider));
loader.Load();
return loader.Plugin;
}
} }
} }

View File

@ -1,13 +1,17 @@
<Addin id="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim" version="0.1"> <Addin id="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim" version="0.1">
<Runtime> <Runtime>
<Import assembly="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" /> <Import assembly="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" />
<Import assembly="OpenSim.Data.dll" />
</Runtime> </Runtime>
<Dependencies> <Dependencies>
<Addin id="OpenSim.Grid.AssetInventoryServer" version="0.1" /> <Addin id="OpenSim.Grid.AssetInventoryServer" version="0.1" />
</Dependencies> </Dependencies>
<ExtensionPoint path = "/OpenSim/AssetData"> <ExtensionPoint path = "/OpenSim/AssetData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetProviderPlugin" /> <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
</ExtensionPoint> </ExtensionPoint>
<Extension path="/OpenSim/AssetInventoryServer/StorageProvider"> <Extension path="/OpenSim/AssetInventoryServer/StorageProvider">
<Plugin id="OpenSimAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSimAssetStoragePlugin" /> <Plugin id="OpenSimAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSimAssetStoragePlugin" />
</Extension> </Extension>

View File

@ -799,6 +799,7 @@
<Reference name="System" /> <Reference name="System" />
<Reference name="System.Data" /> <Reference name="System.Data" />
<Reference name="OpenSim.Framework" /> <Reference name="OpenSim.Framework" />
<Reference name="OpenSim.Data" />
<Reference name="OpenSim.Grid.AssetInventoryServer" /> <Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="OpenMetaverseTypes"/> <Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData2" /> <Reference name="OpenMetaverse.StructuredData2" />