Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/12 10:02:01 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • Added a administrator web interface for job management
  • Fixed Hive Client (PluginValidator) to find the assemblies within the right directories
  • Reorganized controller classes (Folders HL, Interfaces, Azure)
  • You may now successfully schedule and run jobs with the web ui.
Location:
branches/OaaS/HeuristicLab.PluginInfrastructure/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs

    r8200 r8958  
    488488    }
    489489
     490    private string AssemblyDirectory(Assembly assem) {
     491      string codeBase = assem.CodeBase;
     492      UriBuilder uri = new UriBuilder(codeBase);
     493      string path = Uri.UnescapeDataString(uri.Path);
     494      return Path.GetFullPath(path);     
     495    }
     496
    490497
    491498    private bool IsAnyDependencyDisabled(PluginDescription descr, List<PluginDescription> disabledPlugins) {
     
    512519            try {
    513520              string assemblyName = (from assembly in AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies()
    514                                      where string.Equals(Path.GetFullPath(assembly.Location), Path.GetFullPath(assemblyLocation), StringComparison.CurrentCultureIgnoreCase)
     521                                     where string.Equals(Path.GetFullPath(assembly.Location), Path.GetFullPath(assemblyLocation), StringComparison.CurrentCultureIgnoreCase) ||
     522                                           string.Equals(AssemblyDirectory(assembly), Path.GetFullPath(assemblyLocation), StringComparison.CurrentCultureIgnoreCase)
    515523                                     select assembly.FullName).Single();
    516524              // now load the assemblies into the execution context 
  • branches/OaaS/HeuristicLab.PluginInfrastructure/3.3/WebApplicationManager.cs

    r8506 r8958  
    8888    }
    8989
     90    static private string AssemblyDirectory {
     91      get {
     92        string codeBase = Assembly.GetExecutingAssembly().CodeBase;
     93        UriBuilder uri = new UriBuilder(codeBase);
     94        string path = Uri.UnescapeDataString(uri.Path);
     95        return Path.GetDirectoryName(path);
     96      }
     97    }
    9098    // find all types implementing IPlugin in the reflectionOnlyAssemblies and create a list of plugin descriptions
    9199    // the dependencies in the plugin descriptions are not yet set correctly because we need to create
     
    93101    private List<PluginDescription> GatherPluginDescriptions()
    94102    {
    95       List<PluginDescription> pluginDescriptions = new List<PluginDescription>();
    96       foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
     103      /*List<PluginDescription> pluginDescriptions = new List<PluginDescription>();
     104
     105      // load all assemblies that are available in the project folders
     106      var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
     107      IList<string> loadedPaths = new List<string>();
     108      foreach (var asm in loadedAssemblies) {
     109        try {
     110          loadedPaths.Add(asm.Location);
     111        }
     112        catch (Exception ex) {
     113        }
     114      }*/
     115      /*var assembliePaths = from location in loadedAssemblies                           
     116                           select location.Location;
     117
     118      var loadedPaths = loadedAssemblies.Select(a => a.Location).ToArray();*/
     119      var pv = new PluginValidator() { PluginDir = AssemblyDirectory };
     120      pv.DiscoverAndCheckPlugins();
     121      return pv.Plugins.ToList();
     122      /*var pluginManager = new PluginManager(AssemblyDirectory);
     123      pluginManager.DiscoverAndCheckPlugins();
     124      return pluginManager.Plugins.ToList();*/
     125
     126      /*var referencedPaths = Directory.GetFiles(AssemblyDirectory, "*.dll");
     127      var toLoad = referencedPaths.Where(r => !loadedPaths.Contains(r, StringComparer.InvariantCultureIgnoreCase)).ToList();
     128      toLoad.ForEach(path => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(AssemblyName.GetAssemblyName(path))));
     129     
     130      foreach (Assembly assembly in loadedAssemblies)
    97131      {
    98132        // GetExportedTypes throws FileNotFoundException when a referenced assembly
     
    106140                                           where !t.IsAbstract && t.GetInterfaces().Any(x => x.AssemblyQualifiedName == typeof(IPlugin).AssemblyQualifiedName)
    107141                                           select GetPluginDescription(t);
     142
     143          // TODO: Also load all plugin descriptors from assemblies liying in the app domain folder!!!!!
    108144          pluginDescriptions.AddRange(assemblyPluginDescriptions);
    109145        }
     
    122158        }
    123159      }
    124       return pluginDescriptions;
     160      return pluginDescriptions;*/
    125161    }
    126162
Note: See TracChangeset for help on using the changeset viewer.