Class AbstractPluginManager

java.lang.Object
org.pf4j.AbstractPluginManager
All Implemented Interfaces:
PluginManager
Direct Known Subclasses:
DefaultPluginManager

public abstract class AbstractPluginManager extends Object implements PluginManager
This class implements the boilerplate plugin code that any PluginManager implementation would have to support. It helps cut the noise out of the subclass that handles plugin management.

This class is not thread-safe.

Author:
Decebal Suiu
  • Field Details

    • PLUGINS_DIR_PROPERTY_NAME

      public static final String PLUGINS_DIR_PROPERTY_NAME
      See Also:
    • MODE_PROPERTY_NAME

      public static final String MODE_PROPERTY_NAME
      See Also:
    • DEFAULT_PLUGINS_DIR

      public static final String DEFAULT_PLUGINS_DIR
      See Also:
    • DEVELOPMENT_PLUGINS_DIR

      public static final String DEVELOPMENT_PLUGINS_DIR
      See Also:
    • pluginsRoot

      protected Path pluginsRoot
    • extensionFinder

      protected ExtensionFinder extensionFinder
    • pluginDescriptorFinder

      protected PluginDescriptorFinder pluginDescriptorFinder
    • plugins

      protected Map<String, PluginWrapper> plugins
      A map of plugins this manager is responsible for (the key is the 'pluginId').
    • pluginClassLoaders

      protected Map<String, ClassLoader> pluginClassLoaders
      A map of plugin class loaders (the key is the 'pluginId').
    • unresolvedPlugins

      protected List<PluginWrapper> unresolvedPlugins
      A list with unresolved plugins (unresolved dependency).
    • resolvedPlugins

      protected List<PluginWrapper> resolvedPlugins
      A list with all resolved plugins (resolved dependency).
    • startedPlugins

      protected List<PluginWrapper> startedPlugins
      A list with started plugins.
    • pluginStateListeners

      protected List<PluginStateListener> pluginStateListeners
      The registered PluginStateListeners.
    • runtimeMode

      protected RuntimeMode runtimeMode
      Cache value for the runtime mode. No need to re-read it because it wont change at runtime.
    • systemVersion

      protected String systemVersion
      The system version used for comparisons to the plugin requires attribute.
    • pluginRepository

      protected PluginRepository pluginRepository
    • pluginFactory

      protected PluginFactory pluginFactory
    • extensionFactory

      protected ExtensionFactory extensionFactory
    • pluginStatusProvider

      protected PluginStatusProvider pluginStatusProvider
    • dependencyResolver

      protected DependencyResolver dependencyResolver
    • pluginLoader

      protected PluginLoader pluginLoader
    • exactVersionAllowed

      protected boolean exactVersionAllowed
    • versionManager

      protected VersionManager versionManager
  • Constructor Details

    • AbstractPluginManager

      public AbstractPluginManager()
      The plugins root is supplied by System.getProperty("pf4j.pluginsDir", "plugins").
    • AbstractPluginManager

      public AbstractPluginManager(Path pluginsRoot)
      Constructs AbstractPluginManager with the given plugins root.
      Parameters:
      pluginsRoot - the root to search for plugins
  • Method Details