diff options
author | Mike Mazur | 2009-02-16 02:26:01 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-16 02:26:01 +0000 |
commit | 98b5e5062e73727111d40700dcc1acf87887949a (patch) | |
tree | cd0d0ae49146e2a2f87ea107917f600dde47dcc0 /OpenSim/Grid/AssetInventoryServer/Plugins | |
parent | AssetInventoryServer plugins can't be a dependency for the OpenSim.Data.MySQL... (diff) | |
download | opensim-SC-98b5e5062e73727111d40700dcc1acf87887949a.zip opensim-SC-98b5e5062e73727111d40700dcc1acf87887949a.tar.gz opensim-SC-98b5e5062e73727111d40700dcc1acf87887949a.tar.bz2 opensim-SC-98b5e5062e73727111d40700dcc1acf87887949a.tar.xz |
- IAssetProviderPlugin was changed to IAssetDataPlugin
- Use OpenSim.Data.DataPluginFactory to load data plugins
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer/Plugins')
2 files changed, 8 insertions, 15 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs index a5e4c95..40959a4 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs | |||
@@ -38,6 +38,7 @@ using OpenMetaverse; | |||
38 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Grid.AssetInventoryServer.Extensions; | 40 | using OpenSim.Grid.AssetInventoryServer.Extensions; |
41 | using OpenSim.Data; | ||
41 | 42 | ||
42 | namespace OpenSim.Grid.AssetInventoryServer.Plugins | 43 | namespace OpenSim.Grid.AssetInventoryServer.Plugins |
43 | { | 44 | { |
@@ -46,7 +47,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins | |||
46 | const string EXTENSION_NAME = "OpenSimAssetStorage"; // Used in metrics reporting | 47 | const string EXTENSION_NAME = "OpenSimAssetStorage"; // Used in metrics reporting |
47 | 48 | ||
48 | private AssetInventoryServer server; | 49 | private AssetInventoryServer server; |
49 | private IAssetProviderPlugin m_assetProvider; | 50 | private IAssetDataPlugin m_assetProvider; |
50 | 51 | ||
51 | public OpenSimAssetStoragePlugin() | 52 | public OpenSimAssetStoragePlugin() |
52 | { | 53 | { |
@@ -315,7 +316,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins | |||
315 | 316 | ||
316 | try | 317 | try |
317 | { | 318 | { |
318 | m_assetProvider = LoadDatabasePlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null)); | 319 | m_assetProvider = DataPluginFactory.LoadAssetDataPlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null)); |
319 | if (m_assetProvider == null) | 320 | if (m_assetProvider == null) |
320 | { | 321 | { |
321 | Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting."); | 322 | Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting."); |
@@ -354,17 +355,5 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins | |||
354 | } | 355 | } |
355 | 356 | ||
356 | #endregion IPlugin implementation | 357 | #endregion IPlugin implementation |
357 | |||
358 | private IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect) | ||
359 | { | ||
360 | PluginLoader<IAssetProviderPlugin> loader = new PluginLoader<IAssetProviderPlugin>(new AssetDataInitialiser(connect)); | ||
361 | |||
362 | // Loader will try to load all providers (MySQL, MSSQL, etc) | ||
363 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | ||
364 | loader.Add("/OpenSim/AssetData", new PluginProviderFilter (provider)); | ||
365 | loader.Load(); | ||
366 | |||
367 | return loader.Plugin; | ||
368 | } | ||
369 | } | 358 | } |
370 | } | 359 | } |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/Resources/AssetInventoryServerOpenSimPlugins.addin.xml b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/Resources/AssetInventoryServerOpenSimPlugins.addin.xml index a7e5dec..0fe2f48 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/Resources/AssetInventoryServerOpenSimPlugins.addin.xml +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/Resources/AssetInventoryServerOpenSimPlugins.addin.xml | |||
@@ -1,13 +1,17 @@ | |||
1 | <Addin id="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim" version="0.1"> | 1 | <Addin id="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim" version="0.1"> |
2 | <Runtime> | 2 | <Runtime> |
3 | <Import assembly="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" /> | 3 | <Import assembly="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" /> |
4 | <Import assembly="OpenSim.Data.dll" /> | ||
4 | </Runtime> | 5 | </Runtime> |
6 | |||
5 | <Dependencies> | 7 | <Dependencies> |
6 | <Addin id="OpenSim.Grid.AssetInventoryServer" version="0.1" /> | 8 | <Addin id="OpenSim.Grid.AssetInventoryServer" version="0.1" /> |
7 | </Dependencies> | 9 | </Dependencies> |
10 | |||
8 | <ExtensionPoint path = "/OpenSim/AssetData"> | 11 | <ExtensionPoint path = "/OpenSim/AssetData"> |
9 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetProviderPlugin" /> | 12 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" /> |
10 | </ExtensionPoint> | 13 | </ExtensionPoint> |
14 | |||
11 | <Extension path="/OpenSim/AssetInventoryServer/StorageProvider"> | 15 | <Extension path="/OpenSim/AssetInventoryServer/StorageProvider"> |
12 | <Plugin id="OpenSimAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSimAssetStoragePlugin" /> | 16 | <Plugin id="OpenSimAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSimAssetStoragePlugin" /> |
13 | </Extension> | 17 | </Extension> |