From a0930aa80d6f43d1dc1b4de0ee5708888cc45a5a Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 23 Jul 2008 03:08:31 +0000 Subject: [PATCH] Thanks, sempuki, for a patch that moves control of Mono.Addins from source attributes to external XML files. Fix issues 1682 and 1786. --- .../LoadRegions/LoadRegionsPlugin.cs | 5 ---- .../RemoteController/RemoteAdminPlugin.cs | 5 ---- .../Rest/Inventory/RestHandler.cs | 7 ----- .../Rest/Regions/RestRegionPlugin.cs | 6 ---- OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | 6 ---- OpenSim/Data/IGridData.cs | 8 ++---- OpenSim/Data/ILogData.cs | 2 -- OpenSim/Data/MSSQL/MSSQLGridData.cs | 5 ---- OpenSim/Data/MSSQL/MSSQLLogData.cs | 6 ---- OpenSim/Data/MySQL/MySQLGridData.cs | 5 ---- OpenSim/Data/MySQL/MySQLLogData.cs | 6 ---- OpenSim/Data/SQLite/SQLiteGridData.cs | 5 ---- OpenSim/Framework/PluginLoader.cs | 4 ++- OpenSim/Grid/GridServer/GridManager.cs | 12 ++++---- OpenSim/Grid/GridServer/IGridPlugin.cs | 4 --- .../Region/Application/IApplicationPlugin.cs | 4 --- bin/LoadRegionsPlugin.addin.xml | 22 +++++++++++++++ bin/OpenSim.Data.MySQL.addin.xml | 28 +++++++++++++++++++ bin/OpenSim.Data.addin.xml | 24 ++++++++++++++++ bin/OpenSim.Grid.GridServer.addin.xml | 16 +++++++++++ bin/OpenSim.addin.xml | 16 +++++++++++ bin/RemoteAdminPlugin.addin.xml | 22 +++++++++++++++ bin/RestHandler.addin.xml | 22 +++++++++++++++ bin/RestRegionPlugin.addin.xml | 22 +++++++++++++++ 24 files changed, 183 insertions(+), 79 deletions(-) create mode 100644 bin/LoadRegionsPlugin.addin.xml create mode 100644 bin/OpenSim.Data.MySQL.addin.xml create mode 100644 bin/OpenSim.Data.addin.xml create mode 100644 bin/OpenSim.Grid.GridServer.addin.xml create mode 100644 bin/OpenSim.addin.xml create mode 100644 bin/RemoteAdminPlugin.addin.xml create mode 100644 bin/RestHandler.addin.xml create mode 100644 bin/RestRegionPlugin.addin.xml diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 6743fb4e95..523f9fc4d0 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -28,18 +28,13 @@ using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.RegionLoader.Filesystem; using OpenSim.Framework.RegionLoader.Web; -[assembly : Addin] -[assembly : AddinDependency("OpenSim", "0.5")] - namespace OpenSim.ApplicationPlugins.LoadRegions { - [Extension("/OpenSim/Startup")] public class LoadRegionsPlugin : IApplicationPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index d61e5668cf..256e862187 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -33,19 +33,14 @@ using System.Reflection; using System.Timers; using libsecondlife; using log4net; -using Mono.Addins; using Nwc.XmlRpc; using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Region.Environment.Scenes; -[assembly : Addin] -[assembly : AddinDependency("OpenSim", "0.5")] - namespace OpenSim.ApplicationPlugins.RemoteController { - [Extension("/OpenSim/Startup")] public class RemoteAdminPlugin : IApplicationPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index 9a1f628c26..50412c9241 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs @@ -32,16 +32,9 @@ using System.Reflection; using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.ApplicationPlugins.Rest; -using Mono.Addins; - -[assembly : Addin] -[assembly : AddinDependency("OpenSim", "0.5")] namespace OpenSim.ApplicationPlugins.Rest.Inventory { - - [Extension("/OpenSim/Startup")] - public class RestHandler : RestPlugin, IHttpAgentHandler { diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs index 9d68225642..5ec2526ae1 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs @@ -37,7 +37,6 @@ using System.Timers; using System.Xml; using System.Xml.Serialization; using libsecondlife; -using Mono.Addins; using Nwc.XmlRpc; using Nini.Config; using OpenSim.Framework; @@ -47,13 +46,8 @@ using OpenSim.Framework.Communications; using OpenSim.Region.Environment.Scenes; using OpenSim.ApplicationPlugins.Rest; -[assembly : Addin] -[assembly : AddinDependency("OpenSim", "0.5")] - namespace OpenSim.ApplicationPlugins.Rest.Regions { - - [Extension("/OpenSim/Startup")] public partial class RestRegionPlugin : RestPlugin { private static XmlSerializerNamespaces _xmlNs; diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs index 78e0e6697e..1f633d5f14 100644 --- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs @@ -35,7 +35,6 @@ using System.Reflection; using System.Timers; using System.Xml; using libsecondlife; -using Mono.Addins; using Nwc.XmlRpc; using Nini.Config; using OpenSim.Framework; @@ -44,13 +43,8 @@ using OpenSim.Framework.Servers; using OpenSim.Framework.Communications; using OpenSim.Region.Environment.Scenes; -// [assembly : Addin] -// [assembly : AddinDependency("OpenSim", "0.5")] - namespace OpenSim.ApplicationPlugins.Rest { - - // [Extension("/OpenSim/Startup")] public abstract class RestPlugin : IApplicationPlugin { #region properties diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs index fa24d8293d..146288ff64 100644 --- a/OpenSim/Data/IGridData.cs +++ b/OpenSim/Data/IGridData.cs @@ -26,11 +26,8 @@ */ using libsecondlife; -using Mono.Addins; using OpenSim.Framework; -[assembly : AddinRoot("OpenSim.Data", "0.5")] - namespace OpenSim.Data { public enum DataResponse @@ -44,7 +41,6 @@ namespace OpenSim.Data /// /// A standard grid interface /// - [TypeExtensionPoint("/OpenSim/GridDataStore")] public interface IGridDataPlugin : IPlugin { /// @@ -105,10 +101,10 @@ namespace OpenSim.Data ReservationData GetReservationAtPoint(uint x, uint y); } - public class GridDataStoreInitialiser : PluginInitialiserBase + public class GridDataInitialiser : PluginInitialiserBase { private string connect; - public GridDataStoreInitialiser (string s) { connect = s; } + public GridDataInitialiser (string s) { connect = s; } public override void Initialise (IPlugin plugin) { IGridDataPlugin p = plugin as IGridDataPlugin; diff --git a/OpenSim/Data/ILogData.cs b/OpenSim/Data/ILogData.cs index 34657dc1f2..cfbee88f33 100644 --- a/OpenSim/Data/ILogData.cs +++ b/OpenSim/Data/ILogData.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using Mono.Addins; using OpenSim.Framework; namespace OpenSim.Data @@ -64,7 +63,6 @@ namespace OpenSim.Data /// /// An interface to a LogData storage system /// - [TypeExtensionPoint("/OpenSim/GridLogData")] public interface ILogDataPlugin : IPlugin { void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index 7de77d1255..e1de2978d5 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs @@ -33,18 +33,13 @@ using System.Security.Cryptography; using System.Text; using libsecondlife; using log4net; -using Mono.Addins; using OpenSim.Framework; -[assembly : Addin] -[assembly : AddinDependency("OpenSim.Data", "0.5")] - namespace OpenSim.Data.MSSQL { /// /// A grid data interface for MSSQL Server /// - [Extension("/OpenSim/GridDataStore")] public class MSSQLGridData : GridDataBase { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index d0d81b6a6b..d260e8c3ce 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs @@ -30,19 +30,13 @@ using System.Reflection; using System.Collections.Generic; using System.Data; using log4net; -using Mono.Addins; using OpenSim.Framework; -// Only one attribute per assembly. See: *GridData.cs -// [assembly : Addin] -// [assembly : AddinDependency("OpenSim.Data", "0.5")] - namespace OpenSim.Data.MSSQL { /// /// An interface to the log database for MSSQL /// - [Extension("/OpenSim/GridLogData")] internal class MSSQLLogData : ILogDataPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 8142c742f3..fee457a504 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs @@ -33,18 +33,13 @@ using System.Security.Cryptography; using System.Text; using libsecondlife; using log4net; -using Mono.Addins; using OpenSim.Framework; -[assembly : Addin] -[assembly : AddinDependency("OpenSim.Data", "0.5")] - namespace OpenSim.Data.MySQL { /// /// A MySQL Interface for the Grid Server /// - [Extension("/OpenSim/GridDataStore")] public class MySQLGridData : GridDataBase { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index f11aec5872..456cfd228f 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs @@ -28,19 +28,13 @@ using System; using System.Reflection; using System.Collections.Generic; using log4net; -using Mono.Addins; using OpenSim.Framework; -// Only one attribute per assembly. See: *GridData.cs -// [assembly : Addin] -// [assembly : AddinDependency("OpenSim.Data", "0.5")] - namespace OpenSim.Data.MySQL { /// /// An interface to the log database for MySQL /// - [Extension("/OpenSim/GridLogData")] internal class MySQLLogData : ILogDataPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Data/SQLite/SQLiteGridData.cs b/OpenSim/Data/SQLite/SQLiteGridData.cs index 1e0745852d..8c4574e4ee 100644 --- a/OpenSim/Data/SQLite/SQLiteGridData.cs +++ b/OpenSim/Data/SQLite/SQLiteGridData.cs @@ -33,18 +33,13 @@ using System.Security.Cryptography; using System.Text; using libsecondlife; using log4net; -using Mono.Addins; using OpenSim.Framework; -[assembly : Addin] -[assembly : AddinDependency("OpenSim.Data", "0.5")] - namespace OpenSim.Data.SQLite { /// /// A Grid Interface to the SQLite database /// - [Extension("/OpenSim/GridDataStore")] public class SQLiteGridData : GridDataBase { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 2d61b2c69e..0d21093eb4 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs @@ -197,7 +197,9 @@ namespace OpenSim.Framework private void on_addinloaderror_(object sender, AddinErrorEventArgs args) { - log.Error ("[PLUGINS]: Plugin Error: " + args.Message); + log.Error ("[PLUGINS]: Plugin Error: " + args.Message + + ": " + args.Exception.Message + + "\n"+ args.Exception.StackTrace); } private void clear_registry_ () diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index ebc6ac3dcb..0b4b4ac08e 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -73,18 +73,18 @@ namespace OpenSim.Grid.GridServer provider = String.Join (".", s); PluginLoader gridloader = - new PluginLoader (new GridDataStoreInitialiser (connect)); + new PluginLoader (new GridDataInitialiser (connect)); PluginLoader logloader = new PluginLoader (new LogDataInitialiser (connect)); - gridloader.AddExtensionPoint ("/OpenSim/GridDataStore"); - logloader.AddExtensionPoint ("/OpenSim/GridLogData"); + gridloader.AddExtensionPoint ("/OpenSim/GridData"); + logloader.AddExtensionPoint ("/OpenSim/LogData"); // loader will try to load all providers (MySQL, MSSQL, etc) // unless it is constrainted to the correct "id" - gridloader.AddFilter ("/OpenSim/GridDataStore", new PluginIdFilter (provider + "GridData")); - logloader.AddFilter ("/OpenSim/GridLogData", new PluginIdFilter (provider + "LogData")); + //gridloader.AddFilter ("/OpenSim/GridData", new PluginIdFilter (provider + "GridData")); + //logloader.AddFilter ("/OpenSim/LogData", new PluginIdFilter (provider + "LogData")); gridloader.Load(); logloader.Load(); @@ -111,7 +111,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - m_log.Warn("[storage]: Unable to write log via "); + m_log.Warn("[storage]: Unable to write log via " + plugin.Name); } } } diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs index 418caec833..71c357b63e 100644 --- a/OpenSim/Grid/GridServer/IGridPlugin.cs +++ b/OpenSim/Grid/GridServer/IGridPlugin.cs @@ -26,14 +26,10 @@ * */ -using Mono.Addins; using OpenSim.Framework; -[assembly : AddinRoot("OpenSim.Grid.GridServer", "0.5")] - namespace OpenSim.Grid.GridServer { - [TypeExtensionPoint("/OpenSim/GridServer")] public interface IGridPlugin : IPlugin { void Initialise(GridServerBase gridServer); diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index f122925def..2e3122f23e 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs @@ -25,14 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using Mono.Addins; using OpenSim.Framework; -[assembly : AddinRoot("OpenSim", "0.5")] - namespace OpenSim { - [TypeExtensionPoint("/OpenSim/Startup")] public interface IApplicationPlugin : IPlugin { void Initialise(OpenSimBase openSim); diff --git a/bin/LoadRegionsPlugin.addin.xml b/bin/LoadRegionsPlugin.addin.xml new file mode 100644 index 0000000000..f2bb2c9e03 --- /dev/null +++ b/bin/LoadRegionsPlugin.addin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/OpenSim.Data.MySQL.addin.xml b/bin/OpenSim.Data.MySQL.addin.xml new file mode 100644 index 0000000000..70a26d7230 --- /dev/null +++ b/bin/OpenSim.Data.MySQL.addin.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/OpenSim.Data.addin.xml b/bin/OpenSim.Data.addin.xml new file mode 100644 index 0000000000..d2cc6bb5fb --- /dev/null +++ b/bin/OpenSim.Data.addin.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/OpenSim.Grid.GridServer.addin.xml b/bin/OpenSim.Grid.GridServer.addin.xml new file mode 100644 index 0000000000..ae993d275e --- /dev/null +++ b/bin/OpenSim.Grid.GridServer.addin.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/bin/OpenSim.addin.xml b/bin/OpenSim.addin.xml new file mode 100644 index 0000000000..48bd744ec2 --- /dev/null +++ b/bin/OpenSim.addin.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/bin/RemoteAdminPlugin.addin.xml b/bin/RemoteAdminPlugin.addin.xml new file mode 100644 index 0000000000..7dc79c602b --- /dev/null +++ b/bin/RemoteAdminPlugin.addin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/RestHandler.addin.xml b/bin/RestHandler.addin.xml new file mode 100644 index 0000000000..fd2f692119 --- /dev/null +++ b/bin/RestHandler.addin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/RestRegionPlugin.addin.xml b/bin/RestRegionPlugin.addin.xml new file mode 100644 index 0000000000..1b7305b401 --- /dev/null +++ b/bin/RestRegionPlugin.addin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +