Some formatting changes
							parent
							
								
									1352a38680
								
							
						
					
					
						commit
						afa2d7eea3
					
				|  | @ -95,7 +95,7 @@ namespace OpenSim.Server.Handlers.Integration | |||
|                         return HandleUnInstallPlugin(request); | ||||
| 
 | ||||
|                     case "enable_plugin": | ||||
|                         return HandleEnablePlugin (request); | ||||
|                         return HandleEnablePlugin(request); | ||||
| 
 | ||||
|                     case "disable_plugin": | ||||
|                         return HandleDisblePlugin(request); | ||||
|  | @ -104,7 +104,7 @@ namespace OpenSim.Server.Handlers.Integration | |||
|                         return HandlePluginInfo(request); | ||||
| 
 | ||||
|                     case "list_repos": | ||||
|                         return HandleListRepositories (request); | ||||
|                         return HandleListRepositories(request); | ||||
| 
 | ||||
|                     case "add_repo": | ||||
|                         return HandleAddRepository(request); | ||||
|  | @ -124,7 +124,7 @@ namespace OpenSim.Server.Handlers.Integration | |||
|                             command.Length, | ||||
|                             command | ||||
|                         ); | ||||
|                         return FailureResult ("IntegrationHandler: Unrecognized method requested!"); | ||||
|                         return FailureResult("IntegrationHandler: Unrecognized method requested!"); | ||||
|                 } | ||||
|             } | ||||
|             catch (Exception e) | ||||
|  |  | |||
|  | @ -29,20 +29,13 @@ using System; | |||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Reflection; | ||||
| using System.Linq; | ||||
| using OpenSim.Server.Base; | ||||
| using OpenSim.Services.Interfaces; | ||||
| using OpenSim.Framework; | ||||
| using OpenSim.Framework.Servers.HttpServer; | ||||
| using OpenSim.Services.Interfaces; | ||||
| using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||||
| using OpenMetaverse; | ||||
| using OpenMetaverse.StructuredData; | ||||
| using Nini.Config; | ||||
| using log4net; | ||||
| using Mono.Addins; | ||||
| 
 | ||||
| using Ux = OpenSim.Services.IntegrationService.IntegrationUtils; | ||||
| 
 | ||||
| 
 | ||||
| namespace OpenSim.Services.IntegrationService | ||||
| { | ||||
|     public class IntegrationService : IntegrationServiceBase, IIntegrationService | ||||
|  | @ -358,22 +351,22 @@ namespace OpenSim.Services.IntegrationService | |||
|             return Ux.DocToBytes(json); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebAddRepository (OSDMap request) | ||||
|         public byte[] HandleWebAddRepository(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebRemoveRepositroy (OSDMap request) | ||||
|         public byte[] HandleWebRemoveRepositroy(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleEnableRepository (OSDMap request) | ||||
|         public byte[] HandleEnableRepository(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebDisableRepository (OSDMap request) | ||||
|         public byte[] HandleWebDisableRepository(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
|  | @ -426,17 +419,17 @@ namespace OpenSim.Services.IntegrationService | |||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebUnInstallPlugin (OSDMap request) | ||||
|         public byte[] HandleWebUnInstallPlugin(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebEnablePlugin (OSDMap request) | ||||
|         public byte[] HandleWebEnablePlugin(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
| 
 | ||||
|         public byte[] HandleWebDisablePlugin (OSDMap request) | ||||
|         public byte[] HandleWebDisablePlugin(OSDMap request) | ||||
|         { | ||||
|             return Ux.FailureResult("Not Implemented"); | ||||
|         } | ||||
|  |  | |||
|  | @ -27,22 +27,19 @@ | |||
| 
 | ||||
| using System; | ||||
| using System.IO; | ||||
| using OpenSim.Services.Interfaces; | ||||
| using OpenSim.Services.Base; | ||||
| using OpenSim.Framework.Servers.HttpServer; | ||||
| using System.Reflection; | ||||
| using Nini.Config; | ||||
| using OpenSim.Framework; | ||||
| using OpenSim.Framework.Servers.HttpServer; | ||||
| using OpenSim.Services.Base; | ||||
| using OpenSim.Services.Interfaces; | ||||
| using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||||
| using Mono.Addins; | ||||
| using log4net; | ||||
| 
 | ||||
| using Ux = OpenSim.Services.IntegrationService.IntegrationUtils; | ||||
| 
 | ||||
| [assembly:AddinRoot ("IntegrationService", "2.1")] | ||||
| 
 | ||||
| [assembly:AddinRoot("IntegrationService", "2.1")] | ||||
| namespace OpenSim.Services.IntegrationService | ||||
| { | ||||
|     [TypeExtensionPoint (Path="/OpenSim/IntegrationService", Name="IntegrationService")] | ||||
|     [TypeExtensionPoint(Path="/OpenSim/IntegrationService", Name="IntegrationService")] | ||||
|     public interface IntegrationPlugin | ||||
|     { | ||||
|         void Init(IConfigSource MainConfig, IConfigSource PluginConfig, IHttpServer server, ServiceBase service); | ||||
|  | @ -90,16 +87,16 @@ namespace OpenSim.Services.IntegrationService | |||
|             // be able to use the repo/registry commands ... | ||||
|             if (DEVELOPMENT == true) | ||||
|             { | ||||
|                 AddinManager.Initialize ("."); | ||||
|                 AddinManager.Initialize("."); | ||||
|                 registry = new AddinRegistry(".", "."); | ||||
|                 registry.Update (); | ||||
|                 registry.Update(); | ||||
|      | ||||
|                 AddinManager.AddinLoaded += on_addinloaded_; | ||||
|                 AddinManager.AddinLoadError += on_addinloaderror_; | ||||
|                 AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded; | ||||
|                 AddinManager.AddinEngine.ExtensionChanged += HandleAddinManagerAddinEngineExtensionChanged; | ||||
|      | ||||
|                 registry.Update (); | ||||
|                 registry.Update(); | ||||
|                 foreach (IntegrationPlugin cmd in AddinManager.GetExtensionObjects("/OpenSim/IntegrationService")) | ||||
|                 { | ||||
|                     m_log.DebugFormat("[INTEGRATION SERVICE]: Processing _Addin {0}", cmd.PluginName); | ||||
|  | @ -140,20 +137,20 @@ namespace OpenSim.Services.IntegrationService | |||
|                     return; | ||||
|                 } | ||||
|      | ||||
|                 AddinManager.Initialize (RegistryLocation); | ||||
|                 AddinManager.Registry.Update (); | ||||
|                 AddinManager.Initialize(RegistryLocation); | ||||
|                 AddinManager.Registry.Update(); | ||||
| 
 | ||||
|                 AddinManager.AddinLoaded += on_addinloaded_; | ||||
|                 AddinManager.AddinLoadError += on_addinloaderror_; | ||||
|                 AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded; | ||||
|                 AddinManager.AddExtensionNodeHandler ("/OpenSim/IntegrationService", OnExtensionChanged); | ||||
|                 AddinManager.AddExtensionNodeHandler("/OpenSim/IntegrationService", OnExtensionChanged); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         #region addin event handlers | ||||
|         void HandleAddinManagerAddinEngineExtensionChanged (object sender, ExtensionEventArgs args) | ||||
|         void HandleAddinManagerAddinEngineExtensionChanged(object sender, ExtensionEventArgs args) | ||||
|         { | ||||
|             MainConsole.Instance.Output(String.Format ("Plugin Extension Change Path:{0}", args.Path)); | ||||
|             MainConsole.Instance.Output(String.Format("Plugin Extension Change Path:{0}", args.Path)); | ||||
|         } | ||||
| 
 | ||||
|         private IConfigSource GetConfig(string configName) | ||||
|  | @ -161,7 +158,7 @@ namespace OpenSim.Services.IntegrationService | |||
|             return new IniConfigSource(); | ||||
|         } | ||||
| 
 | ||||
|         void HandleAddinManagerAddinUnloaded (object sender, AddinEventArgs args) | ||||
|         void HandleAddinManagerAddinUnloaded(object sender, AddinEventArgs args) | ||||
|         { | ||||
|             MainConsole.Instance.Output("Plugin Unloaded"); | ||||
|         } | ||||
|  | @ -169,20 +166,20 @@ namespace OpenSim.Services.IntegrationService | |||
|         private void on_addinloaderror_(object sender, AddinErrorEventArgs args) | ||||
|         { | ||||
|             if (args.Exception == null) | ||||
|                 m_log.Error ("[INTEGRATION SERVICE]: Plugin Error: " | ||||
|                 m_log.Error("[INTEGRATION SERVICE]: Plugin Error: " | ||||
|                         + args.Message); | ||||
|             else | ||||
|                 m_log.Error ("[INTEGRATION SERVICE]: Plugin Error: " | ||||
|                 m_log.Error("[INTEGRATION SERVICE]: Plugin Error: " | ||||
|                         + args.Exception.Message + "\n" | ||||
|                         + args.Exception.StackTrace); | ||||
|         } | ||||
| 
 | ||||
|         // This is our init | ||||
|         // We can do build-up and tear-down of our plugin | ||||
|         void OnExtensionChanged (object s, ExtensionNodeEventArgs args) | ||||
|         void OnExtensionChanged(object s, ExtensionNodeEventArgs args) | ||||
|         { | ||||
|             IntegrationPlugin ip = (IntegrationPlugin) args.ExtensionObject; | ||||
|             m_log.Info ("[INTEGRATION SERVICE]: Plugin Change"); | ||||
|             m_log.Info("[INTEGRATION SERVICE]: Plugin Change"); | ||||
| 
 | ||||
|             switch (args.Change) | ||||
|             { | ||||
|  | @ -204,7 +201,7 @@ namespace OpenSim.Services.IntegrationService | |||
| 
 | ||||
|         private void on_addinloaded_(object sender, AddinEventArgs args) | ||||
|         { | ||||
|             m_log.Info ("[INTEGRATION SERVICE]: Plugin Loaded: " + args.AddinId); | ||||
|             m_log.Info("[INTEGRATION SERVICE]: Plugin Loaded: " + args.AddinId); | ||||
|         } | ||||
|         #endregion addin-event handlers | ||||
| 
 | ||||
|  | @ -228,7 +225,7 @@ namespace OpenSim.Services.IntegrationService | |||
|                 IniConfigSource source = new IniConfigSource(); | ||||
|                 IConfig Init = source.AddConfig("DatabaseService"); | ||||
|                 Init.Set("StorageProvider",(string)DataService.GetString("StorageProvider")); | ||||
| 				Init.Set("ConnectionString", String.Format ("\"{0}\"",DataService.GetString("ConnectionString"))); | ||||
| 				Init.Set("ConnectionString", String.Format("\"{0}\"",DataService.GetString("ConnectionString"))); | ||||
| 
 | ||||
|                 PlugConfig = Ux.LoadInitialConfig(plugin.DefaultConfig); | ||||
|                 source.Merge(PlugConfig); | ||||
|  |  | |||
|  | @ -50,7 +50,7 @@ namespace OpenSim.Services.IntegrationService | |||
|         /// <param name='r'> | ||||
|         /// R. | ||||
|         /// </param> | ||||
|         internal PluginManager( AddinRegistry r): base (r) | ||||
|         internal PluginManager(AddinRegistry r): base (r) | ||||
|         { | ||||
|             m_Registry = r; | ||||
|             m_Registry.Update(); | ||||
|  | @ -228,7 +228,7 @@ namespace OpenSim.Services.IntegrationService | |||
|         public string Update() | ||||
|         { | ||||
|             IProgressStatus ps = new ConsoleProgressStatus(true); | ||||
|             Repositories.UpdateAllRepositories (ps); | ||||
|             Repositories.UpdateAllRepositories(ps); | ||||
|             return "Update"; | ||||
|         } | ||||
| 
 | ||||
|  | @ -266,7 +266,7 @@ namespace OpenSim.Services.IntegrationService | |||
|         public void RemoveRepository(string[] args) | ||||
|         { | ||||
|             AddinRepository[] reps = Repositories.GetRepositories(); | ||||
|             Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             if (reps.Length == 0) | ||||
|             { | ||||
|                 MainConsole.Instance.Output("No repositories have been registered."); | ||||
|  | @ -281,7 +281,7 @@ namespace OpenSim.Services.IntegrationService | |||
|             } | ||||
| 
 | ||||
|             AddinRepository rep = reps[n]; | ||||
|             Repositories.RemoveRepository (rep.Url); | ||||
|             Repositories.RemoveRepository(rep.Url); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|  | @ -295,7 +295,7 @@ namespace OpenSim.Services.IntegrationService | |||
|         public void EnableRepository(string[] args) | ||||
|         { | ||||
|             AddinRepository[] reps = Repositories.GetRepositories(); | ||||
|             Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             if (reps.Length == 0) | ||||
|             { | ||||
|                 MainConsole.Instance.Output("No repositories have been registered."); | ||||
|  | @ -324,7 +324,7 @@ namespace OpenSim.Services.IntegrationService | |||
|         public void DisableRepository(string[] args) | ||||
|         { | ||||
|             AddinRepository[] reps = Repositories.GetRepositories(); | ||||
|             Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); | ||||
|             if (reps.Length == 0) | ||||
|             { | ||||
|                 MainConsole.Instance.Output("No repositories have been registered."); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 BlueWall
						BlueWall