From a0930aa80d6f43d1dc1b4de0ee5708888cc45a5a Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 23 Jul 2008 03:08:31 +0000 Subject: Thanks, sempuki, for a patch that moves control of Mono.Addins from source attributes to external XML files. Fix issues 1682 and 1786. --- OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | 5 ----- .../ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 5 ----- OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs | 7 ------- OpenSim/ApplicationPlugins/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 ---- OpenSim/Region/Application/IApplicationPlugin.cs | 4 ---- 16 files changed, 11 insertions(+), 79 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 6743fb4..523f9fc 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 d61e566..256e862 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 9a1f628..50412c9 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 9d68225..5ec2526 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 78e0e66..1f633d5 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 fa24d82..146288f 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 34657dc..cfbee88 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 7de77d1..e1de297 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 d0d81b6..d260e8c 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 8142c74..fee457a 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 f11aec5..456cfd2 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 1e07458..8c4574e 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 2d61b2c..0d21093 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 ebc6ac3..0b4b4ac 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 418caec..71c357b 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 f122925..2e3122f 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); -- cgit v1.1