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