12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using Nini.Config;
- using OpenSim.Server.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework.Servers.HttpServer;
- using OpenSim.Server.Handlers.Base;
- namespace OpenSim.Server.Handlers.Grid
- {
- public class GridServiceConnector : ServiceConnector
- {
- private IGridService m_GridService;
- private string m_ConfigName = "GridService";
- public GridServiceConnector(IConfigSource config, IHttpServer server, string configName) :
- base(config, server, configName)
- {
- IConfig serverConfig = config.Configs[m_ConfigName];
- if (serverConfig == null)
- throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
- string gridService = serverConfig.GetString("LocalServiceModule",
- String.Empty);
- if (gridService == String.Empty)
- throw new Exception("No LocalServiceModule in config file");
- Object[] args = new Object[] { config };
- m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
- server.AddStreamHandler(new GridServerPostHandler(m_GridService));
- }
- }
- }
|