A bit more refactoring of the GridServer. To make the "modules" share a common Initialise method.

GenericGridServerConcept
MW 2009-02-21 14:19:40 +00:00
parent fcb737c7f9
commit 65d413e5ee
4 changed files with 22 additions and 19 deletions

View File

@ -34,17 +34,18 @@ namespace OpenSim.Grid.GridServer
get { return _MessageServers; } get { return _MessageServers; }
} }
public GridMessagingModule(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config) public GridMessagingModule()
{
}
public void Initialise(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config)
{ {
m_opensimVersion = opensimVersion; m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService; m_gridDBService = gridDBService;
m_gridCore = gridCore; m_gridCore = gridCore;
m_config = config; m_config = config;
m_httpServer = m_gridCore.GetHttpServer(); m_httpServer = m_gridCore.GetHttpServer();
}
public void Initialise()
{
m_gridCore.RegisterInterface<IGridMessagingModule>(this); m_gridCore.RegisterInterface<IGridMessagingModule>(this);
// Message Server ---> Grid Server // Message Server ---> Grid Server
m_httpServer.AddXmlRPCHandler("register_messageserver", XmlRPCRegisterMessageServer); m_httpServer.AddXmlRPCHandler("register_messageserver", XmlRPCRegisterMessageServer);

View File

@ -62,17 +62,18 @@ namespace OpenSim.Grid.GridServer
/// <param name="opensimVersion"> /// <param name="opensimVersion">
/// Used to notify old regions as to which OpenSim version to upgrade to /// Used to notify old regions as to which OpenSim version to upgrade to
/// </param> /// </param>
public GridRestModule(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config) public GridRestModule()
{ {
m_opensimVersion = opensimVersion; }
public void Initialise(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config)
{
m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService; m_gridDBService = gridDBService;
m_gridCore = gridCore; m_gridCore = gridCore;
m_config = config; m_config = config;
m_httpServer = m_gridCore.GetHttpServer(); m_httpServer = m_gridCore.GetHttpServer();
}
public void Initialise()
{
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", RestGetSimMethod)); m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", RestGetSimMethod));
m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", RestSetSimMethod)); m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", RestSetSimMethod));

View File

@ -155,14 +155,14 @@ namespace OpenSim.Grid.GridServer
m_gridDBService = new GridDBService(); m_gridDBService = new GridDBService();
m_gridDBService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); m_gridDBService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect);
m_gridMessageModule = new GridMessagingModule(m_version, m_gridDBService, this, m_config); m_gridMessageModule = new GridMessagingModule();
m_gridMessageModule.Initialise(); m_gridMessageModule.Initialise(m_version, m_gridDBService, this, m_config);
m_gridXmlRpcModule = new GridXmlRpcModule(m_version, m_gridDBService, this, m_config); m_gridXmlRpcModule = new GridXmlRpcModule();
m_gridXmlRpcModule.Initialise(); m_gridXmlRpcModule.Initialise(m_version, m_gridDBService, this, m_config);
m_gridRestModule = new GridRestModule(m_version, m_gridDBService, this, m_config); m_gridRestModule = new GridRestModule();
m_gridRestModule.Initialise(); m_gridRestModule.Initialise(m_version, m_gridDBService, this, m_config);
} }
public void CheckSims(object sender, ElapsedEventArgs e) public void CheckSims(object sender, ElapsedEventArgs e)

View File

@ -63,17 +63,18 @@ namespace OpenSim.Grid.GridServer
/// <param name="opensimVersion"> /// <param name="opensimVersion">
/// Used to notify old regions as to which OpenSim version to upgrade to /// Used to notify old regions as to which OpenSim version to upgrade to
/// </param> /// </param>
public GridXmlRpcModule(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config) public GridXmlRpcModule()
{
}
public void Initialise(string opensimVersion, GridDBService gridDBService, IGridCore gridCore, GridConfig config)
{ {
m_opensimVersion = opensimVersion; m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService; m_gridDBService = gridDBService;
m_gridCore = gridCore; m_gridCore = gridCore;
m_config = config; m_config = config;
m_httpServer = m_gridCore.GetHttpServer(); m_httpServer = m_gridCore.GetHttpServer();
}
public void Initialise()
{
m_httpServer.AddXmlRPCHandler("simulator_login", XmlRpcSimulatorLoginMethod); m_httpServer.AddXmlRPCHandler("simulator_login", XmlRpcSimulatorLoginMethod);
m_httpServer.AddXmlRPCHandler("simulator_data_request", XmlRpcSimulatorDataRequestMethod); m_httpServer.AddXmlRPCHandler("simulator_data_request", XmlRpcSimulatorDataRequestMethod);
m_httpServer.AddXmlRPCHandler("simulator_after_region_moved", XmlRpcDeleteRegionMethod); m_httpServer.AddXmlRPCHandler("simulator_after_region_moved", XmlRpcDeleteRegionMethod);