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 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs') 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) -- cgit v1.1