Interface PluginLoader

All Known Subinterfaces:
DiscardablePluginLoader, DynamicPluginLoader
All Known Implementing Classes:
BundledPluginLoader, ClassPathPluginLoader, DirectoryPluginLoader, ForwardingPluginLoader, PermissionCheckingPluginLoader, RosterFilePluginLoader, ScanningPluginLoader, SinglePluginLoader

public interface PluginLoader
Handles loading and unloading plugin artifacts from a location
  • Method Details

    • loadAllPlugins

      Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
      Loads all plugins that can be installed in the plugin system.
      Parameters:
      moduleDescriptorFactory - the factory for module descriptors
      Returns:
      the list of found plugins, may be empty
      Throws:
      PluginParseException - if any error occurred loading plugins
    • loadFoundPlugins

      Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
      Load all newly found plugins that can be installed in the plugin system. Only plugins not previously loaded will be added.
      Parameters:
      moduleDescriptorFactory - the factory for module descriptors
      Returns:
      a list of newly discovered plugins since the last time plugins were loaded
      Throws:
      PluginParseException - if any error occurred loading plugins
    • supportsAddition

      boolean supportsAddition()
      Returns:
      true if this PluginLoader tracks whether or not plugins are added to it.
    • supportsRemoval

      boolean supportsRemoval()
      Returns:
      true if this PluginLoader tracks whether or not plugins are removed from it.
    • removePlugin

      void removePlugin(Plugin plugin)
      Remove a specific plugin
    • isDynamicPluginLoader

      boolean isDynamicPluginLoader()
      Returns:
      true if this plugin loader can load plugins dynamically
      Since:
      3.0
    • createModule

      ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory)
      If this loader is capable of loading a plugin of the type passed, attempt to create a module descriptor. Add that module descriptor to the plugin.

      If capable, always return a ModuleDescriptor, even if it indicates a failure case. Caller is responsible for handling exceptional ModuleDescriptor.

      Parameters:
      plugin - that the module will be added to
      module - to create
      moduleDescriptorFactory - basic factory, may be overridden
      Returns:
      null if incapable of creating
      Since:
      7.5.0