Changeset 997
- Timestamp:
- 12/16/08 22:20:13 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r993 r997 45 45 46 46 namespace HeuristicLab.Hive.Client.Core { 47 public class Core { 48 47 public class Core: MarshalByRefObject { 49 48 public delegate string GetASnapshotDelegate(); 50 49 51 50 Dictionary<long, Executor> engines = new Dictionary<long, Executor>(); 52 51 Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>(); 53 54 private ClientCommunicatorClient ccc; 52 55 53 private WcfService wcfService; 56 54 … … 146 144 void wcfService_PullJobCompleted(object sender, PullJobCompletedEventArgs e) { 147 145 if (e.Result.StatusMessage != ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOBS_LEFT) { 148 bool sandboxed = false;146 bool sandboxed = true; 149 147 150 148 PluginManager.Manager.Initialize(); 151 AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.JobId.ToString(), sandboxed, typeof(TestJob)); 149 AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.JobId.ToString(), sandboxed, typeof(TestJob)); 150 appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException); 151 152 152 appDomains.Add(e.Result.JobId, appDomain); 153 153 … … 190 190 return engines; 191 191 } 192 193 void appDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { 194 Logging.GetInstance().Error(this.ToString(), " Exception: " + e.ExceptionObject.ToString()); 195 } 192 196 } 193 197 } -
trunk/sources/HeuristicLab.Hive.Contracts/Properties/AssemblyInfo.frame
r744 r997 24 24 using System.Runtime.InteropServices; 25 25 using HeuristicLab.PluginInfrastructure; 26 using System.Security; 26 27 27 28 // General Information about an assembly is controlled through the following … … 36 37 [assembly: AssemblyTrademark("")] 37 38 [assembly: AssemblyCulture("")] 39 [assembly: AllowPartiallyTrustedCallers] 38 40 39 41 // Setting ComVisible to false makes the types in this assembly not visible -
trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs
r938 r997 161 161 162 162 public AppDomain CreateAndInitAppDomainWithSandbox(string friendlyName, bool sandboxed, Type jobType) { 163 164 163 PermissionSet pset; 164 165 DiscoveryService dService = new DiscoveryService(); 166 //get the declaring plugin of the job 167 PluginInfo jobPlugin = dService.GetDeclaringPlugin(jobType); 168 169 //get all the plugins that have dependencies with the jobplugin 170 List<PluginInfo> depPlugins = GetDependentPlugins(jobPlugin); 171 //insert all jobs into one list 172 depPlugins.Add(jobPlugin); 173 165 174 if (sandboxed) { 166 175 pset = new PermissionSet(PermissionState.None); 167 pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); 176 pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); 177 pset.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); 178 /*foreach (PluginInfo plugin in depPlugins) { 179 foreach(String assemblies in plugin.Assemblies) 180 pset.AddPermission(new FileIOPermission(FileIOPermissionAccess.Read, assemblies)); 181 }*/ 182 pset.AddPermission(new FileIOPermission(PermissionState.Unrestricted)); 168 183 } else { 169 184 pset = new PermissionSet(PermissionState.Unrestricted); … … 176 191 Runner remoteRunner = (Runner)applicationDomain.CreateInstanceAndUnwrap(typeof(Runner).Assembly.GetName().Name, typeof(Runner).FullName); 177 192 NotifyListeners(PluginManagerAction.Initializing, "All plugins"); 178 179 DiscoveryService dService = new DiscoveryService();180 PluginInfo jobPlugin = dService.GetDeclaringPlugin(jobType);181 182 List<PluginInfo> depPlugins = GetDependentPlugins(jobPlugin);183 depPlugins.Add(jobPlugin);184 193 185 194 if (depPlugins != null && depPlugins.Count > 0) { -
trunk/sources/HeuristicLab.PluginInfrastructure/Runner.cs
r886 r997 28 28 29 29 namespace HeuristicLab.PluginInfrastructure { 30 internalclass Runner : MarshalByRefObject {30 public class Runner : MarshalByRefObject { 31 31 32 32 public void LoadPlugins(ICollection<PluginInfo> plugins) {
Note: See TracChangeset
for help on using the changeset viewer.