- 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
0.6.3-post-fixes
Mike Mazur 2009-02-16 02:27:01 +00:00
parent 932e591e05
commit f1e71ca5e1
10 changed files with 25 additions and 77 deletions

View File

@ -56,6 +56,7 @@ namespace OpenSim.Grid.AssetInventoryServer
public IMetricsProvider MetricsProvider; public IMetricsProvider MetricsProvider;
private List<IAssetInventoryServerPlugin> frontends = new List<IAssetInventoryServerPlugin>(); private List<IAssetInventoryServerPlugin> frontends = new List<IAssetInventoryServerPlugin>();
private List<IAssetInventoryServerPlugin> backends = new List<IAssetInventoryServerPlugin>();
public AssetInventoryServer() public AssetInventoryServer()
{ {
@ -107,8 +108,13 @@ namespace OpenSim.Grid.AssetInventoryServer
} }
StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IAssetStorageProvider; 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; 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; MetricsProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/MetricsProvider", String.Empty) as IMetricsProvider;
backends.Add(MetricsProvider);
try try
{ {
@ -122,20 +128,32 @@ namespace OpenSim.Grid.AssetInventoryServer
} }
frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty)); frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty));
AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider; AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider;
backends.Add(AuthenticationProvider);
AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider; AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider;
backends.Add(AuthorizationProvider);
return true; return true;
} }
public void Shutdown() public void Shutdown()
{ {
foreach (IExtension<AssetInventoryServer> extension in ExtensionLoader<AssetInventoryServer>.Extensions) foreach (IAssetInventoryServerPlugin plugin in frontends)
{ {
Logger.Log.Debug("Disposing extension " + extension.GetType().Name); Logger.Log.Debug("Disposing plugin " + plugin.Name);
try { extension.Stop(); } try { plugin.Dispose(); }
catch (Exception ex) 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); }
}
foreach (IAssetInventoryServerPlugin plugin in backends)
{
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); }
} }
if (HttpServer != null) if (HttpServer != null)

View File

@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public string Name public string Name
{ {
get { return "AssetInventoryServer Null authentication frontend"; } get { return "AssetInventoryServer Authorize All"; }
} }
#endregion IPlugin implementation #endregion IPlugin implementation

View File

@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public string Name public string Name
{ {
get { return "AssetInventoryServer Null authentication frontend"; } get { return "AssetInventoryServer Null authentication"; }
} }
#endregion IPlugin implementation #endregion IPlugin implementation

View File

@ -34,7 +34,6 @@ using System.IO;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using ExtensionLoader;
using OpenMetaverse; using OpenMetaverse;
using HttpServer; using HttpServer;
using OpenSim.Framework; using OpenSim.Framework;
@ -147,8 +146,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{ {
Metadata metadata = new Metadata(); Metadata metadata = new Metadata();
Logger.Log.Debug("Handling OpenSim asset upload");
try try
{ {
AssetBase asset = (AssetBase) new XmlSerializer(typeof (AssetBase)).Deserialize(request.Body); AssetBase asset = (AssetBase) new XmlSerializer(typeof (AssetBase)).Deserialize(request.Body);
@ -185,7 +182,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
response.Status = HttpStatusCode.BadRequest; response.Status = HttpStatusCode.BadRequest;
} }
Logger.Log.Debug("Finished handling OpenSim asset upload, Status: " + response.Status.ToString());
return true; return true;
} }
} }

View File

@ -32,8 +32,6 @@ using System.Collections.Generic;
using System.Net; using System.Net;
using System.Data; using System.Data;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using ExtensionLoader;
using ExtensionLoader.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;

View File

@ -32,7 +32,6 @@ using System.Collections.Generic;
using System.Net; using System.Net;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using ExtensionLoader;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using HttpServer; using HttpServer;
@ -92,7 +91,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
public string Name public string Name
{ {
get { return "AssetInventoryServer OpenSim asset frontend"; } get { return "AssetInventoryServer OpenSim inventory frontend"; }
} }
#endregion IPlugin implementation #endregion IPlugin implementation

View File

@ -32,8 +32,6 @@ using System.Collections.Generic;
using System.Net; using System.Net;
using System.Data; using System.Data;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using ExtensionLoader;
using ExtensionLoader.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;

View File

@ -31,7 +31,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using System.IO; using System.IO;
using ExtensionLoader;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;

View File

@ -32,7 +32,6 @@ using System.Collections.Generic;
using System.Net; using System.Net;
using System.IO; using System.IO;
using System.Text; using System.Text;
using ExtensionLoader;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;

View File

@ -836,7 +836,6 @@
<!-- Remove these eventually --> <!-- Remove these eventually -->
<Reference name="MySql.Data" /> <Reference name="MySql.Data" />
<Reference name="ExtensionLoader" />
<Files> <Files>
<Match pattern="*.cs" recurse="false" /> <Match pattern="*.cs" recurse="false" />
@ -868,7 +867,6 @@
<!-- Remove these eventually --> <!-- Remove these eventually -->
<Reference name="MySql.Data" /> <Reference name="MySql.Data" />
<Reference name="ExtensionLoader" />
<Files> <Files>
<Match pattern="*.cs" recurse="false" /> <Match pattern="*.cs" recurse="false" />
@ -876,63 +874,6 @@
</Files> </Files>
</Project> </Project>
<!--Project name="OpenSim.Grid.AssetInventoryServer.Simple" path="OpenSim/Grid/AssetInventoryServer/Extensions/Simple" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.ServiceProcess"/>
<Reference name="System.Xml"/>
<Reference name="log4net2"/>
<Reference name="OpenSim.Grid.AssetServer.exe"/>
<Reference name="OpenMetaverse"/>
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData2"/>
<Reference name="ExtensionLoader"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Grid.AssetInventoryServer.OpenSimMySQL" path="OpenSim/Grid/AssetInventoryServer/Extensions/OpenSimMySQL" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Data"/>
<Reference name="System.ServiceProcess"/>
<Reference name="System.Xml"/>
<Reference name="log4net2"/>
<Reference name="OpenSim.Grid.AssetServer.exe"/>
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData2"/>
<Reference name="ExtensionLoader"/>
<Reference name="MySql.Data"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project-->
<Project name="OpenSim.Grid.UserServer" path="OpenSim/Grid/UserServer" type="Exe"> <Project name="OpenSim.Grid.UserServer" path="OpenSim/Grid/UserServer" type="Exe">
<Configuration name="Debug"> <Configuration name="Debug">
<Options> <Options>