more refactoring of the Grid server, to separate them into modules

GenericGridServerConcept
MW 2009-02-23 19:38:36 +00:00
parent 7d0790447e
commit 03ff84426f
2 changed files with 14 additions and 5 deletions

View File

@ -71,6 +71,9 @@ namespace OpenSim.Grid.GridServer
m_gridDBService = gridDBService;
m_gridCore = gridCore;
m_config = config;
m_gridCore.RegisterInterface<IGridMessagingModule>(this);
RegisterHandlers();
}
@ -84,7 +87,6 @@ namespace OpenSim.Grid.GridServer
//have these in separate method as some servers restart the http server and reregister all the handlers.
m_httpServer = m_gridCore.GetHttpServer();
m_gridCore.RegisterInterface<IGridMessagingModule>(this);
// Message Server ---> Grid Server
m_httpServer.AddXmlRPCHandler("register_messageserver", XmlRPCRegisterMessageServer);
m_httpServer.AddXmlRPCHandler("deregister_messageserver", XmlRPCDeRegisterMessageServer);

View File

@ -50,6 +50,7 @@ namespace OpenSim.Grid.GridServer
protected GridConfig m_config;
protected IGridMessagingModule m_messagingServerMapper;
/// <value>
/// Used to notify old regions as to which OpenSim version to upgrade to
/// </value>
@ -78,7 +79,11 @@ namespace OpenSim.Grid.GridServer
public void PostInitialise()
{
IGridMessagingModule messagingModule;
if (m_gridCore.TryGet<IGridMessagingModule>(out messagingModule))
{
m_messagingServerMapper = messagingModule;
}
}
public void RegisterHandlers()
@ -391,10 +396,12 @@ namespace OpenSim.Grid.GridServer
responseData["messageserver_count"] = 0;
IGridMessagingModule messagingModule;
if (m_gridCore.TryGet<IGridMessagingModule>(out messagingModule))
// IGridMessagingModule messagingModule;
// if (m_gridCore.TryGet<IGridMessagingModule>(out messagingModule))
//{
if(m_messagingServerMapper != null)
{
List<MessageServerInfo> messageServers = messagingModule.MessageServers;
List<MessageServerInfo> messageServers = m_messagingServerMapper.MessageServers;
responseData["messageserver_count"] = messageServers.Count;
for (int i = 0; i < messageServers.Count; i++)