From 5c92aa262a8c3916847b0b7e317d2f17c6f0b3c0 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 1 Apr 2012 15:58:26 -0400 Subject: [PATCH] Pass server up to IntegrationService to allow pluggins to register their handlers --- .../Integration/IntegrationServerConnector.cs | 2 +- .../IntegrationService/IntegrationService.cs | 5 +++-- .../IntegrationService/IntegrationServiceBase.cs | 12 ++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs b/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs index 69839d0299..5b7b0175d7 100644 --- a/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs +++ b/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs @@ -28,7 +28,7 @@ namespace OpenSim.Server.Handlers.Integration if (service == String.Empty) throw new Exception("No LocalServiceModule in config file"); - Object[] args = new Object[] { config }; + Object[] args = new Object[] { config, server }; m_IntegrationService = ServerUtils.LoadPlugin(service, args); server.AddStreamHandler(new IntegrationServerHandler(m_IntegrationService)); diff --git a/OpenSim/Services/IntegrationService/IntegrationService.cs b/OpenSim/Services/IntegrationService/IntegrationService.cs index 4ee2999741..549b88eaed 100644 --- a/OpenSim/Services/IntegrationService/IntegrationService.cs +++ b/OpenSim/Services/IntegrationService/IntegrationService.cs @@ -2,6 +2,7 @@ using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenSim.Framework; +using OpenSim.Framework.Servers.HttpServer; using GridRegion = OpenSim.Services.Interfaces.GridRegion; using OpenMetaverse; using Nini.Config; @@ -13,8 +14,8 @@ namespace OpenSim.Services.IntegrationService public class IntegrationService : IntegrationServiceBase, IIntegrationService { - public IntegrationService(IConfigSource config) - : base(config) + public IntegrationService(IConfigSource config, IHttpServer server) + : base(config, server) { } diff --git a/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs b/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs index 7d08576202..551affb52a 100644 --- a/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs +++ b/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs @@ -1,6 +1,7 @@ using System; using OpenSim.Services.Interfaces; using OpenSim.Services.Base; +using OpenSim.Framework.Servers.HttpServer; using System.Reflection; using Nini.Config; using OpenSim.Framework; @@ -23,17 +24,24 @@ namespace OpenSim.Services.IntegrationService { protected IPresenceService m_PresenceService; protected IGridService m_GridService; + protected IHttpServer m_Server; IConfig m_IntegrationServerConfig; - public IntegrationServiceBase(IConfigSource config) + public IntegrationServiceBase(IConfigSource config, IHttpServer server) : base(config) { Object[] args = new Object[] { config }; + + m_Server = server; + AddinManager.Initialize ("."); AddinManager.Registry.Update (); foreach (IntegrationPlugin cmd in AddinManager.GetExtensionObjects("/OpenSim/IntegrationService")) - cmd.run (); + { + cmd.run (); + server.AddStreamHandler((IRequestHandler)cmd); + } m_IntegrationServerConfig = config.Configs["IntegrationService"]; if (m_IntegrationServerConfig == null)