Thanks, sempuki, for a patch that moves control of Mono.Addins from source attributes to external XML files. Fix issues 1682 and 1786.

0.6.0-stable
Mike Mazur 2008-07-23 03:08:31 +00:00
parent ba17b0df27
commit a0930aa80d
24 changed files with 183 additions and 79 deletions

View File

@ -28,18 +28,13 @@
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using log4net; using log4net;
using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.RegionLoader.Filesystem; using OpenSim.Framework.RegionLoader.Filesystem;
using OpenSim.Framework.RegionLoader.Web; using OpenSim.Framework.RegionLoader.Web;
[assembly : Addin]
[assembly : AddinDependency("OpenSim", "0.5")]
namespace OpenSim.ApplicationPlugins.LoadRegions namespace OpenSim.ApplicationPlugins.LoadRegions
{ {
[Extension("/OpenSim/Startup")]
public class LoadRegionsPlugin : IApplicationPlugin public class LoadRegionsPlugin : IApplicationPlugin
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -33,19 +33,14 @@ using System.Reflection;
using System.Timers; using System.Timers;
using libsecondlife; using libsecondlife;
using log4net; using log4net;
using Mono.Addins;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Region.Environment.Modules.World.Terrain; using OpenSim.Region.Environment.Modules.World.Terrain;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
[assembly : Addin]
[assembly : AddinDependency("OpenSim", "0.5")]
namespace OpenSim.ApplicationPlugins.RemoteController namespace OpenSim.ApplicationPlugins.RemoteController
{ {
[Extension("/OpenSim/Startup")]
public class RemoteAdminPlugin : IApplicationPlugin public class RemoteAdminPlugin : IApplicationPlugin
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -32,16 +32,9 @@ using System.Reflection;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.ApplicationPlugins.Rest; using OpenSim.ApplicationPlugins.Rest;
using Mono.Addins;
[assembly : Addin]
[assembly : AddinDependency("OpenSim", "0.5")]
namespace OpenSim.ApplicationPlugins.Rest.Inventory namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
[Extension("/OpenSim/Startup")]
public class RestHandler : RestPlugin, IHttpAgentHandler public class RestHandler : RestPlugin, IHttpAgentHandler
{ {

View File

@ -37,7 +37,6 @@ using System.Timers;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using libsecondlife; using libsecondlife;
using Mono.Addins;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
@ -47,13 +46,8 @@ using OpenSim.Framework.Communications;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.ApplicationPlugins.Rest; using OpenSim.ApplicationPlugins.Rest;
[assembly : Addin]
[assembly : AddinDependency("OpenSim", "0.5")]
namespace OpenSim.ApplicationPlugins.Rest.Regions namespace OpenSim.ApplicationPlugins.Rest.Regions
{ {
[Extension("/OpenSim/Startup")]
public partial class RestRegionPlugin : RestPlugin public partial class RestRegionPlugin : RestPlugin
{ {
private static XmlSerializerNamespaces _xmlNs; private static XmlSerializerNamespaces _xmlNs;

View File

@ -35,7 +35,6 @@ using System.Reflection;
using System.Timers; using System.Timers;
using System.Xml; using System.Xml;
using libsecondlife; using libsecondlife;
using Mono.Addins;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
@ -44,13 +43,8 @@ using OpenSim.Framework.Servers;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
// [assembly : Addin]
// [assembly : AddinDependency("OpenSim", "0.5")]
namespace OpenSim.ApplicationPlugins.Rest namespace OpenSim.ApplicationPlugins.Rest
{ {
// [Extension("/OpenSim/Startup")]
public abstract class RestPlugin : IApplicationPlugin public abstract class RestPlugin : IApplicationPlugin
{ {
#region properties #region properties

View File

@ -26,11 +26,8 @@
*/ */
using libsecondlife; using libsecondlife;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : AddinRoot("OpenSim.Data", "0.5")]
namespace OpenSim.Data namespace OpenSim.Data
{ {
public enum DataResponse public enum DataResponse
@ -44,7 +41,6 @@ namespace OpenSim.Data
/// <summary> /// <summary>
/// A standard grid interface /// A standard grid interface
/// </summary> /// </summary>
[TypeExtensionPoint("/OpenSim/GridDataStore")]
public interface IGridDataPlugin : IPlugin public interface IGridDataPlugin : IPlugin
{ {
/// <summary> /// <summary>
@ -105,10 +101,10 @@ namespace OpenSim.Data
ReservationData GetReservationAtPoint(uint x, uint y); ReservationData GetReservationAtPoint(uint x, uint y);
} }
public class GridDataStoreInitialiser : PluginInitialiserBase public class GridDataInitialiser : PluginInitialiserBase
{ {
private string connect; private string connect;
public GridDataStoreInitialiser (string s) { connect = s; } public GridDataInitialiser (string s) { connect = s; }
public override void Initialise (IPlugin plugin) public override void Initialise (IPlugin plugin)
{ {
IGridDataPlugin p = plugin as IGridDataPlugin; IGridDataPlugin p = plugin as IGridDataPlugin;

View File

@ -25,7 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
namespace OpenSim.Data namespace OpenSim.Data
@ -64,7 +63,6 @@ namespace OpenSim.Data
/// <summary> /// <summary>
/// An interface to a LogData storage system /// An interface to a LogData storage system
/// </summary> /// </summary>
[TypeExtensionPoint("/OpenSim/GridLogData")]
public interface ILogDataPlugin : IPlugin public interface ILogDataPlugin : IPlugin
{ {
void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,

View File

@ -33,18 +33,13 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using libsecondlife; using libsecondlife;
using log4net; using log4net;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : Addin]
[assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MSSQL namespace OpenSim.Data.MSSQL
{ {
/// <summary> /// <summary>
/// A grid data interface for MSSQL Server /// A grid data interface for MSSQL Server
/// </summary> /// </summary>
[Extension("/OpenSim/GridDataStore")]
public class MSSQLGridData : GridDataBase public class MSSQLGridData : GridDataBase
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -30,19 +30,13 @@ using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using log4net; using log4net;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
// Only one attribute per assembly. See: *GridData.cs
// [assembly : Addin]
// [assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MSSQL namespace OpenSim.Data.MSSQL
{ {
/// <summary> /// <summary>
/// An interface to the log database for MSSQL /// An interface to the log database for MSSQL
/// </summary> /// </summary>
[Extension("/OpenSim/GridLogData")]
internal class MSSQLLogData : ILogDataPlugin internal class MSSQLLogData : ILogDataPlugin
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -33,18 +33,13 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using libsecondlife; using libsecondlife;
using log4net; using log4net;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : Addin]
[assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MySQL namespace OpenSim.Data.MySQL
{ {
/// <summary> /// <summary>
/// A MySQL Interface for the Grid Server /// A MySQL Interface for the Grid Server
/// </summary> /// </summary>
[Extension("/OpenSim/GridDataStore")]
public class MySQLGridData : GridDataBase public class MySQLGridData : GridDataBase
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -28,19 +28,13 @@ using System;
using System.Reflection; using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
using log4net; using log4net;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
// Only one attribute per assembly. See: *GridData.cs
// [assembly : Addin]
// [assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MySQL namespace OpenSim.Data.MySQL
{ {
/// <summary> /// <summary>
/// An interface to the log database for MySQL /// An interface to the log database for MySQL
/// </summary> /// </summary>
[Extension("/OpenSim/GridLogData")]
internal class MySQLLogData : ILogDataPlugin internal class MySQLLogData : ILogDataPlugin
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -33,18 +33,13 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using libsecondlife; using libsecondlife;
using log4net; using log4net;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : Addin]
[assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.SQLite namespace OpenSim.Data.SQLite
{ {
/// <summary> /// <summary>
/// A Grid Interface to the SQLite database /// A Grid Interface to the SQLite database
/// </summary> /// </summary>
[Extension("/OpenSim/GridDataStore")]
public class SQLiteGridData : GridDataBase public class SQLiteGridData : GridDataBase
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -197,7 +197,9 @@ namespace OpenSim.Framework
private void on_addinloaderror_(object sender, AddinErrorEventArgs args) 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_ () private void clear_registry_ ()

View File

@ -73,18 +73,18 @@ namespace OpenSim.Grid.GridServer
provider = String.Join (".", s); provider = String.Join (".", s);
PluginLoader<IGridDataPlugin> gridloader = PluginLoader<IGridDataPlugin> gridloader =
new PluginLoader<IGridDataPlugin> (new GridDataStoreInitialiser (connect)); new PluginLoader<IGridDataPlugin> (new GridDataInitialiser (connect));
PluginLoader<ILogDataPlugin> logloader = PluginLoader<ILogDataPlugin> logloader =
new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect)); new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect));
gridloader.AddExtensionPoint ("/OpenSim/GridDataStore"); gridloader.AddExtensionPoint ("/OpenSim/GridData");
logloader.AddExtensionPoint ("/OpenSim/GridLogData"); logloader.AddExtensionPoint ("/OpenSim/LogData");
// loader will try to load all providers (MySQL, MSSQL, etc) // loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "id" // unless it is constrainted to the correct "id"
gridloader.AddFilter ("/OpenSim/GridDataStore", new PluginIdFilter (provider + "GridData")); //gridloader.AddFilter ("/OpenSim/GridData", new PluginIdFilter (provider + "GridData"));
logloader.AddFilter ("/OpenSim/GridLogData", new PluginIdFilter (provider + "LogData")); //logloader.AddFilter ("/OpenSim/LogData", new PluginIdFilter (provider + "LogData"));
gridloader.Load(); gridloader.Load();
logloader.Load(); logloader.Load();
@ -111,7 +111,7 @@ namespace OpenSim.Grid.GridServer
} }
catch (Exception) catch (Exception)
{ {
m_log.Warn("[storage]: Unable to write log via "); m_log.Warn("[storage]: Unable to write log via " + plugin.Name);
} }
} }
} }

View File

@ -26,14 +26,10 @@
* *
*/ */
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : AddinRoot("OpenSim.Grid.GridServer", "0.5")]
namespace OpenSim.Grid.GridServer namespace OpenSim.Grid.GridServer
{ {
[TypeExtensionPoint("/OpenSim/GridServer")]
public interface IGridPlugin : IPlugin public interface IGridPlugin : IPlugin
{ {
void Initialise(GridServerBase gridServer); void Initialise(GridServerBase gridServer);

View File

@ -25,14 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
[assembly : AddinRoot("OpenSim", "0.5")]
namespace OpenSim namespace OpenSim
{ {
[TypeExtensionPoint("/OpenSim/Startup")]
public interface IApplicationPlugin : IPlugin public interface IApplicationPlugin : IPlugin
{ {
void Initialise(OpenSimBase openSim); void Initialise(OpenSimBase openSim);

View File

@ -0,0 +1,22 @@
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.LoadRegions.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.LoadRegions.LoadRegionsPlugin" />
</Extension>
</Addin>
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.LoadRegions.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.LoadRegions.LoadRegionsPlugin" />
</Extension>
</Addin>

View File

@ -0,0 +1,28 @@
<Addin>
<Runtime>
<Import assembly="OpenSim.Data.MySQL.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim.Data" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/GridData">
<Type type="OpenSim.Data.MySQL.MySQLGridData" />
</Extension>
<Extension path = "/OpenSim/LogData">
<Type type="OpenSim.Data.MySQL.MySQLLogData" />
</Extension>
</Addin>
<Addin>
<Runtime>
<Import assembly="OpenSim.Data.MySQL.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim.Data" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/GridData">
<Type type="OpenSim.Data.MySQL.MySQLGridData" />
</Extension>
<Extension path = "/OpenSim/LogData">
<Type type="OpenSim.Data.MySQL.MySQLLogData" />
</Extension>
</Addin>

View File

@ -0,0 +1,24 @@
<Addin id="OpenSim.Data" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.Grid.GridServer.exe"/>
<Import assembly="OpenSim.Data.dll"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/GridData">
<ExtensionNode objectType="OpenSim.Data.IGridDataPlugin"/>
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/LogData">
<ExtensionNode objectType="OpenSim.Data.ILogDataPlugin"/>
</ExtensionPoint>
</Addin>
<Addin id="OpenSim.Data" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.Grid.GridServer.exe"/>
<Import assembly="OpenSim.Data.dll"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/GridData">
<ExtensionNode objectType="OpenSim.Data.IGridDataPlugin"/>
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/LogData">
<ExtensionNode objectType="OpenSim.Data.ILogDataPlugin"/>
</ExtensionPoint>
</Addin>

View File

@ -0,0 +1,16 @@
<Addin id="OpenSim.Grid.GridServer" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.Grid.GridServer.exe"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/GridServer">
<ExtensionNode objectType="OpenSim.Grid.GridServer.IGridPlugin"/>
</ExtensionPoint>
</Addin>
<Addin id="OpenSim.Grid.GridServer" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.Grid.GridServer.exe"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/GridServer">
<ExtensionNode objectType="OpenSim.Grid.GridServer.IGridPlugin"/>
</ExtensionPoint>
</Addin>

16
bin/OpenSim.addin.xml Normal file
View File

@ -0,0 +1,16 @@
<Addin id="OpenSim" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.exe"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/Startup">
<ExtensionNode objectType="OpenSim.Region.Application.IApplicationPlugin"/>
</ExtensionPoint>
</Addin>
<Addin id="OpenSim" isroot="true" version="0.5">
<Runtime>
<Import assembly="OpenSim.exe"/>
</Runtime>
<ExtensionPoint path = "/OpenSim/Startup">
<ExtensionNode objectType="OpenSim.Region.Application.IApplicationPlugin"/>
</ExtensionPoint>
</Addin>

View File

@ -0,0 +1,22 @@
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.RemoteController.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.RemoteController.RemoteAdminPlugin" />
</Extension>
</Addin>
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.RemoteController.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.RemoteController.RemoteAdminPlugin" />
</Extension>
</Addin>

22
bin/RestHandler.addin.xml Normal file
View File

@ -0,0 +1,22 @@
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.Rest.Inventory.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.Rest.Inventory.RestHandler" />
</Extension>
</Addin>
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.Rest.Inventory.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.Rest.Inventory.RestHandler" />
</Extension>
</Addin>

View File

@ -0,0 +1,22 @@
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.Rest.Regions.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.Rest.Regions.RestRegionPlugin" />
</Extension>
</Addin>
<Addin>
<Runtime>
<Import assembly="OpenSim.ApplicationPlugins.Rest.Regions.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/Startup">
<Type type="OpenSim.ApplicationPlugins.Rest.Regions.RestRegionPlugin" />
</Extension>
</Addin>