Changeset 4140


Ignore:
Timestamp:
08/03/10 17:20:46 (12 years ago)
Author:
kgrading
Message:

#828 added various improvements to the plugin cache manager, the execution engine, the transaction handling on the serverside and the server console

Location:
branches/3.2/sources
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs

    r3931 r4140  
    462462      }
    463463    }
    464 
    465464  }
    466465}
  • branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs

    r4042 r4140  
    4545using HeuristicLab.Hive.Client.Core.JobStorage;
    4646using HeuristicLab.Tracing;
     47using System.IO;
    4748
    4849namespace HeuristicLab.Hive.Client.Core {
     
    135136
    136137        case MessageContainer.MessageType.JobAborted:         
    137         //todo: thread this         
    138           lock (engines) {
    139             Guid jobId = new Guid(container.JobId.ToString());
    140             if (engines.ContainsKey(jobId)) {
    141               appDomains[jobId].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    142               AppDomain.Unload(appDomains[jobId]);
    143               appDomains.Remove(jobId);
    144               engines.Remove(jobId);
    145               jobs.Remove(jobId);
    146               GC.Collect();
    147             } else
    148               Logger.Error("JobAbort: Engine doesn't exist");
    149           }
     138          Guid jobId = new Guid(container.JobId.ToString());
     139          KillAppDomain(jobId);
    150140          break;
    151141
     
    252242            sJob,
    253243            1,
    254             null,
     244            engines[jId].CurrentException,
    255245            true);
    256246        } else {
    257247          Logger.Info("Storing the finished job with id: " + jId + " to hdd");
    258248          JobStorageManager.PersistObjectToDisc(wcfService.ServerIP, wcfService.ServerPort, jId, sJob);
    259           lock (engines) {
    260             appDomains[jId].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    261            
    262             //Disposing it
    263             engines[jId].Dispose();
    264            
    265             AppDomain.Unload(appDomains[jId]);
    266             Logger.Debug("Unloaded appdomain");
    267             appDomains.Remove(jId);           
    268             engines.Remove(jId);           
    269             jobs.Remove(jId);
    270             Logger.Debug("Removed job from appDomains, Engines and Jobs");
    271           }
     249          KillAppDomain(jId);
    272250        }
    273251      }
     
    339317        PluginCache.Instance.PreparePlugins(e.Result.Job.PluginsNeeded);
    340318
    341 //        foreach (CachedHivePluginInfoDto plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded))
    342   //        files.AddRange(plugininfo.PluginFiles);
     319        PluginCache.Instance.CopyPluginsForJob(e.Result.Job.PluginsNeeded, e.Result.Job.Id);
     320
    343321        Logger.Debug("Plugins fetched for job " + e.Result.Job.Id);
    344322        try {
     323          String pluginDir = Path.Combine(PluginCache.PLUGIN_REPO, e.Result.Job.Id.ToString());
    345324          AppDomain appDomain =
    346             HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(
    347               e.Result.Job.Id.ToString(), null);
     325            HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(pluginDir, null);
    348326          appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    349327          lock (engines) {
     
    372350          CurrentlyFetching = false;
    373351          KillAppDomain(e.Result.Job.Id);
     352          wcfService.StoreFinishedJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, e.Result.Job.Id, new byte[] { },
     353                                                 1, exception, true);
    374354        }
    375355      } else
     
    504484          engines.Remove(id);
    505485          jobs.Remove(id);
     486          PluginCache.Instance.DeletePluginsForJob(id);
    506487          GC.Collect();
    507488        }
  • branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/PluginCache.cs

    r4042 r4140  
    22using System.Collections.Generic;
    33using System.Linq;
     4using System.Runtime.CompilerServices;
    45using System.Text;
    56using HeuristicLab.PluginInfrastructure;
     
    910using HeuristicLab.Tracing;
    1011using System.IO;
     12using HeuristicLab.PluginInfrastructure.Manager;
    1113
    1214namespace HeuristicLab.Hive.Client.Core {
     15
     16 
     17
    1318  public class PluginCache {
    1419
    1520    private static PluginCache instance = null;
     21
     22    public const string PLUGIN_REPO = @"plugins\";
     23
     24    private List<PluginDescription> cachedPlugins = new List<PluginDescription>();
     25
     26    private PluginManager pm = new PluginManager(PLUGIN_REPO);
     27 
    1628    public static PluginCache Instance {
    1729      get {
     
    2234    }
    2335   
    24     private List<CachedHivePluginInfoDto> pluginCache;
    25    
    2636
    27     public PluginCache() {
    28       pluginCache = new List<CachedHivePluginInfoDto>();
    29     }
    30    
    31     public void AddPlugin(CachedHivePluginInfoDto plugin) {
    32       pluginCache.Add(plugin);   
     37    public PluginCache() {     
     38      DoUpdateRun();
    3339    }
    3440
    35     public List<CachedHivePluginInfoDto> GetPlugins(List<HivePluginInfoDto> requests) {
     41    private void DoUpdateRun() {
     42      pm.DiscoverAndCheckPlugins();
     43      cachedPlugins = new List<PluginDescription>(pm.Plugins);
     44    }
     45
     46
     47    [MethodImpl(MethodImplOptions.Synchronized)]
     48    public bool CopyPluginsForJob(List<HivePluginInfoDto> requests, Guid jobId) {
     49
     50      String targetDir = PLUGIN_REPO + jobId.ToString() + "\\";
     51
     52      if(Directory.Exists(targetDir)) {
     53        Directory.Delete(targetDir, true);
     54      }
     55
     56      DirectoryInfo di = Directory.CreateDirectory(targetDir);
     57
     58      foreach (HivePluginInfoDto requestedPlugin in requests) {
     59        PluginDescription pd =
     60          cachedPlugins.Where(
     61            cp =>
     62            cp.Name == requestedPlugin.Name &&
     63            cp.Version.Major == requestedPlugin.Version.Major &&
     64            cp.Version.Minor == requestedPlugin.Version.Minor &&
     65            cp.Version.Revision >= requestedPlugin.Version.Revision).
     66            SingleOrDefault();
     67        if (pd == null) {
     68          return false;
     69        }
     70
     71        foreach(IPluginFile ipf in pd.Files) {
     72          File.Copy(ipf.Name, targetDir + ipf.Name.Split('\\').Last());
     73        }
     74      }
     75      return true;                                                                                                       
     76    }
     77
     78    [MethodImpl(MethodImplOptions.Synchronized)]
     79    internal void PreparePlugins(List<HivePluginInfoDto> requiredPlugins) {
    3680      Logger.Debug("Fetching plugins for job");
    37       List<CachedHivePluginInfoDto> neededPlugins = new List<CachedHivePluginInfoDto>();
     81      List<HivePluginInfoDto> localPlugins = new List<HivePluginInfoDto>();
     82      List<HivePluginInfoDto> neededPlugins = new List<HivePluginInfoDto>();
    3883      List<HivePluginInfoDto> missingPlugins = new List<HivePluginInfoDto>();
    3984      bool found = false;
    40            
    41       foreach (HivePluginInfoDto info in requests) {
     85
     86      foreach (HivePluginInfoDto info in requiredPlugins) {
    4287        //we MAY run in problems here - if there is a plugin twice in requests, there may be added two different versions of the plugin
    43         foreach (CachedHivePluginInfoDto cache in pluginCache) {
    44           if (info.Name.Equals(cache.Name) && info.Version.Equals(cache.Version) && info.BuildDate <= cache.BuildDate) {
     88        foreach (PluginDescription cachedPlugin in cachedPlugins) {
     89          if (info.Name.Equals(cachedPlugin.Name)) {
    4590            Logger.Debug("Found plugin " + info.Name + ", " + info.Version);
    46             neededPlugins.Add(cache);
     91            localPlugins.Add(new HivePluginInfoDto() { BuildDate = DateTime.Now, Id = new Guid(), Name = info.Name, Version = info.Version, Update =  true});
     92            neededPlugins.Add(info);
    4793            found = true;
     94
    4895            break;
    4996          }
    5097        }
    51         if (!found)
    52           Logger.Debug("Found NOT found " + info.Name + ", " + info.Version);
     98        if (!found) {
     99          Logger.Debug("Plugin NOT found " + info.Name + ", " + info.Version);
    53100          missingPlugins.Add(info);
     101        }
    54102        found = false;
    55103      }
    56104
    57       Logger.Debug("Requesting missing plugins");
    58       List<CachedHivePluginInfoDto> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);
    59       Logger.Debug("Requested missing plugins");
     105      Logger.Debug("First run - Update the plugins in the cache");
    60106
    61       if (receivedPlugins != null) {
    62         neededPlugins.AddRange(receivedPlugins);
    63         pluginCache.AddRange(receivedPlugins);
    64       } else
    65         Logger.Error("Fetching of the plugins failed!");
     107      localPlugins.AddRange(missingPlugins);
    66108
    67       return neededPlugins;
     109      List<CachedHivePluginInfoDto> updateablePlugins = WcfService.Instance.RequestPlugins(localPlugins);     
     110
     111      foreach (CachedHivePluginInfoDto updateablePlugin in updateablePlugins) {
     112        PluginDescription pd =
     113          cachedPlugins.Where(cachedPlugin => cachedPlugin.Name.Equals(updateablePlugin.Name)).SingleOrDefault();
     114
     115        if (pd != null) {
     116          Logger.Debug("deleting old files");
     117          foreach (IPluginFile ipf in pd.Files) {
     118            File.Delete(ipf.Name);
     119          }
     120        }
     121
     122        Logger.Debug("deleted old files");
     123        Logger.Debug("creating new files");
     124
     125       
     126
     127        foreach (HivePluginFile pf in updateablePlugin.PluginFiles) {
     128          File.WriteAllBytes(PLUGIN_REPO + pf.Name.Split('\\').Last(), pf.BinaryFile);
     129        }
     130
     131        Logger.Debug("created new files");
     132        DoUpdateRun();
     133      }
    68134    }
    69135
    70 
    71     internal void PreparePlugins(List<HivePluginInfoDto> requiredPlugins) {
    72       List<HivePluginInfoDto> missingPlugins = new List<HivePluginInfoDto>();
    73       foreach (HivePluginInfoDto requiredPlugin in requiredPlugins) {
    74         if(ApplicationManager.Manager.Plugins.Count(ipd => ipd.Version.Major == requiredPlugin.Version.Major && ipd.Version.Minor >= requiredPlugin.Version.Minor) == 0) {
    75           missingPlugins.Add(requiredPlugin);             
    76         }
     136    internal void DeletePluginsForJob(Guid id) {
     137      try {
     138        Logger.Debug("unloading...");
     139        Directory.Delete(Path.Combine(PLUGIN_REPO, id.ToString()), true);
     140      } catch (Exception ex) {
     141        Logger.Debug("failed while unloading " + id + " with exception " + ex);
    77142      }
    78 
    79       Logger.Debug("Requesting missing plugins");
    80       List<CachedHivePluginInfoDto> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);
    81       Logger.Debug("Requested missing plugins");
    82 
    83       foreach (CachedHivePluginInfoDto receivedPlugin in receivedPlugins) {
    84         foreach (HivePluginFile hpf in receivedPlugin.PluginFiles) {
    85           Logger.Info("writing file " + hpf.Name);
    86           File.WriteAllBytes("C:\\temp\\" + hpf.Name.Split('\\').Last(), hpf.BinaryFile);
    87         }       
    88       }
    89 
    90143    }
    91144  }
  • branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/ExecutionEnginePlugin.cs

    r2591 r4140  
    3030  [PluginFile("HeuristicLab.Hive.Client.ExecutionEngine-3.2.dll", PluginFileType.Assembly)]
    3131  [PluginDependency("HeuristicLab.Core-3.2")]
     32  [PluginDependency("HeuristicLab.Common")]
    3233  [PluginDependency("HeuristicLab.Hive.Client.Common-3.2")]
    3334  [PluginDependency("HeuristicLab.Hive.Client.Communication-3.2")]
  • branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/Executor.cs

    r3931 r4140  
    3737    public IJob Job { get; set; }
    3838    public MessageContainer.MessageType CurrentMessage { get; set; }
     39    public Exception CurrentException { get; set; }
     40
    3941    public MessageQueue Queue { get; set; }
    4042
     
    6668
    6769    void Job_JobFailed(object sender, EventArgs e) {
    68       Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.JobFailed, JobId));
     70      HeuristicLab.Common.EventArgs<Exception> ex = (HeuristicLab.Common.EventArgs<Exception>) e;
     71      CurrentException = ex.Value;
     72      Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.FinishedJob, JobId));
    6973    }
    7074
  • branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/HeuristicLab.Hive.Client.ExecutionEngine-3.2.csproj

    r1534 r4140  
    9090  </ItemGroup>
    9191  <ItemGroup>
     92    <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj">
     93      <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project>
     94      <Name>HeuristicLab.Common-3.2</Name>
     95    </ProjectReference>
    9296    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
    9397      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs

    r3931 r4140  
    8585    public static string RESPONSE_COMMUNICATOR_SEND_JOBRESULT = "Please send the Jobresult to the server";
    8686    public static string RESPONSE_COMMUNICATOR_PLUGINS_SENT = "Communicator.PluginsSent";
     87    public static string RESPONSE_COMMUNICATOR_PLUGINS_NOT_AVAIL = "Communicator.PluginsNotAvail";
    8788    public static string RESPONSE_COMMUNICATOR_JOB_WAS_ABORTED = "Job was aborted";
    8889
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/ClientDto.cs

    r3931 r4140  
    2828namespace HeuristicLab.Hive.Contracts.BusinessObjects {
    2929
    30   public enum State { nullState, idle, calculating, offline, finished, abort, requestSnapshot, requestSnapshotSent, pending };
     30  public enum State { nullState, idle, calculating, offline, finished, abort, requestSnapshot, requestSnapshotSent, pending, failed };
    3131  public enum CalendarState { Fetch, ForceFetch, Fetching, Fetched, NotAllowedToFetch };
    3232
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/HivePluginInfoDto.cs

    r4042 r4140  
    4141    [DataMember]
    4242    public DateTime BuildDate { get; set; }
     43
     44    [DataMember]
     45    public Boolean Update { get; set; }
    4346  }
    4447}
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/JobDto.cs

    r3578 r4140  
    4444    public double? Percentage { get; set; }
    4545    [DataMember]
     46    public String Exception { get; set; }
     47    [DataMember]
    4648    public DateTime? DateCreated { get; set; }
    4749    [DataMember]
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r4042 r4140  
    595595      }
    596596      job.JobInfo.Percentage = percentage;
    597 
    598       if (finished) {
     597      if(exception != null) {
     598        job.JobInfo.State = State.failed;
     599        job.JobInfo.Exception = exception.ToString();
     600        job.JobInfo.DateFinished = DateTime.Now;
     601      } else if (finished) {
    599602        job.JobInfo.State = State.finished;
    600603        job.JobInfo.DateFinished = DateTime.Now;
     
    718721      ResponsePlugin response = new ResponsePlugin();
    719722      foreach (HivePluginInfoDto pluginInfo in pluginList) {
    720         // TODO: BuildDate deleted, not needed???
    721         // TODO: Split version to major, minor and revision number
    722         foreach (IPluginDescription currPlugin in ApplicationManager.Manager.Plugins) {
    723           if (currPlugin.Name == pluginInfo.Name) {
    724 
    725             CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto {
    726               Name = currPlugin.Name,
    727               Version = currPlugin.Version,
    728               BuildDate = currPlugin.BuildDate
    729             };
    730 
    731             foreach (string fileName in from file in currPlugin.Files select file.Name) {
    732               currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName));
    733             }
    734             response.Plugins.Add(currCachedPlugin);
     723        if(pluginInfo.Update) {
     724          //check if there is a newer version         
     725          IPluginDescription ipd =
     726            ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision > pluginInfo.Version.Revision).SingleOrDefault();
     727          if(ipd != null) {
     728            response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 
     729          } 
     730        } else {
     731          IPluginDescription ipd =
     732            ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision >= pluginInfo.Version.Revision).SingleOrDefault();
     733          if(ipd != null) {
     734            response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 
     735          } else {
     736            response.Success = false;
     737            response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_PLUGINS_NOT_AVAIL;
     738            return response;
    735739          }
    736740        }
     
    741745      return response;
    742746
     747    }
     748
     749    private CachedHivePluginInfoDto convertPluginDescriptorToDto(IPluginDescription currPlugin) {
     750      CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto {
     751                                                                               Name = currPlugin.Name,
     752                                                                               Version = currPlugin.Version,
     753                                                                               BuildDate = currPlugin.BuildDate
     754                                                                             };
     755
     756      foreach (string fileName in from file in currPlugin.Files select file.Name) {
     757        currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName));
     758      }
     759      return currCachedPlugin;
    743760    }
    744761
  • branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.cs

    r3931 r4140  
    19411941    private System.Nullable<double> _Percentage;
    19421942   
     1943    private string _Exception;
     1944   
    19431945    private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
    19441946   
     
    19851987    partial void OnPercentageChanging(System.Nullable<double> value);
    19861988    partial void OnPercentageChanged();
     1989    partial void OnExceptionChanging(string value);
     1990    partial void OnExceptionChanged();
    19871991    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
    19881992    partial void OnSerializedJobChanged();
     
    21242128    }
    21252129   
     2130    [Column(Storage="_Exception", DbType="VarChar(MAX)")]
     2131    public string Exception
     2132    {
     2133      get
     2134      {
     2135        return this._Exception;
     2136      }
     2137      set
     2138      {
     2139        if ((this._Exception != value))
     2140        {
     2141          this.OnExceptionChanging(value);
     2142          this.SendPropertyChanging();
     2143          this._Exception = value;
     2144          this.SendPropertyChanged("Exception");
     2145          this.OnExceptionChanged();
     2146        }
     2147      }
     2148    }
     2149   
    21262150    [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)]
    21272151    public System.Data.Linq.Binary SerializedJob
  • branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.xml

    r3931 r4140  
    9999      <Column Name="ResourceId" Member="ResourceId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
    100100      <Column Name="Percentage" Member="Percentage" DbType="Float" Type="System.Double" CanBeNull="true"/>
     101      <Column Name="Exception" Member="Exception" DbType="VarChar(MAX)" Type="System.String" CanBeNull="true"/>
    101102      <Column Name="SerializedJob" Member="SerializedJob" DbType="VarBinary(MAX)" UpdateCheck="Never" Type="System.Data.Linq.Binary" IsDelayLoaded="true"/>
    102103      <Column Name="DateCreated" Member="DateCreated" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/>
  • branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs

    r3931 r4140  
    167167      target.DateFinished = source.DateFinished;
    168168      target.JobId = source.Id;
    169 
     169     
    170170      target.Percentage = source.Percentage;
     171      target.Exception = source.Exception;
    171172
    172173      target.Priority = source.Priority;
     
    195196      target.DateFinished = source.DateFinished;
    196197      target.Id = source.JobId;
    197        
     198
     199      target.Exception = source.Exception;
    198200      target.Percentage = source.Percentage;
    199201     
  • branches/3.2/sources/HeuristicLab.PluginInfrastructure/Manager/PluginManager.cs

    r3247 r4140  
    3535  /// Class to manage different plugins.
    3636  /// </summary>
    37   internal sealed class PluginManager : MarshalByRefObject {
     37  public sealed class PluginManager : MarshalByRefObject {
    3838    internal event EventHandler<PluginInfrastructureEventArgs> PluginLoaded;
    3939    internal event EventHandler<PluginInfrastructureEventArgs> PluginUnloaded;
     
    4949    /// Gets all installed plugins.
    5050    /// </summary>
    51     internal IEnumerable<PluginDescription> Plugins {
     51    public IEnumerable<PluginDescription> Plugins {
    5252      get { return plugins; }
    5353    }
     
    6464    private bool initialized;
    6565
    66     internal PluginManager(string pluginDir) {
     66    public PluginManager(string pluginDir) {
    6767      this.pluginDir = pluginDir;
    6868      plugins = new List<PluginDescription>();
     
    7474    /// Determines installed plugins and checks if all plugins are loadable.
    7575    /// </summary>
    76     internal void DiscoverAndCheckPlugins() {
     76    public void DiscoverAndCheckPlugins() {
    7777      OnInitializing(PluginInfrastructureEventArgs.Empty);
    7878      AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
  • branches/3.2/sources/HeuristicLab.PluginInfrastructure/Sandboxing/SandboxManager.cs

    r4050 r4140  
    9494      DefaultApplicationManager applicationManager =
    9595        (DefaultApplicationManager)applicationDomain.CreateInstanceAndUnwrap(applicationManagerType.Assembly.FullName, applicationManagerType.FullName, true, BindingFlags.NonPublic | BindingFlags.Instance, null, null, null, null, null);
    96       ApplicationDescription[] apps = ApplicationManager.Manager.Applications.Cast<ApplicationDescription>().ToArray();
    97       PluginDescription[] plugins = ApplicationManager.Manager.Plugins.Cast<PluginDescription>().ToArray();
    98       applicationManager.PrepareApplicationDomain(apps, plugins);
    99       if (files != null && files.Count() > 0)
    100         applicationManager.LoadAssemblies(files);
     96      PluginManager pm = new PluginManager(name);
     97      pm.DiscoverAndCheckPlugins();
     98      ApplicationDescription[] apps = pm.Applications.Cast<ApplicationDescription>().ToArray();
     99      PluginDescription[] plugins = pm.Plugins.Cast<PluginDescription>().ToArray();
     100      applicationManager.PrepareApplicationDomain(apps, plugins);     
    101101      return applicationDomain;
    102102    }
Note: See TracChangeset for help on using the changeset viewer.