aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCharles Krinke2008-07-10 13:45:46 +0000
committerCharles Krinke2008-07-10 13:45:46 +0000
commit7fd63d9dc84cce5a6e6b177ff3b62598b08978f4 (patch)
tree22e18ec3c23e6d7d9ee4cc9b9b39609974651df7 /OpenSim
parentThanks to mikem for a patch that resolves a reference error when building SVN... (diff)
downloadopensim-SC-7fd63d9dc84cce5a6e6b177ff3b62598b08978f4.zip
opensim-SC-7fd63d9dc84cce5a6e6b177ff3b62598b08978f4.tar.gz
opensim-SC-7fd63d9dc84cce5a6e6b177ff3b62598b08978f4.tar.bz2
opensim-SC-7fd63d9dc84cce5a6e6b177ff3b62598b08978f4.tar.xz
Mantis#1682. Thank you kindly, Sempuki for a patch that:
Move control of Mono.Addins from source attributes to external XML files. This removes a lot of coupling of the source with Mono.Addins
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs5
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs5
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs7
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs1
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs1
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs6
-rw-r--r--OpenSim/ApplicationPlugins/Rest/RestPlugin.cs6
-rw-r--r--OpenSim/Framework/PluginLoader.cs59
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs3
-rw-r--r--OpenSim/Grid/GridServer/IGridPlugin.cs4
-rw-r--r--OpenSim/Region/Application/IApplicationPlugin.cs4
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs4
12 files changed, 38 insertions, 67 deletions
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 @@
28using System.Reflection; 28using System.Reflection;
29using System.Threading; 29using System.Threading;
30using log4net; 30using log4net;
31using Mono.Addins;
32using Nini.Config; 31using Nini.Config;
33using OpenSim.Framework; 32using OpenSim.Framework;
34using OpenSim.Framework.RegionLoader.Filesystem; 33using OpenSim.Framework.RegionLoader.Filesystem;
35using OpenSim.Framework.RegionLoader.Web; 34using OpenSim.Framework.RegionLoader.Web;
36 35
37[assembly : Addin]
38[assembly : AddinDependency("OpenSim", "0.5")]
39
40namespace OpenSim.ApplicationPlugins.LoadRegions 36namespace OpenSim.ApplicationPlugins.LoadRegions
41{ 37{
42 [Extension("/OpenSim/Startup")]
43 public class LoadRegionsPlugin : IApplicationPlugin 38 public class LoadRegionsPlugin : IApplicationPlugin
44 { 39 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40 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 e3a0321..3f6869e 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -33,19 +33,14 @@ using System.Reflection;
33using System.Timers; 33using System.Timers;
34using libsecondlife; 34using libsecondlife;
35using log4net; 35using log4net;
36using Mono.Addins;
37using Nwc.XmlRpc; 36using Nwc.XmlRpc;
38using OpenSim.Framework; 37using OpenSim.Framework;
39using OpenSim.Framework.Servers; 38using OpenSim.Framework.Servers;
40using OpenSim.Region.Environment.Modules.World.Terrain; 39using OpenSim.Region.Environment.Modules.World.Terrain;
41using OpenSim.Region.Environment.Scenes; 40using OpenSim.Region.Environment.Scenes;
42 41
43[assembly : Addin]
44[assembly : AddinDependency("OpenSim", "0.5")]
45
46namespace OpenSim.ApplicationPlugins.RemoteController 42namespace OpenSim.ApplicationPlugins.RemoteController
47{ 43{
48 [Extension("/OpenSim/Startup")]
49 public class RemoteAdminPlugin : IApplicationPlugin 44 public class RemoteAdminPlugin : IApplicationPlugin
50 { 45 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 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 c351272..1ec3567 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
@@ -32,16 +32,9 @@ using System.Reflection;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Servers; 33using OpenSim.Framework.Servers;
34using OpenSim.ApplicationPlugins.Rest; 34using OpenSim.ApplicationPlugins.Rest;
35using Mono.Addins;
36
37[assembly : Addin]
38[assembly : AddinDependency("OpenSim", "0.5")]
39 35
40namespace OpenSim.ApplicationPlugins.Rest.Inventory 36namespace OpenSim.ApplicationPlugins.Rest.Inventory
41{ 37{
42
43 [Extension("/OpenSim/Startup")]
44
45 public class RestHandler : RestPlugin, IHttpAgentHandler 38 public class RestHandler : RestPlugin, IHttpAgentHandler
46 { 39 {
47 40
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
index a605d09..2734c77 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
@@ -37,7 +37,6 @@ using System.Timers;
37using System.Xml; 37using System.Xml;
38using System.Xml.Serialization; 38using System.Xml.Serialization;
39using libsecondlife; 39using libsecondlife;
40using Mono.Addins;
41using Nwc.XmlRpc; 40using Nwc.XmlRpc;
42using Nini.Config; 41using Nini.Config;
43using OpenSim.Framework; 42using OpenSim.Framework;
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
index e6131f1..a40af29 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
@@ -37,7 +37,6 @@ using System.Timers;
37using System.Xml; 37using System.Xml;
38using System.Xml.Serialization; 38using System.Xml.Serialization;
39using libsecondlife; 39using libsecondlife;
40using Mono.Addins;
41using Nwc.XmlRpc; 40using Nwc.XmlRpc;
42using Nini.Config; 41using Nini.Config;
43using OpenSim.Framework; 42using OpenSim.Framework;
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;
37using System.Xml; 37using System.Xml;
38using System.Xml.Serialization; 38using System.Xml.Serialization;
39using libsecondlife; 39using libsecondlife;
40using Mono.Addins;
41using Nwc.XmlRpc; 40using Nwc.XmlRpc;
42using Nini.Config; 41using Nini.Config;
43using OpenSim.Framework; 42using OpenSim.Framework;
@@ -47,13 +46,8 @@ using OpenSim.Framework.Communications;
47using OpenSim.Region.Environment.Scenes; 46using OpenSim.Region.Environment.Scenes;
48using OpenSim.ApplicationPlugins.Rest; 47using OpenSim.ApplicationPlugins.Rest;
49 48
50[assembly : Addin]
51[assembly : AddinDependency("OpenSim", "0.5")]
52
53namespace OpenSim.ApplicationPlugins.Rest.Regions 49namespace OpenSim.ApplicationPlugins.Rest.Regions
54{ 50{
55
56 [Extension("/OpenSim/Startup")]
57 public partial class RestRegionPlugin : RestPlugin 51 public partial class RestRegionPlugin : RestPlugin
58 { 52 {
59 private static XmlSerializerNamespaces _xmlNs; 53 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;
35using System.Timers; 35using System.Timers;
36using System.Xml; 36using System.Xml;
37using libsecondlife; 37using libsecondlife;
38using Mono.Addins;
39using Nwc.XmlRpc; 38using Nwc.XmlRpc;
40using Nini.Config; 39using Nini.Config;
41using OpenSim.Framework; 40using OpenSim.Framework;
@@ -44,13 +43,8 @@ using OpenSim.Framework.Servers;
44using OpenSim.Framework.Communications; 43using OpenSim.Framework.Communications;
45using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
46 45
47// [assembly : Addin]
48// [assembly : AddinDependency("OpenSim", "0.5")]
49
50namespace OpenSim.ApplicationPlugins.Rest 46namespace OpenSim.ApplicationPlugins.Rest
51{ 47{
52
53 // [Extension("/OpenSim/Startup")]
54 public abstract class RestPlugin : IApplicationPlugin 48 public abstract class RestPlugin : IApplicationPlugin
55 { 49 {
56 #region properties 50 #region properties
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs
index 9104958..cfc1d7c 100644
--- a/OpenSim/Framework/PluginLoader.cs
+++ b/OpenSim/Framework/PluginLoader.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Framework
55 } 55 }
56 56
57 /// <summary> 57 /// <summary>
58
58 /// Generic Plugin Loader 59 /// Generic Plugin Loader
59 /// </summary> 60 /// </summary>
60 public class PluginLoader <T> : IDisposable where T : IPlugin 61 public class PluginLoader <T> : IDisposable where T : IPlugin
@@ -66,16 +67,17 @@ namespace OpenSim.Framework
66 private PluginInitialiserBase initialiser; 67 private PluginInitialiserBase initialiser;
67 private Dictionary<string,IPluginConstraint> constraints 68 private Dictionary<string,IPluginConstraint> constraints
68 = new Dictionary<string,IPluginConstraint>(); 69 = new Dictionary<string,IPluginConstraint>();
69 70
71 private static bool runonce = false;
70 private static readonly ILog log 72 private static readonly ILog log
71 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 73 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
72 74
73 public PluginInitialiserBase Initialiser 75 public PluginInitialiserBase Initialiser
74 { 76 {
75 set { initialiser = value; } 77 set { initialiser = value; }
76 get { return initialiser; } 78 get { return initialiser; }
77 } 79 }
78 80
79 public List<T> Plugins 81 public List<T> Plugins
80 { 82 {
81 get { return loaded; } 83 get { return loaded; }
@@ -84,25 +86,19 @@ namespace OpenSim.Framework
84 public PluginLoader () 86 public PluginLoader ()
85 { 87 {
86 Initialiser = new PluginInitialiserBase(); 88 Initialiser = new PluginInitialiserBase();
89 initialise_plugin_dir_ (".");
87 } 90 }
88 91
89 public PluginLoader (PluginInitialiserBase init) 92 public PluginLoader (PluginInitialiserBase init)
90 { 93 {
91 Initialiser = init; 94 Initialiser = init;
95 initialise_plugin_dir_ (".");
92 } 96 }
93 97
94 public PluginLoader (PluginInitialiserBase init, string dir) 98 public PluginLoader (PluginInitialiserBase init, string dir)
95 { 99 {
96 Initialiser = init; 100 Initialiser = init;
97 AddPluginDir (dir); 101 initialise_plugin_dir_ (dir);
98 }
99
100 public void AddPluginDir (string dir)
101 {
102 suppress_console_output_ (true);
103 AddinManager.Initialize (dir);
104 AddinManager.Registry.Update (null);
105 suppress_console_output_ (false);
106 } 102 }
107 103
108 public void AddExtensionPoint (string extpoint) 104 public void AddExtensionPoint (string extpoint)
@@ -114,22 +110,21 @@ namespace OpenSim.Framework
114 { 110 {
115 constraints.Add (extpoint, cons); 111 constraints.Add (extpoint, cons);
116 } 112 }
117 113
118 public void Load (string extpoint, string dir) 114 public void Load (string extpoint)
119 { 115 {
120 AddPluginDir (dir);
121 AddExtensionPoint (extpoint); 116 AddExtensionPoint (extpoint);
122 Load(); 117 Load();
123 } 118 }
124 119
125 public void Load () 120 public void Load ()
126 { 121 {
127 suppress_console_output_ (true); 122 log.Info("[PLUGINS]: Begin Loading " + AddinManager.Registry.RegistryPath);
128 AddinManager.Registry.Update (null);
129 suppress_console_output_ (false);
130 123
131 foreach (string ext in extpoints) 124 foreach (string ext in extpoints)
132 { 125 {
126 log.Info("[PLUGINS]: Loading extension point " + ext);
127
133 if (constraints.ContainsKey (ext)) 128 if (constraints.ContainsKey (ext))
134 { 129 {
135 IPluginConstraint cons = constraints [ext]; 130 IPluginConstraint cons = constraints [ext];
@@ -155,9 +150,25 @@ namespace OpenSim.Framework
155 p.Dispose (); 150 p.Dispose ();
156 } 151 }
157 152
158 public void ClearCache() 153 private void initialise_plugin_dir_ (string dir)
154 {
155 if (runonce == true)
156 return;
157
158 log.Info("[PLUGINS]: Initialzing " + dir);
159
160 clear_registry_();
161 suppress_console_output_ (true);
162 AddinManager.Initialize (dir);
163 AddinManager.Registry.Update (null);
164 suppress_console_output_ (false);
165 runonce = true;
166 }
167
168 private void clear_registry_ ()
159 { 169 {
160 // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) occasionally seems to corrupt its addin cache 170 // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
171 // occasionally seems to corrupt its addin cache
161 // Hence, as a temporary solution we'll remove it before each startup 172 // Hence, as a temporary solution we'll remove it before each startup
162 if (Directory.Exists("addin-db-000")) 173 if (Directory.Exists("addin-db-000"))
163 Directory.Delete("addin-db-000", true); 174 Directory.Delete("addin-db-000", true);
@@ -225,7 +236,7 @@ namespace OpenSim.Framework
225 public PluginFilenameConstraint (string name) 236 public PluginFilenameConstraint (string name)
226 { 237 {
227 filename = name; 238 filename = name;
228 239
229 } 240 }
230 241
231 public string Message 242 public string Message
@@ -245,7 +256,7 @@ namespace OpenSim.Framework
245 string[] path = ns[0].Path.Split('/'); 256 string[] path = ns[0].Path.Split('/');
246 if (path [path.Length-1] == filename) 257 if (path [path.Length-1] == filename)
247 return false; 258 return false;
248 259
249 return true; 260 return true;
250 } 261 }
251 } 262 }
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 3cd7489..a8ebd27 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -31,7 +31,6 @@ using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Timers; 32using System.Timers;
33using log4net; 33using log4net;
34using Mono.Addins;
35using OpenSim.Framework; 34using OpenSim.Framework;
36using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
37using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
@@ -121,7 +120,7 @@ namespace OpenSim.Grid.GridServer
121 PluginLoader<IGridPlugin> loader = 120 PluginLoader<IGridPlugin> loader =
122 new PluginLoader<IGridPlugin> (new GridPluginInitialiser (this)); 121 new PluginLoader<IGridPlugin> (new GridPluginInitialiser (this));
123 122
124 loader.Load ("/OpenSim/GridServer", "."); 123 loader.Load ("/OpenSim/GridServer");
125 m_plugins = loader.Plugins; 124 m_plugins = loader.Plugins;
126 } 125 }
127 126
diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs
index 6593962..b8ac611 100644
--- a/OpenSim/Grid/GridServer/IGridPlugin.cs
+++ b/OpenSim/Grid/GridServer/IGridPlugin.cs
@@ -26,14 +26,10 @@
26* 26*
27*/ 27*/
28 28
29using Mono.Addins;
30using OpenSim.Framework; 29using OpenSim.Framework;
31 30
32[assembly : AddinRoot("OpenSim", "0.5")]
33
34namespace OpenSim.Grid.GridServer 31namespace OpenSim.Grid.GridServer
35{ 32{
36 [TypeExtensionPoint("/OpenSim/GridServer")]
37 public interface IGridPlugin : IPlugin 33 public interface IGridPlugin : IPlugin
38 { 34 {
39 void Initialise(GridServerBase gridServer); 35 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 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Mono.Addins;
29using OpenSim.Framework; 28using OpenSim.Framework;
30 29
31[assembly : AddinRoot("OpenSim", "0.5")]
32
33namespace OpenSim 30namespace OpenSim
34{ 31{
35 [TypeExtensionPoint("/OpenSim/Startup")]
36 public interface IApplicationPlugin : IPlugin 32 public interface IApplicationPlugin : IPlugin
37 { 33 {
38 void Initialise(OpenSimBase openSim); 34 void Initialise(OpenSimBase openSim);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 37daf88..065d2f2 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -34,7 +34,6 @@ using System.Text;
34using System.Threading; 34using System.Threading;
35using libsecondlife; 35using libsecondlife;
36using log4net; 36using log4net;
37using Mono.Addins;
38using Nini.Config; 37using Nini.Config;
39using OpenSim.Framework; 38using OpenSim.Framework;
40using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
@@ -337,7 +336,7 @@ namespace OpenSim
337 PluginLoader<IApplicationPlugin> loader = 336 PluginLoader<IApplicationPlugin> loader =
338 new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); 337 new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this));
339 338
340 loader.Load ("/OpenSim/Startup", "."); 339 loader.Load ("/OpenSim/Startup");
341 m_plugins = loader.Plugins; 340 m_plugins = loader.Plugins;
342 } 341 }
343 342
@@ -730,3 +729,4 @@ namespace OpenSim
730 729
731 730
732 731
732