aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs16
-rw-r--r--OpenSim/Grid/GridServer/IGridPlugin.cs11
2 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 010c250..3cd7489 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Grid.GridServer
87 87
88 AddHttpHandlers(); 88 AddHttpHandlers();
89 89
90 LoadGridPlugins(); 90 LoadPlugins();
91 91
92 m_httpServer.Start(); 92 m_httpServer.Start();
93 93
@@ -116,16 +116,12 @@ 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 grid_plugin_initialiser_ (IPlugin plugin) 119 protected void LoadPlugins()
120 { 120 {
121 IGridPlugin p = plugin as IGridPlugin; 121 PluginLoader<IGridPlugin> loader =
122 p.Initialise (this); 122 new PluginLoader<IGridPlugin> (new GridPluginInitialiser (this));
123 }
124 123
125 protected void LoadGridPlugins() 124 loader.Load ("/OpenSim/GridServer", ".");
126 {
127 PluginLoader<IGridPlugin> loader = new PluginLoader<IGridPlugin> (".");
128 loader.Load ("/OpenSim/GridServer", grid_plugin_initialiser_);
129 m_plugins = loader.Plugins; 125 m_plugins = loader.Plugins;
130 } 126 }
131 127
@@ -181,7 +177,7 @@ namespace OpenSim.Grid.GridServer
181 177
182 public override void Shutdown() 178 public override void Shutdown()
183 { 179 {
184 foreach (IGridPlugin plugin in m_plugins) plugin.Close(); 180 foreach (IGridPlugin plugin in m_plugins) plugin.Dispose();
185 181
186 base.Shutdown(); 182 base.Shutdown();
187 } 183 }
diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs
index d51deb3..6593962 100644
--- a/OpenSim/Grid/GridServer/IGridPlugin.cs
+++ b/OpenSim/Grid/GridServer/IGridPlugin.cs
@@ -39,4 +39,15 @@ namespace OpenSim.Grid.GridServer
39 void Initialise(GridServerBase gridServer); 39 void Initialise(GridServerBase gridServer);
40 void Close(); 40 void Close();
41 } 41 }
42
43 public class GridPluginInitialiser : PluginInitialiserBase
44 {
45 private GridServerBase server;
46 public GridPluginInitialiser (GridServerBase s) { server = s; }
47 public override void Initialise (IPlugin plugin)
48 {
49 IGridPlugin p = plugin as IGridPlugin;
50 p.Initialise (server);
51 }
52 }
42} 53}