Fix loading modules with alternate configurations and ports into ROBUST.
Make all current modules support the configuration name option0.6.8-post-fixes
parent
6653a30487
commit
1096103d66
|
@ -41,7 +41,7 @@ namespace OpenSim.Server.Base
|
||||||
{
|
{
|
||||||
// Logger
|
// Logger
|
||||||
//
|
//
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
// The http server instance
|
// The http server instance
|
||||||
//
|
//
|
||||||
|
@ -55,8 +55,14 @@ namespace OpenSim.Server.Base
|
||||||
get { return m_HttpServer; }
|
get { return m_HttpServer; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public uint DefaultPort
|
||||||
|
{
|
||||||
|
get { return m_Port; }
|
||||||
|
}
|
||||||
|
|
||||||
public IHttpServer GetHttpServer(uint port)
|
public IHttpServer GetHttpServer(uint port)
|
||||||
{
|
{
|
||||||
|
m_Log.InfoFormat("[SERVER]: Requested port {0}", port);
|
||||||
if (port == m_Port)
|
if (port == m_Port)
|
||||||
return HttpServer;
|
return HttpServer;
|
||||||
|
|
||||||
|
@ -64,6 +70,8 @@ namespace OpenSim.Server.Base
|
||||||
return m_Servers[port];
|
return m_Servers[port];
|
||||||
|
|
||||||
m_Servers[port] = new BaseHttpServer(port);
|
m_Servers[port] = new BaseHttpServer(port);
|
||||||
|
m_Servers[port].Start();
|
||||||
|
|
||||||
return m_Servers[port];
|
return m_Servers[port];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,9 @@ namespace OpenSim.Server.Base
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
|
if (!(e is System.MissingMethodException))
|
||||||
|
m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return plug;
|
return plug;
|
||||||
|
|
|
@ -37,13 +37,17 @@ namespace OpenSim.Server.Handlers.Asset
|
||||||
public class AssetServiceConnector : ServiceConnector
|
public class AssetServiceConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IAssetService m_AssetService;
|
private IAssetService m_AssetService;
|
||||||
|
private string m_ConfigName = "AssetService";
|
||||||
|
|
||||||
public AssetServiceConnector(IConfigSource config, IHttpServer server) :
|
public AssetServiceConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["AssetService"];
|
if (configName != String.Empty)
|
||||||
|
m_ConfigName = configName;
|
||||||
|
|
||||||
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'Server' in config file");
|
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||||
|
|
||||||
string assetService = serverConfig.GetString("LocalServiceModule",
|
string assetService = serverConfig.GetString("LocalServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
@ -55,7 +59,6 @@ namespace OpenSim.Server.Handlers.Asset
|
||||||
m_AssetService =
|
m_AssetService =
|
||||||
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
||||||
|
|
||||||
//System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no"));
|
|
||||||
server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
|
server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
|
||||||
server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
|
server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
|
||||||
server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService));
|
server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService));
|
||||||
|
|
|
@ -37,13 +37,17 @@ namespace OpenSim.Server.Handlers.Authentication
|
||||||
public class AuthenticationServiceConnector : ServiceConnector
|
public class AuthenticationServiceConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IAuthenticationService m_AuthenticationService;
|
private IAuthenticationService m_AuthenticationService;
|
||||||
|
private string m_ConfigName = "AuthenticationService";
|
||||||
|
|
||||||
public AuthenticationServiceConnector(IConfigSource config, IHttpServer server) :
|
public AuthenticationServiceConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["AuthenticationService"];
|
if (configName != String.Empty)
|
||||||
|
m_ConfigName = configName;
|
||||||
|
|
||||||
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'Server' in config file");
|
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||||
|
|
||||||
string authenticationService = serverConfig.GetString("AuthenticationServiceModule",
|
string authenticationService = serverConfig.GetString("AuthenticationServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
|
|
@ -37,13 +37,16 @@ namespace OpenSim.Server.Handlers.Authorization
|
||||||
public class AuthorizationServerConnector : ServiceConnector
|
public class AuthorizationServerConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IAuthorizationService m_AuthorizationService;
|
private IAuthorizationService m_AuthorizationService;
|
||||||
|
private string m_ConfigName = "AuthorizationService";
|
||||||
|
|
||||||
public AuthorizationServerConnector(IConfigSource config, IHttpServer server) :
|
public AuthorizationServerConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["AuthorizationService"];
|
if (configName != String.Empty)
|
||||||
|
m_ConfigName = configName;
|
||||||
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'Server' in config file");
|
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||||
|
|
||||||
string authorizationService = serverConfig.GetString("LocalServiceModule",
|
string authorizationService = serverConfig.GetString("LocalServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Server.Handlers.Base
|
||||||
|
|
||||||
public class ServiceConnector : IServiceConnector
|
public class ServiceConnector : IServiceConnector
|
||||||
{
|
{
|
||||||
public ServiceConnector(IConfigSource config, IHttpServer server)
|
public ServiceConnector(IConfigSource config, IHttpServer server, string configName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,19 +37,23 @@ namespace OpenSim.Server.Handlers.Freeswitch
|
||||||
public class FreeswitchServerConnector : ServiceConnector
|
public class FreeswitchServerConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IFreeswitchService m_FreeswitchService;
|
private IFreeswitchService m_FreeswitchService;
|
||||||
|
private string m_ConfigName = "FreeswitchService";
|
||||||
|
|
||||||
public FreeswitchServerConnector(IConfigSource config, IHttpServer server) :
|
public FreeswitchServerConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["FreeswitchService"];
|
if (configName != String.Empty)
|
||||||
|
m_ConfigName = configName;
|
||||||
|
|
||||||
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'Server' in config file");
|
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||||
|
|
||||||
string freeswitchService = serverConfig.GetString("LocalServiceModule",
|
string freeswitchService = serverConfig.GetString("LocalServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
|
||||||
if (freeswitchService == String.Empty)
|
if (freeswitchService == String.Empty)
|
||||||
throw new Exception("No FreeswitchService in config file");
|
throw new Exception("No LocalServiceModule in config file");
|
||||||
|
|
||||||
Object[] args = new Object[] { config };
|
Object[] args = new Object[] { config };
|
||||||
m_FreeswitchService =
|
m_FreeswitchService =
|
||||||
|
|
|
@ -37,19 +37,20 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
public class GridServiceConnector : ServiceConnector
|
public class GridServiceConnector : ServiceConnector
|
||||||
{
|
{
|
||||||
private IGridService m_GridService;
|
private IGridService m_GridService;
|
||||||
|
private string m_ConfigName = "GridService";
|
||||||
|
|
||||||
public GridServiceConnector(IConfigSource config, IHttpServer server) :
|
public GridServiceConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["GridService"];
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'Server' in config file");
|
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
|
||||||
|
|
||||||
string gridService = serverConfig.GetString("LocalServiceModule",
|
string gridService = serverConfig.GetString("LocalServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
|
||||||
if (gridService == String.Empty)
|
if (gridService == String.Empty)
|
||||||
throw new Exception("No GridService in config file");
|
throw new Exception("No LocalServiceModule in config file");
|
||||||
|
|
||||||
Object[] args = new Object[] { config };
|
Object[] args = new Object[] { config };
|
||||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
private IHyperlinkService m_HyperlinkService;
|
private IHyperlinkService m_HyperlinkService;
|
||||||
|
|
||||||
public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) :
|
public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) :
|
||||||
base(config, server)
|
base(config, server, String.Empty)
|
||||||
{
|
{
|
||||||
m_HyperlinkService = hyperService;
|
m_HyperlinkService = hyperService;
|
||||||
server.AddXmlRPCHandler("link_region", LinkRegionRequest, false);
|
server.AddXmlRPCHandler("link_region", LinkRegionRequest, false);
|
||||||
|
|
|
@ -54,19 +54,20 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||||
//private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME);
|
//private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME);
|
||||||
|
|
||||||
private string m_userserver_url;
|
private string m_userserver_url;
|
||||||
|
private string m_ConfigName = "InventoryService";
|
||||||
|
|
||||||
public InventoryServiceInConnector(IConfigSource config, IHttpServer server) :
|
public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||||
base(config, server)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["InventoryService"];
|
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
throw new Exception("No section 'InventoryService' in config file");
|
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||||
|
|
||||||
string inventoryService = serverConfig.GetString("LocalServiceModule",
|
string inventoryService = serverConfig.GetString("LocalServiceModule",
|
||||||
String.Empty);
|
String.Empty);
|
||||||
|
|
||||||
if (inventoryService == String.Empty)
|
if (inventoryService == String.Empty)
|
||||||
throw new Exception("No InventoryService in config file");
|
throw new Exception("No LocalServiceModule in config file");
|
||||||
|
|
||||||
Object[] args = new Object[] { config };
|
Object[] args = new Object[] { config };
|
||||||
m_InventoryService =
|
m_InventoryService =
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Land
|
||||||
// TODO : private IAuthenticationService m_AuthenticationService;
|
// TODO : private IAuthenticationService m_AuthenticationService;
|
||||||
|
|
||||||
public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) :
|
public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) :
|
||||||
base(source, server)
|
base(source, server, String.Empty)
|
||||||
{
|
{
|
||||||
m_LandService = service;
|
m_LandService = service;
|
||||||
if (m_LandService == null)
|
if (m_LandService == null)
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Neighbour
|
||||||
private IAuthenticationService m_AuthenticationService = null;
|
private IAuthenticationService m_AuthenticationService = null;
|
||||||
|
|
||||||
public NeighbourServiceInConnector(IConfigSource source, IHttpServer server, INeighbourService nService, IScene scene) :
|
public NeighbourServiceInConnector(IConfigSource source, IHttpServer server, INeighbourService nService, IScene scene) :
|
||||||
base(source, server)
|
base(source, server, String.Empty)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_NeighbourService = nService;
|
m_NeighbourService = nService;
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
private IAuthenticationService m_AuthenticationService;
|
private IAuthenticationService m_AuthenticationService;
|
||||||
|
|
||||||
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
|
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
|
||||||
base(config, server)
|
base(config, server, String.Empty)
|
||||||
{
|
{
|
||||||
IConfig serverConfig = config.Configs["SimulationService"];
|
IConfig serverConfig = config.Configs["SimulationService"];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
|
|
|
@ -96,29 +96,23 @@ namespace OpenSim.Server
|
||||||
if (port != 0)
|
if (port != 0)
|
||||||
server = m_Server.GetHttpServer(port);
|
server = m_Server.GetHttpServer(port);
|
||||||
|
|
||||||
m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
|
if (port != m_Server.DefaultPort)
|
||||||
|
m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, port);
|
||||||
|
else
|
||||||
|
m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
|
||||||
|
|
||||||
IServiceConnector connector = null;
|
IServiceConnector connector = null;
|
||||||
try
|
|
||||||
{
|
Object[] modargs = new Object[] { m_Server.Config, server,
|
||||||
Object[] modargs = null;
|
configName };
|
||||||
if (configName != string.Empty)
|
connector = ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
||||||
{
|
modargs);
|
||||||
modargs = new Object[] { m_Server.Config, server,
|
if (connector == null)
|
||||||
configName };
|
|
||||||
connector = ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
|
||||||
modargs);
|
|
||||||
}
|
|
||||||
if (connector == null)
|
|
||||||
{
|
|
||||||
modargs = new Object[] { m_Server.Config, server };
|
|
||||||
connector =
|
|
||||||
ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
|
||||||
modargs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
{
|
||||||
|
modargs = new Object[] { m_Server.Config, server };
|
||||||
|
connector =
|
||||||
|
ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
||||||
|
modargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connector != null)
|
if (connector != null)
|
||||||
|
|
Loading…
Reference in New Issue