- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/Manager/PluginManager.cs
r7259 r9363 27 27 using System.Runtime.Serialization.Formatters.Binary; 28 28 using System.Threading; 29 using HeuristicLab.Clients.Hive.SlaveCore.Properties;30 29 using HeuristicLab.Core; 30 using CoreProperties = HeuristicLab.Clients.Hive.SlaveCore.Properties; 31 31 32 32 namespace HeuristicLab.Clients.Hive.SlaveCore { 33 33 public class PluginManager { 34 34 private static object locker = new object(); 35 private string lastUsedFileName = Settings.Default.LastUsedFileName;35 private string lastUsedFileName = CoreProperties.Settings.Default.LastUsedFileName; 36 36 //maximum number of days after which a plugin gets deleted if not used 37 private int pluginLifetime = Settings.Default.PluginLifetime;37 private int pluginLifetime = CoreProperties.Settings.Default.PluginLifetime; 38 38 39 39 private string PluginCacheDir { get; set; } … … 46 46 this.pluginService = pluginService; 47 47 this.log = log; 48 PluginCacheDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.PluginCacheDir); 49 PluginTempBaseDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.PluginTempBaseDir); 48 CheckWorkingDirectories(); 49 PluginCacheDir = CoreProperties.Settings.Default.PluginCacheDir; 50 PluginTempBaseDir = CoreProperties.Settings.Default.PluginTempBaseDir; 50 51 DoUpdateRun(); 52 } 53 54 /// <summary> 55 /// Normally the configuration file just contains the folder names of the PluginCache and the AppDomain working directory. 56 /// This means that these folders are created in the current directory which is ok for the console client and the windows service. 57 /// For the HL client we can't do that because the plugin infrastructure gets confused when starting HeuristicLab. 58 /// Therefore if there is only a relative path in the config, we change that to the temp path. 59 /// </summary> 60 private void CheckWorkingDirectories() { 61 if (!Path.IsPathRooted(CoreProperties.Settings.Default.PluginCacheDir)) { 62 CoreProperties.Settings.Default.PluginCacheDir = Path.Combine(Path.GetTempPath(), CoreProperties.Settings.Default.PluginCacheDir); 63 CoreProperties.Settings.Default.Save(); 64 } 65 66 if (!Path.IsPathRooted(CoreProperties.Settings.Default.PluginTempBaseDir)) { 67 CoreProperties.Settings.Default.PluginTempBaseDir = Path.Combine(Path.GetTempPath(), CoreProperties.Settings.Default.PluginTempBaseDir); 68 CoreProperties.Settings.Default.Save(); 69 } 51 70 } 52 71 … … 85 104 } 86 105 87 if (requestedPlugin.Name == Settings.Default.ConfigurationName) {106 if (requestedPlugin.Name == CoreProperties.Settings.Default.ConfigurationName) { 88 107 // configuration plugin consists only of 1 file (usually the "HeuristicLab X.X.exe.config") 89 108 configFileName = Path.Combine(targetDir, Path.GetFileName(filePaths.SingleOrDefault())); … … 93 112 // copy files from PluginInfrastructure (which are not declared in any plugins) 94 113 string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 95 CopyFile(baseDir, targetDir, Settings.Default.PluginInfrastructureDll);96 CopyFile(baseDir, targetDir, Settings.Default.SharpZipLibDll);97 CopyFile(baseDir, targetDir, Settings.Default.SharpZipLibLicense);114 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.PluginInfrastructureDll); 115 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.SharpZipLibDll); 116 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.SharpZipLibLicense); 98 117 99 118 // copy slave plugins, otherwise its not possible to register the UnhandledException handler to the appdomain 100 CopyFile(baseDir, targetDir, Settings.Default.ClientsHiveSlaveCoreDll);101 CopyFile(baseDir, targetDir, Settings.Default.ClientsHiveDll);102 CopyFile(baseDir, targetDir, Settings.Default.HiveDll);103 CopyFile(baseDir, targetDir, Settings.Default.ClientsCommonDll);119 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsHiveSlaveCoreDll); 120 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsHiveDll); 121 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.HiveDll); 122 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsCommonDll); 104 123 } 105 124 … … 109 128 di.Refresh(); 110 129 while (di.Exists) { 111 Thread.Sleep( Settings.Default.DirOpSleepTime);130 Thread.Sleep(CoreProperties.Settings.Default.DirOpSleepTime); 112 131 di.Refresh(); 113 132 } … … 120 139 di = Directory.CreateDirectory(targetDir); 121 140 while (!di.Exists) { 122 Thread.Sleep( Settings.Default.DirOpSleepTime);141 Thread.Sleep(CoreProperties.Settings.Default.DirOpSleepTime); 123 142 di.Refresh(); 124 143 } … … 279 298 try { 280 299 log.LogMessage("Deleting plugins..."); 281 int tries = Settings.Default.PluginDeletionRetries;300 int tries = CoreProperties.Settings.Default.PluginDeletionRetries; 282 301 string path = Path.Combine(PluginTempBaseDir, id.ToString()); 283 302 while (tries > 0) { … … 287 306 } 288 307 catch (Exception) { 289 Thread.Sleep( Settings.Default.PluginDeletionTimeout);308 Thread.Sleep(CoreProperties.Settings.Default.PluginDeletionTimeout); 290 309 tries--; 291 310 if (tries == 0) throw;
Note: See TracChangeset
for help on using the changeset viewer.