diff options
Diffstat (limited to '')
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 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Threading; | 29 | using System.Threading; |
30 | using log4net; | 30 | using log4net; |
31 | using Mono.Addins; | ||
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Framework.RegionLoader.Filesystem; | 34 | using OpenSim.Framework.RegionLoader.Filesystem; |
34 | using OpenSim.Framework.RegionLoader.Web; | 35 | using OpenSim.Framework.RegionLoader.Web; |
35 | 36 | ||
37 | [assembly : Addin] | ||
38 | [assembly : AddinDependency("OpenSim", "0.5")] | ||
39 | |||
36 | namespace OpenSim.ApplicationPlugins.LoadRegions | 40 | namespace 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; | |||
33 | using System.Timers; | 33 | using System.Timers; |
34 | using libsecondlife; | 34 | using libsecondlife; |
35 | using log4net; | 35 | using log4net; |
36 | using Mono.Addins; | ||
36 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Servers; | 39 | using OpenSim.Framework.Servers; |
39 | using OpenSim.Region.Environment.Modules.World.Terrain; | 40 | using OpenSim.Region.Environment.Modules.World.Terrain; |
40 | using OpenSim.Region.Environment.Scenes; | 41 | using OpenSim.Region.Environment.Scenes; |
41 | 42 | ||
43 | [assembly : Addin] | ||
44 | [assembly : AddinDependency("OpenSim", "0.5")] | ||
45 | |||
42 | namespace OpenSim.ApplicationPlugins.RemoteController | 46 | namespace 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; | |||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Servers; | 33 | using OpenSim.Framework.Servers; |
34 | using OpenSim.ApplicationPlugins.Rest; | 34 | using OpenSim.ApplicationPlugins.Rest; |
35 | using Mono.Addins; | ||
36 | |||
37 | [assembly : Addin] | ||
38 | [assembly : AddinDependency("OpenSim", "0.5")] | ||
35 | 39 | ||
36 | namespace OpenSim.ApplicationPlugins.Rest.Inventory | 40 | namespace 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; | |||
37 | using System.Xml; | 37 | using System.Xml; |
38 | using System.Xml.Serialization; | 38 | using System.Xml.Serialization; |
39 | using libsecondlife; | 39 | using libsecondlife; |
40 | using Mono.Addins; | ||
40 | using Nwc.XmlRpc; | 41 | using Nwc.XmlRpc; |
41 | using Nini.Config; | 42 | using Nini.Config; |
42 | using OpenSim.Framework; | 43 | using 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; | |||
37 | using System.Xml; | 37 | using System.Xml; |
38 | using System.Xml.Serialization; | 38 | using System.Xml.Serialization; |
39 | using libsecondlife; | 39 | using libsecondlife; |
40 | using Mono.Addins; | ||
40 | using Nwc.XmlRpc; | 41 | using Nwc.XmlRpc; |
41 | using Nini.Config; | 42 | using Nini.Config; |
42 | using OpenSim.Framework; | 43 | using 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; | |||
37 | using System.Xml; | 37 | using System.Xml; |
38 | using System.Xml.Serialization; | 38 | using System.Xml.Serialization; |
39 | using libsecondlife; | 39 | using libsecondlife; |
40 | using Mono.Addins; | ||
40 | using Nwc.XmlRpc; | 41 | using Nwc.XmlRpc; |
41 | using Nini.Config; | 42 | using Nini.Config; |
42 | using OpenSim.Framework; | 43 | using OpenSim.Framework; |
@@ -46,8 +47,13 @@ using OpenSim.Framework.Communications; | |||
46 | using OpenSim.Region.Environment.Scenes; | 47 | using OpenSim.Region.Environment.Scenes; |
47 | using OpenSim.ApplicationPlugins.Rest; | 48 | using OpenSim.ApplicationPlugins.Rest; |
48 | 49 | ||
50 | [assembly : Addin] | ||
51 | [assembly : AddinDependency("OpenSim", "0.5")] | ||
52 | |||
49 | namespace OpenSim.ApplicationPlugins.Rest.Regions | 53 | namespace 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; | |||
35 | using System.Timers; | 35 | using System.Timers; |
36 | using System.Xml; | 36 | using System.Xml; |
37 | using libsecondlife; | 37 | using libsecondlife; |
38 | using Mono.Addins; | ||
38 | using Nwc.XmlRpc; | 39 | using Nwc.XmlRpc; |
39 | using Nini.Config; | 40 | using Nini.Config; |
40 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
@@ -43,8 +44,13 @@ using OpenSim.Framework.Servers; | |||
43 | using OpenSim.Framework.Communications; | 44 | using OpenSim.Framework.Communications; |
44 | using OpenSim.Region.Environment.Scenes; | 45 | using OpenSim.Region.Environment.Scenes; |
45 | 46 | ||
47 | // [assembly : Addin] | ||
48 | // [assembly : AddinDependency("OpenSim", "0.5")] | ||
49 | |||
46 | namespace OpenSim.ApplicationPlugins.Rest | 50 | namespace 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; | |||
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Timers; | 32 | using System.Timers; |
33 | using log4net; | 33 | using log4net; |
34 | using Mono.Addins; | ||
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Servers; | 37 | using 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 | ||
29 | using Mono.Addins; | ||
29 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
30 | 31 | ||
32 | [assembly : AddinRoot("OpenSim", "0.5")] | ||
33 | |||
31 | namespace OpenSim.Grid.GridServer | 34 | namespace 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 | ||
28 | using Mono.Addins; | ||
28 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
29 | 30 | ||
31 | [assembly : AddinRoot("OpenSim", "0.5")] | ||
32 | |||
30 | namespace OpenSim | 33 | namespace 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; | |||
34 | using System.Threading; | 34 | using System.Threading; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using log4net; | 36 | using log4net; |
37 | using Mono.Addins; | ||
37 | using Nini.Config; | 38 | using Nini.Config; |
38 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | 40 | using 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 | |||