Changeset 770 for trunk/sources
- Timestamp:
- 11/17/08 10:59:37 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Common/JobBase.cs
r768 r770 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 8 29 9 30 namespace HeuristicLab.Hive.Client.Common { 10 31 [Serializable] 11 32 abstract public class JobBase { 12 33 -
trunk/sources/HeuristicLab.Hive.Client.Common/MessageContainer.cs
r768 r770 30 30 /// the actual message itself and the JobId, refered by the message 31 31 /// </summary> 32 [Serializable] 32 33 public class MessageContainer { 33 34 -
trunk/sources/HeuristicLab.Hive.Client.Common/TestJob.cs
r768 r770 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 5 26 6 27 namespace HeuristicLab.Hive.Client.Common { 28 [Serializable] 7 29 public class TestJob: JobBase { 8 30 public override void Run() { -
trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager.cs
r742 r770 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r768 r770 27 27 using HeuristicLab.Hive.Client.Common; 28 28 using System.Threading; 29 using System.Reflection; 30 using System.Diagnostics; 31 using System.Security.Permissions; 32 using System.Security.Policy; 33 using System.Security; 29 34 30 35 … … 33 38 34 39 Dictionary<long, Executor> engines = new Dictionary<long, Executor>(); 35 40 Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>(); 41 42 public static StrongName CreateStrongName(Assembly assembly) { 43 if (assembly == null) 44 throw new ArgumentNullException("assembly"); 45 46 AssemblyName assemblyName = assembly.GetName(); 47 Debug.Assert(assemblyName != null, "Could not get assembly name"); 48 49 // get the public key blob 50 byte[] publicKey = assemblyName.GetPublicKey(); 51 if (publicKey == null || publicKey.Length == 0) 52 throw new InvalidOperationException("Assembly is not strongly named"); 53 54 StrongNamePublicKeyBlob keyBlob = new StrongNamePublicKeyBlob(publicKey); 55 56 // and create the StrongName 57 return new StrongName(keyBlob, assemblyName.Name, assemblyName.Version); 58 } 59 36 60 public void Start() { 37 61 Logging.getInstance().Info(this.ToString(), "Info Message"); … … 45 69 MessageQueue queue = MessageQueue.GetInstance(); 46 70 47 JobBase job = new TestJob(); 71 TestJob job = new TestJob(); 72 73 AppDomain appDomain = CreateNewAppDomain(false); 48 74 49 ExecutionEngine.Executor engine = new ExecutionEngine.Executor(); 75 //This is a HACK. remove static directory ASAP 76 //Executor engine = (Executor)appDomain.CreateInstanceFromAndUnwrap(@"C:\Program Files\HeuristicLab 3.0\plugins\HeuristicLab.Hive.Client.ExecutionEngine-3.2.dll", "HeuristicLab.Hive.Client.ExecutionEngine.Executor"); 77 78 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 79 //ExecutionEngine.Executor engine = new ExecutionEngine.Executor(); 50 80 engine.Job = job; 51 81 engine.JobId = 1L; … … 65 95 } 66 96 97 Assembly appDomain_TypeResolve(object sender, ResolveEventArgs args) { 98 throw new NotImplementedException(); 99 } 100 101 private AppDomain CreateNewAppDomain(bool sandboxed) { 102 PermissionSet pset; 103 if (sandboxed) { 104 pset = new PermissionSet(PermissionState.None); 105 pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); 106 } else { 107 pset = new PermissionSet(PermissionState.Unrestricted); 108 } 109 AppDomainSetup setup = new AppDomainSetup(); 110 setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; 111 //Temp Fix! 112 setup.PrivateBinPath = "plugins"; 113 return System.AppDomain.CreateDomain("appD", AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly())); 114 115 } 116 67 117 private void DetermineAction(MessageContainer container) { 68 118 if(container.Message == MessageContainer.MessageType.AbortJob) -
trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/ExecutionEnginePlugin.cs
r762 r770 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq;
Note: See TracChangeset
for help on using the changeset viewer.