* refactor: make startup a template method

0.6.0-stable
Justin Clarke Casey 2008-10-03 15:11:29 +00:00
parent 5c0a0bc2e0
commit 70124a3213
9 changed files with 21 additions and 25 deletions

View File

@ -95,6 +95,11 @@ namespace OpenSim.Framework.Servers
ThreadTracker.Add(Thread.CurrentThread); ThreadTracker.Add(Thread.CurrentThread);
} }
/// <summary>
/// Must be overriden by child classes for their own server specific startup behaviour.
/// </summary>
protected abstract void StartupSpecific();
/// <summary> /// <summary>
/// Print statistics to the logfile, if they are active /// Print statistics to the logfile, if they are active
/// </summary> /// </summary>
@ -207,6 +212,8 @@ namespace OpenSim.Framework.Servers
EnhanceVersionInformation(); EnhanceVersionInformation();
m_log.Info("[STARTUP]: Version: " + m_version + "\n"); m_log.Info("[STARTUP]: Version: " + m_version + "\n");
StartupSpecific();
} }
/// <summary> /// <summary>

View File

@ -80,10 +80,8 @@ namespace OpenSim.Grid.AssetServer
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml")));
m_log.Info("[ASSET]: Setting up asset DB"); m_log.Info("[ASSET]: Setting up asset DB");

View File

@ -73,10 +73,8 @@ namespace OpenSim.Grid.GridServer
} }
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
SetupGridManager(); SetupGridManager();

View File

@ -62,10 +62,8 @@ namespace OpenSim.Grid.InventoryServer
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
m_inventoryService = new GridInventoryService(config.UserServerURL); m_inventoryService = new GridInventoryService(config.UserServerURL);

View File

@ -56,8 +56,6 @@ namespace OpenSim.Grid.MessagingServer
m_log.Info("Launching MessagingServer..."); m_log.Info("Launching MessagingServer...");
OpenMessage_Main messageserver = new OpenMessage_Main(); OpenMessage_Main messageserver = new OpenMessage_Main();
messageserver.Startup(); messageserver.Startup();
@ -80,10 +78,8 @@ namespace OpenSim.Grid.MessagingServer
} }
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml")));
m_log.Info("[REGION]: Starting HTTP process"); m_log.Info("[REGION]: Starting HTTP process");

View File

@ -88,10 +88,8 @@ namespace OpenSim.Grid.UserServer
} }
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
m_stats = StatsManager.StartCollectingUserStats(); m_stats = StatsManager.StartCollectingUserStats();

View File

@ -363,9 +363,9 @@ namespace OpenSim
/// <summary> /// <summary>
/// Performs initialisation of the scene, such as loading configuration from disk. /// Performs initialisation of the scene, such as loading configuration from disk.
/// </summary> /// </summary>
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup(); base.StartupSpecific();
m_stats = StatsManager.StartCollectingSimExtraStats(); m_stats = StatsManager.StartCollectingSimExtraStats();

View File

@ -44,6 +44,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private static readonly log4net.ILog m_log private static readonly log4net.ILog m_log
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Is throttling enabled at all?
/// </summary>
private bool m_enabled = true; private bool m_enabled = true;
private OpenSim.Framework.BlockingQueue<LLQueItem> SendQueue; private OpenSim.Framework.BlockingQueue<LLQueItem> SendQueue;

View File

@ -71,10 +71,8 @@ namespace OpenSim.Region.ClientStack
get { return m_sceneManager; } get { return m_sceneManager; }
} }
public override void Startup() protected override void StartupSpecific()
{ {
base.Startup();
m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString);
m_clientStackManager = CreateClientStackManager(); m_clientStackManager = CreateClientStackManager();