diff --git a/OpenSim/Grid/GridServer/GridModuleLoader.cs b/OpenSim/Grid/GridServer/GridModuleLoader.cs deleted file mode 100644 index a79b2bedc9..0000000000 --- a/OpenSim/Grid/GridServer/GridModuleLoader.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using log4net; - -namespace OpenSim.Grid.GridServer -{ - public class GridModuleLoader - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public Dictionary LoadedAssemblys = new Dictionary(); - - public List PickupModules(string path) - { - DirectoryInfo dir = new DirectoryInfo(path); - List modules = new List(); - - foreach (FileInfo fileInfo in dir.GetFiles("*.dll")) - { - List foundModules = this.LoadModules(fileInfo.FullName); - modules.AddRange(foundModules); - } - return modules; - } - - public List LoadModules(string dllName) - { - List modules = new List(); - - Assembly pluginAssembly; - if (!LoadedAssemblys.TryGetValue(dllName, out pluginAssembly)) - { - try - { - pluginAssembly = Assembly.LoadFrom(dllName); - LoadedAssemblys.Add(dllName, pluginAssembly); - } - catch (BadImageFormatException) - { - //m_log.InfoFormat("[MODULES]: The file [{0}] is not a module assembly.", e.FileName); - } - } - - if (pluginAssembly != null) - { - try - { - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - if (pluginType.GetInterface(typeof(T).Name) != null) - { - modules.Add((T)Activator.CreateInstance(pluginType)); - } - } - } - } - } - catch (Exception e) - { - m_log.ErrorFormat( - "[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e); - - // justincc: Right now this is fatal to really get the user's attention - throw e; - } - } - - return modules; - } - } -}