From f1e71ca5e115366e55fb1b721d85cef08e3e5816 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Mon, 16 Feb 2009 02:27:01 +0000 Subject: - add list for backend plugins and Dispose() all plugins on shutdown - fix some plugin names - remove most references to ExtensionLoader - remove commented out AssetInventoryServer blobs from prebuild.xml --- .../AssetInventoryServer/AssetInventoryServer.cs | 26 ++++++++-- .../Plugins/AuthorizeAllPlugin.cs | 2 +- .../Plugins/NullAuthenticationPlugin.cs | 2 +- .../Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs | 4 -- .../Plugins/OpenSim/OpenSimAssetStoragePlugin.cs | 2 - .../OpenSim/OpenSimInventoryFrontendPlugin.cs | 3 +- .../OpenSim/OpenSimInventoryStoragePlugin.cs | 2 - .../Plugins/Simple/SimpleAssetStoragePlugin.cs | 1 - .../Plugins/Simple/SimpleInventoryStoragePlugin.cs | 1 - prebuild.xml | 59 ---------------------- 10 files changed, 25 insertions(+), 77 deletions(-) diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs index c6c7da2..19f2081 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs @@ -56,6 +56,7 @@ namespace OpenSim.Grid.AssetInventoryServer public IMetricsProvider MetricsProvider; private List frontends = new List(); + private List backends = new List(); public AssetInventoryServer() { @@ -107,8 +108,13 @@ namespace OpenSim.Grid.AssetInventoryServer } StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IAssetStorageProvider; + backends.Add(StorageProvider); + InventoryProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/InventoryProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IInventoryStorageProvider; + backends.Add(InventoryProvider); + MetricsProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/MetricsProvider", String.Empty) as IMetricsProvider; + backends.Add(MetricsProvider); try { @@ -122,20 +128,32 @@ namespace OpenSim.Grid.AssetInventoryServer } frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty)); + AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider; + backends.Add(AuthenticationProvider); + AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider; + backends.Add(AuthorizationProvider); return true; } public void Shutdown() { - foreach (IExtension extension in ExtensionLoader.Extensions) + foreach (IAssetInventoryServerPlugin plugin in frontends) + { + Logger.Log.Debug("Disposing plugin " + plugin.Name); + try { plugin.Dispose(); } + catch (Exception ex) + { Logger.Log.ErrorFormat("Failure shutting down plugin {0}: {1}", plugin.Name, ex.Message); } + } + + foreach (IAssetInventoryServerPlugin plugin in backends) { - Logger.Log.Debug("Disposing extension " + extension.GetType().Name); - try { extension.Stop(); } + Logger.Log.Debug("Disposing plugin " + plugin.Name); + try { plugin.Dispose(); } catch (Exception ex) - { Logger.Log.ErrorFormat("Failure shutting down extension {0}: {1}", extension.GetType().Name, ex.Message); } + { Logger.Log.ErrorFormat("Failure shutting down plugin {0}: {1}", plugin.Name, ex.Message); } } if (HttpServer != null) diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs index 8974b6f..1c0fca7 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs @@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins public string Name { - get { return "AssetInventoryServer Null authentication frontend"; } + get { return "AssetInventoryServer Authorize All"; } } #endregion IPlugin implementation diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs index 81e58c6..ccb21b0 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs @@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins public string Name { - get { return "AssetInventoryServer Null authentication frontend"; } + get { return "AssetInventoryServer Null authentication"; } } #endregion IPlugin implementation diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs index ebab557..f831e24 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs @@ -34,7 +34,6 @@ using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; -using ExtensionLoader; using OpenMetaverse; using HttpServer; using OpenSim.Framework; @@ -147,8 +146,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim { Metadata metadata = new Metadata(); - Logger.Log.Debug("Handling OpenSim asset upload"); - try { AssetBase asset = (AssetBase) new XmlSerializer(typeof (AssetBase)).Deserialize(request.Body); @@ -185,7 +182,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim response.Status = HttpStatusCode.BadRequest; } - Logger.Log.Debug("Finished handling OpenSim asset upload, Status: " + response.Status.ToString()); return true; } } diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs index 6c02cde..eb000ae 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs @@ -32,8 +32,6 @@ using System.Collections.Generic; using System.Net; using System.Data; using MySql.Data.MySqlClient; -using ExtensionLoader; -using ExtensionLoader.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs index 6e33cdf..0f3867a 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Net; using System.IO; using System.Xml; -using ExtensionLoader; using OpenMetaverse; using OpenMetaverse.StructuredData; using HttpServer; @@ -92,7 +91,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim public string Name { - get { return "AssetInventoryServer OpenSim asset frontend"; } + get { return "AssetInventoryServer OpenSim inventory frontend"; } } #endregion IPlugin implementation diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs index 3fd06c0..a41c48d 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs @@ -32,8 +32,6 @@ using System.Collections.Generic; using System.Net; using System.Data; using MySql.Data.MySqlClient; -using ExtensionLoader; -using ExtensionLoader.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs index fd198d9..301a55f 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs @@ -31,7 +31,6 @@ using System; using System.Collections.Generic; using System.Net; using System.IO; -using ExtensionLoader; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs index 78dae35..415874a 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.Net; using System.IO; using System.Text; -using ExtensionLoader; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; diff --git a/prebuild.xml b/prebuild.xml index 83e31f2..a284f72 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -836,7 +836,6 @@ - @@ -868,7 +867,6 @@ - @@ -876,63 +874,6 @@ - - -- cgit v1.1