aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/GridServer')
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs27
-rw-r--r--OpenSim/Grid/GridServer/IGridPlugin.cs3
2 files changed, 11 insertions, 19 deletions
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 7891c29..010c250 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -116,26 +116,17 @@ namespace OpenSim.Grid.GridServer
116 m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod)); 116 m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod));
117 } 117 }
118 118
119 protected void LoadGridPlugins() 119 protected void grid_plugin_initialiser_ (IPlugin plugin)
120 { 120 {
121 // Temporary hack to stop mono-addins scanning warnings from coming out on the console 121 IGridPlugin p = plugin as IGridPlugin;
122 TextWriter oldOutput = Console.Out; 122 p.Initialise (this);
123 Console.SetOut(new StreamWriter(Stream.Null)); 123 }
124
125 AddinManager.Initialize(".");
126 AddinManager.Registry.Update(null);
127
128 // Returns the console.writelines back to the console's stream
129 Console.SetOut(oldOutput);
130 124
131 ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer"); 125 protected void LoadGridPlugins()
132 foreach (TypeExtensionNode node in nodes) 126 {
133 { 127 PluginLoader<IGridPlugin> loader = new PluginLoader<IGridPlugin> (".");
134 m_log.Info("[GRID PLUGINS]: Loading OpenSim plugin " + node.Path); 128 loader.Load ("/OpenSim/GridServer", grid_plugin_initialiser_);
135 IGridPlugin plugin = (IGridPlugin)node.CreateInstance(); 129 m_plugins = loader.Plugins;
136 plugin.Initialise(this);
137 m_plugins.Add(plugin);
138 }
139 } 130 }
140 131
141 protected virtual void SetupGridManager() 132 protected virtual void SetupGridManager()
diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs
index 47273a2..d51deb3 100644
--- a/OpenSim/Grid/GridServer/IGridPlugin.cs
+++ b/OpenSim/Grid/GridServer/IGridPlugin.cs
@@ -27,13 +27,14 @@
27*/ 27*/
28 28
29using Mono.Addins; 29using Mono.Addins;
30using OpenSim.Framework;
30 31
31[assembly : AddinRoot("OpenSim", "0.5")] 32[assembly : AddinRoot("OpenSim", "0.5")]
32 33
33namespace OpenSim.Grid.GridServer 34namespace OpenSim.Grid.GridServer
34{ 35{
35 [TypeExtensionPoint("/OpenSim/GridServer")] 36 [TypeExtensionPoint("/OpenSim/GridServer")]
36 public interface IGridPlugin 37 public interface IGridPlugin : IPlugin
37 { 38 {
38 void Initialise(GridServerBase gridServer); 39 void Initialise(GridServerBase gridServer);
39 void Close(); 40 void Close();