Class PluginsManager

java.lang.Object
org.ametys.runtime.plugin.PluginsManager

public final class PluginsManager extends Object
The PluginManager is in charge to load and initialize plugins.
It gives access to the extension points.
  • Field Details

  • Method Details

    • getInstance

      public static PluginsManager getInstance()
      Returns the shared instance of the PluginManager
      Returns:
      the shared instance of the PluginManager
    • isSafeMode

      public boolean isSafeMode()
      Returns true if the safe mode is activated.
      Returns:
      true if the safe mode is activated.
    • getErrors

      Returns errors gathered during plugins loading.
      Returns:
      errors gathered during plugins loading.
    • getPluginNames

      Returns the names of the plugins
      Returns:
      the names of the plugins
    • getBundledPluginsNames

      Returns a String array containing the names of the plugins bundled in jars
      Returns:
      a String array containing the names of the plugins bundled in jars
    • getPlugins

      Returns active plugins declarations.
      Returns:
      active plugins declarations.
    • getAllPlugins

      Returns all existing plugins definitions.
      Returns:
      all existing plugins definitions.
    • getFeatures

      Returns loaded features declarations.
      They may be different than active feature in case of safe mode.
      Returns:
      loaded features declarations.
    • getInactiveFeatures

      Returns inactive features id and cause of deactivation.
      Returns:
      inactive features id and cause of deactivation.
    • getExtensionPoints

      Returns the extensions points and their extensions
      Returns:
      the extensions points and their extensions
    • getComponents

      Returns the components roles.
      Returns:
      the components roles.
    • getResourceURI

      public String getResourceURI(String pluginName)
      Returns the base URI for the given plugin resources, or null if the plugin does not exist or is located in the file system.
      Parameters:
      pluginName - the name of the plugin
      Returns:
      the base URI for the given plugin resources, or null if the plugin does not exist or is located in the file system.
    • getPluginLocation

      public File getPluginLocation(String pluginName)
      Returns the plugin filesystem location for the given plugin or null if the plugin is loaded from the classpath.
      Parameters:
      pluginName - the plugin name
      Returns:
      the plugin location for the given plugin
    • getVersion

      public String getVersion(String pluginName)
      Get the plugin version or null if unknown. Only available for bundled plugins.
      Parameters:
      pluginName - the plugin name
      Returns:
      the plugin version if known.
    • getStatus

      Returns the status after initialization.
      Returns:
      the status after initialization.
    • init

      public PluginsComponentManager init(ComponentManager parentCM, Context context, String contextPath, boolean forceSafeMode) throws Exception
      Initialization of the plugin manager
      Parameters:
      parentCM - the parent ComponentManager.
      context - the Avalon context
      contextPath - the Web context path on the server filesystem
      forceSafeMode - true to force the application to enter the safe mode
      Returns:
      the PluginsComponentManager containing loaded components.
      Throws:
      Exception - if something wrong occurs during plugins loading