Class PluginManager


  • public class PluginManager
    extends Object
    • Method Detail

      • init

        public void init()
      • getPluginsToLoad

        public HashMap<String,​File> getPluginsToLoad​(String pluginsDirectories,
                                                           String pluginsInclude)
                                                    throws IllegalArgumentException
        This method will take a semi-colon delimited string of directories and a semi-colon delimited string of plugin names. It will traverse the directories in order and produce a map of plugins to be loaded. If a plugin is found in multiple directories, only the first copy of it will be picked up.
        Parameters:
        pluginsDirectories -
        pluginsInclude -
        Returns:
        A hash map with key = plugin name, value = file object
        Throws:
        IllegalArgumentException
      • load

        public void load​(String pluginName,
                         File directory)
        Loads jars recursively
        Parameters:
        pluginName -
        directory -
      • loadClass

        public Class<?> loadClass​(String className)
                           throws ClassNotFoundException
        Loads a class. The class name can be in any of the following formats
      • com.x.y.foo
      • loads the class in the default class path
      • pluginName:com.x.y.foo
      • loads the class in plugin specific classloader
Parameters:
className -
Returns:
Throws:
ClassNotFoundException
Parameters:
className -
Returns:
Throws:
Exception