Changeset 8242
- Timestamp:
- 07/05/12 17:39:12 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 18 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab 3.3 Hive.Slave.sln
r7009 r8242 17 17 EndProject 18 18 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup-3.3", "HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup\HeuristicLab.Clients.Hive.Slave.WindowsServiceSetup.vdproj", "{C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}" 19 EndProject 20 Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "HeuristicLab.Clients.Hive.Slave.Azure", "HeuristicLab.Clients.Hive.Slave.Azure\HeuristicLab.Clients.Hive.Slave.Azure.ccproj", "{BB824120-4F6D-4DD9-B492-618063532515}" 21 EndProject 22 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.AzureClient-3.3", "HeuristicLab.Clients.Hive.Slave.AzureClient\3.3\HeuristicLab.Clients.Hive.Slave.AzureClient-3.3.csproj", "{D0DDC7C9-9215-4325-AA2F-0C4ABF809321}" 19 23 EndProject 20 24 Global … … 124 128 {C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x86.ActiveCfg = Release 125 129 {C16CA1A6-7AE8-4B87-A6A6-9C290E8B9646}.Release|x86.Build.0 = Release 130 {BB824120-4F6D-4DD9-B492-618063532515}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 131 {BB824120-4F6D-4DD9-B492-618063532515}.Debug|Any CPU.Build.0 = Debug|Any CPU 132 {BB824120-4F6D-4DD9-B492-618063532515}.Debug|x64.ActiveCfg = Debug|Any CPU 133 {BB824120-4F6D-4DD9-B492-618063532515}.Debug|x86.ActiveCfg = Debug|Any CPU 134 {BB824120-4F6D-4DD9-B492-618063532515}.Release|Any CPU.ActiveCfg = Release|Any CPU 135 {BB824120-4F6D-4DD9-B492-618063532515}.Release|Any CPU.Build.0 = Release|Any CPU 136 {BB824120-4F6D-4DD9-B492-618063532515}.Release|x64.ActiveCfg = Release|Any CPU 137 {BB824120-4F6D-4DD9-B492-618063532515}.Release|x86.ActiveCfg = Release|Any CPU 138 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 139 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Debug|Any CPU.Build.0 = Debug|Any CPU 140 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Debug|x64.ActiveCfg = Debug|Any CPU 141 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Debug|x86.ActiveCfg = Debug|Any CPU 142 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|Any CPU.ActiveCfg = Release|Any CPU 143 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|Any CPU.Build.0 = Release|Any CPU 144 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|x64.ActiveCfg = Release|Any CPU 145 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|x86.ActiveCfg = Release|Any CPU 126 146 EndGlobalSection 127 147 GlobalSection(SolutionProperties) = preSolution -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r7259 r8242 26 26 using System.Threading.Tasks; 27 27 using HeuristicLab.Clients.Hive.SlaveCore.Properties; 28 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;29 28 using HeuristicLab.Common; 30 29 using HeuristicLab.Core; … … 52 51 private ConfigManager configManager; 53 52 private PluginManager pluginManager; 54 55 public Core() { 53 private bool startClientComService; 54 55 public Core() 56 : this(true) { 57 } 58 59 public Core(bool startClientComService) { 56 60 var log = new ThreadSafeLog(Settings.Default.MaxLogCount); 57 61 this.pluginManager = new PluginManager(WcfService.Instance, log); … … 63 67 this.configManager = new ConfigManager(taskManager); 64 68 ConfigManager.Instance = this.configManager; 69 70 this.startClientComService = startClientComService; 65 71 } 66 72 … … 73 79 74 80 try { 75 //start the client communication service (pipe between slave and slave gui) 76 slaveComm = new ServiceHost(typeof(SlaveCommunicationService)); 77 slaveComm.Open(); 78 81 if (startClientComService) { 82 //start the client communication service (pipe between slave and slave gui) 83 slaveComm = new ServiceHost(typeof(SlaveCommunicationService)); 84 slaveComm.Open(); 85 } 86 79 87 // delete all left over task directories 80 88 pluginManager.CleanPluginTemp(); … … 96 104 } 97 105 ShutdownCore(); 98 } finally { 106 } 107 finally { 99 108 DeregisterServiceEvents(); 100 109 waitShutdownSem.Release(); … … 466 475 SlaveClientCom.Close(); 467 476 468 if (slaveComm.State != CommunicationState.Closed) 469 slaveComm.Close(); 477 if (startClientComService) { 478 if (slaveComm.State != CommunicationState.Closed) 479 slaveComm.Close(); 480 } 470 481 } 471 482 -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/HeuristicLab.Clients.Hive.Slave-3.3.csproj
r6983 r8242 128 128 <ItemGroup> 129 129 <Compile Include="Exceptions\TaskFailedException.cs" /> 130 <Compile Include="IClientCom.cs" /> 130 131 <Compile Include="Manager\ConfigManager.cs" /> 131 132 <Compile Include="Exceptions\SerializationException.cs" /> … … 142 143 <Compile Include="Exceptions\OutOfCoresException.cs" /> 143 144 <Compile Include="Exceptions\AppDomainNotCreatedException.cs" /> 145 <Compile Include="PipeCom.cs" /> 144 146 <Compile Include="SlaveClientCom.cs" /> 145 147 <Compile Include="Core.cs" /> … … 163 165 <Compile Include="SlaveStatusInfo.cs" /> 164 166 <Compile Include="StatusCommons.cs" /> 167 <Compile Include="TraceCom.cs" /> 165 168 <Compile Include="WcfService.cs" /> 166 169 <None Include="app.config" /> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.Designer.cs
r7777 r8242 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319. 5304 // Runtime Version:4.0.30319.269 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 311 311 } 312 312 } 313 314 [global::System.Configuration.UserScopedSettingAttribute()] 315 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 316 [global::System.Configuration.DefaultSettingValueAttribute("Trace")] 317 public global::HeuristicLab.Clients.Hive.SlaveCore.ClientComType ClientComType { 318 get { 319 return ((global::HeuristicLab.Clients.Hive.SlaveCore.ClientComType)(this["ClientComType"])); 320 } 321 set { 322 this["ClientComType"] = value; 323 } 324 } 313 325 } 314 326 } -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.settings
r7777 r8242 75 75 <Value Profile="(Default)">-1</Value> 76 76 </Setting> 77 <Setting Name="ClientComType" Type="HeuristicLab.Clients.Hive.SlaveCore.ClientComType" Scope="User"> 78 <Value Profile="(Default)">Trace</Value> 79 </Setting> 77 80 </Settings> 78 81 </SettingsFile> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/SlaveClientCom.cs
r7259 r8242 20 20 #endregion 21 21 22 using System .ServiceModel;22 using System; 23 23 using HeuristicLab.Clients.Hive.SlaveCore.Properties; 24 24 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts; 25 using System;26 25 27 26 namespace HeuristicLab.Clients.Hive.SlaveCore { 27 28 public enum ClientComType { Pipe, Trace }; 28 29 29 30 /// <summary> … … 32 33 public class SlaveClientCom { 33 34 private static SlaveClientCom instance; 34 private static DuplexChannelFactory<ISlaveCommunication> pipeFactory; 35 //private static DuplexChannelFactory<ISlaveCommunication> pipeFactory; 36 private static IClientCom clientComInstance; 35 37 public ISlaveCommunication ClientCom { get; set; } 36 38 … … 45 47 } 46 48 return instance; 49 } 50 } 51 52 public static IClientCom ClientComInstance { 53 get { 54 if (clientComInstance != null) { 55 return clientComInstance; 56 } 57 throw new NullReferenceException("No instance of SlaveClientCom<T>"); 47 58 } 48 59 } … … 67 78 68 79 private SlaveClientCom() { 69 SetupClientCom(); 70 } 80 ClientComType type = Settings.Default.ClientComType; 81 if (type == ClientComType.Pipe) { 82 clientComInstance = new PipeCom(); 83 } else if (type == ClientComType.Trace) { 84 clientComInstance = new TraceCom(); 85 } else { 86 throw new InvalidStateException("Invalid client communication type"); 87 } 71 88 72 private void SetupClientCom() { 73 DummyListener dummy = new DummyListener(); 74 try { 75 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, Settings.Default.SlaveCommunicationServiceEndpoint); 76 } 77 catch { 78 EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with config!"); 79 80 try { 81 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom")); 82 } 83 catch { 84 EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with fixed addresse!"); 85 return; 86 } 87 } 88 pipeFactory.Faulted += new System.EventHandler(pipeFactory_Faulted); 89 90 ISlaveCommunication pipeProxy = pipeFactory.CreateChannel(); 91 ClientCom = pipeProxy; 92 } 93 94 void pipeFactory_Faulted(object sender, System.EventArgs e) { 95 EventLogManager.LogMessage("SlaveClientCom just faulted. Trying to repair it..."); 96 97 try { 98 pipeFactory.Faulted -= new System.EventHandler(pipeFactory_Faulted); 99 SetupClientCom(); 100 } 101 catch { } 89 ClientCom = clientComInstance.GetSlaveCom(); 102 90 } 103 91 104 92 public static void Close() { 105 if (pipeFactory.State != CommunicationState.Closed && pipeFactory.State != CommunicationState.Faulted) 106 pipeFactory.Close(); 93 ClientComInstance.Close(); 107 94 } 108 95 } -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/app.config
r7777 r8242 9 9 <gcServer enabled="true" /> 10 10 </runtime> 11 12 11 <startup> 13 12 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 14 13 </startup> 15 16 14 <system.serviceModel> 17 15 <behaviors> … … 122 120 <value>-1</value> 123 121 </setting> 122 <setting name="ClientComType" serializeAs="String"> 123 <value>Trace</value> 124 </setting> 124 125 </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings> 125 126 </userSettings>
Note: See TracChangeset
for help on using the changeset viewer.