Some annotations for refactoring
parent
0fedc13fe6
commit
0b96019c5e
|
@ -43,7 +43,9 @@ using log4net;
|
|||
using Mono.Addins;
|
||||
using Ux = OpenSim.Services.IntegrationService.IntegrationUtils;
|
||||
|
||||
|
||||
// ****[ Robust ] Keep the core services here and rebrand it as a more generic
|
||||
// ****[ Robust ] service for use in buthe OpenSim.exe and Robust.exe
|
||||
//
|
||||
namespace OpenSim.Services.IntegrationService
|
||||
{
|
||||
public class IntegrationService : IntegrationServiceBase, IIntegrationService
|
||||
|
@ -62,6 +64,12 @@ namespace OpenSim.Services.IntegrationService
|
|||
}
|
||||
}
|
||||
|
||||
// ****[ Robust ] We have console commands to manage the repositories and modules.
|
||||
// ****[ Robust ] We can add/remove/enable/disable repositories and modules
|
||||
// ****[ Robust ] We can query repositories for available modules and updates
|
||||
// ****[ Robust ] The manager needs to be moved to OpenSim.Framework so we can
|
||||
// ****[ Robust ] use it to complete the region module loader
|
||||
//
|
||||
// Our console commands
|
||||
private void AddConsoleCommands()
|
||||
{
|
||||
|
@ -348,6 +356,10 @@ namespace OpenSim.Services.IntegrationService
|
|||
}
|
||||
#endregion
|
||||
|
||||
// ****[ Robust ] These are handlers that relate to the console commands, but
|
||||
// ****[ Robust ] are connecting to remote applications. It would be ok to do
|
||||
// ****[ Robust ] this later in a separate module
|
||||
//
|
||||
#region IIntegrationService implementation
|
||||
// Will hold back on implementing things here that can actually make changes
|
||||
// Need to secure it first
|
||||
|
|
|
@ -39,9 +39,18 @@ using Mono.Addins;
|
|||
using log4net;
|
||||
using Ux = OpenSim.Services.IntegrationService.IntegrationUtils;
|
||||
|
||||
|
||||
// ****[ Robust ] Re-factor to use in both OpenSim.exe and Robust.exe
|
||||
// ****[ Robust ] ** Loading can be done in modules that overide a base
|
||||
// ****[ Robust ] ** class that provides the base services for the
|
||||
// ****[ Robust ] ** discovery, loading and event queing of the modules
|
||||
|
||||
|
||||
// ****[ Robust ] We need to define our root to graft our modules into
|
||||
[assembly:AddinRoot("IntegrationService", "2.1")]
|
||||
namespace OpenSim.Services.IntegrationService
|
||||
{
|
||||
// ****[ Robust ] The name our modules look for as a dependency
|
||||
[TypeExtensionPoint(Path="/OpenSim/IntegrationService", Name="IntegrationService")]
|
||||
public interface IntegrationPlugin
|
||||
{
|
||||
|
@ -84,6 +93,11 @@ namespace OpenSim.Services.IntegrationService
|
|||
AddinRegistry registry ;
|
||||
bool DEVELOPMENT = serverConfig.GetBoolean("DevelopmentMode", false);
|
||||
|
||||
// ****[ Robust ] Would be able to load as a local Robust module,
|
||||
// ****[ Robust ] during development, by adding the info to the
|
||||
// ****[ Robust ] ServiceConnectors. Also allows modules to be
|
||||
// ****[ Robust ] loaded locally under normal operations
|
||||
//
|
||||
// Are we developing plugins? We will load them now.
|
||||
// This will allow debugging of the modules and will
|
||||
// use the runtime directory for the registry. Will not
|
||||
|
@ -119,6 +133,12 @@ namespace OpenSim.Services.IntegrationService
|
|||
}
|
||||
}
|
||||
}
|
||||
// ****[ Robust ] Place this in a loader that getsd called from
|
||||
// Robust after the main server is running
|
||||
//
|
||||
// ****[ Robust ] Make generic version of this to be overridden
|
||||
// ****[ Robust ] by OpenSim.exe and Robust.exe
|
||||
//
|
||||
else
|
||||
{
|
||||
// defaults to the ./bin directory
|
||||
|
@ -177,6 +197,9 @@ namespace OpenSim.Services.IntegrationService
|
|||
+ args.Exception.StackTrace);
|
||||
}
|
||||
|
||||
// ****[ Robust ] This is where we get control of the plugin during
|
||||
// ****[ Robust ] the loading and unloading
|
||||
//
|
||||
// This is our init
|
||||
// We can do build-up and tear-down of our plugin
|
||||
void OnExtensionChanged(object s, ExtensionNodeEventArgs args)
|
||||
|
@ -208,6 +231,14 @@ namespace OpenSim.Services.IntegrationService
|
|||
}
|
||||
#endregion addin-event handlers
|
||||
|
||||
// ****[ Robust ] We are taking the module from the event handler and
|
||||
// ****[ Robust ] taking it through the initialization process
|
||||
// ****[ Robust ] This is using a mixture of the user's existing ini
|
||||
// ****[ Robust ] and the developer supplied initial configuration
|
||||
// ****[ Robust ]
|
||||
// ****[ Robust ] We should first check the user's ini for existing entries
|
||||
// ****[ Robust ] in case they have configured the module ahead of time.
|
||||
//
|
||||
private void LoadingPlugin(IntegrationPlugin plugin)
|
||||
{
|
||||
string ConfigPath = String.Format("{0}/(1)", m_IntegrationConfigLoc,plugin.ConfigName);
|
||||
|
@ -240,6 +271,9 @@ namespace OpenSim.Services.IntegrationService
|
|||
plugin.Init(m_ConfigSource, PlugConfig, m_Server, this);
|
||||
}
|
||||
|
||||
// ****[ Robust ] We are taking the plugin from the event handler to unload it
|
||||
// ****[ Robust ] and we need to tear down to release all objects.
|
||||
//
|
||||
private void UnLoadingPlugin(IntegrationPlugin plugin)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -42,6 +42,10 @@ namespace OpenSim.Services.IntegrationService
|
|||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// ****[ Robust ] Only a couple of these are needed in the core management system
|
||||
// ****[ Robust ] These could be moved to the implementation instead of being in
|
||||
// ****[ Robust ] a separate file
|
||||
//
|
||||
#region web utils
|
||||
public static bool ParseStringToOSDMap(string input, out OSDMap json)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,16 @@ using Ux = OpenSim.Services.IntegrationService.IntegrationUtils;
|
|||
|
||||
namespace OpenSim.Services.IntegrationService
|
||||
{
|
||||
// ****[ Robust ] These are the functions that connect our console
|
||||
// ****[ Robust ] commands to the addin management. This needs to
|
||||
// ****[ Robust ] be maintained in a file separately from the main
|
||||
// ****[ Robust ] implementation in the same namespace. Any generaly
|
||||
// ****[ Robust ] usefull methods can be located in one of the existing
|
||||
// ****[ Robust ] places
|
||||
// ****[ Robust ]
|
||||
// ****[ Robust ] This needs to be in OpenSim.Framework so it can be
|
||||
// ****[ Robust ] used to complete the region module management
|
||||
//
|
||||
// This will maintain the plugin repositories and plugins
|
||||
public class PluginManager : SetupService
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue